# figma-mcp [Health: Active]

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

## Description
Figma to pixel-perfect code: deterministic HTML/React, then a render + pixel-diff verify loop.

## 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-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-mcp does

figma-mcp turns a selected Figma frame into files that an agent or developer can inspect and run. The conversion includes HTML, an intermediate representation in `ir.json`, image assets, a reference PNG, and design-token files in W3C DTCG JSON, CSS, and Tailwind v4 formats. React output can include imported components, while Next.js output can be produced as a runnable App Router project. Tailwind output uses utility classes in React or Next.js results.

The server is designed around a conversion-and-verification loop. It does not use an LLM to determine the initial layout, and the refinement process is driven by the calling agent editing files and invoking verification again.

## How it works

`figma_convert` fetches a frame through the Figma API and writes the generated artifacts to files. Images are stored in an `assets/` directory by default, or embedded as data URIs when `inlineAssets: true` is selected. Figma responses are cached per frame, allowing subsequent work on a converted frame to run without another API request.

`figma_verify` renders HTML in Chromium and compares it with the Figma reference. Its results include an overall pixel mismatch, high-difference regions, element bounding-box IoU measurements, and targeted correction guidance. It also checks rendered paint order against the design order and detects content clipped by an ancestor. To check an existing application instead, pass its running `url` and optionally a `selector`.

Responsive conversion follows sizing intent declared through Figma Auto Layout. FILL, HUG, and FIXED sizing map to different web behaviors. Frames without root Auto Layout remain fixed canvases and are scaled to the viewport rather than reflowed; adding Auto Layout in Figma provides the information needed for genuine reflow.

`figma_inspect` prints the intermediate representation as a filtered, indented outline containing roles, boxes, layout data, text, and tokens. Tool results return file paths and measurements instead of placing large generated documents directly into the agent context.

## Setup and configuration

A Figma personal access token with the `File content: read` scope is required. Set it in `FIGMA_TOKEN`, then register the server with an MCP host using `npx -y figma-codekit-mcp@latest`. Claude Code can add it with `claude mcp add`; other hosts can use a JSON MCP configuration with the command, arguments, and environment variable.

Run the package with `--check` to validate Node, token discovery, Figma authentication, and Chromium availability. If the browser is missing, `--install-browser` installs it. On Windows, hosts that cannot spawn `npx.cmd` directly can invoke it through `cmd /c npx`.

## Tools and capabilities

- `figma_convert`: Generate HTML, assets, reference imagery, IR data, design tokens, and optional React, Next.js, Tailwind, or responsive output.
- `figma_verify`: Compare generated HTML or a running page against a Figma frame using pixels, element geometry, paint order, and clipping checks.
- `figma_inspect`: Examine the converted IR as a concise, filterable outline.
- Cached frame responses: Reuse fetched Figma data during later conversion and verification passes.

## Limitations and notes

Responsive behavior depends on Auto Layout information in the source design. A canvas-style frame keeps its coordinates and is scaled instead of automatically becoming a reflowing layout. Verification requires Chromium for rendered comparisons, while checking a running page requires that page to be available at the supplied URL. The refinement loop runs through the calling agent; the server does not contain a separate LLM or require an `ANTHROPIC_API_KEY`.

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

