Skip to main content
Glama
Figma MCP Server

Figma MCP Server

by sanjeev23oct

Figma MCP Server

A Model Context Protocol (MCP) server that provides a bridge between Figma designs and React implementations. This server enables pixel-perfect conversion of Figma designs into React applications by processing Figma file data and providing it in a React-friendly format.

πŸš€ Features

  • Figma API Integration: Direct connection to Figma's API for accessing design files

  • React-Ready Output: Processes Figma data into React-compatible format

  • Style Processing: Converts Figma styles to CSS/styled-components

  • Asset Management: Handles image assets and SVG components

  • Layout Processing: Converts Figma auto-layout to Flexbox

  • Type Safety: Built with TypeScript for reliable type checking

Related MCP server: MCP Figma to React Converter

πŸ› οΈ Tools Provided

  1. get_file_content:

    • Fetches and processes Figma file content

    • Converts layout, styles, and components

    • Returns React-ready component structure

    {
      fileKey: string;    // Figma file key
      nodeId?: string;    // Optional specific component ID
    }
  2. get_node_images:

    • Retrieves image assets from Figma

    • Supports multiple formats (PNG, JPG, SVG)

    • Configurable scaling options

    {
      fileKey: string;    // Figma file key
      nodeIds: string[];  // Component IDs to fetch
      format?: 'png' | 'jpg' | 'svg';
      scale?: number;     // 1-4
    }

πŸ“¦ Installation

Installing via Smithery

To install Figma Design to React Converter for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @sanjeev23oct/figma-mcp --client claude

Manual Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/figma-mcp.git
    cd figma-mcp
  2. Install dependencies:

    npm install
  3. Configure your Figma access token:

    cp .env.example .env
    # Add your Figma access token to .env

🎯 Cursor IDE Setup

  1. Create the .cursor/mcp.json file in your project root:

    mkdir -p .cursor
    touch .cursor/mcp.json
  2. For Stdio-based server configuration:

    {
     "mcpServers": {
       "figma": {
         "command": "node",
         "args": ["d:/<folder>>/figma-mcp/build/index.js"],
         "env": {
           "FIGMA_ACCESS_TOKEN": "your figma token"
         },
         "disabled": false,
         "alwaysAllow": [],
         "protocol": "stdio"
       }
     }
      }

πŸ’» Usage

  1. Build the server:

    npm run build
  2. Configure MCP settings based on your IDE:

    • For VS Code (global settings):

      // In settings.json
      {
        "mcpServers": {
          "figma": {
            "command": "node",
            "args": ["path/to/figma-mcp/build/index.js"],
            "env": {
              "FIGMA_ACCESS_TOKEN": "your-token-here"
            }
          }
        }
      }
    • For Cursor IDE: Use the .cursor/mcp.json configuration as described in the "Cursor IDE Setup" section above. This configuration will take precedence over VS Code settings when using Cursor IDE.

  3. Use the MCP tools in your application:

    // Example: Fetch processed Figma content
    const result = await useMcpTool("figma", "get_file_content", {
      fileKey: "your-figma-file-key"
    });

🧩 Example Project

Check out the raccoon-game directory for a complete example of using this MCP server to create a pixel-perfect React implementation of a Figma design.

πŸ”„ Processing Pipeline

  1. Input: Figma file data through official API

  2. Processing:

    • Style conversion (colors, typography, effects)

    • Layout transformation (absolute to Flexbox)

    • Component hierarchy mapping

    • Asset optimization

  3. Output: React-ready component data

πŸ“ License

MIT License

🀝 Contributing

Contributions welcome! Please read our contributing guidelines.

πŸ™ Acknowledgments

  • Figma API team for the comprehensive API

  • Model Context Protocol for the MCP specification


Check out my other project: https://github.com/sanjeev23oct/zap , light weight coding agent free from bloated system prompts built in rust with skill first approach.

Available Tools

5 tools
add_figma_fileC

Add a Figma file to your context

Inputs: url (required).

post_commentC

Post a comment on a node in a Figma file

Inputs: file_key (required), message (required), x (required), y (required), +1 more.

read_commentsC

Get all comments on a Figma file

Inputs: file_key (required).

reply_to_commentC

Reply to an existing comment in a Figma file

Inputs: file_key (required), comment_id (required), message (required).

view_nodeC

Get a thumbnail for a specific node in a Figma file

Inputs: file_key (required), node_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific actions in Figma: adding files, posting comments, reading comments, replying to comments, and viewing nodes. There is no overlap in functionality, making it easy for an agent to select the correct tool without confusion.

    Naming Consistency4/5

    The naming follows a consistent verb_noun pattern (e.g., add_figma_file, post_comment) with clear and descriptive names. The only minor deviation is 'view_node' which uses 'view' instead of a more action-oriented verb like 'get', but it still fits the pattern well and remains readable.

    Tool Count5/5

    With 5 tools, the server is well-scoped for its purpose of interacting with Figma files, comments, and nodes. Each tool serves a distinct and necessary function, avoiding bloat while covering essential operations like file management and comment handling.

    Completeness4/5

    The toolset covers core workflows for Figma interactions, including file addition, comment management (post, read, reply), and node viewing. A minor gap is the lack of tools for updating or deleting files or comments, but agents can still perform basic operations effectively without major dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers