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
Provider
F2C
Release date
Apr 25, 2025
Language
TypeScript
Package
Stats
348 downloads
3 stars

F2C MCP Server enables AI coding assistants to access Figma design data and transform it into HTML/CSS code. It provides design context to AI tools like Cursor, supports Figma file URLs, and implements the JSON-RPC 2.0 protocol for seamless integration.

Installation

To use the F2C MCP Server, you'll need to configure it as an MCP service in your environment. This process varies slightly depending on your operating system.

Setting Up Your Figma API Key

Before using the server, you need a Figma API key:

  1. Create a .env file in your project directory
  2. Add your Figma API key:
FIGMA_API_KEY=your_api_key_here

Installing Dependencies

Install the required dependencies:

npm install

Configuration

Adding MCP Service (Mac/Linux)

Add the F2C MCP service to your configuration:

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

Adding MCP Service (Windows)

For Windows systems, use this configuration instead:

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

Starting the Server

Launch the development server with:

npm run dev

Troubleshooting

Common Issues

If you encounter the following error:

Error: spawn npx ENOENT

Add your PATH to the mcpServer configuration:

{
  "env": {
    "PATH": "/Users/xxx/.nvm/versions/node/v20.10.0/bin:/bin"
  }
}

Be sure to replace the PATH with your actual Node.js installation path.

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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