About designfit
designfit is an MCP server and Claude Code skill for checking rendered front ends against Figma designs. It compares design tokens and element geometry with tolerances, then returns actionable fixes without relying on pixel diffs.
Key features
- 01Extract design data from Figma
- 02Validate tokens and element geometry
- 03Report violations and unmapped elements
- 04Return a scored validation result
- 05Repeat checks through a fidelity skill
Use cases
- 01Check an AI-built page against a Figma frame
- 02Find layout and color mismatches
- 03Guide iterative front-end fixes
MCP support
It exposes `designfit_extract` and `designfit_validate` tools to MCP clients. Extraction accepts a Figma link or supplied node data; validation returns pass status, score, violations, and unmapped elements.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y designfitFIGMA_TOKENSecretFigma personal access token. Lets designfit_extract fetch frames; without it, pass the /nodes JSON instead.Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
2Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | |
| design | object | Yes | |
| design.root | object | Yes | |
| design.root.id | string | Yes | |
| design.root.name | string | Yes | |
| design.root.frame | object | Yes | |
| design.root.frame.h | number | Yes | |
| design.root.frame.w | number | Yes | |
| design.root.frame.x | number | Yes | |
| design.root.frame.y | number | Yes | |
| design.root.tokens | object | Yes | |
| design.root.tokens.fill | string | No | |
| design.root.tokens.color | any | No | |
| design.root.tokens.opacity | number | No | |
| design.root.tokens.fontSize | number | No | |
| design.root.tokens.fontFamily | string | No | |
| design.root.tokens.fontWeight | number | No | |
| design.root.tokens.lineHeight | number | No | |
| design.root.tokens.borderColor | any | No | |
| design.root.tokens.borderWidth | number | No | |
| design.root.tokens.borderRadius | number | No | |
| design.root.tokens.letterSpacing | number | No | |
| design.root.children | array | Yes | |
| design.root.tokenSources | object | No | |
| viewport | object | Yes | |
| viewport.width | number | Yes | |
| viewport.height | number | Yes | |
| tolerances | object | No | |
| tolerances.color | object | No | |
| tolerances.color.deltaE | number | No | |
| tolerances.fontSize | object | No | |
| tolerances.fontSize.px | number | No | |
| tolerances.geometry | object | No | |
| tolerances.geometry.size | number | No | |
| tolerances.geometry.position | number | No | |
| tolerances.lineHeight | object | No | |
| tolerances.lineHeight.px | number | No | |
| tolerances.borderWidth | object | No | |
| tolerances.borderWidth.px | number | No | |
| tolerances.borderRadius | object | No | |
| tolerances.borderRadius.px | number | No | |
| tolerances.letterSpacing | object | No | |
| tolerances.letterSpacing.px | number | No | |
| componentMap | array | Yes |
Details
From the project READMEdesignfit
Validate AI-built front-ends against their Figma design — without the screenshot-diff thrash.
https://github.com/user-attachments/assets/01df52c9-90eb-4abc-b56c-fe18b31076cd
A real run on a 360-node Figma frame: designfit_extract reads the frame from its link, then designfit_validate scores three build iterations, 87 to 89 to 100 pass. No screenshot diffing anywhere in it.
designfit is an MCP server + Claude Code skill that checks a rendered implementation against its Figma design and hands the coding agent a machine-actionable fix-list. It compares design tokens and geometry (element boxes relative to the screen root) — not raw pixels — so font-rendering noise never makes the agent oscillate. Deterministic in, deterministic out.
Why geometry, not pixels
Screenshot-diffing an AI-built UI against a Figma frame thrashes: anti-aliasing and sub-pixel shifts read as "still wrong," so the agent fixes forever. designfit compares what a designer actually catches — wrong colors, wrong sizes, misalignment, missing elements — as deterministic measurements with explicit tolerances. Same input, same output, no oscillation.
The long version: Why screenshot-diffing AI-built UIs thrashes, and how geometry fixes it.
Install
Claude Code — as a plugin:
/plugin marketplace add as9978/designfit
/plugin install designfit@designfit
Then once, to fetch the browser the measurement engine drives:
npx playwright install chromium
The plugin registers the designfit_extract and designfit_validate MCP tools and the designfit-fidelity-loop skill together, and asks once for a Figma personal access token (optional: without it, extract accepts pasted /nodes JSON).
Any other MCP client — manually:
npm install -g designfit
npx playwright install chromium
{ "mcpServers": { "designfit": { "command": "designfit", "env": { "FIGMA_TOKEN": "<token>" } } } }
Windows: some MCP clients can't spawn a bare
designfit(it resolves todesignfit.cmd). Use{ "command": "npx", "args": ["-y", "designfit"] }, or point at the binary directly with{ "command": "node", "args": ["<absolute-path>/node_modules/designfit/dist/index.js"] }. The plugin install above already uses thenpxform, so it isn't affected.
Use
Ask your agent to implement a Figma frame and give it the frame's link. The designfit-fidelity-loop skill drives: designfit_extract → build → tag elements with data-designfit-id → designfit_validate → fix → repeat until pass → strip the tags.
If you installed the plugin, the skill is already registered. On a manual install it isn't: skills aren't auto-loaded from an npm dependency, so copy the one that ships at skill/SKILL.md into your agent's skills directory (for Claude Code: .claude/skills/designfit-fidelity-loop/SKILL.md) so it can be discovered.
Two tools:
designfit_extracttakes a Figma link ({ url }), or{ fileKey, nodeId }, or a pastedGET /v1/files/:key/nodesbody ({ nodes }), plus optionalmaxDepth, and returns{ design, componentMap, viewport }. Fetching needsFIGMA_TOKENin the MCP server's environment. Hidden nodes are skipped and a frame made only of vectors is one leaf.designfit_validatetakes{ url, viewport, design, componentMap, tolerances? }and returns{ pass, score, violations, unmapped }.
For a full walkthrough on a real Figma frame — the loop, a copy-paste prompt, and troubleshooting — see docs/validating-a-figma-frame.md.
v1 scope
One viewport. Token + geometry + presence checks. Responsive multi-breakpoint and a perceptual VLM fallback are on the roadmap, not in v1.
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.