This MCP server is described as an “LLM-optimized Figma MCP server.” It transforms Figma design data into a compact, LLM-friendly format intended for code generation and UI building. The repository name is io.github.felixAnhalt/figma-to-code-mcp, and its readme excerpt positions it for developer-facing workflows tied to Figma-to-code transformation.
🛠️ Key Features
LLM-optimized processing of Figma design data
Output format is described as compact and “LLM-friendly”
Focus on code generation and UI building
🚀 Use Cases
Converting Figma design data into code generation inputs
Supporting UI building workflows from Figma assets
⚡ Developer Benefits
Produces a format intended to be easy for LLM consumption
Aligns Figma design inputs with downstream code generation and UI construction
⚠️ Limitations
Available source material provides a description and positioning only; no specific tools, endpoints, or detailed constraints are included in the excerpt
Transform Figma design data into a compact, LLM-friendly format for code generation and UI building.
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
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
json
{"mcpServers":{"Figma To Code MCP":{"command":"npx","args":["-y","@tmegit/figma-to-code-mcp","--figma-api-key=YOUR-KEY","--stdio"]}}}
Windows
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.
Option
CLI
Env
Default
Figma API key
--figma-api-key
FIGMA_API_KEY
required
Figma OAuth token
--figma-oauth-token
FIGMA_OAUTH_TOKEN
unset
Port
--port
FIGMA_TO_CODE_MCP_PORT or PORT
3333
Host
--host
FIGMA_TO_CODE_MCP_HOST
127.0.0.1
Output format
--json
OUTPUT_FORMAT
yaml
Skip image tools
--skip-image-downloads
SKIP_IMAGE_DOWNLOADS=true
false
SVG output dir
--svg-output-dir
FIGMA_SVG_OUTPUT_DIR
temp dir
Prefetch library variables
--library-file-keys
FIGMA_LIBRARY_VARIABLE_PREFETCH_FILE_KEYS
unset
Cache path
--library-cache-path
FIGMA_MCP_CACHE_PATH
temp cache file
Cache TTL
n/a
FIGMA_MCP_CACHE_TTL_MS
7 days
Force cache refresh
n/a
FIGMA_MCP_REFRESH_CACHE
off
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:
Call
Endpoint
Tier
Description
1
GET /v1/files/{fileKey}/nodes
T1
Fetch requested nodes (geometry=paths)
2
GET /v1/files/{fileKey}/styles
T3
Fetch all styles
3
GET /v1/files/{fileKey}/variables/local
T2
Fetch local variables (if resolveVariables=true)
4
GET /v1/components/{key}
T3
Resolve component key → library file (up to 3 tries)
5
GET /v1/files/{libFileKey}/components
T3
Fetch all components from library
6+
GET /v1/files/{libFileKey}/nodes
T1
Fetch 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).
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.
Install
Configuration
Environment variables
FIGMA_API_KEYrequiredsecret
Your Figma Personal Access Token, learn more here: https://www.figma.com/developers/api#access-tokens