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.
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.
Before using the server, you need a Figma API key:
.env
file in your project directoryFIGMA_API_KEY=your_api_key_here
Install the required dependencies:
npm install
Add the F2C MCP service to your configuration:
{
"mcpServers": {
"f2c-mcp": {
"command": "npx",
"args": [
"-y",
"@f2c/mcp"
],
"env": {
"personalToken": ""
}
}
}
}
For Windows systems, use this configuration instead:
{
"mcpServers": {
"f2c-mcp": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@f2c/mcp"],
"env": {
"personalToken": ""
}
}
}
}
Launch the development server with:
npm run dev
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.
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.
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"
]
}
}
}
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.
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.