跪拜 Guibai
← All articles
Frontend · Backend · Interview

Stop Feeding Figma Screenshots to AI: Wire Codex to Figma's MCP and Hit 95% Fidelity

By aZhe的全栈知识分享 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

AI-generated frontends only match a design when the model reads the actual numbers, not a pixelated screenshot. This workflow gives teams a concrete, verifiable integration pattern for Codex and Figma, plus a realistic look at the rate limits and the human-in-the-loop confirmation that prevents wasted rework.

Summary

Sending a Figma link or screenshot and hoping the AI nails the layout usually fails because the model only sees pixels and has to guess sizes, spacing, and fonts. The fix is to give the AI direct access to Figma's design data through the official remote MCP server. The article walks through installing the Figma plugin in Codex, copying a node link, and then running a four-step loop: read and confirm, list differences, approve the checklist, and verify the built page in a real browser.

The loop forces the AI to restate the requirement before any code changes, which catches misinterpretation early. Then it produces a table of concrete differences (e.g., "four cards in a 2×2 grid" vs. "five cards, three in first row"). Only after explicit confirmation does the AI write code, reusing existing components and marking missing API fields as pending instead of inventing data. The final verification uses Playwright or browser tools to click through tabs, modals, pagination, and responsive widths, which surfaced real bugs like double scrolling on a 390×844 viewport and a 16px padding offset.

The article also covers rate limits for Figma MCP reads—20 per month on Starter or View/Collab seats, 200 per day on the Education plan—and suggests a workaround of copying frames into an education-team project. The claimed result: an estimated 95%+ visual fidelity on the author's own project, with the remaining work being fine-tuning details.

Takeaways
— Figma's official remote MCP server is supported by Codex, Claude Code, Cursor, VS Code, Copilot CLI, Gemini CLI, OpenCode, Kiro, Warp, Augment Code, Factory, Replit, Android Studio, Firebender, and Xcode (Beta).
— Starter or View/Collab seats get up to 20 Figma MCP reads per month; the Education plan provides 200 reads per day and 10 per minute.
— Copying a Figma frame into a team on an education plan and sharing a new node link sidesteps the rate limit, but requires account verification.
— Before any code change, the AI must restate the requirement and list concrete differences in a table with numbers (e.g., size, spacing, font size).
— When a module has no API, use centrally managed Mock data; when an API exists, bind real fields and never let the AI invent missing ones.
— Open the built page in a live browser viewport (e.g., 390×844), click through tabs, pagination, modals, and back navigation, and rerun the same steps after fixes.
— Real bugs caught this way include two nested scrolling layers pushing a button off-screen and a 16px missing left padding on a tab state.
— The workflow reports an estimated 95%+ visual fidelity after the full loop, with remaining differences being fine-tuning.
Conclusions

Screenshot-based design-to-code fails because spacing and alignment are relative to the surrounding layout; direct node data eliminates guessing but only works if the design file actually contains those values.

The 95% fidelity claim depends more on the human confirming each step than on the AI's coding ability—the loop is essentially a structured human-review gate for generated frontends.

The education-plan workaround for rate limits is a gray-market hack that many will adopt, but Figma's enforcement of academic eligibility could make it unstable in the long run.

The final browser verification step is the most commonly skipped part in similar workflows, yet the article shows it catches concrete layout bugs that static design comparison would miss.

Concepts & terms
MCP (Model Context Protocol)
A standardized protocol that lets AI assistants connect to external tools and data sources. In this workflow, Figma's MCP server exposes design node data—geometry, styles, structure, and assets—so the AI can read exact values instead of inferring from a screenshot.
Figma node link
A URL that points to a specific frame, layer, or element within a Figma file. Copying it (via 'Copy link to selection') lets an MCP-connected AI agent locate and read that exact node's properties.
From the discussion
Featured comments
biaozhang

How many tokens does this whole setup end up using?

Kiroro

Not that much. I use it every day. 6.1 sol high, don't enable acceleration.

aZhe的全栈知识分享

I haven't kept track of it, but my impression is it's not much, because it produces good results on the first pass and there's basically no rework later, so the consumption is acceptable. Dozens of pages can be finished in a few hours, which greatly frees yourself.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗