figma-files-mcp
Provides read-only access to Figma files through the public Figma REST API, letting agents inspect pages, layers, styles, components, variants, prototype flows, and comments, and derive CSS/HTML/SVG, design tokens, component states, and image exports.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
figma-files-mcp
A read-only local MCP server (and Node library) that gives Copilot, Claude, Cursor, or any MCP-capable agent the design as it is in a Figma file. It uses only a personal access token and the public Figma REST API, so no Dev seat or official Figma MCP is needed.
What an agent gets:
Need | Tool | Cost |
Pages, screens, sizes, flows at a glance |
| 1× Tier 1 the first time, then cached |
Find layers by name / type / text |
| free |
Node tree + computed CSS per layer (+ raw Figma JSON) |
| free |
Exact CSS: flex/grid auto layout, sizing, constraints, gradients, borders, radius, shadows, blurs, blend modes, typography, truncation, scroll/sticky |
| free |
HTML + CSS for a whole screen or component (icons inlined as SVG, interactions as |
| free |
Text content with per-run styles, links, lists |
| free |
SVG for icons/vectors from Figma's own geometry |
| free |
Color / text / effect / grid styles with resolved values |
| free |
Design tokens (JSON or |
| free + 1× Tier 2 per version |
Fonts (families, weights, sizes, Google Fonts URLs), color palette |
| free |
Components, variants and properties |
| free |
Hover / pressed / focus / disabled CSS from variants + transitions |
| free |
Prototype flows: what happens on click/hover/…, destinations, overlays, animations (duration, easing, springs → CSS |
| free |
Original bitmap assets (photos) |
| 1× Tier 2 per version |
Pixel renders PNG/JPG/SVG/PDF |
| 1× Tier 1 per call (batch ids) |
Comments, Dev Mode links |
| 1× Tier 2 per version |
Quota usage + cache status |
| free |
Quick start (VS Code + GitHub Copilot, about 2 minutes)
You need Node.js 20 or newer. Nothing to install: VS Code downloads the server with npx the first time it starts.
1. Get a Figma access token (works with a free View seat)
Open figma.com → click your avatar / name (top-left) → Settings → Security tab.
Under Personal access tokens, click Generate new token.
Name it (e.g.
vscode-mcp), pick an expiration, and under Scopes set File content → Read-only. Optionally add Comments → Read and Dev resources → Read.Click Generate token and copy it now. Figma shows it only once. It starts with
figd_.
2. Add the server to VS Code
Press Ctrl + Shift + P (macOS: Cmd + Shift + P) and run
MCP: Open User Configuration(all your projects), orMCP: Open Workspace Folder Configuration(this project only, saved as.vscode/mcp.json).Paste this, replacing
figd_your_token_herewith your token:{ "servers": { "figma": { "type": "stdio", "command": "npx", "args": ["-y", "figma-files-mcp"], "env": { "FIGMA_TOKEN": "figd_your_token_here" } } } }If the file already has a
"servers"block, add just the"figma": { … }entry inside it.Save. Click Start above
"figma"in the file, or runMCP: List Servers→ figma → Start Server.
3. Use it
Keep the token private. If you used the workspace configuration, add
.vscode/mcp.jsonto.gitignore. Alternatively, keep the token out of the file entirely: let VS Code prompt for it ("env": { "FIGMA_TOKEN": "${input:figma-token}" }, see Setup), or runnpx -y figma-files-mcp loginonce and drop theenvline.
Other editors (Cursor, Claude Code, Claude Desktop, Windsurf) are covered in Setup.
Related MCP server: figmad-mcp
Why it's built this way: Figma's rate limits
Since Nov 2025 Figma meters REST calls per token owner and plan. On View/Collab seats, Tier 1 endpoints (GET file, GET nodes, GET image renders) allow only "up to 20 per month" (6 on Starter-plan files). Dev/Full seats get 10–20/min. Tier 2: 5/min vs 25–100/min. Tier 3: 10/min vs 50–150/min.
So this server:
Downloads each file once per version (
GET /v1/files/:key?geometry=paths, 1 Tier 1 call) and keeps it on disk (~/.figma-files-mcp/cache). Every process and session shares the cache.Derives everything else locally from that JSON: CSS, HTML, SVG (from vector geometry), tokens, states, flows.
Checks freshness with the cheap Tier 3
/metaendpoint (at most everyFIGMA_FRESHNESS_TTL_SEC, default 600 s) and re-downloads only when the version changed. Concurrent requests share one download.Throttles client-side per tier (sliding window), honours
Retry-Afteron 429s up toFIGMA_MAX_RETRY_WAIT_SEC, and fails fast with an actionable message (Retry-After in days, plan tier, seat type, upgrade link) instead of looping.Persists a usage ledger of every real API call, so agents and you can see what was spent (
figma_rate_limit_status).Caches Tier 2 results (image fill URLs, variables, comments) and Tier 1 renders per file version.
Optional hard cap:
FIGMA_TIER1_MONTHLY_BUDGET=15refuses Tier 1 calls past that count in a rolling 30 days.
Agents are told all of this through the MCP server instructions, each tool's description (which states its cost),
and AGENTS.md.
Setup (2 steps)
This is not a Figma plugin: nothing is installed inside Figma. Figma only issues the access token, and the server runs on your machine, launched by your editor.
1. Get a token. In Figma: avatar menu → Settings → Security → Personal access tokens → Generate new token,
with scope File content: Read (optionally Comments: Read, Dev resources: Read). Copy it (it starts with figd_).
2. Save it once (validated against Figma, stored in ~/.figma-files-mcp/config.json, readable only by you):
npx -y figma-files-mcp login # prompts for the token
# or: npm i -g figma-files-mcp && figma-files-mcp login
figma-files-mcp status # shows account, token source, cache and API usageThen add the server to your editor. No path, args or token are needed:
VS Code / GitHub Copilot: .vscode/mcp.json (workspace) or the user-level mcp.json:
{ "servers": { "figma": { "type": "stdio", "command": "npx", "args": ["-y", "figma-files-mcp"] } } }or, after npm i -g figma-files-mcp, simply { "servers": { "figma": { "type": "stdio", "command": "figma-files-mcp" } } }.
Claude Code
claude mcp add figma -- npx -y figma-files-mcp # Windows: claude mcp add figma -- cmd /c npx -y figma-files-mcpCursor / Windsurf / Claude Desktop (mcp.json / claude_desktop_config.json)
{ "mcpServers": { "figma": { "command": "npx", "args": ["-y", "figma-files-mcp"] } } }Where the token can come from (first match wins)
--token figd_…in the server args (optional)FIGMA_TOKENenv var, e.g. in the editor config's"env": { "FIGMA_TOKEN": "…" }. Useful for per-project tokens or CI. VS Code can prompt for it securely:{ "inputs": [{ "type": "promptString", "id": "figma-token", "description": "Figma token", "password": true }], "servers": { "figma": { "type": "stdio", "command": "npx", "args": ["-y", "figma-files-mcp"], "env": { "FIGMA_TOKEN": "${input:figma-token}" } } } }The saved login (
figma-files-mcp login). It is re-read on every request, so logging in, switching accounts, orfigma-files-mcp logouttakes effect without restarting the editor.
Without any token the server still starts, and every tool answers with these setup instructions.
Environment variables
Variable | Default | Meaning |
| – | Personal access token (optional if you ran |
|
| Config, cache and assets root |
|
|
|
| 3 / 5 / 10 (low), 10 / 25 / 50 (high) | Client-side per-minute caps |
|
| Hard cap on Tier 1 calls per rolling 30 days |
|
| Longest Retry-After the server will sleep through; longer means fail fast |
|
| Retries for 429 / 5xx / network errors |
|
| How often a cached file's version is re-checked (Tier 3) |
|
| File JSON + ledger + Tier 2 caches |
|
| Downloaded image fills and renders |
|
| Hard cap per tool response (tools also budget themselves) |
| – |
|
Library use
import { FigmaDesign } from "figma-files-mcp";
const figma = new FigmaDesign(); // token: FIGMA_TOKEN env or saved login; or pass { token }
const url = "https://www.figma.com/design/KEY/Name?node-id=12-345";
const { html, css } = await figma.code(url, "12:345");
const tokensCss = (await figma.tokens(url, "css")).css;
const states = await figma.componentStates(url, "1:10");
const flows = await figma.flows(url);Lower-level pieces are exported too: nodeToCss, nodeToSvg, generateCode, prototypeFlows, componentStates,
resolveStyles, FigmaApi (rate-limited client), FileStore, UsageLedger, ...
Fidelity: how it was verified
The data itself is exact: tools return Figma's own values (and figma_get_node format: "raw" returns the untouched
JSON). What is measured here is the translation of that data into SVG and HTML/CSS.
test/visual/compare.mjs renders nodes three ways and diffs them pixel by pixel at 2×: Figma's own renderer
(/v1/images), this server's local SVG, and its generated HTML/CSS in headless Chrome. Text areas are reported
separately: glyph rasterisation differs between any browser and Figma (different font engines and font builds),
so text can match in every value but never in every antialiased pixel. Everything else (geometry, layout, colors,
gradients, strokes, masks, effects) should be exact.
file | output | mismatch outside text (mean) | nodes at 0 px |
Pomo prototype (846 auto-layout frames, variants, flows) | local SVG | 0.001 % (≤ 5 px per node) | 11 / 14 |
HTML/CSS | 0.45 % | 7 / 14 | |
Figma "UI2" design system (vectors, booleans, masks, tiled images, blend modes) | local SVG | 0.24 % | 15 / 20 |
HTML/CSS | 0.17 % | 16 / 20 |
Full 1512×982 screens: 0 px outside text as SVG, 0.012 % as HTML. The remaining HTML differences come from
hug-sized boxes around text: when the browser's font renders a word 1–2 px wider than Figma's, the box grows by the
same amount. Open test/fixtures/visual-report*/report.html after a run for side-by-side images and diffs.
Run the suites:
npm test # unit tests (synthetic Figma JSON + mock API)
FIGMA_TOKEN=... node test/mcp-e2e.mjs <file-url> # every MCP tool over stdio (uses the cache)
# visual: Figma's reference renders aren't committed (they're renders of third-party files);
# fetch them once (1 Tier 1 call per fixture file), then compare as often as you like (free)
FIGMA_TOKEN=... node test/visual/render-fixtures.mjs test/fixtures/ui2-nodes.json test/fixtures/ui2-renders
FIGMA_TOKEN=... node test/visual/compare.mjs test/fixtures/ui2-nodes.json test/fixtures/ui2-rendersThe visual compare needs npm i (dev deps: puppeteer-core, pngjs, pixelmatch) and a local Chrome or Edge.
Known limitations (REST API / web platform)
Variables (names, collections, modes) are REST-accessible only on Enterprise plans. Elsewhere you get each binding with the value Figma resolved, plus the frames that switch modes, but not variable names.
Text in SVG is emitted as
<text>, because REST geometry has no glyph outlines. Usefigma_export_imageswithformat: "svg", svgOutlineText: true(Tier 1) for outlined text.CSS has no equivalent for diamond gradients, corner smoothing (squircles), noise/texture/glass effects, progressive blur or Figma image filters. These are flagged in
notes, and the SVG path covers most of them.Dev Mode annotations and measurements are not exposed by the REST API.
Smart Animate is described as transition type + duration + easing + "match layers". Implementing the layer matching (e.g. FLIP) is up to the app.
Main components of remote library instances live in the library file. Pass that file to analyse its variants.
Releasing
Releases are automated by .github/workflows/release.yml. From an up-to-date master:
npm version patch # or minor / major: bumps package.json, commits, creates tag vX.Y.Z
git push --follow-tags # pushes master + the tag; GitHub Actions builds, tests and publishes to npmThe workflow refuses tags that aren't on master or don't match package.json, skips versions already on npm,
publishes with provenance, and creates a GitHub Release with generated notes. CI (ci.yml) runs the build and
tests on Linux and Windows for Node 20/22/24 on every push and pull request.
npm authentication uses Trusted Publishing (OIDC, no stored token). It is a one-time setup by the package owner, either from the CLI (npm ≥ 11.10; it asks you to approve in the browser):
npx -y npm@latest trust github figma-files-mcp --file release.yml --repo AmirShokry/figma-files-mcp --env npm --allow-publish --yesor on npmjs.com → package figma-files-mcp → Settings → Trusted Publisher → GitHub Actions: owner
AmirShokry, repository figma-files-mcp, workflow release.yml, environment npm.
npm is phasing out "bypass 2FA" tokens for publishing, so prefer Trusted Publishing over an NPM_TOKEN secret.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only design skills, components and tokens from your Alpy library for any AI agent.
Keeps Figma in sync with your Storybook and sends designers' changes to your coding agent.
1The Figma MCP server brings Figma design context directly into your AI workflow.
Give AI agents your deeepSpace design system: components, tokens, styles and code mappings.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI coding agents with access to Figma design data through the Figma API. Enables accurate one-shot implementation of designs in any framework by translating Figma files into simplified layout and styling information.1MIT
- AlicenseAqualityDmaintenanceEnables AI agents to interact with Figma to create, read, and manage designs using the Figma REST API and a dedicated plugin. It supports advanced features like UI generation from text, webpage reconstruction in Figma, and design token synchronization with codebases.20MIT
- FlicenseBqualityDmaintenanceEnables AI agents to read, inspect, and export Figma designs programmatically. Provides tools for listing components, styles, and exporting assets in various formats.51-
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Figma design files with local caching to reduce API requests and rate limits, allowing faster and more reliable retrieval of design data for AI tools.34 npm82MIT