openfig-mcp
Parses locally saved Figma .fig files (no Figma account, API token or plugin required) and turns them into LLM-ready design data: lists pages/sections/frames with ids and sizes, exports any frame as HTML + CSS (auto layout, fills, strokes, effects, text styles), renders frames as PNG, extracts color/text/effect styles and Figma Variables with light/dark modes as CSS custom properties, lists components and variants with their interactive state diffs, maps prototype flows, overlays/modals, timers and transitions, searches layers by name or text, and exports icons/vectors as SVG.
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.
openfig-mcp
Figma .fig files → LLM-ready design data, over MCP. No Figma account, API token or plugin: point it
at a downloaded .fig file and your coding agent (GitHub Copilot, Claude, Cursor, …) can list the
screens, pull any frame as HTML + CSS, see it as an image, and get the design tokens, components,
hover/press states, animations, prototype links, icons (SVG), images and fonts.
Built on OpenFig's .fig parser (openfig-core) and SVG renderer.
Quick start — VS Code + GitHub Copilot
Save your Figma file into the project as
design.fig(Figma: Main menu → File → Save local copy…, or Download on a Community file).Add
.vscode/mcp.json:
{
"servers": {
"openfig": {
"type": "stdio",
"command": "npx",
"args": ["-y", "openfig-mcp", "${workspaceFolder}/design.fig"]
}
}
}Open Copilot Chat in Agent mode and ask:
Implement the "Login" screen from the design in React + Tailwind.
Use openfig to build
https://www.figma.com/design/…?node-id=12-345as a Vue component.
The file given in args is the default for every tool. Frames can be referenced by name ("Login"),
id ("12:345") or a Figma URL with node-id. Working with several files? Pass a folder
("${workspaceFolder}/designs") instead, and name the file in the prompt ("…from designs/app.fig").
Other clients
{ "mcpServers": { "openfig": { "command": "npx", "args": ["-y", "openfig-mcp", "/absolute/path/to/design.fig"] } } }Claude Code: claude mcp add openfig -- npx -y openfig-mcp ./design.fig
Related MCP server: figctx-mcp
Tools
Tool | What the agent gets |
|
|
| pages → sections → screens / frames / component sets, with ids, sizes, prototype start points |
| the main tool. Summary (fonts, components + variants, tokens, |
| PNG image of any frame/node so the model can see it |
| color / text / effect styles and Figma Variables (all modes, e.g. light/dark) as CSS custom properties + typography classes, or JSON |
| components & variant sets with their properties ( |
| every variant, the CSS diff between interactive states, HTML/CSS of the set |
| find layers by name or text ("Sign in", "price") |
| flows and every click/hover/timer link between screens, overlays (modals), URLs |
| any icon / logo / vector as SVG |
Plus an MCP prompt implement_frame (in VS Code: /mcp.openfig.implement_frame).
What get_frame writes
figma-export/<frame>-<id>/
DESIGN.md summary: fonts, components, states, animations, links, modals
index.html HTML reproduction (flex where Figma used auto-layout, absolute elsewhere)
styles.css one class per unique style + :hover / :active rules from variant interactions
tokens.css CSS variables for the tokens this frame uses (styles + variables, per mode)
spec.json full tree: box, style, text runs, constraints, component/variant info, interactions
preview.png rendering of the frame
assets/ SVG icons & vectors, images (png/jpg/gif/webp), masked groups as PNGThe inline response is budgeted (maxChars, default 40k): deep subtrees are collapsed with a pointer
to drill in (get_frame on a section id), and the full files are always on disk.
What is extracted
Figma | Output |
Auto layout (direction, gap, padding, alignment, wrap, hug / fill / fixed, absolute children, margins) |
|
Frames without auto layout, constraints | absolute positioning (+ constraints in |
Fills: solid, linear/radial/angular gradients, images (fill/fit/tile/crop), multiple layers |
|
Strokes (inside/center/outside, per-side, dashed), corner radii (per corner) |
|
Effects: drop/inner shadow, layer & background blur |
|
Opacity, blend modes, clip content, scrolling frames |
|
Text: font, weight, size, line height, letter spacing, case, decoration, alignment, truncation, mixed-style runs, links | full typography, |
Color / text / effect styles, Figma Variables + modes |
|
Components, variants, instance overrides, component properties (text / boolean / instance swap) | resolved per instance; |
Prototype interactions, variants, states | see Interactivity |
Vectors, icons, boolean ops, masks | SVG files (icons deduplicated), masked groups → PNG |
Fonts | reported, not bundled: family, weights and styles of every font used, with a warning to add them to the project (and whether each is installed locally) |
Ids of nodes inside component instances use Figma's own format (I<instance>;<child>).
Interactivity
Everything Figma's prototype model can express is extracted, and turned into CSS where CSS can express it:
Figma | Output |
Triggers: on click, while hovering, while pressing, mouse enter / leave / down / up, after delay, key press (key names, e.g. | per element in |
Navigate to another frame, back, scroll to a layer (+ offset), open URL (new tab or not) | "click → navigates to "Checkout" (12:34) [smart animate 300ms ease-out]" |
Overlays / modals: open, swap, close; position, backdrop color, close-on-outside-click | "click → opens overlay/modal "Share" — position center, closes on outside click, backdrop rgba(0,0,0,0.5)" |
Variant swaps ("change to") | CSS diff between the two variants, plus exactly which layers appear and disappear ( |
Variables: set variable (with expressions like | "click → sets menuOpen = !menuOpen → toggles visibility of "Dropdown menu" (hidden by default)" (layers whose visibility is bound to the variable are resolved) |
Pseudo-classes |
|
Timers (after delay → change variant) | grouped into auto-playing animations (carousels, marquees, loaders) with each step's delay, transition and easing |
Transitions | type (instant, dissolve, slide/push/move in/out, smart animate), duration, easing as |
Scrolling: scroll direction, fixed and sticky layers |
|
Prototype flows |
|
Hover and press states become CSS rules. Click toggles, key handlers, variables and conditionals are described precisely (trigger, effect, timing) for the agent to implement in the app's framework.
Fidelity
npm run fidelity -- <file.fig> lays every generated index.html out in a real browser and compares
each element's box with the layout Figma stored in the file, checks every text string and asset,
and computes SSIM against the rendered preview. Results on the 33 non-empty screens of a 134 MB
community file (8 interactive UI designs, 23k layers; 4,797 elements compared):
Metric | Fonts as-is | Text boxes at Figma's size ( |
Elements within 8 px of Figma's position & size | 93.2 % (median screen 97.8 %) | 99.5 % (median screen 100 %) |
Elements within 2 px | 87.9 % | 99.5 % |
Text strings present | 100 % | 100 % |
Broken asset references (2,337 images / SVGs) | 0 | 0 |
Why not 100 %? The design uses fonts the test browser doesn't have (Satoshi, Clash Display,
Zen Dots). The fallback font has different glyph widths and line heights, so every text box that
hugs its content gets a different size, and that shifts its containers and siblings in auto-layout.
Pin the text boxes to the sizes Figma measured (--pin-text) and that whole category disappears:
99.5 % of elements land within 2 px. The remaining 0.5 % are a handful of rotated/skewed mockup layers
and masked decorative groups. With the design's real fonts installed in your app, you get the
right-hand column.
The metric is strict: an element counts as wrong if any of x, y, width or height is off, and one
mis-sized parent marks all its descendants as wrong too. See examples/fidelity-report.md.
CLI
The same package is a CLI (handy for CI or a quick look):
npx -y openfig-mcp frames design.fig # list frames
npx -y openfig-mcp export design.fig "Login" -o out/ # export bundle
npx -y openfig-mcp render design.fig 12:345 -o login.png
npx -y openfig-mcp tokens design.fig [--json]
npx -y openfig-mcp components design.fig [query]
npx -y openfig-mcp search design.fig "Sign in"
npx -y openfig-mcp flows design.figLibrary
import { FigFile } from 'openfig-mcp';
const fig = await FigFile.open('design.fig');
fig.listFrames(); // [{ id, name, kind, page, size, ... }]
const r = await fig.getFrame('Login', { outDir: 'out/login' });
r.summary; r.fullHtml; r.fullCss; r.spec; r.meta.states;
const { png } = await fig.render('12:345');
fig.tokens().css;Configuration
Env var | |
| optional extra local font folders used for preview renders ( |
Fonts
openfig-mcp never downloads or bundles fonts. Providing them is the project's job. Every get_frame /
render_frame response lists the fonts the design needs (family, weights, styles) with a warning, and
says which ones aren't installed on the machine. Generated CSS uses font-family: 'Family', sans-serif.
Limitations
.figis Figma's private format. openfig follows it closely, but a new Figma release can add fields before the parser knows them. Everything unknown is passed through tospec.jsonas-is.render_frame/preview.pngcome from openfig's renderer, not Figma: good for layout and color, but text uses installed fonts (or a fallback), and complex blend modes and some effects (noise, glass, progressive blur) are approximate.Components from unpublished external libraries only exist in the file as the copies Figma embeds (that is usually all that is needed).
Smart-animate transitions are described (from/to state, duration, easing). The generated CSS covers hover/press states. Click toggles, carousels and page transitions are listed for the agent to implement in JS.
Figma Variables support follows the file schema and is covered by tests with synthetic data. The sample community file uses styles, not variables.
Development
npm install
npm test # unit + end-to-end MCP tests (FIG_SAMPLE=/path/to.fig for the big ones)
npm run fidelity -- design.fig [frameId…] # browser-based fidelity report (needs Edge/Chrome or CHROME_PATH)Releasing
CI (.github/workflows/ci.yml) runs the tests on Linux, Windows and macOS for every push and PR.
Publishing is tag-driven (.github/workflows/release.yml):
npm version patch # or minor / major: bumps package.json, commits, creates tag vX.Y.Z
git push --follow-tags # pushes main + the tag → CI tests, publishes to npm (with provenance), creates a GitHub releaseThe release job only publishes if the tag points at a commit on main and matches package.json's version.
It authenticates with the NPM_TOKEN repository secret (an npm granular access token with
read/write access to openfig-mcp).
MIT. Figma is a trademark of Figma, Inc. This project is not affiliated with Figma.
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
The Figma MCP server brings Figma design context directly into your AI workflow.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Keeps Figma in sync with your Storybook and sends designers' changes to your coding agent.
Persistent file storage for AI agents. Save files over MCP, get a link a human can open.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables offline reading and rendering of Figma .fig files, allowing AI agents to extract design specs, export assets, and generate code without needing the Figma API or network access.262MIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to extract, inspect, search, and bundle design context from local Figma .fig files entirely offline, exposing frame summaries, node context, style tokens, assets, vector SVGs, and visual-match review via MCP.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to read and inspect local Figma .fig files entirely offline, exposing document structure, geometry, styles, text, components, variables, and embedded images via MCP tools.1286 npm5MIT
- AlicenseAqualityBmaintenanceProvides read-only Figma design data to AI agents via MCP, supporting local .fig files and browser-based figma.com access without plugins or API tokens.1886 npm1MIT