Figma Context MCP server

Bridges AI systems with Figma design platform, transforming complex API responses into structured design information for easier understanding of layout properties, styling, and text content.
Back to servers
Provider
1yhy
Release date
Mar 23, 2025
Language
TypeScript
Stats
8 stars

The Figma MCP server enables seamless integration between Figma design files and AI coding tools like Cursor, Windsurf, and Cline. Through the Model Context Protocol (MCP), this server transforms Figma design data into formats that AI models can easily understand, allowing them to generate code that accurately matches your designs.

Installation

Option 1: Install via Smithery (Recommended)

For automatic installation with Claude Desktop:

npx -y @smithery/cli install @1yhy/Figma-Context-MCP --client claude

Option 2: Install from NPM

# Global installation
npm install -g @yhy2001/figma-mcp-server

# Start the server
figma-mcp --figma-api-key=<your-figma-api-key>

Option 3: Install from Local Package

# Global installation of local package
npm install -g ./figma-mcp-server-1.0.0.tgz

# Start the server
figma-mcp --figma-api-key=<your-figma-api-key>

Option 4: Use in a Project

# Install in your project
npm install @yhy2001/figma-mcp-server --save

# Add to package.json scripts
# "start-figma-mcp": "figma-mcp --figma-api-key=<your-figma-api-key>"

# Or run directly
npx figma-mcp --figma-api-key=<your-figma-api-key>

Command Line Arguments

  • --version: Display version number
  • --figma-api-key: Your Figma API access token (required)
  • --port: Port for the server to run on (default: 3333)
  • --stdio: Run server in command mode instead of default HTTP/SSE mode
  • --help: Display help menu

Connecting with AI Tools

Using Configuration Files

For tools like Cursor, Windsurf, and Claude Desktop, add the following to your configuration file:

# For MCP Client
{
  "mcpServers": {
    "Figma MCP": {
      "command": "npx",
      "args": ["figma-mcp", "--figma-api-key=<your-figma-api-key>", "--stdio"]
    }
  }
}

# For local use
{
  "mcpServers": {
    "Figma MCP": {
      "url": "http://localhost:3333/sse",
      "env": {
        "API_KEY": "<your-figma-api-key>"
      }
    }
  }
}

Connecting with Cursor

  1. Start the server: figma-mcp --figma-api-key=<your-figma-api-key>
  2. Connect to the MCP server in Cursor's settings → Features tab: http://localhost:3333
  3. After confirming connection, use Composer in Agent mode
  4. Paste your Figma file link and ask Cursor to implement the design

Available Tools

get_figma_data

Retrieves information from a Figma file or specific node.

Parameters:

  • fileKey: The Figma file key
  • nodeId: Node ID (strongly recommended)
  • depth: Depth to traverse the node tree

download_figma_images

Downloads images and icon resources from a Figma file.

Parameters:

  • fileKey: The Figma file key containing the nodes
  • nodes: Array of image nodes to fetch
  • localPath: Directory path in your project to store images

Data Structure

The server returns Figma designs in a structured JSON format that includes:

  • Basic design file information (name, last modified date, thumbnail URL)
  • A node array containing all page elements with:
    • Basic node information (ID, name, type)
    • Text content (for text nodes)
    • CSS styles including positioning, typography, and visual properties
    • Fill information (gradients, images)
    • Export information for images and SVGs
    • Child nodes in a recursive structure

This structured data enables AI tools to understand the design in detail and generate more accurate code implementations.

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