Figma to Code MCP server

Bridges Figma design files to code generation, enabling direct conversion of designs into HTML, CSS, and other assets with customizable output paths and file organization.
Back to servers
Setup instructions
Provider
F2C
Release date
Apr 25, 2025
Language
TypeScript
Package
Stats
13.7K downloads
330 stars

The F2C MCP Server enables seamless conversion of Figma designs into code, supporting multiple frameworks while preserving pixel-perfect accuracy and design context for AI tools.

Installation

Prerequisites

  • Node.js installed on your system
  • A Figma account with access to your design files

Setting Up the Server

  1. Install the package using npm:
npm install @f2c/mcp

Note: Due to Figma REST API rate limits, you may need to switch to @f2c/mcp-plugin for uninterrupted operation.

Usage

Basic Configuration

To use the F2C MCP server, you'll need to configure it in an MCP-supported IDE such as Cursor, Trae, or Comate AI IDE.

Workflow Process

  1. Configure the server in your MCP-supported IDE
  2. Open the chat in your IDE (such as agent mode in Cursor)
  3. Copy a Figma node link by right-clicking any node in the Figma Layer panel
  4. Paste the link into your IDE chat
  5. Specify your requirements (fetch node data, download images, convert to code, etc.)

Example Commands

Once you've set up the server, you can interact with it through your IDE. Here are some example prompts:

  • "Convert this Figma node to React with Tailwind CSS"
  • "Fetch design information for this Figma component"
  • "Download all images from this Figma design as local assets"

Features

Supported Output Formats

The F2C MCP Server supports multiple code output formats:

  • HTML/CSS with pixel-perfect accuracy
  • React components
  • CSS Modules
  • Tailwind CSS

Additional Capabilities

  • Design Context Integration: F2C preserves design context for compatibility with AI tools
  • Figma File URL Parsing: Easily convert design nodes via Figma URLs
  • Remote Image Localization: Automatically download Figma images to local assets

Troubleshooting

If you encounter rate limit issues with the Figma REST API, switch to the plugin version:

npm install @f2c/mcp-plugin

For more detailed troubleshooting and information, visit the F2C MCP GitHub repository.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "f2c-mcp" '{"command":"npx","args":["-y","@f2c/mcp"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "f2c-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@f2c/mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "f2c-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@f2c/mcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later