Figma to code with AI: a 7-step workflow with the Figma MCP server

Figma to code with AI: a 7-step workflow with the Figma MCP server

The most reliable way to turn Figma designs into code with AI is to connect a coding agent such as Claude Code, Codex or Cursor to Figma's MCP server, so the agent reads real layers, variables and components instead of guessing from a picture. This guide covers setup, preparing the file, prompts per frame, screenshots as a fallback, and how to review the result for fidelity and accessibility.

In shortTL;DR
  • Figma's MCP server gives agents structured design context (layers, variables, components, screenshots); a screenshot alone gives only pixels.
  • In Claude Code, connect it with claude mcp add --transport http figma https://mcp.figma.com/mcp, then authenticate through /mcp.
  • Code quality depends on the file: components, variables, auto layout and semantic layer names produce cleaner code than absolute-positioned groups.
  • Prompt one frame at a time, name your real components and token files, and say which framework you want; the default output is React and Tailwind.
  • Review every screen against the design and WCAG basics: contrast, focus states, labels and 24 by 24 pixel targets.

How does Figma to code with AI work?

Figma to code with AI works best when a coding agent reads the design file directly through Figma's MCP server and writes code inside your existing project. The agent gets layer structure, variables, component mappings and a screenshot, then edits your codebase the way a developer would.

There are three common approaches, and they differ in what the AI actually sees:

ApproachWhat the AI seesReuses your componentsBest for
Figma MCP server + coding agentLayers, variables, styles, Code Connect mappings, screenshotsYes, if mapped or named in the promptProduction UI in an existing codebase
Screenshot + coding agentPixels onlyOnly if you tell it which onesQuick prototypes, designs outside Figma
Code export plugins inside FigmaThe frame's layersRarelyOne-off static pages, handoff starting points

The first approach is the focus of this guide. MCP (Model Context Protocol) is the standard that lets agents call external tools; Figma publishes an official server for it, and our guide to using MCP with Claude Code covers the general setup.

What is the Figma MCP server?

The Figma MCP server is Figma's official bridge between design files and AI coding agents. It exposes tools that return design context, code, variables and screenshots for a frame, and, with the right seat, tools that write back to the canvas.

Figma recommends the remote server at https://mcp.figma.com/mcp, which doesn't need the desktop app. A desktop server runs through the Figma desktop app and requires a Dev or Full seat on a Professional, Education, Organization or Enterprise plan. One practical difference: with the desktop server you can prompt with whatever is selected in Figma, while the remote server needs a link to a frame or layer.

The tools list is long, but these are the ones that matter for design to code:

ToolWhat it returns
get_design_contextDesign context and code for a layer or selection (React and Tailwind by default)
get_metadataA lightweight XML outline of layers and basic properties, useful for big frames
get_variable_defsThe variables and styles used in the selection
get_screenshotA screenshot of the selection, so the agent can compare visually
get_code_connect_mapWhich code component each Figma component instance maps to
download_assetsExports icons and images as PNG, JPG, SVG or PDF
search_design_systemMatching components, variables and styles in connected libraries

There is also an MCP prompt, create_design_system_rules, that writes a rules file to help the agent generate code matching your design system.

Figma lists Claude Code, Codex, Cursor, VS Code, Gemini CLI, Kiro and many others as supported clients.

How do you connect Figma to Claude Code, Codex or Cursor?

Add the remote server to your agent and sign in with your Figma account once. The commands below come from Figma's installation guide.

Claude Code. Install the plugin, or add the server by hand:

terminal
# Plugin (recommended by Figma)claude plugin install figma@claude-plugins-official# Or add the MCP server manually, for all your projectsclaude mcp add --transport http --scope user figma https://mcp.figma.com/mcp

Then start a new session, type /mcp, select figma, choose Authenticate and click Allow access in the browser. You should see "Authentication successful. Connected to figma".

Codex CLI:

terminal
codex mcp add figma --url https://mcp.figma.com/mcp

Cursor: type /add-plugin figma in chat, or add a custom MCP server with the same URL. VS Code: add "figma": { "url": "https://mcp.figma.com/mcp", "type": "http" } to mcp.json.

Rate limits by seat

Read tools are rate-limited by plan and seat, so check your seat before planning a big migration. Tools that write to Figma are exempt.

20tool calls a month on View and Collab seats
200tool calls a day on Professional Dev and Full seats
600tool calls a day on Enterprise Dev and Full seats
Source: Figma developer docs, Rate limits and access (November 2026)

Organization plans sit between those, at 200 a day and 15 a minute. A single screen can take several calls (metadata, design context, variables, screenshot), so 20 a month is enough to try the workflow, not to build with it. Figma notes it may change limits at any time.

How should you prepare a Figma file for AI code generation?

Prepare the file the way you would for a careful developer: components for anything that repeats, variables for every token, auto layout instead of absolute positions, and layer names that say what things are. Figma's own file structure guide lists these as the main levers on output quality.

Color swatches and a ruler laid out on a dark desk
Variables for color, spacing and type let the agent use your tokens instead of hardcoded values
In FigmaWhy it matters for the code
Components for buttons, cards, inputs, nav itemsThe agent reuses one code component per instance instead of duplicating markup
Variables for color, spacing, radius, typographyOutput references tokens like --color-primary instead of #3B82F6
Auto layoutProduces flex and grid layouts instead of absolute positioning
Semantic layer names (CardContainer, not Frame1268)Class names and component names make sense
AnnotationsBehavior, alignment and responsive rules the picture can't show
Code ConnectMaps Figma components to real code components with imports and usage

Figma calls Code Connect "the most effective way to get your agent to reuse your real components." With mappings in place, design context wraps each connected component in a snippet with its real import and props. It needs a Dev or Full seat on a Professional, Organization or Enterprise plan. Without it, put the mapping in your prompt or in a rules file.

If you don't own the design file, you can still help: ask the designer for semantic names and variables on the screens you will build first.

Figma to code with AI: step by step

This seven-step loop works for one screen or a whole feature. Build one frame per prompt, starting from the smallest shared components.

  1. Generate design system rules once. Run the create_design_system_rules prompt and save the result in your agent's rules file (CLAUDE.md, AGENTS.md or Cursor rules). Add your token file path, component folder and styling approach.
  2. Inventory the frame. For a large screen, ask for get_metadata first so the agent sees the structure without pulling the full design context. Figma's docs advise against selecting large, heavy frames.
  3. Build missing primitives first. If the design uses a component you don't have in code, build that component on its own before the screen.
  4. Generate the screen with constraints. Paste the frame link and name your framework, components and tokens (prompt below).
  5. Download real assets. Use download_assets for icons and images instead of letting the agent invent SVGs or placeholder URLs.
  6. Compare visually. Have the agent run the app, take a screenshot and compare it with get_screenshot output at the same width. In Claude Code, /verify builds and runs the app and checks the result.
  7. Review and commit. Read the diff like any AI-generated code: hardcoded values, duplicated components, missing states.

A prompt that encodes those constraints:

prompt
Implement this Figma frame: <frame link>- Framework: Next.js App Router, TypeScript, Tailwind.- Use existing components from src/components/ui (Button, Card, Input, Badge). Do not create new versions of them.- Use tokens from src/styles/tokens.css. No hex values or pixel spacing that isn't a token.- Download icons with the Figma MCP server into public/icons; don't draw your own.- Layout must work from 360px to 1440px wide; ask me if the design doesn't show a breakpoint.- Include hover, focus, disabled and loading states for interactive elements.- When done, run the dev server, screenshot the page at 1440px and 390px, and list every visible difference from the Figma screenshot.

Can you turn a screenshot into code with AI?

Yes. Claude Code, Codex and most other coding agents accept images, so you can turn a screenshot, mockup or whiteboard photo into a component. The result is an approximation, because pixels carry no token names, component boundaries or exact spacing.

In Claude Code, drag an image into the terminal, paste it with Ctrl+V (Alt+V on Windows and WSL), or give a file path, as described in the Claude Code workflows docs. Then be explicit about what to reuse:

prompt
Build this screenshot as a React component in src/app/pricing/page.tsx.Use our Button and Card components and the Tailwind theme in tailwind.config.ts.Match layout and hierarchy, not exact pixels. List any values you guessed (colors, font sizes, spacing) so I can check them against the design.

Screenshots work well for prototypes, competitor-inspired layouts and designs that only exist as images. For anything going to production from a Figma file, the MCP route gives better fidelity with less correction. Our guide to AI for frontend development covers the rest of the UI workflow.

How do you review AI-generated UI for fidelity and accessibility?

Review generated UI in two passes: fidelity against the design, then accessibility against WCAG. Agents are good at layout and weak at the details neither the design nor the prompt spelled out.

Fidelity checklist:

  • Spacing, sizes and colors come from tokens, not hardcoded values.
  • Existing components were reused, not copied into new near-duplicates.
  • The layout holds at narrow and wide widths, not only the frame's width.
  • Text from the design is not truncated by real content lengths.
  • Hover, focus, active, disabled, loading, empty and error states exist.

Accessibility checklist, using WCAG 2.2 Level AA:

CheckWCAG 2.2 criterionWhat to look for in generated code
Text contrast at least 4.5:1 (3:1 for large text)1.4.3 Contrast (Minimum)Light gray text on white is a common design-file habit
UI component contrast at least 3:11.4.11 Non-text ContrastInput borders, icon buttons, focus rings
Visible keyboard focus2.4.7 Focus Visibleoutline: none without a replacement
Targets at least 24 by 24 CSS pixels2.5.8 Target Size (Minimum)Small icon buttons and close buttons
Text alternatives for images1.1.1 Non-text ContentMissing alt, icon buttons without aria-label
Semantic elements4.1.2 Name, Role, Valuediv with onClick instead of button

Ask the agent to run this review itself before you do; it catches the easy ones. Automated browser checks help too, and our guide to AI end-to-end testing with Playwright shows how to make them part of the loop.

Note

A design file can fail accessibility before any code exists. If the agent reports a contrast failure that matches the design, take it to the designer instead of silently changing the color.

Common Figma to code problems and fixes

Most bad output traces back to the file or the prompt, not the model. Fix the input and regenerate rather than patching the output by hand.

ProblemLikely causeFix
Absolute positioning everywhereFrame built without auto layoutAsk the designer to add auto layout, or tell the agent to use flex or grid
Hardcoded hex colorsNo variables in the file, or token file not named in the promptAdd variables; point the agent to your token file
New duplicate componentsNo Code Connect, no component folder in the promptMap components or list them in the rules file
Agent ran out of context or timed outWhole page selected at onceUse get_metadata, then build sections separately
Rate limit errorsView or Collab seatUse a Dev or Full seat for real work
Placeholder images or invented iconsAssets not downloadedUse download_assets

How to start today

Start with one real screen from a file you can edit, and judge the result by how much you had to fix.

  1. Connect the Figma MCP server to your agent and authenticate.
  2. Pick a screen that uses components you already have in code.
  3. Rename its main layers, check it uses variables and auto layout.
  4. Run create_design_system_rules and add your component and token paths.
  5. Use the constrained prompt above with the frame link.
  6. Compare screenshots, run the accessibility checklist, and note what you corrected.
  7. Fold every repeated correction into the rules file before the next screen.

Once the loop is reliable, UI tickets become tasks an agent can take while you do something else. Orkio runs Claude Code on an always-on cloud box, and its Web/SaaS kit sets up a Next.js project, so you can hand over a screen from your phone and review the pull request later. Designers who want the other side of this workflow can read our guide to AI for designers.

Frequently asked questions

Can AI convert Figma to code?

Yes, for most layouts and components. A coding agent connected to Figma's MCP server can generate working UI that reuses your components and tokens. It still needs review: interactions, responsive behavior, data loading and accessibility details usually need correction.

Is the Figma MCP server free?

Every plan gets some access, but limits depend on the seat. As of November 2026, View and Collab seats get up to 20 tool calls a month, while Dev and Full seats on paid plans get daily limits, for example 200 a day on Professional. Check Figma's rate limits page for current numbers.

Do I need the Figma desktop app for AI design to code?

No. Figma recommends the remote MCP server at mcp.figma.com, which does not need the desktop app. The desktop server runs through the app and lets you prompt with your current selection; the remote server needs a link to a frame or layer.

Can I turn a screenshot into code without Figma?

Yes. Claude Code, Codex and similar agents accept images, so you can paste a screenshot or mockup and ask for a component. Expect approximate spacing, colors and fonts, because a screenshot carries no tokens or component names.

Which framework does Figma's MCP server generate?

By default it produces React with Tailwind, but you can ask for Vue, plain HTML and CSS, iOS or other targets in your prompt. Telling the agent to use components from a specific folder in your codebase matters more than the framework choice.

SOURCES

  1. Figma developer docs: Figma MCP server
  2. Figma developer docs: Remote server installation
  3. Figma developer docs: Tools and prompts
  4. Figma developer docs: Rate limits and access
  5. Figma developer docs: Structure your Figma file for better code
  6. Claude Code docs: Common workflows (work with images)
  7. W3C: Web Content Accessibility Guidelines (WCAG) 2.2
  • #figma
  • #frontend
  • #mcp
  • #ai coding
  • #design systems
Orkio team

The team building Orkio. We write about putting AI to work: coding agents that run overnight, always-on boxes and pull requests ready by morning.

Keep reading

All posts

07:06 · YOU MERGED #128

Go to sleep. Wake up to pull requests.

Start for $19 a month
© 2026 Orkio · Hosted in Europe TürkçeStatus