Free, two-way Figma MCP server. Turn designs into framework-aware code, and push code back to the canvas. Works with Claude Code, Cursor, Codex, and any MCP client.
$ npx -y skills add awdr74100/figwright --agent claude-code
Run the curl in your terminal, the rest in Claude Code.
Repo: awdr74100/figwright
What's inside
Where Playwright drives the browser, Figwright drives Figma.
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.
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 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.
And it follows your Figma theme, light or dark.
The window is yours to arrange. Drag the bottom-right corner to resize it β a taller panel keeps more of the log in view, and the size is remembered next time you open it. Or send it to the background: the panel gets out of your way while the connection stays live, so a long-running agent keeps working.
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.
The plugin isn't on the Figma Community marketplace yet, so install it from the latest release:
manifest.json.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.
The skills make agents reach for Figwright at the right moment and follow the grounded workflows:
npx skills add awdr74100/figwright/skills
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.
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 |
|---|---|
figmaβcodegen | Turn a Figma selection into framework-aware code, grounded on your stack and existing components. |
figmaβbuild | 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 # one
[!NOTE] Skills need the
@figwright/mcpserver connected β on their own they have no tools to drive.
Figwright exposes 112 MCP tools in three groups:
batch tool to apply many edits at once.get_design_context for faithful, de-duplicated design context, and component_map / token_map / icon_map, which join Figma data to your codebase so codegen reuses what you already have; plus design_diff, which reports what changed in a design against a saved baseline so you update only the affected code.[!TIP] Your MCP client lists every tool at connect time β that's always the authoritative, up-to-date catalog.
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.)Figwright runs entirely on your machine: your client launches the server over stdio, the server relays to the plugin over a WebSocket on 127.0.0.1:3055, and nothing is sent anywhere else. The plugin uses only Figma's public Plugin API, so it reaches the file you have open and nothing beyond it.
Loopback is not on its own a boundary β a web page you visit can still reach a local port β so the relay gates every request on two headers a page cannot forge: Host, which must name loopback (this is what stops DNS rebinding), and Origin, which admits the plugin's sandboxed handshake and refuses browsers everywhere else. The leader's HTTP endpoints additionally require a media type that cannot be sent without a CORS preflight. See MCP Security Best Practices for the wider picture, and SECURITY.md for Figwright's threat model, what is in and out of scope, and how to report a vulnerability privately.
Figwright is not a substitute for reviewing what your agent does. Its write tools change your Figma file and its export tools write files to paths the agent chooses; an agent acting on a malicious design or a prompt-injected instruction can misuse both. Your MCP client's tool-approval controls are the boundary that matters.
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 (or which node) and use that full path as command:
{
"mcpServers": {
"figwright": {
"command": "/Users/you/.local/share/fnm/node-versions/v24.x.x/installation/bin/npx",
"args": ["-y", "@figwright/mcp@latest"]
}
}
}
Or pass PATH through env. If your client supports a per-server env, add your version manager's bin directory to env.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 @latest from your config. The @latest tag is what forces the registry round-trip; without it, npx uses the copy already in node_modules (a project-scoped config like Claude Code's .mcp.json runs 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 command straight at it β no npx, no per-launch resolution. Use the absolute path from which 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:
ping);127.0.0.1);No. Figwright talks to Figma through a plugin, so the free tier is enough β no Dev Mode seat or paid tier required.
It runs in both, with less available than in Figma Design β because those editors give plugins less, not because Figwright holds anything back.
get_metadata reports the editor (editorType / mode), and any tool that fails because of the editor says so in its error, so an agent can re-plan rather than retry.
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.
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.
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.
MIT Β© Roya
.claude/
hooks/
format-on-edit.mjs
settings.json
skills/
figma-typings-audit/
SKILL.md
mcp-sdk-audit/
probe.mjs
SKILL.md
.cspell.json
.editorconfig
.gitattributes
.github/
code-to-figma.gif
figma-to-code.gif
ISSUE_TEMPLATE/
bug_report.yml
config.yml
docs.yml
feature_request.yml
logo-dark.svg
logo-full-dark.svg
logo-full-light.svg
logo-light.svg
plugin-panel.png
plugin-theme.png
plugin-window.png
PULL_REQUEST_TEMPLATE.md
social-preview-dark.png
social-preview-light.png
workflows/
actionlint.yml
ci.yml
release.yml
semantic-pr.yml
zizmor.yml
.gitignore
.mcp.json
.node-version
.oxfmtrc.json
.oxlintrc.json
.vscode/
settings.json
AGENTS.md
CHANGELOG.md
CLAUDE.md
CONTRIBUTING.md
glama.json
knip.json
LICENSE
package.json
packages/
mcp/
package.json
README.md
src/
build-id.ts
diff/
design-diff.ts
dispatch.ts
election/
election.ts
follower.ts
leader-endpoints.ts
node.ts
icons/
repo-icons.ts
ignored-dirs.ts
index.ts
instructions.ts
join/
casefold.ts
component-map.ts
icon-map.ts
status.ts
token-map.ts
lifecycle.ts
local-access.ts
node-id.ts
profile/
profile.ts
prompts/
code-to-figma.ts
figma-to-code.ts
registry.ts
relay/
relay.ts
session.ts
repo-walk.ts
scan/
scan.ts
tokens/
css-scan.ts
figma-tokens.ts
hex.ts
load.ts
repo-css.ts
token-index.ts
tokens.ts
tools/
add-component-property.ts
add-page.ts
add-variable-mode.ts
analyze-project.ts
annotations.ts
apply-animation-style.ts
apply-manual-keyframe-track.ts
apply-style-to-node.ts
batch-rename-nodes.ts
batch.ts
bind-component-property.ts
bind-variable-to-node.ts
bind-variable-to-paint.ts
clone-node.ts
combine-as-variants.ts
component-map.ts
create-component.ts
create-effect-style.ts
create-ellipse.ts
create-frame.ts
create-grid-style.ts
create-instance.ts
create-paint-style.ts
create-rectangle.ts
create-section.ts
create-text-style.ts
create-text.ts
create-variable-collection.ts
create-variable.ts
delete-component-property.ts
delete-nodes.ts
delete-page.ts
delete-style.ts
delete-variable-collection.ts
delete-variable.ts
design-context-guard.ts
design-diff.ts
detach-instance.ts
edit-component-property.ts
effect-schema.ts
export-pdf.ts
export-video.ts
find-replace-text.ts
get-annotations.ts
get-component-api.ts
get-design-context.ts
get-document.ts
get-fonts.ts
get-local-components.ts
get-metadata.ts
get-motion-styles.ts
get-node-motion.ts
get-node.ts
get-nodes-info.ts
get-pages.ts
get-reactions.ts
get-screenshot.ts
get-selection.ts
get-styles.ts
get-variable-defs.ts
get-viewport.ts
group-nodes.ts
icon-map.ts
import-image.ts
import-svg.ts
list-files.ts
lock-nodes.ts
motion-schemas.ts
move-nodes.ts
navigate-to-page.ts
paint-schema.ts
ping.ts
registry.ts
remove-animation-style.ts
remove-manual-keyframe-track.ts
remove-reactions.ts
rename-node.ts
rename-page.ts
rename-variable.ts
reorder-nodes.ts
reparent-nodes.ts
resize-nodes.ts
rotate-nodes.ts
save-image-fills.ts
save-screenshots.ts
scan-components.ts
scan-nodes-by-types.ts
scan-text-nodes.ts
search-nodes.ts
set-arc.ts
set-auto-layout.ts
set-blend-mode.ts
set-constraints.ts
set-corner-radius.ts
set-effects.ts
set-fills.ts
set-instance-properties.ts
set-layout-grids.ts
set-layout-props.ts
set-mask.ts
set-opacity.ts
set-position.ts
set-reactions.ts
set-strokes.ts
set-text-properties.ts
set-text-range.ts
set-text.ts
set-timeline-duration.ts
set-variable-code-syntax.ts
set-variable-value.ts
set-visible.ts
skew-notice.ts
spec.ts
swap-component.ts
token-map.ts
ungroup-nodes.ts
unlock-nodes.ts
update-effect-style.ts
update-paint-style.ts
update-text-style.ts
test/
diff/
design-diff.test.ts
dispatch.test.ts
e2e/
_helpers.ts
get-document.test.ts
get-selection.test.ts
mcp-wire.test.ts
ping.test.ts
process-lifecycle.test.ts
read-tools.test.ts
election/
election.test.ts
follower.test.ts
leader-endpoints.test.ts
node.test.ts
icons/
repo-icons.test.ts
join/
casefold.test.ts
component-map.test.ts
icon-map.test.ts
status.test.ts
token-map.test.ts
lifecycle.test.ts
local-access.test.ts
node-id.test.ts
plugin-contract.json
plugin-contract.test.ts
plugin-contract.ts
profile/
profile.test.ts
prompts/
prompt-tool-names.test.ts
registry.test.ts
relay/
relay.test.ts
session.test.ts
repo-walk.test.ts
scan/
scan.test.ts
tokens/
css-scan.test.ts
figma-tokens.test.ts
repo-css.test.ts
token-index.test.ts
tokens.test.ts
tool-schema.ts
tools/
component-map.test.ts
design-context-guard.test.ts
design-diff.test.ts
export-pdf.test.ts
export-video.test.ts
get-document.test.ts
get-screenshot.test.ts
get-selection.test.ts
local-tools.test.ts
motion-schemas.test.ts
ping.test.ts
read-tools.test.ts
save-image-fills.test.ts
save-screenshots.test.ts
skew-notice.test.ts
token-map.test.ts
write-tools.test.ts
tsconfig.json
tsdown.config.ts
vitest.config.ts
plugin/
manifest.json
package.json
protocol/
bridge.ts
editor-context.ts
panel-control.ts
src/
code.ts
dispatcher.ts
handlers/
add-component-property.ts
add-page.ts
add-variable-mode.ts
apply-animation-style.ts
apply-manual-keyframe-track.ts
apply-style-to-node.ts
batch-rename-nodes.ts
batch.ts
bind-component-property.ts
bind-variable-to-node.ts
bind-variable-to-paint.ts
clone-node.ts
combine-as-variants.ts
component-property.ts
convert.ts
create-component.ts
create-effect-style.ts
create-ellipse.ts
create-frame.ts
create-grid-style.ts
create-instance.ts
create-paint-style.ts
create-rectangle.ts
create-section.ts
create-text-style.ts
create-text.ts
create-variable-collection.ts
create-variable.ts
delete-component-property.ts
delete-nodes.ts
delete-page.ts
delete-style.ts
delete-variable-collection.ts
delete-variable.ts
detach-instance.ts
edit-component-property.ts
export-pdf.ts
export-video.ts
find-replace-text.ts
get-annotations.ts
get-component-api.ts
get-design-context.ts
get-document.ts
get-fonts.ts
get-local-components.ts
get-metadata.ts
get-motion-styles.ts
get-node-motion.ts
get-node.ts
get-nodes-info.ts
get-pages.ts
get-reactions.ts
get-screenshot.ts
get-selection.ts
get-styles.ts
get-variable-defs.ts
get-viewport.ts
group-nodes.ts
import-image.ts
import-svg.ts
list-files.ts
lock-nodes.ts
motion-shared.ts
move-nodes.ts
navigate-to-page.ts
ping.ts
place.ts
registry.ts
remove-animation-style.ts
remove-manual-keyframe-track.ts
remove-reactions.ts
rename-node.ts
rename-page.ts
rename-variable.ts
reorder-nodes.ts
reparent-nodes.ts
resize-nodes.ts
rotate-nodes.ts
save-image-fills.ts
scan-nodes-by-types.ts
scan-text-nodes.ts
search-nodes.ts
set-arc.ts
set-auto-layout.ts
set-blend-mode.ts
set-constraints.ts
set-corner-radius.ts
set-effects.ts
set-fills.ts
set-instance-properties.ts
set-layout-grids.ts
set-layout-props.ts
set-mask.ts
set-opacity.ts
set-position.ts
set-reactions.ts
set-strokes.ts
set-text-properties.ts
... 250 moreFAQ
figwright is a Claude Code plugin with 4 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes figma-typings-audit, mcp-sdk-audit, figma-build. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.