Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Figma Design – Figma Learn
  • Dev Mode
  • Turn designs to code

Guide to the Dev Mode MCP Server

Written by Figma Man

Updated at June 19th, 2025

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Administration – Figma Learn
    Manage files and projects Manage a team Manage your account Manage a Figma organization Manage Enterprise plan settings and permissions Billing Manage Figma in a school
  • Figma Design – Figma Learn
    Create prototypes Import and export Create designs Tour the interface Dev Mode Work together in files Build design systems Figma Draw
  • Get started – Figma Learn
    Set up your account Layers 101
  • FigJam – Figma Learn
    Import and export Run meetings Work on boards Tour the interface
  • Community – Figma Learn
    Explore the Community Creator tools and resources
  • Help – Figma Learn
    Troubleshoot Common questions Work with support
  • Work across Figma – Figma Learn
    Figma AI Work across Figma
  • Courses, tutorials, projects – Figma Learn
    Courses Projects
  • Figma Slides – Figma Learn
    Create and edit slides Present slide decks Tour the interface Import and export
  • Figma Buzz – Figma Learn
    Templates in Figma Buzz Create and edit assets in Figma Buzz Overview
  • Figma Make – Figma Learn
    Tour the interface Work with Figma Make
  • Figma Sites – Figma Learn
    Design a site Create webpages and breakpoints Make your site interactive Preview and publish a site Tour the interface
+ More

Table of Contents

Step 1: Enable the MCP Server Step 2: Set up your MCP client Step 3: Prompt your MCP client Selection-based Link-based MCP best practices Structure your Figma file for better code Write effective prompts to guide the AI Trigger specific tools when needed Add custom rules Break down large selections

🚧 The Dev Mode MCP Server is currently in open beta. Some functions and settings may not yet be available. The feature may change and you may experience bugs or performance issues during the beta period.

Before you start

Who can use this feature

The Dev Mode MCP Server is in open beta.

Available on a Dev or Full seat on the Professional, Organization, or Enterprise plans

You must use a code editor or application that supports MCP Servers (i.e. VS Code, Cursor, Windsurf, Claude Code)

You can only use the Dev Mode MCP server from the Figma desktop app. Download the Figma desktop app →

The Dev Mode MCP Server brings Figma directly into your workflow by providing important design information and context to AI agents generating code from Figma design files.

MCP Servers are part of a standardized interface for AI agents to interact with data sources using the Model Context Protocol.

With the server enabled, you can:

  • Generate code from selected frames

    Select a Figma frame and turn it into code. Great for product teams building new flows or iterating on app features.

  • Extract design context

    Pull in variables, components, and layout data directly into your IDE. This is especially useful for design systems and component-based workflows.

  • Code smarter with Code Connect

    Boost output quality by reusing your actual components. Code Connect keeps your generated code consistent with your codebase.

    Learn more about Code Connect →

Step 1: Enable the MCP Server

  1. Open the Figma desktop app and make sure you’ve updated to the latest version.
    Product Education Work Image.png
  2. Create or open a Figma Design file.
  3. In the upper-left corner, open the Figma menu.
  4. Under Preferences, select Enable Dev Mode MCP Server.
    mcp_menu.png

You should see a confirmation message at the bottom of the screen letting you know the server is enabled and running.

The server runs locally at http://127.0.0.1:3845/sse. Keep this address handy for your configuration file in the next step.

Step 2: Set up your MCP client

Once the server is running locally on the Figma desktop app, MCP clients will be able to connect to your server. Follow the instructions for your specific client to add the Dev Mode MCP server.

  1. Go to Code → Settings → Settings or use the shortcut ⌘ ,

  2. In the search bar, type “MCP”.

    vscode.png

  3. Select Edit in settings.json.

  4. Add the following configuration:

    "chat.mcp.discovery.enabled": true,
     "mcp": {
       "servers": {
         "Figma Dev Mode MCP": {
           "type": "sse",
           "url": "http://127.0.0.1:3845/sse"
         }
       }
     },
     "chat.agent.enabled": true
    
  5. Open the chat toolbar ⌄⌘B and switch to Agent mode.

  6. Open the selection tool menu and look for a section labeled: MCP Server: Figma Dev Mode MCP. If no tools are listed, restart the Figma desktop app and VS Code.

Note: You must have GitHub Copilot enabled on your account to use MCP in VS Code.

For more information, see VS Code’s official documentation.

  1. Open Cursor → Settings → Cursor Settings.

  2. Go to the MCP tab.

  3. Click + Add new global MCP server.

  4. Enter the following configuration and save:

    {
      "mcpServers": {
        "Figma": {
          "url": "http://127.0.0.1:3845/sse"
        }
      }
    }
    

For more information, see Cursor’s official documentation.

  1. Open Windsurf → Settings → Windsurf Settings or use the shortcut ⌘ ,.
  2. Navigate to Cascade settings and select Open plugin store.
  3. Search for Figma and install the plugin.
  4. Open Cascade and you should see the Figma MCP server and available tools.
    cascade.png
For more information, see Windsurf’s official documentation.

Note: For Windsurf, change the url property in the configuration file to serverUrl to avoid errors.

  1. Open your terminal and run:
    claude mcp add --transport sse figma-dev-mode-mcp-server http://127.0.0.1:3845/sse
  2. Use the following commands to check MCP settings and manage servers:
    • List all configured servers
      claude mcp list
    • Get details for a specific server
      claude mcp get my-server
    • Remove a server
      claude mcp remove my-server
For more information, see Anthropic’s official documentation.

Other code editors and tools that support SSE (Server-Sent Events) can also connect to the Dev Mode MCP server.

If you're using a different editor or tool, check its documentation to confirm it supports SSE-based communication. If it does, you can manually add the Dev Mode MCP server using this configuration:

{
  "mcpServers": {
    "Figma Dev Mode MCP": {
      "url": "http://127.0.0.1:3845/sse"
    }
  }
}

Note: The Dev Mode MCP server communicates over the SSE protocol. Use your editor’s steps for setting up an SSE-compatible MCP server, and use the URL: http://localhost:3845/sse

Once configured, refresh or start the server. You should see a successful connection and the available tools. If the connection failed or you do not see any tools, double check that the server is active in the Figma desktop app.

Step 3: Prompt your MCP client

The Dev Mode MCP server introduces a set of tools that help LLMs translate designs in Figma. Once connected, you can prompt your MCP client to access a specific design node.

There are two ways to provide Figma design context to your AI client:

Selection-based

  1. Select a frame or layer inside Figma using the desktop app.
  2. Prompt your client to help you implement your current selection.
    prompt.png

Link-based

  1. Copy the link to a frame or layer in Figma.
    copy_link.png
  2. Prompt your client to help you implement the design at the selected URL.

Note: Your client won’t be able to navigate to the selected URL, but it will extract the node-id that is required for the MCP server to identify which object to return information about.

As you use the Dev Mode MCP server, you may see a popup inside Figma asking you for feedback. To give us feedback, please use this form.

MCP best practices

The quality of the generated code depends on several factors. Some controlled by you, and some by the tools you’re using. Here are some suggestions for clean, consistent output.

Structure your Figma file for better code

Provide the best context for your design intent, so the MCP and your AI assistant can generate code that’s clear, consistent, and aligned with your system.

  • Use components for anything reused (buttons, cards, inputs, etc.)

  • Link components to your codebase via Code Connect. This is the best way to get consistent component reuse in code. Without it, the model is guessing.

  • Use variables for spacing, color, radius, and typography.

  • Name layers semantically (e.g. CardContainer, not Group 5)

  • Use Auto layout to communicate responsive intent.

    Tip: Resize the frame in Figma to check that it behaves as expected before generating code.

  • Use annotations and dev resources to convey design intent that’s hard to capture from visuals alone, like how something should behave, align, or respond.

Write effective prompts to guide the AI

MCP gives your AI assistant structured Figma data, but your prompt drives the result. Good prompts can:

  • Align the result with your framework or styling system
  • Follow file structure and naming conventions
  • Add code to specific paths (e.g. src/components/ui)
  • Add or modify code in existing files instead of creating new ones
  • Follow specific layout systems (e.g. grid, flexbox, absolute)

Examples:

  • “Generate iOS SwiftUI code from this frame”
  • “Use Chakra UI for this layout”
  • “Use src/components/ui components”
  • “Add this to src/components/marketing/PricingCard.tsx"
  • “Use our Stack layout component”

Think of prompts like a brief to a teammate. Clear intent leads to better results.

Trigger specific tools when needed

The MCP supports different tools, and each one provides your AI assistant with a different kind of structured context. Sometimes, the assistant doesn’t automatically pick the right one, especially as more tools become available. If results are off, try being explicit in your prompt.

  • get_code provides a structured React + Tailwind representation of your Figma selection. This is a starting point that your AI assistant can translate into any framework or code style, depending on your prompt.
  • get_variable_defs extracts the variables and styles used in your selection (color, spacing, typography, etc). This helps the model reference your tokens directly in the generated code.

For example, if you’re getting raw code instead of tokens, try something like:

  • “Get the variable names and values used in this frame.”

Add custom rules

Set project-level guidance to keep output consistent—just like onboarding notes for a new developer. These are things like:

  • Preferred layout primitives
  • File organization
  • Naming patterns
  • What not to hardcode

You can provide this in whatever format your MCP client uses for instruction files.

Examples:

 
---
description: Figma Dev Mode MCP rules
globs: 
alwaysApply: true
---
  - The Figma Dev Mode MCP Server provides an assets endpoint which can serve image and SVG assets
  - IMPORTANT: If the Figma Dev Mode MCP Server returns a localhost source for an image or an SVG, use that image or SVG source directly
  - IMPORTANT: DO NOT import/add new icon packages, all the assets should be in the Figma payload
  - IMPORTANT: do NOT use or create placeholders if a localhost source is provided
# MCP Servers
## Figma Dev Mode MCP Rules
  - The Figma Dev Mode MCP Server provides an assets endpoint which can serve image and SVG assets
  - IMPORTANT: If the Figma Dev Mode MCP Server returns a localhost source for an image or an SVG, use that image or SVG source directly
  - IMPORTANT: DO NOT import/add new icon packages, all the assets should be in the Figma payload
  - IMPORTANT: do NOT use or create placeholders if a localhost source is provided
- IMPORTANT: Always use components from `/path_to_your_design_system` when possible
- Prioritize Figma fidelity to match designs exactly
- Avoid hardcoded values, use design tokens from Figma where available
- Follow WCAG requirements for accessibility
- Add component documentation
- Place UI components in `/path_to_your_design_system`; avoid inline styles unless truly necessary

Adding these once can dramatically reduce the need for repetitive prompting and ensures that teammates or agents consistently follow the same expectations.

Be sure to check your IDE or MCP client’s documentation for how to structure rules, and experiment to find what works best for your team. Clear, consistent guidance often leads to better, more reusable code with less back-and-forth.

Break down large selections

Break screens into smaller parts (like components or logical chunks) for faster, more reliable results.

Large selections can slow the tools down, cause errors, or result in incomplete responses, especially when there's too much context for the model to process. Instead:

  1. Generate code for smaller sections or individual components (e.g. Card, Header, Sidebar)
  2. If it feels slow or stuck, reduce your selection size

This helps keep the context manageable and results more predictable, both for you and for the model.

If something in the output doesn’t look quite right, it usually helps to revisit the basics: how the Figma file is structured, how the prompt is written, and what context is being sent. Following the best practices above can make a big difference, and often leads to more consistent, reusable code.

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Figma for VS Code
  • Use code snippets in Dev Mode
  • Link Dev resources to layers in Dev Mode
  • Code Connect
  • Blog
  • Best practices
  • QR code generator
  • Color wheel
  • Colors
  • Color picker
  • Color palettes
  • Color palette generator
  • Color contrast checker
  • Font Library
  • Templates
  • Developers
  • Integrations
  • Affiliate program
  • Resource library
  • Reports and insights
  • Support
  • Status
  • Legal and privacy
  • Modern slavery statement
  • Climate disclosure statement
  • COMPARE
  • Sketch
  • Adobe XD
  • Framer
  • Miro
  • COMPANY
  • Events
  • Customers
  • Careers
  • Newsroom
Expand