# figma-codekit-mcp [Health: Active]

**Category:** 📐 Architecture & Design  
**Repository:** https://github.com/Mehmoodqureshi/figma-codekit-mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 629  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/figma-codekit-mcp

## Description
Figma to pixel-perfect code, as an MCP server. Converts a frame to self-contained HTML deterministically, then closes the loop: renders your code in Chromium, pixel-diffs it against the Figma reference, and tells the agent exactly which elements are missi

## Tools
Capabilities this server exposes over MCP:

- **figma_convert** — Fetch a Figma frame and deterministically convert it to self-contained HTML (no LLM). Writes generated.html, reference.png, ir.json and assets.json to a cache dir and returns the paths plus a summary. Pass react=true for a component file, or next=true for a runnable Next.js App Router project you can npm install && npm run dev. Figma responses are cached, so re-running is offline and free unless refresh=true. Follow with figma_verify to see how close the render is.
- **figma_verify** — Render an HTML file in Chromium, pixel-diff it against the Figma reference, and check each element position with bounding-box IoU, paint order (z-index) and clipping. Returns the diff ratio plus specific instructions on what to fix (MISSING / MISPLACED / WRONG STACKING / OVER-CLIPPED elements, worst regions). Writes render.png and diff.png. Edit the HTML based on the correction and call this again to iterate toward pixel-exact. Read the returned diff.png to see the mismatches highlighted.
- **figma_inspect** — Print the IR tree as an indented outline (role, name, box, layout, text, tokens) so you can understand the design structure and find a specific element without reading raw Figma JSON or the whole ir.json. Use after figma_convert.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "figma-codekit-mcp": {
    "command": "npx",
    "args": ["-y","figma-codekit-mcp@latest"],
    "env": {
      "FIGMA_TOKEN": ""
    }
  }
}
```

**Requires environment variables:** `FIGMA_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What figma-codekit-mcp does

Figma frame conversion, browser rendering, and visual comparison are combined into three MCP tools. `figma_convert` retrieves a frame and writes a self-contained implementation plus its supporting artifacts. The output can include HTML, `ir.json`, image assets, a reference screenshot, and design-token files in W3C DTCG, CSS, and Tailwind v4 formats.

The converter can also produce React output, a runnable Next.js App Router project, or Tailwind-based React and Next.js output. A responsive option uses sizing intent from Figma Auto Layout where that information exists. Conversion is deterministic and does not use an LLM inside the server.

`figma_verify` checks whether the browser-rendered result matches the reference. Along with a pixel mismatch ratio and problem regions, it compares element bounding boxes using IR identifiers. It also checks rendered paint order and whether ancestor clipping hides content that should overhang. The result distinguishes issues such as missing elements, misplaced elements, incorrect stacking, and over-clipping.

## How it works

A typical workflow starts with a Figma frame link and `figma_convert`. The generated files are then edited by the calling agent. `figma_verify` renders the edited HTML in Chromium and returns measurements and fix guidance for the next iteration. The refinement loop belongs to the calling agent; the server does not contain a separate model or require an Anthropic API key.

Verification can target an existing page by passing a URL, and an optional selector can narrow the checked area. This allows a local application running at an address such as `http://localhost:3000` to be compared with the Figma frame, regardless of its application framework.

Figma responses are cached per frame. After the initial conversion, subsequent verification work can use the cached data without repeatedly fetching the frame from Figma. Tool results use file paths and numeric results so large generated documents are read from disk instead of being returned as large context payloads.

`figma_inspect` presents the intermediate representation as a readable outline containing roles, boxes, layout information, text, and tokens. It supports filtering, which helps an agent examine structure without placing the complete raw Figma response in context.

## Setup and configuration

The server is distributed for execution with `npx` and requires a Figma personal access token with the `File content: read` scope. Set it as `FIGMA_TOKEN`, or use the supported `.figma-token` file. A standard MCP configuration starts the package with `npx -y figma-codekit-mcp@latest` and passes the environment variable to the process.

Run the package with `--check` to validate the Node environment, token discovery and acceptance, and Chromium availability. The check reports `READY` when the three tools can operate. If the browser is unavailable, `--install-browser` installs it. On Windows, MCP hosts that cannot spawn `npx.cmd` directly can launch it through `cmd /c npx`.

A local visual interface is available through `npm run site`, which serves a page at `http://localhost:5173`. It uses the same token and cache locations as the MCP workflow and displays the generated application, source files, verification values, and pixel differences.

## Limitations and notes

Responsive conversion depends on design intent encoded by Figma Auto Layout. FILL, HUG, and FIXED sizing can be translated into flexible, content-sized, or fixed behavior when those constraints are present. A root frame without Auto Layout is treated as a fixed canvas: its children remain positioned at their design coordinates. In that case, the converter preserves the canvas and scales it for narrower viewports rather than inventing a reflow layout; below 0.5x, the page scrolls.

Chromium is required for `figma_verify`. The source reference must first be obtained through Figma for conversion, while verification itself can operate from cached frame data or against a locally running application. The example workflow includes a scripted generator to demonstrate the pipeline, but the server’s measurement and comparison stages are the substantive verification steps.

_Full upstream README: https://allmcps.com/mcp/figma-codekit-mcp/readme_

