
figma-mcp
io.github.Mehmoodqureshi由 GitHub 帳號 Mehmoodqureshi 發布v0.2.1更新於 Oct 24, 2026
Figma to pixel-perfect code: deterministic HTML/React, then a render + pixel-diff verify loop.
發布方自己的服務:Figma MCP Server
概覽
把 Figma 畫板確定性地轉成 HTML、React 或 Next.js 程式碼,再於 Chromium 中算繪並與設計做像素比對,直到收斂。
- 可以做什麼
- 把 Figma 畫板轉成 HTML、React 或 Next.js 程式碼,並輸出資源、參考圖與設計權杖
- 在 Chromium 中算繪產生的程式碼,與畫板做像素比對,並檢查元素框與繪製層級
- 直接以 URL 驗證正在運行的頁面,而非產生的 HTML
- 以可篩選的大綱形式檢視轉換後的畫板結構
- 只回傳檔案路徑與數值而非大塊內容,由助理直接讀取與修改檔案
- 適用情境
- 適合把 Figma 設計實作為程式碼時,讓助理自行核對輸出與設計是否一致,而不是靠肉眼微調間距。也適合用畫板驗證既有的運行中應用程式,或與其他 Figma 轉程式碼工具搭配使用。
- 執行需求
- 透過 npx(Node.js)以 stdio 在本機執行。需要具備檔案內容讀取權限的 Figma 個人存取權杖,透過 FIGMA_TOKEN 提供(也可放在 .figma-token 檔案中,FIGMA_API_KEY 可作為別名)。安裝時會下載用於算繪的 Chromium;FIGMA_MCP_CACHE_DIR 可指定快取位置。首次轉換需要連線至 Figma API 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 figma-mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
figma-codekit-mcp
Figma → code that is actually checked against the design. The pixel-diff verifier for Figma-to-code: it renders the output and diffs it against the frame until it converges — and it can verify your own running app the same way, so it works alongside Figma's official MCP server or Framelink rather than replacing them.
Most Figma-to-code tools stop at the moment of generation: they hand you JSX and walk away. Nobody ever renders the output and compares it to the frame, so the result stalls at "90% there" and you spend the afternoon nudging padding by eye.
This MCP server closes that loop. It converts a frame to self-contained HTML deterministically (no LLM, no hallucinated layout), then renders your code in Chromium, pixel-diffs it against the Figma reference, measures every element's box, and tells the agent exactly what is missing or misplaced. The agent edits, calls verify again, and repeats until the diff is at the anti-aliasing floor.
Those are real artifacts from npm run example, which runs the loop end to end
with no API key. The generate callback in that demo is a scripted stand-in
for an LLM, so it shows the loop mechanics honestly — the measuring is real, the
"model" is not.
Why the verify step matters
A Figma node tree tells you what the designer declared. It does not tell you what a browser will do with your CSS. Those diverge constantly — a flex gap that collapses, a font that falls back, an absolute child that escapes its parent. The only way to know is to render it and look.
figma_verify gives the agent three independent signals per pass:
- Pixel diff — the overall mismatch ratio plus the worst regions, so it knows how wrong and where.
- Element bounding-box IoU — every IR node is tagged
data-ir-id, measured in the live DOM, and matched against its Figma box. This is what turns "the bottom-left looks off" into "the CTA button is missing" or "the price label is 40px too low". - Paint order and clipping — Figma lists children back-to-front, so a node's
pre-order index is its paint order;
elementsFromPointover a sample grid gives the rendered order wherever two elements actually overlap. This catches the class of bug the other two signals are blind to by construction: elements present, in exactly the right box, stacked the wrong way round — or cut off by an ancestor'soverflowwhere the design lets them overhang. Neither moves a box, and on a tall frame neither moves the diff ratio much, but a decorative overlay drawn over a photo instead of under it is the first thing a person sees. Reported asWRONG STACKING/OVER-CLIPPED, and reported even when the pixel diff has converged.
Tools
Responsive output depends on what the design actually declares
responsive: true reads Figma's sizing intent — FILL becomes flex/100%, HUG becomes
fit-content, FIXED keeps its px. That only exists where the designer used Auto Layout.
A frame with no Auto Layout on the root is a canvas: every child is position:absolute at a
coordinate on a 1440px artboard. There is nothing to relax, so making the root width:100% does not
reflow it — the children stay pinned at their canvas coordinates and the right-hand side disappears
under overflow:hidden. That reads exactly like a page breaking when you zoom.
For those frames the converter keeps the exact canvas and scales it to the viewport instead, so the
design stays intact at every width and zoom level (down to 0.5x, after which the page scrolls).
figma_convert tells you which strategy it used. If you want real reflow rather than proportional
scaling, add Auto Layout in Figma — that is the signal the converter needs.
Every tool returns file paths and numbers, never large blobs. A converted frame is often 100+ KB of HTML; pushing that through a tool result would burn the agent's context for nothing. The agent reads and edits the files directly.
Figma responses are cached per frame, so after the first figma_convert the
whole loop runs offline and free — including when you are rate-limited.
Quick start
You need a Figma personal access token: Figma → Settings → Security → Personal
access tokens, scope File content: read.
Add it to Claude Code:
Or for any MCP host that reads a JSON config:
Then, in the agent: copy a frame link out of Figma (right-click the frame → Copy link to selection) and say "convert this frame and verify it until it converges."
Check your setup
It checks Node, whether a token was found (and where, never its value), whether
Figma accepts it, and whether the Chromium figma_verify renders in is
installed, then prints READY or what to fix. Exit code 0 means all three tools
will work. If Chromium is missing (a skipped download, or CI), install it with
npx -y figma-codekit-mcp@latest --install-browser.
Windows
npx resolves to npx.cmd, which some MCP hosts cannot spawn directly. If the
server fails to start, point at the shim explicitly:
The loop, concretely
The refine loop runs through the calling agent, not through an LLM inside the
server. That means no ANTHROPIC_API_KEY, no second model billing, and the agent
keeps full context on what it already tried. A headless refine loop
(src/refine/) still exists for library use.
Watch the loop without an agent
The same pipeline has a one-page local web front end, split in two: a chat on the left, the generated app on the right. You send a frame link, it asks what to build — HTML, React or Next.js; exact or responsive — and then converts, renders and diffs in front of you. The right pane carries the running app, its source files, the verify numbers and the pixel diff.
It uses the same .figma-token and the same .figma-cache/, so a frame you have
already converted re-runs offline in about a second. Useful for checking a frame
converts cleanly before pointing an agent at it — and for showing someone what
"verified against the design" means rather than describing it. Details in
site/README.md.
Configuration
See .env.example. Add .figma-cache/ to your project's
.gitignore — a cached frame keeps the original bitmaps and can be tens of megabytes.
FIGMA_FILE_TIMEOUT_MS (default 90000) caps how long figma_convert waits for
Figma's whole-file download, which it falls back to when the per-node endpoint is
rate-limited. When Figma will not answer, the tool says so within that time and,
if the frame is already cached anywhere, builds from the cached copy and marks the
result STALE CACHE instead of hanging.
Verify your own app, not just the generated HTML
Build the page however you like — Figma's official MCP server, Framelink, by hand —
then point figma_verify at it. It screenshots the page (or just the selected
element) at the frame's size and pixel-diffs it against Figma. Element-box and
layering checks need the converter's data-ir-id markers, so for a URL only the
pixel diff runs.
What it does not do
Being straight about the edges, because they are Figma's, not bugs:
- Token names are derived, not designed, unless you are on Enterprise. The
Figma Variables REST API is Enterprise-only. Without it the converter still
collects every colour, font, size and spacing value into
tokens.json/tokens.css/tailwind.theme.css, but names them after the value (--color-c8960c) because it cannot know intent. Rename them in your theme. - Figma rate-limits by cost. A very large file fetched repeatedly can lock a
token out for hours (free accounts hit this sooner). Cached frames keep working
offline;
figma_converttells you when the limit lifts. - Component prop bindings need Code Connect. Components are matched by name and reported, but the API does not expose which instance prop drove which value.
- The diff has a floor. Anti-aliasing and font hinting keep the ratio around
0.5–1.5% even on a perfect match.
thresholddefaults to 2% for that reason — chasing 0 is chasing rendering noise. - One frame at a time. No whole-file crawling, by design: it keeps token spend and Figma rate-limit pressure predictable.
Use it as a library
The verify loop is framework-agnostic and does not need the MCP layer:
The loop keeps the best iteration seen, so a later regression never makes the
result worse. To verify a React component on a dev server instead of an HTML
string, pass render: () => renderUrl('http://localhost:3000/preview', viewport).
Develop
example/ doubles as the test suite — npm test runs the full
loadFrame → figmaToIR → generateHtml chain against a mocked Figma REST API,
including rate-limit handling and rotation/mirror transforms. No token, no
network, no browser, so it runs in CI on every push.
Upgrading from an earlier package name
Replace the package in your MCP client command with npx -y figma-codekit-mcp@latest. Existing environment settings and saved data remain compatible.
Related
- MCP Browser Extension (mcp-browser-extension): let Claude, Cursor or any MCP agent use the Chrome you are already logged into, with a deny-all domain allowlist.
License
MIT © Mehmood Ur Rehman Qureshi
來源:README.md,提交 4626f30
工具
0版本歷史
1- v0.2.1最新Sep 26, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Figma 整合

Figma MCP Server
com.figma.mcp官方發布者
Figma 官方遠端 MCP 伺服器,為 AI 程式助理提供 Figma 設計脈絡,用來產生與更新程式碼。

FigmaMCP
由 GitHub 帳號 MrCoder 發布
一個本機 Mac MCP 伺服器,透過 Figma 外掛讓 Claude Code 或 Codex 讀取並編輯你目前開啟的 Figma 檔案。

Figma Bridge Mcp
由 GitHub 帳號 nguyendinhphongdx 發布
把 AI 助理連接到你在 Figma 桌面版中開啟的文件,讓它直接在畫布上繪製介面,並把設計讀回成資料與程式碼。

Figma Vector MCP
由 GitHub 帳號 workingmodel 發布
本機 MCP 伺服器加 Figma 外掛,讓助理在 Figma 畫布上建立與編輯可完整編輯的向量節點、形狀、文字與元件。

Figma CodeKit MCP
由 GitHub 帳號 Mehmoodqureshi 發布
把 Figma 畫框轉換成 HTML、React 或 Next.js 程式碼,並將渲染結果與設計稿做像素比對,反覆迭代直到收斂。