designfit
v0.2.1Validate AI-built front-ends against Figma by tokens and geometry, not pixels.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
designfit_validate Validate design fidelity
Validate a rendered front-end against its Figma design. Tag each built element with data-designfit-id="<figmaNodeId>", pass the design spec (geometry + tokens, from designfit_extract or relayed from Figma's MCP), the running URL, and the component map. Returns a fidelity score and a machine-actionable fix-list of token, geometry, and presence violations.
| Parameter | Type | Description |
|---|---|---|
componentMap * | array | |
design * | object | |
url * | string | |
viewport * | object | |
tolerances | object |
designfit_extract Extract a design spec from Figma
Turn a Figma frame into the design spec designfit_validate expects. Give it a Figma link (https://www.figma.com/design/<fileKey>/...?node-id=...), or fileKey + nodeId, and it fetches the node via Figma's REST API using the FIGMA_TOKEN env var; or paste the raw GET /v1/files/:key/nodes response as `nodes` and nothing is fetched. Returns { design, componentMap, viewport }: add `url` and call designfit_validate. Deterministic. Hidden nodes are skipped; a frame made only of vectors is one leaf (an icon). `maxDepth` limits how deep to go.
| Parameter | Type | Description |
|---|---|---|
fileKey | string | |
maxDepth | integer | |
nodeId | string | |
nodes | object | |
url | string |