Figma To Code MCP logo

Figma To Code MCP

MCP server to extract Figma design information and convert it to mostly css for coding agents.

Install Figma To Code MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "figma-to-code-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@tmegit/figma-to-code-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

npx -y @tmegit/figma-to-code-mcp

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 7d ago.

Overview

Tools4

What Figma To Code MCP lets your agent do. Expand a tool for its parameters.

Self-reported~63 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

5/5 checks healthy over the last 41d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 15d ago via OSV.dev · @tmegit/figma-to-code-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars7Stargazers on the source repository.
npm downloads671Package downloads in the last 30 days.
Last commit1mo agoMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.
Tools exposed4Callable tools this server registers over MCP.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

Figma To Code MCP

Transform Figma design data into a compact, LLM-friendly format for code generation and UI building.

weekly downloads MIT License

Why This Project?

Figma To Code MCP specializes in extracting only the information LLMs need to build UIs while removing Figma-specific metadata that isn't relevant for code generation. The result:

  • ✅ 99.5% size reduction on real Figma files (65 MB → 128 KB)
  • ✅ CSS-aligned property names (backgroundColor, flexDirection, etc.) matching LLM training data
  • ✅ Complete UI-building data preserved (layout, styling, text, components)
  • ✅ Inline styles - no separate dictionaries to parse
  • ✅ Omits Figma internals - no bounding boxes, constraints, or prototype data
  • ✅ Variable resolution - resolves Figma variables to actual values
  • ✅ SVG support - exports vector graphics to disk
  • ✅ Pattern collapsing - deduplicates repeating UI patterns

Give Cursor and other AI-powered coding tools access to your Figma files with this Model Context Protocol server.

Available Tools

ToolDescription
get_figma_designFetches CSS-aligned, LLM-optimized design data. Supports SVG export to custom dir.
get_image_fillsRetrieves image fill URLs from a Figma file
render_node_imagesRenders Figma nodes as PNG images
read_vector_svgReads vector node data as SVG

Required Scopes

Create a Figma personal access token with these scopes:

ScopePurpose
file_content:readRead file nodes, layout, styles
library_content:readRead published components/styles
file_variables:readRead variables (Enterprise only, optional)

Note: Variable resolution requires Enterprise plan. Set resolveVariables: false if not on Enterprise.

How it works

  1. Open your IDE's chat (e.g. agent mode in Cursor).
  2. Paste a link to a Figma file, frame, or group.
  3. Ask Cursor to implement the design.
  4. Cursor fetches CSS-aligned, LLM-optimized design data and generates accurate code.

This MCP server transforms Figma API data into an LLM-friendly format:

  • CSS property names (backgroundColor, flexDirection, fontSize) instead of Figma internals
  • Inline styles directly in nodes (no separate dictionaries)
  • Flexbox primitives for layout (no absolute positioning)
  • Complete UI data (colors, typography, spacing, effects)
  • 99.5% size reduction while preserving all UI-critical information

See V2_CSS_PROPERTY_MAPPING.md for complete property mapping details.

Getting Started

Many code editors and other AI clients use a configuration file to manage MCP servers.

This server requires Node.js 18 or later.

The tmegit-figma-to-code-mcp server can be configured by adding the following to your configuration file.

MacOS / Linux

config.json
{
  "mcpServers": {
    "Figma To Code MCP": {
      "command": "npx",
      "args": ["-y", "@tmegit/figma-to-code-mcp", "--figma-api-key=YOUR-KEY", "--stdio"]
    }
  }
}

Windows

config.json
{
  "mcpServers": {
    "Figma To Code MCP": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@tmegit/figma-to-code-mcp",
        "--figma-api-key=YOUR-KEY",
        "--stdio"
      ]
    }
  }
}

Or you can set FIGMA_API_KEY and PORT in the env field.

Configuration

The server reads configuration from CLI flags and environment variables. If both are set, the CLI flag wins.

OptionCLIEnvDefault
Figma API key--figma-api-keyFIGMA_API_KEYrequired
Figma OAuth token--figma-oauth-tokenFIGMA_OAUTH_TOKENunset
Port--portFIGMA_TO_CODE_MCP_PORT or PORT3333
Host--hostFIGMA_TO_CODE_MCP_HOST127.0.0.1
Output format--jsonOUTPUT_FORMATyaml
Skip image tools--skip-image-downloadsSKIP_IMAGE_DOWNLOADS=truefalse
SVG output dir--svg-output-dirFIGMA_SVG_OUTPUT_DIRtemp dir
Prefetch library variables--library-file-keysFIGMA_LIBRARY_VARIABLE_PREFETCH_FILE_KEYSunset
Cache path--library-cache-pathFIGMA_MCP_CACHE_PATHtemp cache file
Cache TTLn/aFIGMA_MCP_CACHE_TTL_MS7 days
Force cache refreshn/aFIGMA_MCP_REFRESH_CACHEoff

Notes:

  • --library-file-keys and FIGMA_LIBRARY_VARIABLE_PREFETCH_FILE_KEYS are comma-separated Figma library file keys.
  • FIGMA_MCP_CACHE_PATH may point to either a file or a directory. If it is a directory, the cache file is stored as figma-mcp-library-cache.json inside it.
  • The library cache is used only when library file keys are configured.
  • FIGMA_MCP_REFRESH_CACHE forces a re-fetch on startup even if a cache file exists.

Example .env:

env
FIGMA_API_KEY=your_figma_pat
# prefetch variables (tokens etc) from specific library files on startup to avoid T2 calls during design fetch
FIGMA_LIBRARY_VARIABLE_PREFETCH_FILE_KEYS=abc123,def456
FIGMA_MCP_CACHE_PATH=./cache
FIGMA_MCP_CACHE_TTL_MS=604800000
# Uncomment to force cache refresh on next startup
# FIGMA_MCP_REFRESH_CACHE=1

API Calls & Rate Limits

One execution of get_figma_design makes the following API calls:

CallEndpointTierDescription
1GET /v1/files/{fileKey}/nodesT1Fetch requested nodes (geometry=paths)
2GET /v1/files/{fileKey}/stylesT3Fetch all styles
3GET /v1/files/{fileKey}/variables/localT2Fetch local variables (if resolveVariables=true)
4GET /v1/components/{key}T3Resolve component key → library file (up to 3 tries)
5GET /v1/files/{libFileKey}/componentsT3Fetch all components from library
6+GET /v1/files/{libFileKey}/nodesT1Fetch component definitions from each library

Amount of T1 calls: 1 + N (N=number of unique library files) Amount of T2 calls: 1 (if resolveVariables=true) Amount of T3 calls: 2 + N (styles + component key resolution + N library components)

For Professional plan with Dev/Full seat: 10 req/min (Tier 1), 25 req/min (Tier 2), 50 req/min (Tier 3).

Star History

Star History Chart

Acknowledgment

This project was initially inspired by the ideas explored in the original Figma Context MCP by GLips: https://github.com/glips/figma-context-mcp

While the original project provides a Model Context Protocol (MCP) server that simplifies Figma data for use with AI coding agents, this implementation has been substantially redesigned with a different data model, API, and processing approach, and should be considered an independent system.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Figma To Code MCP

figma-to-code-mcp is an MCP server that extracts Figma design information and converts it into a compact, CSS-aligned format for coding agents. It preserves UI-focused layout, styling, text, and component data while omitting Figma-specific metadata. It also supports image fills, PNG node rendering, vector SVG reading, and SVG export.

figma-to-code-mcp provides four tools: get_figma_design for CSS-aligned design data and optional SVG export, get_image_fills for image fill URLs, render_node_images for PNG renders of Figma nodes, and read_vector_svg for vector node data as SVG.

figma-to-code-mcp requires the file_content:read and library_content:read scopes, while file_variables:read is optional for reading variables. Variable resolution requires a Figma Enterprise plan; set resolveVariables to false if the plan does not support it.

Configure figma-to-code-mcp in your MCP client's server configuration using the tmegit-figma-to-code-mcp package and the npx command. The server requires Node.js 18 or later; after setup, provide a Figma file, frame, or group link in an IDE chat and ask the coding agent to implement it.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewFigma To Code MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/figma-to-code-mcp?style=directory)](https://allmcps.com/mcp/figma-to-code-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/figma-to-code-mcp"><img src="https://allmcps.com/api/badge/figma-to-code-mcp?style=directory" alt="Figma To Code MCP on AllMCPs" /></a>