figma-mcp
Read-only Figma MCP server that enables design-to-code workflows by talking to the Figma REST API with a personal access token, for use with Claude Code and GitHub Copilot.
README
figma-mcp
Read-only Figma MCP server for design→code. Talks to the Figma REST API with a personal access token (PAT) over stdio, for use with Claude Code and GitHub Copilot.
Unofficial. This is a community project and is not affiliated with, endorsed by, or sponsored by Figma, Inc. "Figma" is a trademark of Figma, Inc., used here only to describe what this tool talks to. You provide your own Figma personal access token; none is bundled. Use is subject to Figma's Developer / API Terms.
Tools
get_file_metadata— pages + top-level child nodes (navigate first)get_node— node(s) by id; component instances are collapsed with variant props, slots, and acodeConnectblock when mappedget_components/get_component_sets— components and variant-axis catalogget_design_tokens— color/typography/effect tokens from styles (all plans)get_variables— variables from an imported plugin JSON (DTCG or raw Figma)get_code_connect_map/set_code_connect_map/delete_code_connect_map— Figma↔code component mappingsexport_image— render node(s) to PNG/SVG/PDF, saved to diskget_comments,parse_figma_url
Setup
npm install && npm run build— compilessrc/→build/index.js(the server entrypoint).- Create a Figma personal access token (Figma → Settings → Security → Personal access tokens) with at least File content: read and Comments: read scopes. It looks like
figd_…. - Connect it to your MCP client (below).
The token goes in the
X-Figma-TokenHTTP header, so it must be plain ASCII. Pasting a placeholder (e.g. Thai text) fails fast with a clear error instead of an opaqueByteStringcrash.
Connecting
Claude Code — CLI (recommended)
Register once. Point the path at this repo's build/index.js (the entry file, not the repo folder):
claude mcp add figma -s user --env FIGMA_ACCESS_TOKEN=figd_your_token_here -- node "/absolute/path/to/figma-mcp/build/index.js"
One line, so it pastes cleanly into any shell (bash, zsh, PowerShell, cmd). Swap the path for this repo's build/index.js — on Windows use forward slashes, e.g. D:/Personal Projects/figma-mcp/build/index.js.
-s user→ available in every project. Use-s localto scope it to the current project only.- Everything after
--is the command Claude Code runs to launch the server. - Add more env vars with extra
--env KEY=valueflags —-eis the short alias (see the table below). - Restart Claude Code afterward so the tool registry reloads.
Verify:
claude mcp list
Expected: figma · ✔ connected · 12 tools.
Claude Code / Copilot / Cursor — manual JSON
Edit the client's MCP config — Claude Code .mcp.json, GitHub Copilot .vscode/mcp.json, Cursor .cursor/mcp.json:
{
"mcpServers": {
"figma": {
"command": "node",
"args": ["<abs-path>/build/index.js"],
"env": {
"FIGMA_ACCESS_TOKEN": "figd_...",
"FIGMA_CODE_CONNECT_PATH": "./figma.code-connect.json",
"FIGMA_VARIABLES_PATH": "./figma.variables.json"
}
}
}
}
On Windows, use forward slashes (D:/...) or escaped backslashes (D:\\...) in JSON. Restart the client to pick it up.
Environment variables
| Variable | Required | Default | Purpose |
|---|---|---|---|
FIGMA_ACCESS_TOKEN |
yes | — | Figma personal access token (figd_…, ASCII) |
FIGMA_BASE_URL |
no | https://api.figma.com |
Override the API base URL |
FIGMA_CODE_CONNECT_PATH |
no | ./figma.code-connect.json |
Where the local Code Connect map lives |
FIGMA_VARIABLES_PATH |
no | — | Local variables JSON (DTCG or raw Figma export) |
FIGMA_OUTPUT_DIR |
no | ./figma-exports |
Output directory for export_image |
Quick check
Give the client a Figma URL and ask it to parse, e.g.:
Parse this Figma URL:
https://www.figma.com/design/<fileKey>/<name>?node-id=1-2
It should call parse_figma_url and return { fileKey, nodeId }.
Troubleshooting
FIGMA_ACCESS_TOKEN is not set— the env var didn't reach the server. Re-check the-eflag /envblock, then restart the client....contains non-ASCII or whitespace— you pasted a placeholder, not a real token. Replace with afigd_…value.0 tools/ not connected — confirmnpm run buildsucceeded andargspoints atbuild/index.js.- 401 / 403 from Figma — token expired or missing scope; regenerate it.
Code Connect mapping
figma.code-connect.json, keyed by Figma component key:
{
"<figmaComponentKey>": {
"component": "FormValidated",
"source": "@/forms/form-validated",
"props": { "DocType": "docType", "PartnerType": "partnerType" },
"valueMap": { "DocType": { "Z100": "z100", "Z200": "z200" } },
"slots": { "Icon": "icon", "Content": "children" }
}
}
Variables (non-Enterprise)
Figma's Variables REST API is Enterprise-only. On Free/Pro/Org, export variables with a community plugin to JSON (W3C DTCG or raw Figma) and point FIGMA_VARIABLES_PATH at it; get_variables normalizes it (modes + alias refs). Styles always work via get_design_tokens.
Tests
npm test— unit tests (no network).- Integration tests run only when
FIGMA_ACCESS_TOKENandFIGMA_TEST_FILEare set:FIGMA_ACCESS_TOKEN=figd_... FIGMA_TEST_FILE=<fileKey> npm test
Known v1 limitations
get_design_tokenscolor tokens are RGB hex; the alpha channel is dropped.- Component variant axes are derived by parsing variant names (
Axis=Value); confirmed against real files via the integration test. - Code Connect
slotsare stored but not yet applied byget_node'scodeConnectblock — content slots are surfaced separately asslotContent, and INSTANCE_SWAP props flow throughprops. - Some Figma REST response shapes (component-set linkage, style node values, instance overrides) are best-effort and validated by the integration test against a real file.
License
MIT © chisanucha_s
Disclaimer
Not affiliated with, endorsed by, or sponsored by Figma, Inc. Provided "as is" without warranty. You are responsible for keeping your Figma access token secret and for complying with Figma's API terms and rate limits. Never commit your token or local Figma exports — .env, figma.code-connect.json, figma.variables.json, and figma-exports/ are git-ignored by default.
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.