MCP Hub
Back to servers

Figma Bridge

MCP (Model Context Protocol) Server. Bridges Figma documents with external tools through a WebSocket-based dual-architecture system providing node creation, styling, layout management, component handling, and design system automation with token-efficient search capabilities.

pulsemcp
Stars
3
Updated
Dec 1, 2025
Validated
Feb 7, 2026

Figma MCP Bridge

A Model Context Protocol (MCP) server that enables Claude to read and manipulate Figma documents in real-time through a WebSocket bridge to a Figma plugin.

Features

  • 62 Figma operations - Create shapes, modify styles, manage components, export assets
  • Real-time bidirectional communication - Changes appear instantly in Figma
  • Token-optimized queries - Efficient variable search and node traversal for AI interactions
  • Full Figma API access - Styles, variables, auto-layout, boolean operations, and more

Architecture

Claude Code ←──stdio──→ MCP Server ←──WebSocket──→ Figma Plugin ←──→ Figma API
                        (Node.js)    localhost:3055    (runs in Figma)

Quick Start

Prerequisites

  • Node.js 18+
  • Figma desktop app
  • Claude Code CLI or Claude Desktop

Installation

Option A: Install from npm (recommended)

For Claude Code CLI:

claude mcp add figma-mcp-bridge -- npx @magic-spells/figma-mcp-bridge

For Claude Desktop:

Edit your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "figma-mcp-bridge": {
      "command": "npx",
      "args": ["-y", "@magic-spells/figma-mcp-bridge"]
    }
  }
}

Then restart Claude Desktop.

Install the Figma plugin:

  • Download the plugin folder from this repo
  • In Figma: Plugins → Development → Import plugin from manifest
  • Select plugin/manifest.json

Connect:

  • Open a Figma file
  • Run the plugin: Plugins → Development → Claude Figma Bridge
  • The status should show "Connected"

Option B: Install from source

  1. Clone the repository

    git clone https://github.com/magic-spells/figma-mcp-bridge.git
    cd figma-mcp-bridge
    npm install
    
  2. Add to Claude Code

    claude mcp add figma-mcp-bridge node /path/to/figma-mcp-bridge/src/index.js
    
  3. Install the Figma plugin

    • In Figma: Plugins → Development → Import plugin from manifest
    • Select plugin/manifest.json from the cloned repo
  4. Connect

    • Open a Figma file
    • Run the plugin: Plugins → Development → Claude Figma Bridge
    • The status should show "Connected"

Configuration

Environment Variables

VariableDefaultDescription
FIGMA_BRIDGE_PORT3055WebSocket server port (auto-increments if busy)

Auto-approve Figma Tools

Add to .claude/settings.local.json:

{
  "permissions": {
    "allow": ["mcp__figma-mcp-bridge__*"]
  }
}

Commands Reference

Query Commands

figma_get_context

Get the current Figma document context including file info, current page, and selection.

ParameterTypeDescription
(none)

figma_list_pages

List all pages in the current Figma document.

ParameterTypeDescription
(none)

figma_get_nodes

Get detailed information about specific nodes by their IDs.

ParameterTypeRequiredDescription
nodeIdsstring[]YesArray of node IDs (e.g., ["1:23", "4:56"])
depthstringNoDetail level: minimal, compact, or full (default)

figma_get_local_styles

List all local styles defined in the document.

ParameterTypeRequiredDescription
typestringNoFilter: PAINT, TEXT, EFFECT, GRID, or ALL (default)

figma_get_local_variables

Get all local variables and variable collections.

ParameterTypeRequiredDescription
typestringNoFilter: COLOR, FLOAT, STRING, BOOLEAN, or ALL (default)

Note: Can return 25k+ tokens. Prefer figma_search_variables for efficiency.

figma_get_children

Get immediate children of a node. Efficient for browsing hierarchy one level at a time.

ParameterTypeRequiredDefaultDescription
parentIdstringYesNode ID to get children of
compactbooleanNotrueReturn minimal data

figma_search_nodes

Search for nodes by name within a scope. Preferred for finding specific frames, sections, or elements.

ParameterTypeRequiredDefaultDescription
parentIdstringYesScope to search (page/frame/section ID)
nameContainsstringNoCase-insensitive substring match
namePatternstringNoGlob pattern with wildcards (e.g., *button*)
typesstring[]NoFilter by node types: FRAME, TEXT, SECTION, COMPONENT, INSTANCE, GROUP, etc.
maxDepthnumberNo-1Search depth (-1 = unlimited, 1 = immediate children)
compactbooleanNotrueReturn minimal data
limitnumberNo50Maximum results

Returns ~50 tokens/node vs ~500 for full node data.

figma_search_components

Search local components by name. Use when looking for specific components like "Button", "Header", etc.

ParameterTypeRequiredDefaultDescription
nameContainsstringNoCase-insensitive substring match
namePatternstringNoGlob pattern with wildcards
includeVariantsbooleanNofalseInclude individual variants from component sets
compactbooleanNotrueReturn minimal data
limitnumberNo50Maximum results

figma_search_styles

Search local styles by name. More efficient than figma_get_local_styles when looking for specific styles.

ParameterTypeRequiredDefaultDescription
nameContainsstringNoCase-insensitive substring match
typestringNo"ALL"Filter: PAINT, TEXT, EFFECT, GRID, ALL
compactbooleanNotrueReturn minimal data
limitnumberNo50Maximum results

Creation Commands

figma_create_rectangle

Create a new rectangle.

ParameterTypeRequiredDefaultDescription
xnumberNo0X position
ynumberNo0Y position
widthnumberNo100Width in pixels
heightnumberNo100Height in pixels
namestringNo"Rectangle"Node name
fillscolorNoFill color
parentIdstringNoParent node ID

figma_create_ellipse

Create an ellipse, circle, arc, or ring.

ParameterTypeRequiredDefaultDescription
xnumberNo0X position
ynumberNo0Y position
widthnumberNo100Width (diameter for circle)
heightnumberNo100Height
namestringNo"Ellipse"Node name
fillscolorNoFill color
parentIdstringNoParent node ID
arcData.startingAnglenumberNoStarting angle in radians
arcData.endingAnglenumberNoEnding angle in radians
arcData.innerRadiusnumberNoInner radius ratio (0-1) for rings

figma_create_line

Create a line.

ParameterTypeRequiredDefaultDescription
xnumberNo0X position
ynumberNo0Y position
lengthnumberNo100Line length
rotationnumberNo0Rotation in degrees
strokeWeightnumberNo1Stroke weight
strokescolorNoStroke color
strokeCapstringNo"NONE"Cap: NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL
namestringNo"Line"Node name
parentIdstringNoParent node ID

figma_create_frame

Create a frame container (supports auto-layout).

ParameterTypeRequiredDefaultDescription
xnumberNo0X position
ynumberNo0Y position
widthnumberNo100Width
heightnumberNo100Height
namestringNo"Frame"Node name
fillscolorNoFill color
parentIdstringNoParent node ID

figma_create_text

Create a text node.

ParameterTypeRequiredDefaultDescription
xnumberNo0X position
ynumberNo0Y position
textstringNo"Text"Text content
fontSizenumberNo16Font size
fontFamilystringNo"Inter"Font family
fontStylestringNo"Regular"Font style
fillscolorNoText color
namestringNo"Text"Node name
parentIdstringNoParent node ID

figma_clone_nodes

Clone (duplicate) nodes.

ParameterTypeRequiredDefaultDescription
nodeIdsstring[]YesNode IDs to clone
parentIdstringNoParent for clones
offset.xnumberNo20X offset from original
offset.ynumberNo20Y offset from original

figma_create_component

Create a reusable component.

ParameterTypeRequiredDefaultDescription
fromNodeIdstringNoConvert existing node to component
xnumberNo0X position
ynumberNo0Y position
widthnumberNo100Width
heightnumberNo100Height
namestringNo"Component"Component name
fillscolorNoFill color
parentIdstringNoParent node ID
descriptionstringNoComponent description

figma_create_instance

Create an instance of a component.

ParameterTypeRequiredDescription
componentIdstringYesComponent ID to instantiate
xnumberNoX position
ynumberNoY position
parentIdstringNoParent node ID
namestringNoInstance name

Style Commands

figma_set_fills

Set fill color on a node.

ParameterTypeRequiredDescription
nodeIdstringYesNode to modify
fillscolorYesFill color

Color formats:

  • Hex: { color: "#FF0000" } or { color: "#FF0000AA" } (with alpha)
  • RGB: { r: 1, g: 0, b: 0, a: 0.5 }
  • Full array: [{ type: "SOLID", color: { r, g, b }, opacity: 1 }]

figma_set_strokes

Set stroke color on a node.

ParameterTypeRequiredDescription
nodeIdstringYesNode to modify
strokescolorYesStroke color
strokeWeightnumberNoStroke weight in pixels

figma_set_text

Set text content on a text node.

ParameterTypeRequiredDescription
nodeIdstringYesText node to modify
textstringYesNew text content

figma_set_opacity

Set node transparency.

ParameterTypeRequiredDescription
nodeIdstringYesNode to modify
opacitynumberYesOpacity (0-1)

figma_set_corner_radius

Set corner radius.

ParameterTypeRequiredDescription
nodeIdstringYesNode to modify
radiusnumberNoUniform radius for all corners
topLeftnumberNoTop-left corner radius
topRightnumberNoTop-right corner radius
bottomLeftnumberNoBottom-left corner radius
bottomRightnumberNoBottom-right corner radius

figma_set_effects

Set effects (shadows, blurs).

ParameterTypeRequiredDescription
nodeIdstringYesNode to modify
effectsarrayYesArray of effect objects

Shadow effect:

{
  "type": "DROP_SHADOW",
  "color": { "color": "#000000" },
  "offset": { "x": 0, "y": 4 },
  "radius": 8,
  "spread": 0,
  "visible": true
}

Blur effect:

{
  "type": "LAYER_BLUR",
  "radius": 10,
  "visible": true
}

figma_apply_style

Apply a local style to a node.

ParameterTypeRequiredDescription
nodeIdstringYesNode to apply style to
styleIdstringYesStyle ID
propertystringYesProperty: fills, strokes, text, effects, grid

figma_set_variable

Set variable value or bind to node property.

ParameterTypeRequiredDescription
variableIdstringYesVariable ID
modeIdstringNoMode ID (for setting value)
valueanyNoValue to set
nodeIdstringNoNode ID (for binding)
fieldstringNoField to bind (opacity, cornerRadius, fills, etc.)
paintIndexnumberNoPaint array index for fills/strokes (default 0)

Layout Commands

figma_set_auto_layout

Configure auto-layout on a frame.

ParameterTypeRequiredDescription
nodeIdstringYesFrame to configure
layoutModestringNoNONE, HORIZONTAL, VERTICAL
primaryAxisSizingModestringNoFIXED, AUTO
counterAxisSizingModestringNoFIXED, AUTO
primaryAxisAlignItemsstringNoMIN, CENTER, MAX, SPACE_BETWEEN
counterAxisAlignItemsstringNoMIN, CENTER, MAX, BASELINE
paddingTopnumberNoTop padding
paddingRightnumberNoRight padding
paddingBottomnumberNoBottom padding
paddingLeftnumberNoLeft padding
itemSpacingnumberNoSpace between items
counterAxisSpacingnumberNoSpace between rows when wrapped
layoutWrapstringNoNO_WRAP, WRAP

figma_set_layout_align

Set child alignment in auto-layout.

ParameterTypeRequiredDescription
nodeIdstringYesChild node to modify
layoutAlignstringNoMIN, CENTER, MAX, STRETCH, INHERIT
layoutGrownumberNoGrowth factor (0-1)
layoutPositioningstringNoAUTO, ABSOLUTE

Transform Commands

figma_move_nodes

Move nodes to a new position.

ParameterTypeRequiredDescription
nodeIdsstring[]YesNodes to move
xnumberNoX position or offset
ynumberNoY position or offset
relativebooleanNoIf true, x/y are offsets (default false)

figma_resize_nodes

Resize nodes.

ParameterTypeRequiredDescription
nodeIdsstring[]YesNodes to resize
widthnumberNoNew width
heightnumberNoNew height

figma_delete_nodes

Delete nodes.

ParameterTypeRequiredDescription
nodeIdsstring[]YesNodes to delete

figma_group_nodes

Group multiple nodes.

ParameterTypeRequiredDefaultDescription
nodeIdsstring[]YesNodes to group
namestringNo"Group"Group name

figma_ungroup_nodes

Ungroup group nodes.

ParameterTypeRequiredDescription
nodeIdsstring[]YesGroup nodes to ungroup

figma_rename_node

Rename nodes.

ParameterTypeRequiredDescription
nodeIdstringNoSingle node ID
nodeIdsstring[]NoBatch node IDs
namestringYesNew name

figma_reorder_node

Change z-order (layer order).

ParameterTypeRequiredDescription
nodeIdstringYesNode to reorder
positionstring/numberYes"front", "back", or index number

figma_set_constraints

Set resize constraints (non-auto-layout frames only).

ParameterTypeRequiredDescription
nodeIdstringYesNode to configure
horizontalstringNoMIN, CENTER, MAX, STRETCH, SCALE
verticalstringNoMIN, CENTER, MAX, STRETCH, SCALE

Navigation Commands

figma_set_selection

Set the current selection.

ParameterTypeRequiredDescription
nodeIdsstring[]YesNodes to select (empty to clear)

figma_set_current_page

Switch to a different page.

ParameterTypeRequiredDescription
pageIdstringYesPage ID to switch to

Export Commands

figma_export_node

Export a node as an image.

ParameterTypeRequiredDefaultDescription
nodeIdstringYesNode to export
formatstringNo"PNG"Format: PNG, SVG, JPG, PDF
scalenumberNo1Export scale (1 = 100%)

Returns base64-encoded data.


Component Commands

figma_detach_instance

Detach instance from component (converts to frame).

ParameterTypeRequiredDescription
nodeIdstringYesInstance to detach

Token Optimization

Variable Queries

Use figma_search_variables instead of figma_get_local_variables:

// Inefficient (~25k+ tokens)
figma_get_local_variables({ type: 'ALL' })

// Efficient (~500 tokens)
figma_search_variables({
  namePattern: 'tailwind/orange/*',
  type: 'COLOR',
  compact: true,
  limit: 50
})

figma_search_variables parameters:

ParameterTypeDefaultDescription
namePatternstringWildcard pattern (* = any chars)
typestring"ALL"Variable type filter
collectionNamestringCollection name filter
compactbooleantrueMinimal data (id, name, value only)
limitnumber50Max results

Node Traversal

Use the depth parameter in figma_get_nodes:

DepthPropertiesUse Case
minimal~5Tree traversal, finding nodes
compact~10Layout inspection
full~40Detailed node editing

Finding Nodes

Use search tools instead of traversing the full tree:

// Find nodes by name within a page/frame
figma_search_nodes({
  parentId: '1:2',           // Required scope
  nameContains: 'button',    // Case-insensitive
  types: ['FRAME', 'COMPONENT'],
  compact: true
})

// Browse hierarchy one level at a time
figma_get_children({ parentId: '1:2' })

// Find components by name
figma_search_components({ nameContains: 'Header' })

// Find styles by name
figma_search_styles({ nameContains: 'primary', type: 'PAINT' })
ToolUse CaseToken Efficiency
figma_search_nodesFind frames/elements by name~50 tokens/node
figma_get_childrenBrowse hierarchy level-by-level~50 tokens/node
figma_search_componentsFind specific components~50 tokens/result
figma_search_stylesFind specific styles~30 tokens/result

Known Limitations

  • No ES6 spread operator in plugin code
  • Boolean operations require nodes with same parent
  • Constraints don't work on auto-layout children (use layoutAlign)
  • Lines have height=0, use length parameter
  • Vectors only support M, L, Q, C, Z commands (no arcs)
  • detachInstance() also detaches ancestor instances
  • 30-second timeout on all commands

Troubleshooting

Plugin Not Connecting

  1. Ensure the MCP server is running
  2. Check the port: default is 3055, or set FIGMA_BRIDGE_PORT
  3. Restart the plugin in Figma
  4. Click "Reconnect" in the plugin UI

Port Already in Use

The server automatically tries ports 3055-3070. To use a specific port:

FIGMA_BRIDGE_PORT=3057 node src/index.js

Multiple Claude Code Instances

Each Claude Code instance can work with a different Figma file by using different ports:

  1. First instance: Use default port 3055
  2. Second instance: Set FIGMA_BRIDGE_PORT=3056
  3. In Figma plugin: Change the port number in the plugin UI to match

The plugin UI has a port input field - just change it to connect to a different MCP server.

Commands Timing Out

  • Commands have a 30-second timeout
  • Large exports may timeout; try smaller scales
  • Check plugin is still connected (green status)

Font Errors

Text operations require font loading. The plugin handles this automatically, but if a font isn't installed, it will fail. Use fonts available on your system.


License

MIT

Reviews

No reviews yet

Sign in to write a review