AI & Tools

Figma MCP

Provides Model Context Protocol (MCP) to convert Figma designs to React code using AI Agents.

Quick Setup

You can issue a Personal Access Token (PAT) from Figma Settings.

  • If you have PAT: You can use REST API mode by copying the Figma URL and passing it to an AI Agent.
  • If you don't have PAT: You need to use WebSocket mode to fetch selected layers in real-time through the Figma plugin.

For detailed differences between each method, see the Installation section below.

claude mcp add seed-design-figma \
  --env FIGMA_PERSONAL_ACCESS_TOKEN=${FIGMA_PERSONAL_ACCESS_TOKEN} \
  -- bunx -y @seed-design/mcp@latest

Installation

Choose Figma Access Method

Fetch layer information using Figma URL and Personal Access Token.

  1. Issue a Personal Access Token from Figma Settings.

Grant the following permissions to the token:

  • file_content:read
  • file_metadata:read
  • file_variables:read
  • library_assets:read
  • library_content:read
  • team_library_content:read
  • file_dev_resources:read
  1. Allow the MCP to use the token through an environment variable. Set the FIGMA_PERSONAL_ACCESS_TOKEN environment variable in the Register MCP Server step.

Register MCP Server

Limiting Tool Scope with --mode Option

When running the MCP server, specify the --mode option to register only tools available in that mode, reducing context size.

If the --mode option is not provided, the default all mode is used.

ModeToolsNote
all (default)Register all toolsIf PAT exists, REST is prioritized; WS-only tools use WS
restREST API tools onlyWS-only tools like get_selection are not registered
websocketWebSocket tools onlyAll tools currently work with WebSocket; PAT is ignored

You must set the FIGMA_PERSONAL_ACCESS_TOKEN environment variable.

If you always use only REST API, you can add the --mode=rest flag.

.mcp.json
{
  "mcpServers": {
    "seed-design-figma": {
      "command": "bunx",
      "args": ["-y", "@seed-design/mcp@latest"],
      "env": {
        "FIGMA_PERSONAL_ACCESS_TOKEN": "${FIGMA_PERSONAL_ACCESS_TOKEN}"
      }
    }
  }
}

Using the Tool

  1. Copy the layer URL from Figma (⌘ + L).
  2. Request from the LLM tool.
Please get the React code for this layer: https://www.figma.com/design/abc123/MyDesign?node-id=123-456

Main Tools List

REST API + WebSocket Common

When passing a Figma URL or fileKey + nodeId, it works via REST API; when passing only nodeId, it works via WebSocket. Registered in all modes.

ToolDescription
get_node_infoReturns structural information of a layer.
get_nodes_infoReturns structural information of multiple layers at once.
get_node_react_codeGenerates React code for a layer.
get_component_infoReturns component key and property definitions.
find_nodesSearch child layers by name (regex) and return ID list.
export_node_as_imageRenders layer as image (PNG, JPG) and returns it.
export_node_as_svgReturns layer as SVG markup (text).
get_annotationsRetrieves Annotations from layer and child layers.
retrieve_color_variable_namesReturns list of Crispy color variable names.

WebSocket Only

Requires communication with Figma plugin. Registered in websocket or all mode.

ToolDescription
get_selectionReturns ID of currently selected layer.
get_document_infoReturns information about the currently open Figma document.
add_annotationsAdds Annotations to a layer.
join_channelJoin a specific channel.

Table of contents