Figma MCP Server

Figma MCP Server

A bridge between Figma designs and React implementations that enables pixel-perfect conversion of Figma designs into React applications by processing Figma file data into React-friendly format.

Category
Visit Server

README

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

🛠️ 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

  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:
 ```bash
 npm run build
 ```

2. Configure MCP settings based on your IDE:

- For VS Code (global settings):
  ```json
  // 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:
```typescript
// 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

Made with ❤️ by [Your Name]

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured