Your team's secret weapon: bridge design and code with AI-powered workflows. From HTML to Figma components and back — in minutes, not days.
The bridge between your AI assistant and the tools you actually use every day.
Imagine you're a brilliant architect, but you can only communicate through handwritten letters. Frustrating, right? That was Claude before MCP. The Model Context Protocol (MCP) is like giving Claude a direct phone line to your favorite tools — Figma, GitHub, Slack, databases, and more.
MCP is an open standard created by Anthropic that lets AI models like Claude talk to external applications through a structured, secure protocol. Instead of you copy-pasting designs, Claude can directly read your Figma files, inspect components, pull design tokens, and even understand your entire design system — all in real time.
Design files, components,
tokens, styles
Translates between
Figma API & Claude
Understands designs,
generates code
Think of the MCP server as a universal translator. Figma speaks REST API. Claude speaks MCP. The server sits in the middle and makes sure they understand each other perfectly.
Here's the painful truth: the gap between design and code is where projects go to die. Designers spend weeks crafting pixel-perfect UIs. Developers squint at Figma specs and rebuild from scratch. Details get lost. Colors shift. Spacing drifts. Everyone's frustrated.
With MCP, Claude becomes the ultimate translator between these two worlds. It reads your Figma designs with the precision of a developer and the sensibility of a designer. It understands that your "Primary Button" component maps to a specific React component with specific props. It knows your spacing scale, your color tokens, your typography system.
Roll up your sleeves — this is where the magic begins. Don't worry, it's easier than it looks.
Before we dive in, let's make sure your toolbox is ready. You'll need four things:
The MCP server runs on Node. Install it from nodejs.org or use nvm if you're fancy.
You'll need a Personal Access Token from Figma. Free accounts work, but team/enterprise unlocks more component features.
MCP servers connect through Claude Desktop or the CLI tool Claude Code. Both support MCP configuration.
For the full code-to-Figma workflow, you'll want a published component library in Figma. This is your source of truth.
The MCP server needs Node.js to run. Here's how to install it on each platform, including verification that everything works:
Option A: Direct Install (simplest)
Visit nodejs.org and download the LTS (Long Term Support) version — not "Current." LTS is more stable and is what the MCP server is tested against. As of writing, that's v20.x or v22.x.
On macOS: Open the .pkg file and follow the wizard. It installs to /usr/local/. On Windows: Run the .msi installer. Check the box to "Add to PATH" when prompted — this is critical. On Linux: Use your package manager: sudo apt install nodejs npm (Ubuntu/Debian) or sudo dnf install nodejs (Fedora).
Open a new terminal window (important — existing terminals won't see the new PATH). Run these three commands to confirm everything is ready:
# Check Node.js version (must be 18+) $ node --version v20.11.0 # ✓ Good — v18 or higher # Check npm (comes bundled with Node) $ npm --version 10.2.4 # ✓ Good — any recent version works # Check npx (this is what the MCP server uses) $ npx --version 10.2.4 # ✓ Good — npx must be available
Option B: Using nvm (recommended for developers)
Node Version Manager lets you install and switch between multiple Node versions. This is ideal if you work on projects requiring different Node versions:
# Install nvm (macOS / Linux) $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash # Close and reopen your terminal, then: $ nvm install --lts $ nvm use --lts $ node --version v20.11.0 # On Windows, use nvm-windows instead: # Download from github.com/coreybutler/nvm-windows $ nvm install lts $ nvm use lts
npx returns "command not found" after installing Node, your terminal's PATH isn't updated. Close ALL terminal windows and open a fresh one. On macOS, you may need to restart your machine or run source ~/.zshrc. On Windows, sign out and back in.Getting your Figma API token is your golden ticket to this whole workflow. Here's how:
Click your profile avatar in the top-left corner of Figma (web or desktop) and select "Settings".
Scroll down to the "Personal access tokens" section. Click "Generate new token".
Give it a descriptive name like claude-mcp-integration. You'll see a list of permission scopes — select carefully based on what you need (see the detailed scope breakdown below).
Figma lets you set token expiry. For security, choose 90 days rather than "No expiration." Set a calendar reminder to rotate it before it expires. You can always generate a new one.
Copy the token immediately — you won't see it again! Store it in a password manager (1Password, Bitwarden, etc.) or as an environment variable on your machine. Never paste it into a Slack message, email, or shared doc.
Understanding Figma Token Permission Scopes:
When you create your token, Figma asks you to select scopes. Here's what each one does and whether you need it for the MCP workflow:
FIGMA_PERSONAL_ACCESS_TOKEN instead. See the "Storing Your Token Safely" question below for the full setup.Hardcoding your token directly into config files is a bad habit — especially if those files end up in version control. Here's how to set up environment variables on each platform so your token stays safe:
macOS / Linux (Zsh or Bash):
# Add to your shell profile (one-time setup) # For Zsh (default on modern macOS): $ echo 'export FIGMA_PERSONAL_ACCESS_TOKEN="figd_xYz123..."' >> ~/.zshrc $ source ~/.zshrc # For Bash (Linux default): $ echo 'export FIGMA_PERSONAL_ACCESS_TOKEN="figd_xYz123..."' >> ~/.bashrc $ source ~/.bashrc # Verify it's set: $ echo $FIGMA_PERSONAL_ACCESS_TOKEN figd_xYz123... # ✓ You should see your token
Windows (PowerShell):
# Set permanently for your user account: PS> [System.Environment]::SetEnvironmentVariable( "FIGMA_PERSONAL_ACCESS_TOKEN", "figd_xYz123...", "User" ) # Or via System Properties: # Win+R → sysdm.cpl → Advanced → Environment Variables # Add a new User variable with: # Name: FIGMA_PERSONAL_ACCESS_TOKEN # Value: figd_xYz123... # Restart your terminal, then verify: PS> echo $env:FIGMA_PERSONAL_ACCESS_TOKEN figd_xYz123...
Using a .env file (project-level):
# Create a .env file in your project root FIGMA_PERSONAL_ACCESS_TOKEN=figd_xYz123AbCdEfGhIjKlMnOp
.env file, immediately add it to your .gitignore: echo ".env" >> .gitignore. Also add .env.local, .env.*.local, and any other variants. A leaked Figma token gives full read access to your design files.Here's where things get exciting. The Figma MCP server is available as an npm package. You can set it up in two ways:
Option A: Quick Setup (npx — no installation needed)
You can run the server directly with npx. This is the fastest way to get started, and it's what you'll reference in your Claude config. npx downloads and runs the package on demand — no npm install needed.
# Run the server directly to test it works $ npx -y figma-developer-mcp --figma-api-key=YOUR_TOKEN # You should see output like: Figma MCP Server running on stdio # Press Ctrl+C to stop — this was just a test
Option B: Clone from GitHub (for more control)
If you want to inspect the source, customize behavior, or pin to a specific version:
# Clone the official repository $ git clone https://github.com/anthropics/figma-developer-mcp.git $ cd figma-developer-mcp # Install dependencies $ npm install # Build the TypeScript source $ npm run build # Test it runs correctly $ node dist/index.js --figma-api-key=YOUR_TOKEN Figma MCP Server running on stdio
Next, you need to tell Claude where to find this server. The configuration differs based on whether you're using Claude Desktop or Claude Code:
For Claude Desktop App:
Edit (or create) your Claude Desktop configuration file. The location depends on your operating system:
~/Library/Application Support/Claude/claude_desktop_config.json
To open this folder: In Finder, press Cmd+Shift+G and paste the path. Or in Terminal: open ~/Library/Application\ Support/Claude/. If the Claude folder doesn't exist, create it.
%APPDATA%\Claude\claude_desktop_config.json
To open this folder: Press Win+R, type %APPDATA%\Claude, and hit Enter. If the Claude folder doesn't exist, create it. The full path is typically C:\Users\YourName\AppData\Roaming\Claude\.
~/.config/Claude/claude_desktop_config.json
Create the directory if needed: mkdir -p ~/.config/Claude. Then create the file with your text editor of choice.
Using npx (recommended — simplest approach):
{
"mcpServers": {
"figma": {
"command": "npx",
"args": [
"-y",
"figma-developer-mcp",
"--figma-api-key=YOUR_TOKEN_HERE"
]
}
}
}
Using an environment variable (more secure):
{
"mcpServers": {
"figma": {
"command": "npx",
"args": [
"-y",
"figma-developer-mcp"
],
"env": {
"FIGMA_PERSONAL_ACCESS_TOKEN": "YOUR_TOKEN_HERE"
}
}
}
}
Using a locally cloned build:
{
"mcpServers": {
"figma": {
"command": "node",
"args": [
"/absolute/path/to/figma-developer-mcp/dist/index.js",
"--figma-api-key=YOUR_TOKEN_HERE"
]
}
}
}
/Users/jane/dev/figma-developer-mcp/dist/index.js) — not a relative path. Claude Desktop doesn't resolve ~/ or relative paths the same way your terminal does.For Claude Code (CLI):
Claude Code offers two approaches — a config file or an interactive command:
Method 1: Project config file (.mcp.json)
{
"mcpServers": {
"figma": {
"command": "npx",
"args": ["-y", "figma-developer-mcp",
"--figma-api-key", "YOUR_TOKEN"
]
}
}
}
Method 2: Claude Code CLI command (interactive)
# Add the Figma MCP server to your project $ claude mcp add figma -- npx -y figma-developer-mcp \ --figma-api-key YOUR_TOKEN # Or add it globally (available in all projects) $ claude mcp add --scope user figma -- npx -y figma-developer-mcp \ --figma-api-key YOUR_TOKEN # List all configured MCP servers to verify $ claude mcp list figma: npx -y figma-developer-mcp --figma-api-key=figd_...
.mcp.json if your whole team needs Figma access (commit it to your repo with a placeholder token). Use claude mcp add --scope user if it's just for you and you want it available across all projects. The CLI command is simpler for one-off setups.The Figma URL you share with Claude matters — different URL formats give Claude different levels of access. Here's how to get the right one:
Open your Figma file in the browser or desktop app. Copy the URL from the address bar. It looks like: https://www.figma.com/design/AbC123xYz/My-Design-System. This gives Claude access to the entire file — all pages, all frames, all components.
Right-click any frame in Figma and choose "Copy link to selection" (or select the frame and press Ctrl/Cmd+L). The URL will include a node-id parameter: ?node-id=123:456. This tells Claude exactly which frame to focus on — much faster for large files.
In the Assets panel, right-click a component and choose "Copy link". This links directly to the main component definition, which is ideal when you want Claude to inspect a specific component's structure, variants, and properties.
/* Full file URL */ https://www.figma.com/design/FILE_KEY/File-Name /* URL with specific page */ https://www.figma.com/design/FILE_KEY/File-Name?node-id=PAGE_ID /* URL with specific frame/component */ https://www.figma.com/design/FILE_KEY/File-Name?node-id=123:456 /* The FILE_KEY is the important part — it's the unique */ /* identifier Claude uses to access your file via the API */
node-id rather than the entire file. This reduces API calls, speeds up Claude's response, and produces more focused output. You can say: "Read this Figma frame: [URL with node-id]. Convert just this frame to code."This is a crucial Figma-side step that many people miss. Claude's get_components MCP tool only returns published components — local/unpublished components won't show up. Here's how to set up and publish your library:
In your Figma design system file, make sure every reusable element is a component (not just a frame). Select the element and press Ctrl/Cmd+Alt+K to create a component. Use slash naming for hierarchy: Button/Primary/Large, Input/Text/Default. This naming structure becomes the component's API that Claude reads.
For components with multiple states (e.g., Button with Primary/Secondary/Ghost), combine them into a Component Set. Select all variants, right-click, and choose "Combine as variants." Define properties like Type=Primary, Size=Medium, State=Default. Claude reads these variant properties and maps them to component props in code.
Select each component and add a description in the right panel. Something like: "Primary action button. Use for main CTAs. Supports icon-left and icon-right slots." Claude reads these descriptions and uses them to generate better code comments and prop documentation.
In the Figma toolbar, go to the Assets panel (left sidebar). Click the book icon or go to the Figma menu → Libraries → Publish. Write a version description (e.g., "v2.4 — Added DataTable component, updated Button hover states"). Click "Publish". Your components are now available via the API.
Go to Local variables (right panel) and define your design tokens as Figma Variables: colors (primitives like purple/500 and semantics like color/primary), spacing (space/sm=8, space/md=16), and border-radius. Bind these variables to your components. When Claude reads via MCP with the Variables scope, it can extract these as a structured token system.
Time to see the magic happen. Let's make sure Claude can see your designs.
After saving your config file, Claude won't automatically detect changes. You need to restart properly — and the method differs by platform:
Option 1 (Quick): Right-click the Claude icon in the Dock → "Quit." Then reopen from Applications. Option 2 (Thorough): Press Cmd+Q to fully quit, wait 3 seconds, then relaunch. Do not just close the window — that leaves Claude running in the background without reloading configs. Option 3: In the Claude menu bar, look for a "Reload MCP Servers" option if available.
Right-click Claude in the system tray (bottom-right near the clock) → "Quit" or "Exit." Wait a few seconds, then relaunch from the Start menu. If Claude doesn't appear in the tray, open Task Manager (Ctrl+Shift+Esc), find any "Claude" processes, end them, then relaunch.
Simply exit your current Claude Code session (/exit or Ctrl+C) and start a new one with claude. Claude Code reads the MCP config fresh on each session start. If you used claude mcp add, the change takes effect immediately in new sessions.
After restarting Claude, it's time for the moment of truth. Here's exactly what to look for and how to test, step by step:
Step 1: Check the MCP indicator in Claude Desktop
Look at the bottom of the Claude Desktop chat input area. You should see a small hammer icon (🔨) or a tools indicator with a number. Click it — a panel should appear listing your connected MCP servers. Look for "figma" in the list. If it shows a green dot or checkmark, the server is connected and running.
Step 2 (Claude Code): Check via CLI
# Inside a Claude Code session, type: /mcp # You should see output like: MCP Servers: figma — connected Tools: get_file, get_styles, get_components, get_node, ... Status: running
Step 3: Run a live test
Ask Claude to read a Figma file. Use a simple file you own — ideally one with a few frames and some components:
You: Can you read my Figma file and tell me what's in it? Here's the URL: https://www.figma.com/design/YOUR_FILE_KEY/Your-File-Name /* If the connection works, Claude will respond with: */ Claude: I'll read your Figma file now... ✓ Successfully connected to Figma! Your file "Your File Name" contains: - 3 pages: Home, Components, Tokens - 24 frames across all pages - 12 published components ... /* If the connection fails, you'll see something like: */ Claude: I tried to read the file but encountered an error: Error: 403 Forbidden — The token doesn't have access to this file, or the token is invalid.
The tools you should see available:
get_fileRetrieves the full structure of a Figma file — frames, components, layers, everything. This is Claude's X-ray vision into your designs. Parameters: fileKey (from the URL), optional depth to control how deep into the tree to read.
get_stylesPulls your design tokens: colors, typography, effects, and grid styles. The DNA of your design system. Returns: an array of style objects with names, descriptions, and visual values (hex colors, font properties, shadow definitions).
get_componentsLists all published components and component sets in your library. Claude learns your design vocabulary. Returns: component names, descriptions, variant properties, and their node IDs for further inspection.
get_nodeZooms into a specific node/element by ID. Perfect for examining a particular component or frame in detail. Parameters: fileKey and nodeId. Returns: the full subtree of that node — all children, properties, styles, and layout info.
get_imagesExports specific nodes as images (PNG, SVG, JPG, PDF). Useful when Claude needs to reference how a particular section looks visually, or when exporting assets. Parameters: fileKey, nodeIds, format, scale.
npx is accessible from your system PATH.Connection issues are almost always one of five things. Here's a systematic diagnostic checklist:
The #1 cause. A missing comma, an extra trailing comma, or a mismatched bracket breaks the entire file. Paste your config into jsonlint.com to validate. Common trap: JSON doesn't allow comments — remove any // ... lines.
Test your token directly with a curl command. Open a terminal and run: curl -H "X-Figma-Token: YOUR_TOKEN" https://api.figma.com/v1/me. If you get back your user info, the token works. If you get a 403, generate a new one.
npx not in PATHClaude Desktop uses a minimal PATH that may not include where Node.js is installed. Try using the full absolute path to npx in your config: on macOS, run which npx in Terminal (typically /usr/local/bin/npx), then use that path as the "command" value instead of just "npx".
The file must be named exactly claude_desktop_config.json and placed in the exact directory for your OS. A common mistake is saving it as claude_desktop_config.json.txt (Windows hides extensions by default). Enable "Show file extensions" in File Explorer settings.
Corporate firewalls or VPNs may block outgoing connections to api.figma.com. If you're on a work network, try switching to a personal network to test. If it works there, you'll need to whitelist Figma's API endpoints with your IT team.
# 1. Test your token directly $ curl -s -H "X-Figma-Token: YOUR_TOKEN" \ https://api.figma.com/v1/me | head -5 {"id":"123","email":"you@company.com","handle":"YourName"} # ✓ Token is valid if you see your info # 2. Test npx is available and can find the package $ npx -y figma-developer-mcp --help # Should print help info, not "command not found" # 3. Find the absolute path to npx (for config) $ which npx /usr/local/bin/npx # Use this full path in your config if "npx" alone doesn't work # 4. Validate your config JSON $ cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | python3 -m json.tool # If it prints formatted JSON, syntax is valid # If it shows "Expecting..." error, you have a JSON syntax issue
This is where it gets mind-blowing. When Claude reads your Figma file through MCP, it doesn't just see a flat image — it sees the entire design tree, similar to how a browser sees HTML DOM. Specifically, Claude can read:
Structure: Every frame, group, component instance, and layer, including their nesting hierarchy. Claude understands parent-child relationships, auto-layout settings, and constraints.
Styles & Tokens: Fill colors (with exact hex/rgba values), stroke properties, corner radius, shadows, blur effects, typography (font family, size, weight, line height, letter spacing), and spacing.
Components: It recognizes component instances and traces them back to their main component definitions. It sees variant properties, overrides, and slot content.
Layout: Auto-layout direction, gap, padding, alignment, sizing modes (fixed, hug, fill), min/max dimensions — all the info needed to generate accurate Flexbox or Grid CSS.
Turn your pixel-perfect designs into production-ready code — without losing a single detail.
Here's the beautiful part: you don't need to install any Figma plugins or use third-party tools. Claude + MCP handles everything. Here's the flow:
Copy the URL of the specific page, frame, or component you want to convert. Paste it into your Claude conversation. Pro tip: be specific about which frame you want — "Convert the 'Hero Section' frame from this page" gives better results than "convert this file."
Claude uses the MCP tools to read the file structure. It parses every layer, extracts colors, typography, spacing, and identifies component instances. It builds a mental model of your design, just like a developer would when examining a spec.
This is crucial: tell Claude what framework you're using. "Generate this as a React component using Tailwind CSS" vs "Give me vanilla HTML/CSS" will produce very different outputs. Also mention your component library if you have one (e.g., "use our existing Button and Card components from the design system").
Claude outputs clean, semantic code that matches your design. It preserves auto-layout as Flexbox/Grid, converts Figma tokens to CSS variables, maps component instances to your codebase's components, and handles responsive behavior based on constraints.
Not perfect on the first try? No problem. Say "Make the hero image full-bleed" or "Use our spacing scale instead of pixel values" and Claude adjusts. This conversational refinement is the superpower of this workflow.
The quality of your output is directly proportional to the quality of your prompt. Here's a template that consistently produces excellent results:
/* Copy and customize this prompt for your needs */ Read this Figma file: [PASTE_FIGMA_URL] Context: - Framework: React with TypeScript - Styling: Tailwind CSS (v3.4) - Component library: Our custom design system at "src/components/ui/" - Design tokens are in "src/tokens.css" Please: 1. Convert the "Dashboard Layout" frame to code 2. Use our existing components where they match (Button, Card, Avatar, Badge) 3. Preserve all spacing using our 4px grid 4. Extract any new colors as CSS custom properties 5. Make it responsive (mobile-first) 6. Add meaningful component/prop names
The crown jewel. Take existing HTML, reimagine it using your design system's Figma components, and export back as new, clean code.
This is the holy grail workflow — and it's where Claude's ability to understand both code AND design truly shines. Picture this scenario:
You have an existing HTML page (maybe a legacy app, a prototype, or a third-party template). You want to rebuild it using your company's design system — your carefully crafted Figma component library with its approved buttons, cards, inputs, layouts, and tokens. Then you want that redesigned version exported back as clean, production code.
Let's break this down into the detailed steps your team will follow:
Share your HTML/CSS/React code with Claude. You can paste it directly, share a file, or — if using Claude Code — point it to the file in your project. Claude will analyze the UI structure: what components exist, their hierarchy, their visual properties, and their behavior.
Point Claude at your Figma design system file using MCP. Claude uses get_components to catalog every component, variant, and property available. It reads get_styles to understand your design tokens — color palette, typography scale, spacing system, elevation levels.
This is the magic moment. Claude cross-references the elements in your existing HTML with the components in your Figma library. It creates an intelligent mapping — your <button class="btn-primary"> becomes an instance of the "Button / Primary / Medium" component in Figma. Your custom card layout maps to the "Card / Elevated" variant. Claude identifies where your code deviates from the design system and suggests corrections.
Working with your designer (or autonomously if you trust the mapping), the redesigned screens are assembled in Figma using only components from your library. Claude can guide this by providing a detailed specification: "The hero section should use a Stack/Vertical with 32px gap, containing a Heading/H1 component and a Button/Primary/Large component."
Once the Figma redesign is complete, use the Figma-to-Code workflow (Section 4) to have Claude read the redesigned file and generate brand-new code that perfectly uses your actual coded component library. The output is clean, consistent, and design-system-compliant.
Absolutely. Here's what a real mapping looks like when Claude analyzes your HTML against your Figma component library. This table shows how each element in the old code gets translated to a design system component:
Let's look at a real before/after to see the transformation. Imagine you have a legacy login form and your design system has well-defined components:
<div class="login-box"> <h2 style="color: #333; font-size: 24px; margin-bottom: 20px;"> Sign In </h2> <input type="email" style="width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px;" placeholder="Email" /> <input type="password" style="width: 100%; padding: 12px; ..." placeholder="Password" /> <button style="background: blue; color: white; padding: 12px 24px;"> Log In </button> </div>
import { Card } from '@ui/Card'; import { Heading } from '@ui/Heading'; import { Input } from '@ui/Input'; import { Button } from '@ui/Button'; import { Stack } from '@ui/Stack'; export const LoginForm = () => ( <Card variant="elevated" padding="xl"> <Stack gap="lg"> <Heading level={2}> Sign In </Heading> <Input type="email" label="Email" size="md" /> <Input type="password" label="Password" size="md" /> <Button variant="primary" size="lg" fullWidth> Log In </Button> </Stack> </Card> );
See the difference? The left side is fragile, inconsistent, and unmaintainable. The right side uses your design system's components, respects your spacing tokens, and is instantly consistent with every other screen in your app. That's the power of the round-trip workflow.
Alright, let's go deep. Imagine your company is called Acme Corp and you have a mature Figma design system called "Acme UI Kit". A product team just inherited a legacy dashboard built with Bootstrap and inline styles. They want to rebuild it using Acme's design system. Here's exactly how the workflow unfolds:
Open Claude Code in your project directory. Ask Claude: "Analyze the UI components in src/pages/Dashboard.tsx. List every visual element, its purpose, and the HTML/CSS used to render it." Claude parses the file and returns a structured inventory — 3 cards, a sidebar nav, a data table, a search input, 4 action buttons, a chart, etc.
Share your Figma library URL: "Now read our design system from Figma: [Acme UI Kit URL]. Catalog all available components and their variants." Claude connects via MCP and returns: Button (4 variants, 3 sizes), Card (3 variants), Input (5 types), Table (sortable, pagination), Navigation (sidebar, topbar), Avatar, Badge, etc.
Ask Claude: "Map every element from the legacy dashboard to the closest component in our Acme UI Kit. Flag any elements that don't have a match." Claude produces the mapping table — Bootstrap's .btn-primary maps to Acme's Button/Primary/MD, the custom <table> maps to Acme's DataTable component, and it flags 2 custom widgets that need new Figma components.
Claude generates a detailed specification for your designer: "The Dashboard page should use a Sidebar/Expanded on the left (240px), with a main content area using Stack/Vertical gap=24. The top section contains a SearchInput/Default and 3x Card/Metric in a horizontal Stack/gap=16." Your designer follows this to assemble the new design using existing library components.
Your designer drags components from the Acme UI Kit into a new page. They follow Claude's spec while applying their judgment on visual polish, micro-interactions, and edge cases Claude might have missed. The result: a beautiful, on-brand dashboard that uses 100% design system components.
Share the redesigned Figma page URL with Claude. Ask: "Convert this redesigned dashboard to React/TypeScript using our Acme component library at src/components/acme/. Use our existing imports and token system." Claude reads the redesigned Figma via MCP and generates clean, component-based code that uses your actual imports.
Review the generated code. Ask Claude to adjust anything: "The table needs client-side sorting on the 'Revenue' column" or "Add loading skeletons that match our Skeleton component." Once polished, it's ready for PR. The entire process that would've taken a team two weeks just happened in an afternoon.
The complete picture — from existing code, through design, and back to new code.
Here's the entire journey visualized. This is the workflow that turns legacy spaghetti into design-system-compliant, production-grade code:
The beauty of this workflow is that Claude is the central intelligence at every stage. It reads your old code, understands your design system, creates the mapping, guides the redesign, reads the new Figma screens, and generates production code. It's one conversation, one context, one AI that understands the full picture.
Let's get real with some rough estimates based on common scenarios:
Manual audit: 2-4 hours
Component mapping: 1-2 days
Figma rebuild: 3-5 days
Code from Figma: 5-10 days
QA & alignment: 2-3 days
Total: 2-4 weeks
AI-powered audit: 10-30 min
Auto component map: 5-15 min
Guided Figma rebuild: 1-2 days
AI code generation: 30-60 min
Refinement: 2-4 hours
Total: 2-3 days
That's roughly a 5-8x speedup, and the quality is often higher because Claude doesn't miss design token mismatches or spacing inconsistencies that humans overlook during long coding sessions.
Concrete, copy-paste-ready examples for every step of the workflow. No hand-waving — just the real thing.
Scenario: You've just configured the Figma MCP server and want to verify it's working. Here's the exact interaction:
// ~/Library/Application Support/Claude/claude_desktop_config.json { "mcpServers": { "figma": { "command": "npx", "args": [ "-y", "figma-developer-mcp", "--figma-api-key=figd_xYz123AbCdEfGhIjKlMnOp" ] } } }
/* After restarting Claude Desktop */ You: Can you read my Figma file and tell me what's in it? Here's the URL: https://www.figma.com/design/AbC123xYz/ Acme-Design-System Claude: I'll read your Figma file now using the MCP tools. Let me fetch the file structure... ✓ Successfully connected to Figma! Your file "Acme Design System" contains: Pages (4): • Getting Started — Overview and usage docs • Foundations — Colors, typography, spacing • Components — 47 published components • Templates — 12 page templates Component Library Summary: • Button (Primary, Secondary, Ghost, Danger) — each with SM, MD, LG sizes • Input (Text, Email, Password, Search, Textarea) • Card (Default, Elevated, Outlined) • Avatar (Circle, Square) — XS to XXL • Badge (Status, Count, Dot) ... and 42 more components
Scenario: You want to convert a "Pricing Card" component from your Figma design into a React component with Tailwind CSS.
You: Read this Figma file:
https://www.figma.com/design/AbC123/Acme-Design-System
Find the "Pricing Card" component on the Components page.
Convert it to a React + TypeScript component using
Tailwind CSS.
Requirements:
- Make it accept props for: title, price, features list,
CTA button text, and a "popular" boolean for highlight
- Use our color tokens: primary=#6366F1, surface=#1E1B2E
- The card should be responsive
- Export as a named export
import React from 'react'; interface PricingCardProps { title: string; price: string; period?: string; features: string[]; ctaText: string; popular?: boolean; onCtaClick?: () => void; } export const PricingCard: React.FC<PricingCardProps> = ({ title, price, period = '/month', features, ctaText, popular = false, onCtaClick, }) => ( <div className={` relative rounded-2xl p-8 ${popular ? 'bg-[#6366F1] text-white ring-2 ring-[#6366F1]' : 'bg-[#1E1B2E] text-gray-100 ring-1 ring-white/10'} flex flex-col gap-6 transition-transform hover:-translate-y-1 `} > {popular && ( <span className="absolute -top-3 left-1/2 -translate-x-1/2 bg-amber-400 text-black text-xs font-bold px-3 py-1 rounded-full"> Most Popular </span> )} <h3 className="text-lg font-semibold tracking-tight"> {title} </h3> <div className="flex items-baseline gap-1"> <span className="text-4xl font-extrabold tracking-tight"> {price} </span> <span className="text-sm opacity-70"> {period} </span> </div> <ul className="flex flex-col gap-3"> {features.map((feat, i) => ( <li key={i} className="flex items-center gap-2 text-sm"> <span className="text-emerald-400"> ✓ </span> {feat} </li> ))} </ul> <button onClick={onCtaClick} className={` mt-auto w-full py-3 px-6 rounded-xl font-semibold text-sm transition-colors cursor-pointer ${popular ? 'bg-white text-[#6366F1] hover:bg-gray-100' : 'bg-[#6366F1] text-white hover:bg-[#5558E3]'} `} > {ctaText} </button> </div> );
Scenario: You have a legacy Bootstrap dashboard and want Claude to create a mapping to your Figma component library so your designer can rebuild it.
You: I have this legacy dashboard HTML. I also have our design system in Figma. Legacy code: [paste or share file path] Figma DS: https://figma.com/design/AbC123/Acme-DS Please: 1. Analyze every UI element in the legacy HTML 2. Read our Figma component library via MCP 3. Create a detailed component mapping table 4. Flag elements that have NO match in our DS 5. Write a Figma assembly spec that a designer can follow to rebuild this page
/* Claude reads both sources and produces: */ ===== COMPONENT MAPPING REPORT ===== File analyzed: dashboard.html (347 lines) Figma library: Acme Design System v2.4 Components available: 47 --- DIRECT MATCHES (14 elements) --- # | HTML Element | Figma Component ----+------------------------+---------------------- 1 | .btn.btn-primary | Button/Primary/MD 2 | .btn.btn-outline-secondary | Button/Secondary/MD 3 | .card | Card/Elevated 4 | .form-control (text) | Input/Text/Default 5 | .form-control (search) | Input/Search/Default 6 | .badge.bg-success | Badge/Status/Success 7 | .badge.bg-warning | Badge/Status/Warning 8 | .navbar | Navigation/TopBar 9 | .nav-sidebar | Navigation/Sidebar 10 | .avatar-circle | Avatar/Circle/MD 11 | .dropdown-menu | Menu/Dropdown 12 | .table | DataTable/Default 13 | .breadcrumb | Breadcrumb/Default 14 | .progress-bar | ProgressBar/Linear --- PARTIAL MATCHES (3 elements) --- 15 | .stat-widget | Card/Metric → NOTE: HTML has icon left-aligned; Figma has icon top. Suggest using Card/Metric/Horizontal variant 16 | .chart-container | NO direct match → RECOMMEND: Create "ChartWrapper" component in Figma using Card/Default with 24px internal padding 17 | custom <footer> | NO direct match → RECOMMEND: Use Stack/Horizontal with Text/Caption for copyright line --- FIGMA ASSEMBLY SPEC --- Page structure (top to bottom): ├─ Navigation/TopBar │ ├─ Logo slot: Acme logo │ ├─ Search: Input/Search/Default (width: fill) │ └─ Right slot: Avatar/Circle/SM + Menu/Dropdown ├─ Main Layout: Auto-layout Horizontal │ ├─ Navigation/Sidebar (width: 260px, fixed) │ │ ├─ NavItem × 6 (icons: Home, Analytics, ...) │ │ └─ Divider + NavItem "Settings" │ └─ Content Area: Auto-layout Vertical, gap=24 │ ├─ Breadcrumb/Default │ ├─ Metrics Row: Auto-layout Horizontal, gap=16 │ │ ├─ Card/Metric (Revenue) ×1 │ │ ├─ Card/Metric (Users) ×1 │ │ ├─ Card/Metric (Orders) ×1 │ │ └─ Card/Metric (Conversion) ×1 │ ├─ Card/Elevated (contains ChartWrapper) │ │ ├─ Heading/H3: "Revenue Over Time" │ │ └─ Chart placeholder (540×280) │ └─ Card/Elevated (contains DataTable) │ ├─ Heading/H3: "Recent Orders" │ └─ DataTable/Default (6 cols, 10 rows) └─ Footer (Stack/Horizontal)
Your designer can now follow this spec like a recipe — dragging components from the Acme UI Kit library, following the layout structure, and producing a pixel-perfect, design-system-compliant version of the dashboard.
Scenario: Your designer has rebuilt the dashboard in Figma using the component mapping from Example 3. Now it's time to generate the final production code.
You: Our designer has finished rebuilding the dashboard in Figma using our Acme DS components. Here's the redesigned page: https://figma.com/design/XyZ789/Dashboard-Redesign Please convert this to production React + TypeScript. Requirements: - Import components from "@acme/ui" - Use our spacing tokens: $space-xs=4, $space-sm=8, $space-md=16, $space-lg=24, $space-xl=32 - Follow our file conventions: one component per file, PascalCase names - Include TypeScript interfaces for all props - Make the sidebar collapsible on mobile - Use CSS Modules for any custom styles - Include the data-fetching hooks (use SWR)
import React, { useState } from 'react'; import useSWR from 'swr'; import { TopBar, Sidebar, SidebarItem, Card, MetricCard, DataTable, Breadcrumb, SearchInput, Avatar, Stack, } from '@acme/ui'; import { RevenueChart } from './RevenueChart'; import { fetcher } from '@/lib/fetcher'; import styles from './DashboardPage.module.css'; interface MetricData { label: string; value: string; change: number; trend: 'up' | 'down'; } export const DashboardPage = () => { const [sidebarOpen, setSidebarOpen] = useState(true); const { data: metrics } = useSWR<MetricData[]>('/api/metrics', fetcher); const { data: orders } = useSWR('/api/orders/recent', fetcher); return ( <div className={styles.layout}> <TopBar> <TopBar.Logo src="/acme-logo.svg" /> <SearchInput placeholder="Search anything..." className={styles.searchExpand} /> <Avatar size="sm" src="/me.jpg" fallback="IS" /> </TopBar> <div className={styles.body}> <Sidebar collapsed={!sidebarOpen} onToggle={()=>setSidebarOpen(!sidebarOpen)}> <SidebarItem icon="home" active>Dashboard</SidebarItem> <SidebarItem icon="chart" >Analytics</SidebarItem> <SidebarItem icon="users" >Customers</SidebarItem> <SidebarItem icon="box" >Products</SidebarItem> <Sidebar.Divider /> <SidebarItem icon="settings" >Settings</SidebarItem> </Sidebar> <main className={styles.content}> <Breadcrumb items={[ { label: 'Home', href: '/' }, { label: 'Dashboard' }, ]} /> <Stack direction="horizontal" gap="md" wrap> {metrics?.map((m) => ( <MetricCard key={m.label} label={m.label} value={m.value} change={m.change} trend={m.trend} /> ))} </Stack> <Card variant="elevated" padding="lg"> <Card.Header> Revenue Over Time </Card.Header> <RevenueChart /> </Card> <Card variant="elevated" padding="lg"> <Card.Header> Recent Orders </Card.Header> <DataTable data={orders ?? []} columns={orderColumns} sortable pagination={{ pageSize: 10 }} /> </Card> </main> </div> </div> ); };
That's the full journey: legacy HTML → Claude analysis → component mapping → designer rebuilds in Figma → Claude generates production code. The new code uses your real component library, your real tokens, and your real conventions. It's not a rough draft — it's a production-ready starting point.
Scenario: Before generating code, you want Claude to extract your complete design token system from Figma and output it as CSS custom properties.
You: Read our Figma design system at [URL].
Extract ALL design tokens and output them as:
1. CSS custom properties (:root block)
2. A Tailwind theme extension config
Include: colors, typography, spacing, border-radius,
shadows, and any Figma variables you find.
/* Auto-extracted from Figma: Acme Design System v2.4 */ /* Generated via Claude + Figma MCP */ :root { /* --- Colors: Primary --- */ --color-primary-50: #EEF2FF; --color-primary-100: #E0E7FF; --color-primary-500: #6366F1; --color-primary-600: #4F46E5; --color-primary-900: #312E81; /* --- Colors: Semantic --- */ --color-success: #10B981; --color-warning: #F59E0B; --color-danger: #EF4444; --color-info: #3B82F6; /* --- Colors: Surface --- */ --color-bg: #0F0D1A; --color-surface: #1E1B2E; --color-elevated: #2A2640; --color-border: rgba(255,255,255,0.08); /* --- Typography --- */ --font-sans: 'Inter', system-ui, sans-serif; --font-mono: 'JetBrains Mono', monospace; --text-xs: 0.75rem; /* 12px */ --text-sm: 0.875rem; /* 14px */ --text-base: 1rem; /* 16px */ --text-lg: 1.125rem; /* 18px */ --text-xl: 1.25rem; /* 20px */ --text-2xl: 1.5rem; /* 24px */ --text-3xl: 1.875rem; /* 30px */ /* --- Spacing (4px grid) --- */ --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px; /* --- Border Radius --- */ --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px; --radius-full: 9999px; /* --- Shadows --- */ --shadow-sm: 0 1px 2px rgba(0,0,0,0.3); --shadow-md: 0 4px 12px rgba(0,0,0,0.25); --shadow-lg: 0 8px 24px rgba(0,0,0,0.3); }
Having your tokens extracted programmatically ensures perfect parity between Figma and code. No more eyeballing hex values or guessing spacing — it's all pulled directly from the source of truth.
The difference between "kinda close" and "indistinguishable from the original." This is where craft meets precision — and where most people give up too early.
Here's a truth that trips up everyone at first: Claude is brilliant at understanding structure and logic, but it doesn't "see" your design the way you do. When you show Claude a Figma file or a website, it reads the data — colors, fonts, spacing, hierarchy — but it doesn't perceive visual rhythm, optical balance, or the subtle "feel" of a design the way a human eye does.
The gap between "roughly correct" and "pixel-perfect" comes down to five common drift points:
Claude may round colors to "close enough" values. #1E1B2E becomes #1a1a2e. Imperceptible? Maybe. But multiply that across 40 elements and the whole palette drifts.
Without exact values, Claude defaults to common patterns: 16px, 24px, 32px. Your design might use 18px, 28px, or a non-standard grid. These tiny offsets compound.
Font weight, line height, and letter spacing are the most commonly "approximated" properties. Your heading might be Inter 600 at -0.02em tracking — Claude might output 700 with default tracking.
Box shadows, blurs, gradients, and opacity layers are often simplified. A complex multi-layer shadow gets reduced to a single box-shadow value.
Alignment, overflow behavior, text truncation, aspect ratios, max-widths — these "invisible" properties define how a design feels and are the first things Claude skips when it's filling in gaps.
The good news? Every single one of these is solvable — you just need to give Claude the right reference material. Let's break down exactly how for each scenario.
Think of these as the "Seven Pillars of Pixel Perfection" — the reference materials that, when provided together, eliminate guesswork entirely:
Here's what each pillar means in practice:
1. Color Tokens (exact values) — Don't say "dark blue background." Provide the exact hex: #0F0D1A. Include every color: backgrounds, text (primary, secondary, muted), borders, accents, hover states, active states, disabled states. The more colors you specify, the less Claude guesses.
2. Typography System — Font family, font weights for each heading level and body text, font sizes (in px or rem), line heights (as ratios like 1.5 or px values), letter spacing. If your H1 uses Inter Semi Bold 48px/56px with -0.02em tracking, say exactly that.
3. Spacing Scale — Your base unit (4px? 8px?), the scale (4, 8, 12, 16, 24, 32, 48, 64), and how it's used: section padding, card padding, gap between elements, margin between sections. Specify padding: 32px, not "generous padding."
4. Layout Rules — Max content width, sidebar width, grid columns, breakpoints, how elements stack on mobile, whether cards use fixed or fluid widths, alignment rules (center vs left).
5. Effects & Decorations — Exact box shadow values (offset, blur, spread, color), border radius for each element type, gradient definitions, backdrop blur values, border widths and colors, opacity levels.
6. Component Patterns — How buttons look (padding, border-radius, font-weight, text-transform), how cards are structured (header + body + footer), how inputs are styled (border color, focus ring, placeholder color), how navigation works.
7. Interaction States — Hover effects (color shifts, transforms, transitions), focus indicators, active/pressed states, disabled states, loading states, animation durations and easing curves.
This is the most common scenario: you have a Figma design and you want Claude to generate HTML/CSS/React that looks identical. Here's the step-by-step approach:
Before asking Claude to generate any code, have it study the design first. This is the most critical step that most people skip. Ask Claude to read the Figma file and output a complete design specification — not code, just a detailed report of every visual property it finds.
MCP reads most properties, but some things get lost: background images/patterns, specific icon sets, custom fonts that aren't in the Figma metadata, animation behaviors, and responsive breakpoint logic. Supplement with explicit instructions for these.
Ask Claude to first output the CSS custom properties / design tokens it plans to use, before writing the component code. Review these tokens against your Figma design. Catch color/spacing errors at the token level, not after 200 lines of code.
Don't ask for the entire page at once. Go section by section: "Now generate just the hero section," then "Now the features grid," then "Now the footer." This keeps Claude's attention focused and reduces accumulated drift.
Open the generated HTML alongside your Figma design. Screenshot both. Point out specific differences: "The card border radius should be 16px not 12px," "The heading is too bold — use font-weight 600 not 700." Claude corrects instantly.
The Master Prompt for this scenario:
/* PHASE 1: STUDY (run this first) */ Read this Figma file via MCP: [FIGMA_URL] Before writing any code, output a complete design specification including: 1. COLOR PALETTE: Every unique color used, grouped by purpose (backgrounds, text, borders, accents, states). Use exact hex values. 2. TYPOGRAPHY SCALE: Every text style — font family, weight, size, line-height, letter-spacing, and where each is used. 3. SPACING MAP: All unique padding, margin, and gap values. Identify the base grid unit. 4. COMPONENT INVENTORY: Every distinct UI element (buttons, cards, inputs, etc) with their exact visual properties. 5. EFFECTS: All shadows, gradients, blurs, border radii, and opacity values. 6. LAYOUT STRUCTURE: Page width, section layout (flex/grid), column counts, responsive behavior inferred from constraints. Output as a structured spec document. Do NOT write code yet. /* PHASE 2: GENERATE (run after reviewing spec) */ Now generate the HTML/CSS using exactly the spec above. Requirements: - Use CSS custom properties for ALL design tokens (colors, spacing, radii, shadows). Define them in a :root block at the top. - Match the Figma layout precisely: same flex directions, same gaps, same alignment. - Preserve exact values — do NOT round 18px to 16px, do NOT change #1E1B2E to #1a1a2e. - Include hover states and transitions that match the Figma interaction specs (if present). - Use semantic HTML5 elements. - Make it responsive following the Figma constraints. - Single file: inline all CSS in a <style> block. - Load the exact Google Fonts referenced in Figma. /* PHASE 3: REFINE (run after visual comparison) */ I compared your output to the Figma design. Fix these specific differences: [LIST EXACT DIFFERENCES YOU SPOTTED]
Matching a live website is trickier than a Figma file because Claude can't read the website's actual CSS through MCP. But there's a powerful workflow that gets you incredibly close:
Give Claude as much raw information as possible. The ideal combination is: a screenshot of the page (Claude can analyze images), the page's HTML source code (right-click → View Page Source), and optionally the computed CSS for key elements (use browser DevTools → Computed tab). The screenshot gives Claude visual context; the source gives it structural truth.
Ask Claude to analyze the HTML/CSS source and extract the design tokens — just like the Figma scenario. Claude will identify the color palette, typography scale, spacing patterns, and component structures from the actual code. This is far more accurate than Claude "guessing" from a screenshot alone.
Be explicit about intent. Do you want a 1:1 clone? Or do you want the same style applied to different content? This distinction changes Claude's approach entirely.
For any element you need to match exactly, open DevTools, select the element, and copy the computed styles. Paste these into your prompt. Claude will use the exact font: 500 16px/24px "Inter" value rather than guessing.
Open both the reference site and your generated HTML in adjacent browser windows. Screenshot both at the same viewport width. Point out specific discrepancies. Repeat until the match is perfect.
The Master Prompt for this scenario:
/* Provide as much source material as possible */ I want to create an HTML page that matches the visual style of a reference website exactly. Reference materials I'm providing: 1. Screenshot: [attached image] 2. Source HTML: [pasted or attached] 3. Key CSS values (from DevTools): - Background: #0a0a0a - Primary text: #fafafa - Secondary text: #a1a1aa - Accent color: #6366f1 - Card background: #18181b - Border color: rgba(255,255,255,0.08) - Font: Inter, 400/500/600/700 - Base size: 16px, line-height: 1.6 - Border radius: cards=12px, buttons=8px - Content max-width: 1200px - Section padding: 80px vertical - Card shadow: 0 4px 24px rgba(0,0,0,0.2) Instructions: - Match the visual style exactly. Use the CSS values I provided as the source of truth. - Do NOT approximate or round any values. - Replicate the layout structure: [describe layout] - Include the same hover effects and transitions. - Use CSS custom properties for all tokens. - Single self-contained HTML file. - Load fonts from Google Fonts CDN. Content to use: [Provide YOUR content — headings, text, images — that should be styled in the reference site's visual language]
This is a "design style transfer" scenario — you have a design in one Figma file and you want it to adopt the visual language of a different reference Figma file (like your company's design system). Claude + MCP is uniquely powerful here because it can read both files simultaneously.
/* Claude reads both Figma files via MCP */ I have two Figma files. Please read both: SOURCE (the design to restyle): [FIGMA_URL_1] Focus on the page/frame: "[Frame Name]" REFERENCE (the target style to match): [FIGMA_URL_2] This is our design system / brand reference. Please do the following: 1. ANALYZE both files. Extract the complete design token sets from BOTH — colors, typography, spacing, effects, component patterns. 2. CREATE A MAPPING between the source's visual properties and the reference's design tokens. Show me a table: | Source Property | Source Value | Reference Token | 3. GENERATE A REDESIGN SPEC that tells a designer exactly how to rebuild the SOURCE design using ONLY the REFERENCE's visual language: - Which reference colors replace which source colors - Which reference type styles replace which headings - Which reference components replace which elements - How spacing should change to match the ref grid 4. THEN GENERATE CODE that implements the source layout/content but with the reference's complete visual style applied. Every color, font, spacing, shadow, and radius should come from the reference. The output should be indistinguishable in style from a page designed natively in the reference system.
This is the reverse challenge: you have working code and need a Figma design that matches it exactly, built from your design system components. This is common when legacy code needs to be "documented" in Figma for future design work.
/* Provide both the code and your Figma library */ I have existing HTML/CSS code and I need to recreate it faithfully in Figma using our component library. My code: [paste HTML/CSS or share file] Our Figma component library: [FIGMA_LIBRARY_URL] Please: 1. AUDIT MY CODE — list every visual element, its computed dimensions, colors, fonts, spacing. Be exhaustive. Include: - Exact pixel dimensions of each section - Every color value (backgrounds, text, borders) - Font properties for each text element - Spacing between all elements (margin + padding) - Border radius, shadows, opacity for every box - Layout type (flex/grid) with direction & gaps 2. READ THE FIGMA LIBRARY — catalog all components, their variants, and their visual properties. 3. MAP CODE → FIGMA COMPONENTS — for each coded element, specify exactly which Figma component (and which variant/size) to use. Where there's no exact match, specify overrides needed. 4. WRITE A FIGMA BUILD SPEC — a step-by-step assembly guide a designer can follow: Frame: "Dashboard" (1440×900) ├─ Auto-layout: Vertical, gap=0 ├─ Child 1: Navigation/TopBar │ ├─ Width: Fill, Height: 64px │ ├─ Padding: 0 24px │ ├─ Background: #0F0D1A │ └─ Contents: [Logo] + [Spacer] + [Avatar/SM] ├─ Child 2: Auto-layout Horizontal, gap=0 │ ├─ Child 2a: Sidebar (Width: 260px, Fill Y) │ └─ Child 2b: Main Content (Fill X, Fill Y) │ ├─ Padding: 32px │ ├─ Auto-layout: Vertical, gap=24 │ └─ Children: [Metrics Row] [Chart Card] ... Include EVERY property needed to match the code.
The refinement loop is where "close" becomes "perfect." Here's the systematic approach that works every time:
The key is being surgically specific in your corrections. Vague feedback like "it doesn't look right" wastes iterations. Precise feedback like the examples below gets you there fast:
/* BAD — vague, forces Claude to guess */ ✗ "The header looks off." ✗ "The colors aren't quite right." ✗ "It doesn't feel the same." ✗ "Make it match better." /* GOOD — surgical, one-shot fixes */ ✓ "The hero heading should be font-weight 800, not 700. And the line-height should be 1.1, not 1.2." ✓ "Card background is #16161F but should be #1E1B2E. Border should be rgba(255,255,255,0.06) not rgba(255,255,255,0.1)." ✓ "The gap between metric cards is 16px but should be 20px. And each card should have padding 24px, not 20px." ✓ "The CTA button border-radius is 8px but should be 12px. Its box-shadow should be 0 4px 14px rgba(99,102,241,0.4), not the current 0 2px 8px value." ✓ "The section padding is 64px top/bottom but should be 80px. And the max-width should be 1140px, not 1200px."
The "Nuclear Option" for stubborn mismatches:
If a specific section just won't match, use this power prompt that forces Claude to work from computed CSS rather than its interpretation:
The [section name] still doesn't match. Here are the EXACT computed CSS values from the reference (copied from DevTools): .hero-container { max-width: 1140px; margin: 0 auto; padding: 96px 48px; display: flex; flex-direction: column; align-items: center; gap: 40px; background: #0a0a0f; } .hero-heading { font: 800 64px/1.08 "Inter"; letter-spacing: -0.03em; color: #fafafa; text-align: center; max-width: 800px; } .hero-subtitle { font: 400 20px/1.6 "Inter"; color: #a1a1aa; text-align: center; max-width: 580px; } Replace your current hero section CSS with these EXACT values. Do not modify or "improve" them.
Here's the honest accuracy breakdown based on what you provide Claude:
Here's your copy-paste arsenal — one prompt for each common scenario, optimized for maximum accuracy:
Prompt A: "Generate HTML that matches a Figma mockup exactly"
Read this Figma file: [URL] Focus on frame: "[Frame Name]" CRITICAL RULES: - Extract and use EXACT color values (no rounding) - Match EXACT font weights, sizes, and line heights - Preserve EXACT spacing (padding, margin, gap) - Replicate EXACT border-radius and shadow values - Follow EXACT layout structure (flex/grid/auto-layout) Output approach: 1. First output the design tokens as CSS variables 2. Wait for my confirmation 3. Then generate the full HTML with those tokens 4. Use semantic HTML5, single file, inline styles 5. Load exact Google Fonts from the design
Prompt B: "Clone a website's visual style for my own content"
I want to build a page that matches the visual style of [WEBSITE_URL] but with my own content. Here are the exact CSS values from the reference (from DevTools): Colors: [list every color] Fonts: [family, weights, sizes] Spacing: [section padding, card padding, gaps] Effects: [shadows, radii, gradients] Layout: [max-width, columns, breakpoints] My content: [YOUR_CONTENT] Apply the reference's visual language to my content. Use CSS custom properties. Match the reference EXACTLY on colors, typography, spacing, and effects.
Prompt C: "Generate Figma mockup (via code) from a reference website"
Create a high-fidelity mockup page for [PURPOSE] that visually matches the design language of [REFERENCE]. I'm providing: - Screenshot of the reference: [attached] - Key CSS values: [pasted from DevTools] Requirements: - Match the reference's color palette EXACTLY - Use the same typography system (font, weights, scale) - Replicate the spacing rhythm (base unit + scale) - Copy the component styling (cards, buttons, inputs) - Include matching hover/transition effects - Responsive: mobile-first with 768px/1024px breaks - Self-contained single HTML file My page content & structure: [Describe your page sections and content]
Prompt D: "Redesign existing code to match a Figma design system"
I have existing code that needs to be restyled to match our design system in Figma. My current code: [paste or file path] Our Figma design system: [FIGMA_URL] Please via MCP: 1. Read the Figma DS and extract ALL tokens 2. Analyze my code's current styling 3. Generate UPDATED code that: - Keeps the same structure & functionality - Replaces ALL colors with DS tokens - Replaces ALL fonts with DS typography - Replaces ALL spacing with DS grid values - Replaces ALL effects with DS shadow/radius tokens - Uses DS component patterns where applicable The output should look like it was built natively with the design system from day one.
Prompt E: "Universal refinement prompt" (use after any generation)
I compared your output to the reference. Fix these specific mismatches (do NOT change anything else): 1. [Element]: [property] is [current] → should be [correct value] 2. [Element]: [property] is [current] → should be [correct value] 3. [Element]: [property] is [current] → should be [correct value] Apply ONLY these changes. Do not "improve" or adjust anything else in the code.
The wisdom that comes from doing this many, many times.
Layers named "Frame 427" tell Claude nothing. Layers named "Hero / CTA Button" tell it everything. Clean naming = cleaner code.
Published components in Figma are much easier for Claude to identify via MCP. Draft components may not appear in get_components results.
Figma auto-layout translates perfectly to CSS Flexbox. Absolutely-positioned layers result in worse code output. Auto-layout = responsive code.
Don't say "convert this file." Say "convert the 'User Profile' frame to a React component using Tailwind and our @ui imports." Context is king.
Figma's native variables feature makes tokens readable via the API. Claude can map these directly to your CSS custom properties or Tailwind theme.
Check that your Personal Access Token has the right permissions and hasn't expired. Verify the file isn't in a draft or restricted project. Try a file you own first.
Double-check your claude_desktop_config.json syntax — a missing comma or bracket breaks everything. Restart Claude Desktop completely after config changes.
This usually means Claude didn't have enough context. Share your existing component library code alongside the Figma file. The more context, the better the output.
Make sure components are published to your team library, not just local components. The Figma API's component endpoints only return published components.
While the Claude + MCP workflow is powerful on its own, these tools can enhance specific parts of the pipeline:
Figma Dev Mode — Figma's native developer handoff feature. It shows CSS, iOS, and Android code snippets for selected elements. Great for spot-checking Claude's output against Figma's own interpretation.
Storybook — If your team uses Storybook for your coded component library, Claude can reference it to understand your component APIs, props, and variants. Share your Storybook docs alongside the Figma file for maximum accuracy.
Figma Variables & Tokens Studio — For teams with mature design token systems, Tokens Studio (formerly Figma Tokens) exports tokens as JSON that Claude can directly consume. This bridges the gap between Figma's visual tokens and your code's CSS custom properties or Tailwind theme.
GitHub Copilot + Claude — Use Claude for the high-level design-to-code conversion, then lean on Copilot for filling in implementation details, event handlers, and business logic within the generated component structure.
Your Figma token is a key to your design files. Treat it like a password — because it is one.
A leaked Figma token gives anyone full read access to every file you can access — including confidential designs, unreleased product screens, and internal documentation. Here's how to lock it down:
If your claude_desktop_config.json or .mcp.json file contains a real token, do not commit it to Git. Add these files to .gitignore. If you've already committed a token, rotate it immediately — it may already be in your Git history even after deletion.
Store your token in your shell profile (~/.zshrc, ~/.bashrc) or system environment variables. Reference the variable in your config using the "env" field. See Section 02 for the complete setup guide.
When generating your Figma token, always set an expiration date (30, 60, or 90 days). Set a calendar reminder to rotate before expiry. Shorter-lived tokens limit the damage window if a token is compromised.
Only grant the permissions Claude needs. For read-only workflows, select File content (Read), Dev resources (Read), and Variables (Read). Never grant write access unless you specifically need Claude to modify Figma files.
Even without a breach, rotate your tokens every 60-90 days. In Figma Settings → Personal Access Tokens, generate a new token, update your environment variable, restart Claude, and then revoke the old token. Overlap them briefly to avoid downtime.
Review your Figma Settings → Personal Access Tokens list. Revoke any tokens you no longer use, don't recognize, or that were created for one-off experiments. Fewer active tokens = smaller attack surface.
When multiple team members need the Figma MCP integration, you need a strategy for token management that balances security with convenience:
Approach 1: Individual tokens (recommended)
Each team member generates their own Personal Access Token with their own account. This is the safest approach because each token has the exact permissions of the user who created it, actions are auditable per-person, and revoking one person's token doesn't affect anyone else.
Approach 2: Shared service account (enterprise)
For CI/CD pipelines or automated workflows, create a dedicated Figma service account (e.g., design-bot@company.com) with read-only access to the relevant projects. Generate a token for this account and store it in your organization's secrets manager (AWS Secrets Manager, HashiCorp Vault, 1Password Business, etc.). This keeps automated access separate from human access.
Sharing the MCP config without sharing the token:
{
"mcpServers": {
"figma": {
"command": "npx",
"args": ["-y", "figma-developer-mcp"],
"env": {
// Each dev sets this env var locally
"FIGMA_PERSONAL_ACCESS_TOKEN": "${FIGMA_PERSONAL_ACCESS_TOKEN}"
}
}
}
}
claude mcp add or copy the shared config. Total time: under 5 minutes.Scaling the Figma + Claude workflow across your entire design and engineering team.
The Figma + Claude MCP workflow fundamentally changes the designer-developer handoff. Instead of the traditional "designer throws designs over the wall" model, you get a continuous feedback loop. Here's what the collaboration looks like in practice:
The designer builds the component library in Figma with clean naming (Button/Primary/Large), proper auto-layout, and published components. They set up Figma Variables for tokens. Key responsibility: the designer is now the "API designer" — every component they publish is an interface that Claude will translate to code.
The developer sets up the MCP connection, tests it against the Figma library, and establishes the code-side conventions: component file structure, naming patterns, import paths, token file location. They might do a first pass converting 2-3 key components to establish patterns for Claude to follow.
When a new feature is designed, the designer builds it entirely from published components — no one-off custom elements. They use proper auto-layout for every layout, and annotate any interactive behavior in comments or a spec note.
The developer shares the Figma URL with Claude, specifies their codebase conventions, and generates production code. Because the designer used published components, Claude maps them directly to the coded components. The output is typically 90-95% production-ready.
Designer and developer review the output together. The designer spots visual discrepancies; the developer spots implementation issues. Both feed corrections to Claude for refinement. This collaborative review typically takes 15-30 minutes, replacing what used to be days of back-and-forth.
Design systems evolve constantly — new components get added, existing ones get updated, tokens change. Here's how to keep Figma and code synchronized using the MCP workflow:
Once a month, ask Claude to re-extract your design tokens from Figma and diff them against your current tokens.css or Tailwind theme. Claude will identify any new colors, modified spacing values, or deprecated tokens. This catches drift before it becomes a problem.
When your designer publishes new components in Figma, ask Claude to compare the Figma component list against your coded component library: "Read our Figma library and list any components that don't exist in our src/components/ directory." This gives you a clear "to-build" list.
Match your Figma library publish versions to your code releases. When the designer publishes "v2.5" of the Figma library, the developer generates updated code and releases "v2.5" of the code library. This creates a clear audit trail.
For enterprise teams, use Figma's webhooks (requires the Webhooks scope) to trigger notifications when the design system file is updated. This can kick off an automated pipeline: Figma webhook → CI runs Claude to extract updated tokens → opens a PR with the changes.
Yes — and for mature teams this is the ultimate workflow. Here's the architecture for a fully automated Figma-to-Code pipeline:
What you can automate today:
Design token extraction — Set up a scheduled script (e.g., a GitHub Action that runs nightly or on-demand) that uses Claude Code with the Figma MCP to extract tokens and commit any changes to a PR. The script fetches the latest tokens from Figma, generates your tokens.css / Tailwind theme, and diffs against the current version.
Component inventory reports — Automatically generate a "component coverage" report that shows which Figma components have code implementations and which don't. This becomes your design system health dashboard.
Visual regression testing — After generating code from Figma, use tools like Chromatic (for Storybook) or Percy to screenshot the generated components and compare against the Figma exports. This catches visual drift automatically.
What the workflow can't do (yet), and how to work around the rough edges.
This workflow is powerful, but it's important to know its boundaries so you set realistic expectations:
MCP reads the structure of your Figma file, not rendered pixels. Claude knows an image element exists and its dimensions, but can't see the actual photo/illustration content. For image-heavy designs, you'll need to provide the image assets separately or describe what each image should be.
Figma's native prototyping animations (smart animate, spring transitions, scroll effects) are not exposed through the REST API. Claude can't read your prototype interactions. You'll need to describe animation behavior explicitly: "The card should scale to 1.03 on hover with a 200ms ease-out transition."
Files with 200+ frames or thousands of layers take longer to read via MCP. The Figma API returns the full node tree, and very large responses can slow Claude down. Workaround: always target specific frames/pages rather than requesting the entire file. Use node-id in your URLs.
Some Figma plugins create non-standard layer structures, custom metadata, or deeply nested groups that confuse the API output. If Claude's reading of a particular element seems garbled, check if it was generated by a plugin and try recreating it with native Figma tools.
MCP reads the file at the moment you ask. It doesn't maintain a live connection. If your designer is actively editing while Claude reads, Claude sees the state at the time of the API call. For consistent results, coordinate timing — read files when the designer is done editing.
The get_components API endpoint only returns published components. If your designer has created components but hasn't published them to the team library, Claude won't see them. Always confirm your library is published and up to date before running the workflow.
Figma's REST API has rate limits to prevent abuse. If you hit them, you'll see 429 Too Many Requests errors. Here's what to know:
Current limits (as of 2025): Figma allows approximately 30 requests per minute per personal access token for file-reading endpoints. Image export endpoints have separate, lower limits. Enterprise plans may have higher thresholds.
How Claude triggers API calls: Each MCP tool call translates to one or more Figma API requests. get_file is typically 1-2 calls. get_components is 1 call. get_node is 1 call per node. If Claude is reading multiple frames or iterating through components, these add up quickly.
Strategies to stay under limits:
Instead of "read the entire file," say "read the frame named 'Dashboard' on the 'App Screens' page." This reduces API calls from potentially dozens to just 1-2.
Have Claude extract your design tokens at the start of a session and save them as a CSS or JSON file. For subsequent code generation in the same session, reference the extracted tokens rather than re-reading from Figma each time.
Plan your Claude session: read the Figma file once, generate all the code you need, then refine. Don't re-read the file for every small change — Claude remembers the file structure within a conversation.
Quick reference for every acronym and concept mentioned in this guide.