Skip to main content
Glama

figma-mcp

MCP server that connects AI agents (Cursor, Claude Code) to Figma: read node trees, classify assets, export SVG/PNG, and measure layout gaps.

Agent ←stdio→ MCP server ←WebSocket→ relay (port 3055) ←WebSocket→ Figma plugin

Path

Role

src/talk_to_figma_mcp/server.ts

MCP server (built to dist/)

src/socket.ts

WebSocket relay

src/cursor_mcp_plugin/

Figma plugin (code.js, ui.html)

Setup

  1. Install Bun, then from the repo root:

bun install
bun setup          # writes .cursor/mcp.json and .mcp.json
bun socket         # relay on ws://localhost:3055
  1. In Figma: Plugins → Development → Link existing plugin → src/cursor_mcp_plugin/manifest.json, run the plugin, and join the same channel the agent uses.

  2. In the agent: call list_channels, then join_channel (match by channel_description or channel from the list) before any other Figma command.

MCP config

Published package (from bun setup):

{
  "mcpServers": {
    "figma-mcp": {
      "command": "bunx",
      "args": ["figma-mcp@latest"]
    }
  }
}

Local development:

{
  "mcpServers": {
    "figma-mcp": {
      "command": "bun",
      "args": ["/absolute/path/to/figma-mcp/src/talk_to_figma_mcp/server.ts"]
    }
  }
}

Related MCP server: finish-line

Tools

Tool

Purpose

list_channels

Active relay channels (name, client count, description)

join_channel

Join by channel and/or channel_description; call list_channels first to match the plugin

get_node_info

Single node tree (filtered)

get_nodes_info

Batch node trees

get_asset

Asset prediction scores and exportNodeIds

export_node_as_svg

SVG string; optional writePath + outputDir

export_node_as_image

PNG (base64 or file); scale 2–4 for retina

measure_gap_between

Edge gap and offsets between two nodes

Node IDs: Figma API form (2403:34143), URL form (2403-34143), or instance path (I2403-34143-…).

Notes for agents

  • list_channels then join_channel — list active plugin channels first; join by matching channel_description (Figma file name) or exact channel from the list. Skip listing only when the user supplied a channel ID. No other Figma calls work until MCP and plugin share a channel.

  • Unpainted nodes — get_node_info / get_nodes_info omit children with absoluteRenderBounds: null; do not emit HTML for them.

  • Export — prefer export_node_as_svg when the subtree has < 3 vector primitives and SVG is ≤ 8 KB; otherwise export_node_as_image (scale: 2–4). Use outputDir to write under your project (absolute or relative to MCP server cwd).

  • WSL — uncomment hostname: "0.0.0.0" in src/socket.ts if the plugin cannot reach the relay.

Development

bun run build      # tsup → dist/
bun run dev        # watch build
bun run start      # run dist/server.js

Plugin sources are edited directly in src/cursor_mcp_plugin/ (no separate plugin build).

License

MIT

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to inspect Figma selections, navigate pages, render previews, generate starter code, and submit user-approved canvas edits through a local bridge.
      3 npm
      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
      F
      maintenance
      Enables AI agents to bridge to Figma through a local plugin for batched canvas edits, design-system search, token extraction and diffing, asset export, audits, and website-to-design capture.
      18
      11 npm
      1
      MIT