Two-way MCP server for Figma: an agent reads a design or a FigJam board and renders one back through the Figma Plugin API, so it needs no REST token and has no monthly call limit.
mirra.mp4
npx @ttsalpha/mirra initThen restart your agent.
Requires Figma Desktop (macOS or Windows) and Node 24+.
Install notes
- Adds Mirra to Claude Desktop, Claude Code, Cursor, VS Code, Antigravity and Codex / ChatGPT desktop (
--no-configskips) - Figma open during
init: import by hand, Plugins → Development → Import plugin from manifest… →~/.mirra/plugin/manifest.json - Upgrading: run
initagain
- Open a Figma or FigJam file
- Run Plugins → Development → Mirra
- Keep the panel open
The panel reads Disconnected until your agent has started Mirra. Open your agent; if the panel
still doesn't connect, run npx @ttsalpha/mirra doctor.
| Tool | What it does |
|---|---|
mirra_render |
Build a whole screen, or a FigJam board, from one declarative tree |
mirra_read |
Read the selection, or a node, back as that same tree |
mirra_patch |
set / append / replace / move / component / remove by key, as one undo step |
mirra_find |
Locate layers by name, kind or key, and select them |
mirra_pages |
List the pages, add one, or switch to one |
mirra_screenshot |
Export a layer as PNG and hand the image back |
mirra_tokens |
List variables and styles, with the $name a tree refers to |
mirra_define_tokens |
Create or update variables, modes, aliases and paint/text/effect styles |
mirra_export_assets |
Write layers to disk as PNG or SVG |
mirra_ping |
Check the connection and report the open file and editor |
mirra_exec |
Run Plugin API code; off by default, see below |
mirra_render and mirra_read share one format, so an agent can write code from what it reads.
- Nodes:
frame,text,rect,ellipse,instance,svg,image - Flexbox-like:
layout: {dir, gap, pad, …} w/h: a number,"fill"or"hug""$name"binds a field to a variablekeyletsmirra_patchaddress a node later
{
"type": "frame",
"key": "card",
"layout": { "dir": "vertical", "gap": 12, "pad": 16 },
"fill": "#ffffff",
"radius": 12,
"children": [
{ "type": "text", "text": "Welcome back", "size": 24 },
{ "type": "rect", "w": "fill", "h": 1, "fill": "#eeeeee" }
]
}- Nodes:
section,sticky,shape,connector,table,code,link,gif - A board is one
section; FigJam has no frames, auto layout or variables - Place a node with
at: {x, y}, or let the section'slayoutplace its children - A connector joins nodes by
keyand routes itself mirra_define_tokensand"$name"need a Figma Design file- Stamps, highlights, washi tape and widgets: found with
mirra_find, never created or read
| Variable | What it does |
|---|---|
MIRRA_PORT |
Pin one port instead of scanning 51730–51739 |
MIRRA_ROOT |
Directory that tool file paths resolve from; paths outside it are refused |
MIRRA_ALLOW_EXEC |
Register mirra_exec at all; the panel still has to allow it |
MIRRA_ALLOW_ORIGIN |
Accept one more browser origin on the socket |
Unset, MIRRA_ROOT falls back to the working directory. Set it for agents that start the server
outside a project, such as Claude Desktop.
mirra_execruns any Plugin API code the agent writes- Needs two keys:
MIRRA_ALLOW_EXECon the server, and Allow code execution ticked in the panel (reset on every run)
claude mcp add -s user Mirra-exec -e MIRRA_ALLOW_EXEC=1 -- npx -y @ttsalpha/mirra serveAgent ⇄ stdio ⇄ MCP server ⇄ ws://localhost:51730 ⇄ plugin ⇄ Figma
- The socket listens on loopback and rejects browser origins other than Figma's
- No authentication against other processes running as you while the plugin is open
packages/schema holds the tree and wire protocol, packages/plugin the Figma side,
packages/server the MCP server and CLI. Tests run against a fake of the Figma sandbox, so
they don't need Figma open. The fake doesn't reproduce FigJam's quirks: try FigJam changes in a
real FigJam file.