figwright
Figwright is a bidirectional MCP server that lets AI agents read from and write to Figma canvases through a local WebSocket-connected Figma plugin — enabling design-to-code and code-to-design workflows without requiring a paid Figma plan.
Health & Connectivity
pingverifies end-to-end server and plugin connectivity.
Read / Inspection
Selection, full document tree, individual/multiple nodes by ID, file metadata, pages, viewport, and fonts.
Search nodes by name/type; scan TEXT nodes or by specific node type within a subtree.
Retrieve local styles, variables (collections, modes, values), components, component property APIs, prototype reactions, and Dev Mode annotations.
Token-efficient, depth-limited, deduplicated design context optimized for large files and AI consumption.
Export nodes as PNG/JPG/SVG (base64 or saved to disk) and export nodes/pages as PDFs.
Codebase ↔ Figma Grounding
Project analysis: Detect framework, language, styling system, Tailwind version, SVG handling.
Component scan: AST-scan local UI components (React/Vue/Svelte) for reuse candidates.
Component map: Fuzzy-match Figma component instances to existing local code components.
Token map: Map Figma variables to local design tokens (Tailwind v4
@theme, CSS custom properties, or Tailwind built-in scale utilities).Icon map: Match Figma icon nodes to local
.svgfiles or icon libraries (Lucide, Heroicons, Iconify).
Write — Node Creation
Create frames, text, rectangles, ellipses, sections, and components.
Import raster images (PNG/JPG/GIF via base64 or URL) and SVGs as editable vector nodes.
Clone nodes; create local or published component instances; combine components into variant sets.
Write — Styling & Appearance
Set fills (solid, linear/radial/angular/diamond gradients), strokes (weight, alignment, dash, per-side), and effects (drop shadow, inner shadow, blurs).
Set opacity, visibility, blend mode, mask behavior, corner radius (uniform or per-corner), and arc data (pie slices, donuts, progress rings).
Write — Layout & Position
Move, resize, rotate, and set constraints on nodes.
Configure auto-layout (horizontal, vertical, or CSS-grid) with padding, spacing, alignment, and wrap.
Set child layout properties (grow, align, absolute positioning).
Group/ungroup, reparent, and reorder nodes in z-order.
Write — Text & Naming
Set text content and typography (font, size, line height, letter spacing, truncation).
Find & replace text across a scope; rename individual nodes or batch-rename many at once.
Lock/unlock nodes.
Write — Styles & Variables
Create, update, apply, and delete local paint, text, effect, and grid styles.
Create variable collections, add modes, create/rename/delete variables, set per-mode values, and bind variables to node scalar fields or fill/stroke paints.
Write — Pages & Prototyping
Add, delete, rename, and navigate between pages.
Set or remove prototype reactions (triggers + navigation actions) on nodes.
Swap instance main components, set instance properties (variant, boolean, text, instance-swap), and detach instances into plain frames.
Batch Operations
batch: Apply multiple invertible write operations atomically (all-or-nothing with rollback) in a single call.
Provides bidirectional Figma integration allowing AI agents to read design context (layout, typography, variables, components) and write back to the canvas, including creating and editing frames, text, auto-layout, styles, variables, components, and more.
Where Playwright drives the browser, Figwright drives Figma.
What is Figwright?
Figwright connects an MCP server to a Figma plugin over a local WebSocket relay, so an AI agent — Claude Code, Cursor, Codex, or any other MCP client — can work with Figma instead of just looking at it.
It works in both directions:
Read — turn a Figma selection into framework-aware code, grounded on faithful, de-duplicated design context (layout, typography, variables, components).
Write — author and edit the canvas directly: frames, text, auto-layout, styles, variables, components, whole screens.
Everything runs on your machine and talks to Figma through a plugin, so it needs no Figma Dev Mode seat and no paid tier.
Related MCP server: figma-pilot
Why Figwright
Free — no Figma Dev Mode or paid seat. The official Dev Mode MCP is gated; Figwright isn't.
Bidirectional — not read-only. 104 tools span reading and writing the canvas, so an agent can both implement designs and build them.
Provider-first codegen — Figwright detects your real stack (framework + styling system) and reuses your existing components, tokens, and icons, instead of emitting generic markup you have to rewrite.
Any MCP client — Claude Code, Cursor, and other MCP-capable agents all work the same way.
Open & extensible — the read/write workflows ship as installable skills you can adopt or fork.
How it works
Your MCP client talks to the @figwright/mcp server over stdio; the server relays to the Figma plugin over a local WebSocket. Several clients can share one plugin — they elect a leader that owns the connection — and the transport is built to ride out dropped sockets:
┌─────────────────────────────────────────────────────────────────────┐
│ MCP CLIENTS — one per agent │
│ Claude Code · Cursor · Claude · any MCP-capable client │
└─────────────────────────────────────────────────────────────────────┘
│ MCP protocol over stdio
▼
┌─────────────────────────────────────────────────────────────────────┐
│ @figwright/mcp — your client launches one; they elect a leader │
│ │
│ LEADER (owns the single plugin connection) │
│ • WebSocket relay · request idempotency │
│ • routes to the most-recently-active file │
│ • session resume · "busy ≠ dead" heartbeat │
│ • endpoints: /ws (plugin) · /ping (health) · /rpc (followers) │
│ │
│ FOLLOWERS │
│ • forward tool calls to the leader over HTTP /rpc │
│ • take over automatically if the leader exits │
└─────────────────────────────────────────────────────────────────────┘
│ local WebSocket · msgpack (binary)
▼
┌─────────────────────────────────────────────────────────────────────┐
│ FIGMA (desktop or browser) │
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Figwright plugin │ │
│ │ • UI (Vue 3 iframe): WebSocket client + heartbeat │ │
│ │ • sandbox: executes Figma Plugin API calls │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │
│ │ Figma Plugin API │
│ ▼ │
│ Canvas │
└─────────────────────────────────────────────────────────────────────┘By design Figwright is provider-first: rather than a fixed compiler pipeline, the tools surface honest design context and let the model generate code that matches your codebase. The figma-codegen skill encodes this approach.
The plugin
The Figma-side plugin isn't a black box. It shows every call as it happens, lets you inspect the exact payload sent to the model, and surfaces its own connection health.
Quick start
1. Add the server to your MCP client
For Claude Code, add this to your .mcp.json (other clients use the same shape):
{
"mcpServers": {
"figwright": {
"command": "npx",
"args": ["-y", "@figwright/mcp@latest"]
}
}
}npx fetches and runs the published server — no global install needed.
2. Install the Figma plugin
The plugin isn't on the Figma Community marketplace yet, so install it from the latest release:
Download the plugin zip from the latest GitHub Release and unzip it.
In the Figma desktop app: Menu → Plugins → Development → Import plugin from manifest… and pick the unzipped
manifest.json.
3. Connect
Open the Figwright plugin in Figma (Plugins → Development → Figwright). It connects to the local server automatically and shows Connected. Ask your agent to run ping to confirm the link.
4. (Optional) Install the skills
The skills make agents reach for Figwright at the right moment and follow the grounded workflows:
npx skills add awdr74100/figwright/skills5. Try it
With a frame selected in Figma, prompt your agent:
Code this Figma selection as a React component.
or, the other direction:
Build a pricing section in Figma from this spec.
Skills
Agent skills orchestrate Figwright's tools. They're model-invoked — your agent loads one automatically when the task matches its description.
Skill | What it does |
Turn a Figma selection into framework-aware code, grounded on your stack and existing components. | |
Build a Figma design from code or a description, reusing the file's existing components and styles. |
Install across any supported agent with the skills CLI:
npx skills add awdr74100/figwright/skills # both
npx skills add https://github.com/awdr74100/figwright/tree/main/skills/figma-codegen # oneSkills need the@figwright/mcp server connected — on their own they have no tools to drive.
Tools
Figwright exposes 104 MCP tools in three groups:
Read — selection, document and node inspection, styles, variables, components, fonts, reactions, screenshots, original image-fill assets, and PDF export.
Write — create and edit frames, text, shapes, auto-layout, effects, styles, variables, components (including authoring their boolean/text/instance-swap properties), pages, and reactions; plus a
batchtool to apply many edits at once.Grounding —
get_design_contextfor faithful, de-duplicated design context, andcomponent_map/token_map/icon_map, which join Figma data to your codebase so codegen reuses what you already have; plusdesign_diff, which reports what changed in a design against a saved baseline so you update only the affected code.
Your MCP client lists every tool at connect time — that's always the authoritative, up-to-date catalog.
Requirements
An MCP client (Claude Code, Cursor, …).
Node.js 20.19+ or 22.12+ — the server runs via
npx, as its own process, so this is independent of the Node version your project builds with. (This is the modern-Node baseline; Node 18/21 and 22.0–22.11 aren't supported.)Figma — the free tier is enough; the desktop app is needed to import the plugin in development.
FAQ
Both come down to how your MCP client launches the server: it spawns the command directly, not through your interactive shell, so it inherits none of what your shell sets up. That bites hardest when Node is managed by a version manager (fnm, nvm, asdf, volta, mise), since those configure PATH and npm from shell hooks that only run in a real terminal. It isn't specific to Figwright — it affects any npx-launched MCP server. There are two symptoms, with two different fixes.
command not found — the client can't find npx / node on its PATH.
Use an absolute path. In a normal terminal run
which npx(orwhich node) and use that full path ascommand:{ "mcpServers": { "figwright": { "command": "/Users/you/.local/share/fnm/node-versions/v24.x.x/installation/bin/npx", "args": ["-y", "@figwright/mcp@latest"] } } }Or pass
PATHthroughenv. If your client supports a per-serverenv, add your version manager'sbindirectory toenv.PATH.
-32000 / "Connection closed" / it just never connects — npx runs, but the server exits before the handshake.
npx … @latest re-resolves the package from the registry on every launch. In a directly-spawned environment that step can fail or stall — empty or different npm config, a corporate proxy or private registry that isn't configured there, or no network — so the process dies before MCP connects and the client reports the connection as closed. (A missing node for the binary's shebang lands here too.)
The fix is to install the package so launch needs no registry fetch:
As a project dependency — the quickest unblock. Install it, then drop
@latestfrom your config. The@latesttag is what forces the registry round-trip; without it,npxuses the copy already innode_modules(a project-scoped config like Claude Code's.mcp.jsonruns from your project root):pnpm add -D @figwright/mcp # or: npm i -D @figwright/mcp{ "mcpServers": { "figwright": { "command": "npx", "args": ["-y", "@figwright/mcp"] } } }Or globally, pinned to the binary. Install once, then point
commandstraight at it — nonpx, no per-launch resolution. Use the absolute path fromwhich figwright-mcp:npm i -g @figwright/mcp which figwright-mcp{ "mcpServers": { "figwright": { "command": "/absolute/path/to/figwright-mcp" } } }
The server is launched by your MCP client, so it only runs while that client is open. Check that:
your MCP client is running and has Figwright configured (try a
ping);the plugin is open in the same Figma app on the same machine (the relay is local-only,
127.0.0.1);nothing is blocking local loopback connections (some firewall / security tools do).
No. Figwright talks to Figma through a plugin, so the free tier is enough — no Dev Mode seat or paid tier required.
Yes. Several MCP servers can share a single plugin via leader/follower election — one leads, the others follow, with a graceful handoff if the leader goes away.
Contributing
Contributions are welcome. See CONTRIBUTING.md for how to get set up and open a pull request, and AGENTS.md for the architecture, repo layout, tech stack, and conventions.
What's in the name
figwright follows the -wright tradition — an old English word for a maker or craftsman: a playwright writes plays, a shipwright builds ships, a wheelwright, wheels. The name is a nod to Playwright, which automates the browser. Where Playwright drives the browser, Figwright drives Figma — a maker of designs that both reads the canvas and crafts work back onto it.
License
MIT © Roya
Maintenance
Appeared in Searches
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/awdr74100/figwright'
If you have feedback or need assistance with the MCP directory API, please join our Discord server