Read the original at figma.com ↗figma.com
Code Connect in Figma's MCP server provides coding agents with production-accurate code snippets instead of generic React, enabling them to use existing design system components. Through rigorous evaluation, Figma measured significant improvements: 19.6% faster task completion, 29.5% fewer tokens consumed, and code quality increased by one full point on a 1–4 scale. The key insight is that agents need explicit, structured context about your codebase to avoid reinventing components and wasting resources.
01Key takeaways
- Provide agents explicit production code context; they won't discover design system components without it.
- Code Connect coverage directly drives efficiency gains—higher coverage yields faster, cheaper, higher-quality outputs.
- Agents need structured context to avoid reinventing components and wasting tokens on exploratory searches.
- Visually correct code can be functionally broken; agents need real component implementations, not generic React.
- Design system organization and clarity matter more as agentic tools become standard in development workflows.
02Key sections
- The Problem: Agents Rebuild Instead of Reuse
- Without design-to-code context, AI agents fabricate components from scratch, pick wrong ones, or waste tokens searching. This produces visually correct but functionally incorrect code that doesn't align with production design systems.
- How Code Connect Enriches MCP Responses
- Code Connect substitutes generic React descriptions with real production code snippets and import statements. Agents receive exact component names and property values, eliminating guesswork and enabling direct use of existing design system components.
- Evaluation Methodology and Design
- Figma tested 27 design-to-code tasks across two React design systems using LLM judges against a 1–4 rubric measuring correctness, code quality, maintainability, completeness, and best practices. Tests ran on Claude Sonnet and Opus models.
- Results: Measurable Improvements Across Metrics
- Code Connect coverage directly correlated with better outcomes. Higher coverage led to fewer exploratory tool calls, less time grepping for components, and agents reaching for real design system components instead of hand-building from scratch.
- Code Quality in Practice
- Without Code Connect, agents produced non-functional hardcoded tabs and raw CSS. With Code Connect, agents correctly imported and used design system components, producing succinct, maintainable, and interactive code.
- Key Takeaway for LLM-Powered Products
- Agents don't inherently understand company-specific code standards. Providing explicit, structured context through production code snippets is essential to prevent wasted tokens and ensure agents produce code worth committing.
“Without Code Connect, the agent would sometimes fabricate its own version of components: say, build a stepper out of progress bars.”Erich Kuerschner, Frontend Engineer, Coinbase · figma.com
03Frameworks mentioned
Summary and takeaways written by PM Atlas; quotes are short excerpts. © the original author.