Heniflow
All articles
03Guide
Written by
Heni
Published
Reading time
6 min
  • Figma MCP
  • Claude Code
  • Figma to code
  • Design engineering

From Figma to Claude,through Figma MCP.

A step-by-step guide to connecting Figma to Claude Code with the Figma MCP server: setup, preparing your files, the key tools, prompts that work, and the workflow I use.

Figma
MCPdesign context
</>Claude

For years, the handoff between design and code worked like this: a designer exported screens, a developer looked at them, and both hoped the result would match. With the Figma MCP server, Claude can read your Figma file directly: the layers, the auto layout, the variables, the components and a screenshot of the frame. It writes code from the real design, not from a guess.

I use this workflow on client projects, including the AuditHub redesign for Veridise. This guide covers everything you need to set it up and get good results.

What is the Figma MCP server?

MCP (Model Context Protocol) is an open standard that lets AI tools connect to other apps and data. The Figma MCP server is Figma's official connector: it gives an AI agent like Claude Code structured access to your designs, so it can turn a frame into code, read your design tokens, and even write back to the canvas.

Figma offers two versions:

Remote server (recommended)Desktop server
Where it runsFigma's hosted endpoint, https://mcp.figma.com/mcpLocally, through the Figma desktop app
Desktop app neededNoYes
How you point at a designPaste a link to a frame or layerSelect a frame in Figma
Write to the canvasYesLimited
Who it is forMost peopleSpecific organization and enterprise needs

What you need

  • A Figma account with access to the file you want to build.
  • Claude Code installed and working in your project.
  • For the desktop server: a Dev or Full seat on a Professional, Education, Organization, Government or Enterprise plan.
  • To write to the canvas outside your drafts: a Full seat.

Step 1: Connect Figma to Claude Code

Option A: install the Figma plugin (recommended)

The plugin adds the MCP server and Figma's agent skills, which help Claude use the tools more reliably.

Terminal
claude plugin install figma@claude-plugins-official
  1. 01Restart Claude Code if it is running.
  2. 02Type /plugin, press Enter, then press the right arrow key to open the Installed tab.
  3. 03Select the figma server, press Enter, then press Enter again to sign in.
  4. 04In the browser page that opens, click Allow access.
  5. 05Back in Claude Code, type /plugin again. The figma server should show as connected.

Option B: add the server manually

Terminal
# This project only
claude mcp add --transport http figma https://mcp.figma.com/mcp

# Or every project on your machine
claude mcp add --scope user --transport http figma https://mcp.figma.com/mcp
  1. 01Start a new Claude Code session.
  2. 02Type /mcp, select figma, then select Authenticate.
  3. 03In the browser, click Allow access.
  4. 04Back in Claude Code you should see "Authentication successful. Connected to figma". Type /mcp again to confirm.

Step 2: Prepare your Figma file

The MCP server can only pass on the structure that exists in your file. A well built file produces clean code. A messy file produces messy code. Before you prompt:

  • Use auto layout everywhere. It translates directly into flexbox and grid, with real gaps and padding instead of absolute positions.
  • Name your layers meaningfully ("Pricing card", not "Frame 412"). Names become component and class names.
  • Use variables for colors, spacing, radius and typography. Claude reads them as tokens instead of hard-coded values.
  • Use components for anything repeated, like buttons, cards and inputs.
  • Set up Code Connect if you have a component library, so generated code reuses your real components instead of recreating them.
  • Keep frames focused. One section or component per request beats a whole page at once.

Step 3: Know the key tools

You rarely call these tools by name, as Claude picks the right one from your prompt. But knowing what exists helps you ask for the right thing.

ToolWhat it does
get_design_contextProduces code and design details for a layer or selection. The main design-to-code tool.
get_variable_defsLists the variables and styles used in a selection: colors, spacing, typography.
get_screenshotCaptures an image of the selection, so Claude can compare its result visually.
get_metadataReturns a lightweight outline of a selection. Useful for large frames.
get_code_connect_mapReturns the code components mapped to the Figma components in a selection.
search_design_systemFinds matching components, variables and styles across your connected libraries.
use_figmaCreates, edits and inspects content in Figma files (writes to the canvas).
generate_figma_designSends a live web UI into Figma as design layers.
create_design_system_rulesA prompt that generates a rules file to guide design-to-code output.

Figma keeps the complete, current list in its tools and prompts documentation.

Step 4: From frame to code

  1. 01In Figma, right-click the frame you want to build and choose Copy link to selection.
  2. 02In Claude Code, paste the link with a clear prompt (see the examples below).
  3. 03Claude fetches the design context, the variables and a screenshot, then writes the code in your project.
  4. 04Run the project and compare the result with the screenshot. Ask Claude to fix any differences.
  5. 05Repeat section by section until the page is complete.
Prompt
Build this section as a React component using our existing
Tailwind setup and components in /components/ui:
https://www.figma.com/design/FILE_KEY/Project?node-id=12-345

- Use our color and spacing tokens, not hard-coded values
- Make it responsive, stacking to one column under 768px
- Then take a screenshot of the Figma frame and compare it
  with your result. List and fix any differences.
Prompt
Read the variables used in this frame and add any missing
ones to our design tokens file:
https://www.figma.com/design/FILE_KEY/Project?node-id=1-2

Step 5: Teach Claude your design system

Run the create_design_system_rules prompt once per project. It generates a rules file describing your tokens, components and conventions. Save the important parts in your project's CLAUDE.md, so every future session follows the same rules without you repeating them.

CLAUDE.md
## Design to code
- Use components from /components/ui before creating new ones
- Use tokens from /styles/tokens.css, never raw hex values
- Spacing follows the 8-point scale (4, 8, 16, 24, 32, 48, 64)
- Images: next/image with explicit width and height

Step 6: The other direction, Claude to Figma

The remote server can also write to Figma. With generate_figma_design, Claude can send a live web UI into Figma as editable design layers, which is useful for documenting a built page or iterating on it visually. With use_figma, it can create and edit content in your files. Writing outside your drafts needs a Full seat.

Tips for better results

  • Go small. One section per prompt gives far better code than a full page.
  • For big frames, ask Claude to read the outline with get_metadata first, then build the pieces one by one.
  • Always compare visually. Ask Claude to check its result against the Figma screenshot before you review it.
  • Name your stack and your folders in the prompt, so code lands where it belongs.
  • Fix the file, not just the code. If the output is wrong because the design lacks auto layout, fix the design. Every future prompt benefits.
  • Review like a developer. MCP removes guesswork, not responsibility. Check accessibility, responsiveness and performance yourself.

How I use it

On client projects I design in Figma with auto layout and variables from the start, connect the file to Claude Code, and build section by section. Claude handles the translation from frame to component. I spend my time on what matters: the interactions, the details, the edge cases and the quality of the result. For founders, that means a faster path from approved design to live product, with fewer differences between the two.

If you want a product designed and built this way, start a project.

Have a project in mind?

Bring it.I engineer it.