Skip to main content
Glama
Figma MCP Bridge

Figma MCP Bridge

by dumdummisha

Figma MCP Bridge

An MCP server that lets AI agents (Claude Code, OpenCode, any MCP client) edit Figma files through the Figma Plugin API, the same API Figma's own use_figma tool runs scripts against. A development plugin runs in the open file in the Figma desktop app and talks to the server over a localhost WebSocket, so there is no MCP call quota: the only limits are Figma's own.

How it works

agent ──stdio──> figma-mcp-bridge ──ws://localhost:38547──> plugin UI ──postMessage──> plugin sandbox (Plugin API)

Every agent session starts its own server process. The first one binds the port and becomes the hub that plugins connect to; the others connect to it, and one takes over when it exits. Each Figma file you want edited runs its own copy of the plugin.

Related MCP server: Figma Local MCP

Tools

Tool

What it does

figma_status

Lists connected files and the session id of each.

figma_run_script

Runs JavaScript in a connected file: the body of an async function with figma and console in scope. The returned value comes back as JSON (nodes become { id, name, type }), with the console.log lines.

figma_export_png

Renders a node to PNG and returns the image.

Each running plugin window executes one command at a time; a second one fails as busy until the first finishes, even when its caller stopped waiting. The bridge closes an undo step when a run returns or throws, so a run's edits undo together unless the script commits undo steps itself; an error does not roll them back. None of this is a file-wide transaction.

Scripts run with dynamic page loading, so use figma.getNodeByIdAsync, figma.setCurrentPageAsync and page.loadAsync() before reading another page, and figma.loadFontAsync before editing text.

Setup

Requires macOS or Linux (the token file relies on POSIX permissions), Node 20 or later, pnpm and the Figma desktop app (development plugins cannot be imported in the browser).

pnpm install
pnpm build
  1. Add the server to your agent, for example Claude Code:

    claude mcp add --scope user figma-bridge -- node /absolute/path/to/figma-mcp-bridge/dist/cli.js

    The first start creates the token file ~/.figma-mcp-bridge/token (mode 0600).

  2. In the Figma desktop app: Plugins › Development › Import plugin from manifest… and pick plugin/manifest.json.

  3. Open the file to edit and run Plugins › Development › Figma MCP Bridge. Paste the token from ~/.figma-mcp-bridge/token once; the plugin keeps it. Leave the plugin window open (you can collapse it) while agents work in the file.

Security

  • The server listens on the loopback addresses only.

  • Both ends of every connection prove they know the token with an HMAC challenge-response; the token itself never crosses the socket. The plugin and other sessions relay nothing, and the plugin does not even name its file, until the server on the port has proved itself, so a different program that takes the port first learns nothing and cannot send the plugin commands. The server holds the port on both loopback addresses localhost resolves to (127.0.0.1 and ::1), and refuses to start if another program holds either, so nothing can sit on the second address between the plugin and the server. Connections from web page origins are refused before the handshake.

  • The token file and its folder must belong to you and be private (modes 0600 and 0700); the server refuses to start otherwise, because a token other accounts could read may already be exposed. Access control lists that grant other accounts access are refused too. To get a new token, stop every agent session that runs the bridge (each keeps the token it read), delete ~/.figma-mcp-bridge, and paste the new token into the plugin.

  • figma_run_script runs arbitrary code with full access to the open file and to the plugin's own storage, which holds the token. Anything that can talk to your agent can change or delete the file's content, and choosing a session selects a file but does not limit what a script can do. Figma's version history is the undo of last resort.

  • Layer names and text in a file are input to your agent. Treat files from others as untrusted.

  • The bridge assumes one person uses the computer. Any program under your own account can read the token file, and on a Mac shared by several user accounts, a program under another account that takes the port before an agent session starts could relay the plugin's connection and read or alter what passes through it. Messages after the handshake are not signed or encrypted.

Limits that remain

These come from Figma, not from the bridge:

  • The plugin must be running in each file, in the desktop app.

  • A long synchronous script blocks the Figma editor until it finishes. The server stops waiting after the timeout you pass, but Figma cannot interrupt the script.

  • A single message is capped at 100 MiB (the ws library's default), so a very large export fails with an error; export at a smaller scale.

  • Plan limits still apply through the Plugin API, for example the Starter plan's 3 pages per file and single variable mode per collection.

Development

pnpm typecheck
pnpm test
pnpm format:check

The port 38547 and the message cap appear in src/protocol.ts, plugin/manifest.json and plugin/ui.html; a test checks they agree. The plugin sandbox has no crypto API, so plugin/src/hmac.ts implements HMAC-SHA256, and a test checks it against node:crypto.

License

MIT

Available Tools

3 tools
figma_export_pngA

Render a node of a connected Figma file to PNG and return the image, to look at what a script made.

Inputs: scale (required), nodeId (required), timeoutSeconds (required), session.

figma_run_scriptA

Run JavaScript against the Figma Plugin API in a connected file. code is the body of an async function with figma and console in scope; await works and return sends a value back. The returned value is serialized as JSON: an object with a string id, a string type and a boolean removed (a node) becomes { id, name, type }, a Uint8Array becomes a base64 string, a bigint a decimal string, and a circular reference "[circular]". console.log lines come back as logs. The plugin uses dynamic page loading: use figma.getNodeByIdAsync, figma.setCurrentPageAsync and page.loadAsync() before reading another page, and figma.loadFontAsync before editing text. Each plugin window runs one command at a time; a second one fails as busy until the first finishes, even when its caller stopped waiting. The bridge closes an undo step when a run returns or throws, so its edits undo together unless the script commits undo itself; an error does not roll them back.

Inputs: code (required), timeoutSeconds (required), session.

figma_statusA

List the Figma files connected through the Figma MCP Bridge plugin, with the session to pass to the other tools. A file connects when the plugin runs in it (Plugins › Development › Figma MCP Bridge in the Figma desktop app).

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 3 tools

    Disambiguation5/5

    The three tools split cleanly along lifecycle lines: discover/connect (figma_status), mutate/inspect via code (figma_run_script), and visually verify (figma_export_png). The only theoretical overlap is that a script could return binary data, but export_png exists specifically to return renderable images, so an agent won't misselect.

    Naming Consistency4/5

    All tools share a consistent `figma_` namespace prefix followed by snake_case, which is predictable and readable. The minor deviation is that `figma_status` uses a noun rather than a verb like `run`/`export`, but it still reads naturally as a state-query tool.

    Tool Count4/5

    Three tools is thin, but the design is deliberate: one escape-hatch executor over the full Figma Plugin API plus a discovery endpoint and a render endpoint covers essentially unlimited operations. A slightly larger surface (e.g. session teardown or file metadata) would round it out.

    Completeness4/5

    Because figma_run_script exposes the entire Plugin API, almost any read/write operation is reachable, and status + PNG export close the discovery and verification loops. Gaps are minor: no explicit cancel/busy-status tool despite the documented 'busy' failure mode, and no dedicated way to inspect a file's structure without writing JS.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Figma MCP server that lets agents execute arbitrary JavaScript inside a running Figma desktop app via a local development plugin, enabling real-time document inspection and manipulation while avoiding REST API rate limits.
      3
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables an agent to read, edit, and build Figma designs from scratch — including style guides, variables, components, and screens — through a local plugin bridge to the open file's Plugin API, with no Figma token or REST API calls.
      21
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to read, create, edit, and organize Figma documents directly through a local plugin bridge, without needing a Figma AI subscription.
      3
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI coding agents to read and edit the file currently open in Figma Desktop through a local development plugin, supporting node inspection, JSON/image exports, and arbitrary Plugin API scripts without REST API rate limits.
      7
      9 npm
      MIT