Enables real-time reading and manipulation of Figma documents through 62 operations including creating shapes, modifying styles, managing components, configuring auto-layout, performing boolean operations, and exporting assets via a WebSocket bridge to a Figma plugin.
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
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:
For Claude Desktop:
Edit your config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Then restart Claude Desktop.
Install the Figma plugin:
Download the
pluginfolder from this repoIn 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
Clone the repository
git clone https://github.com/magic-spells/figma-mcp-bridge.git cd figma-mcp-bridge npm installAdd to Claude Code
claude mcp add figma-mcp-bridge node /path/to/figma-mcp-bridge/src/index.jsInstall the Figma plugin
In Figma: Plugins → Development → Import plugin from manifest
Select
plugin/manifest.jsonfrom the cloned repo
Connect
Open a Figma file
Run the plugin: Plugins → Development → Claude Figma Bridge
The status should show "Connected"
Configuration
Environment Variables
Variable | Default | Description |
|
| WebSocket server port (auto-increments if busy) |
Auto-approve Figma Tools
Add to .claude/settings.local.json:
Commands Reference
Query Commands
figma_get_context
Get the current Figma document context including file info, current page, and selection.
Parameter | Type | Description |
(none) |
figma_list_pages
List all pages in the current Figma document.
Parameter | Type | Description |
(none) |
figma_get_nodes
Get detailed information about specific nodes by their IDs.
Parameter | Type | Required | Description |
| string[] | Yes | Array of node IDs (e.g.,
) |
| string | No | Detail level:
,
, or
(default) |
figma_get_local_styles
List all local styles defined in the document.
Parameter | Type | Required | Description |
| string | No | Filter:
,
,
,
, or
(default) |
figma_get_local_variables
Get all local variables and variable collections.
Parameter | Type | Required | Description |
| string | No | Filter:
,
,
,
, or
(default) |
Note: Can return 25k+ tokens. Prefer
figma_search_variablesfor efficiency.
figma_get_children
Get immediate children of a node. Efficient for browsing hierarchy one level at a time.
Parameter | Type | Required | Default | Description |
| string | Yes | Node ID to get children of | |
| boolean | No |
| Return minimal data |
figma_search_nodes
Search for nodes by name within a scope. Preferred for finding specific frames, sections, or elements.
Parameter | Type | Required | Default | Description |
| string | Yes | Scope to search (page/frame/section ID) | |
| string | No | Case-insensitive substring match | |
| string | No | Glob pattern with wildcards (e.g.,
) | |
| string[] | No | Filter by node types:
,
,
,
,
,
, etc. | |
| number | No |
| Search depth (-1 = unlimited, 1 = immediate children) |
| boolean | No |
| Return minimal data |
| number | No |
| Maximum 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.
Parameter | Type | Required | Default | Description |
| string | No | Case-insensitive substring match | |
| string | No | Glob pattern with wildcards | |
| boolean | No |
| Include individual variants from component sets |
| boolean | No |
| Return minimal data |
| number | No |
| Maximum results |
figma_search_styles
Search local styles by name. More efficient than figma_get_local_styles when looking for specific styles.
Parameter | Type | Required | Default | Description |
| string | No | Case-insensitive substring match | |
| string | No |
| Filter:
,
,
,
,
|
| boolean | No |
| Return minimal data |
| number | No |
| Maximum results |
Creation Commands
figma_create_rectangle
Create a new rectangle.
Parameter | Type | Required | Default | Description |
| number | No |
| X position |
| number | No |
| Y position |
| number | No |
| Width in pixels |
| number | No |
| Height in pixels |
| string | No |
| Node name |
| color | No | Fill color | |
| string | No | Parent node ID |
figma_create_ellipse
Create an ellipse, circle, arc, or ring.
Parameter | Type | Required | Default | Description |
| number | No |
| X position |
| number | No |
| Y position |
| number | No |
| Width (diameter for circle) |
| number | No |
| Height |
| string | No |
| Node name |
| color | No | Fill color | |
| string | No | Parent node ID | |
| number | No | Starting angle in radians | |
| number | No | Ending angle in radians | |
| number | No | Inner radius ratio (0-1) for rings |
figma_create_line
Create a line.
Parameter | Type | Required | Default | Description |
| number | No |
| X position |
| number | No |
| Y position |
| number | No |
| Line length |
| number | No |
| Rotation in degrees |
| number | No |
| Stroke weight |
| color | No | Stroke color | |
| string | No |
| Cap:
,
,
,
,
|
| string | No |
| Node name |
| string | No | Parent node ID |
figma_create_frame
Create a frame container (supports auto-layout).
Parameter | Type | Required | Default | Description |
| number | No |
| X position |
| number | No |
| Y position |
| number | No |
| Width |
| number | No |
| Height |
| string | No |
| Node name |
| color | No | Fill color | |
| string | No | Parent node ID |
figma_create_text
Create a text node.
Parameter | Type | Required | Default | Description |
| number | No |
| X position |
| number | No |
| Y position |
| string | No |
| Text content |
| number | No |
| Font size |
| string | No |
| Font family |
| string | No |
| Font style |
| color | No | Text color | |
| string | No |
| Node name |
| string | No | Parent node ID |
figma_clone_nodes
Clone (duplicate) nodes.
Parameter | Type | Required | Default | Description |
| string[] | Yes | Node IDs to clone | |
| string | No | Parent for clones | |
| number | No |
| X offset from original |
| number | No |
| Y offset from original |
figma_create_component
Create a reusable component.
Parameter | Type | Required | Default | Description |
| string | No | Convert existing node to component | |
| number | No |
| X position |
| number | No |
| Y position |
| number | No |
| Width |
| number | No |
| Height |
| string | No |
| Component name |
| color | No | Fill color | |
| string | No | Parent node ID | |
| string | No | Component description |
figma_create_instance
Create an instance of a component.
Parameter | Type | Required | Description |
| string | Yes | Component ID to instantiate |
| number | No | X position |
| number | No | Y position |
| string | No | Parent node ID |
| string | No | Instance name |
Style Commands
figma_set_fills
Set fill color on a node.
Parameter | Type | Required | Description |
| string | Yes | Node to modify |
| color | Yes | Fill 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.
Parameter | Type | Required | Description |
| string | Yes | Node to modify |
| color | Yes | Stroke color |
| number | No | Stroke weight in pixels |
figma_set_text
Set text content on a text node.
Parameter | Type | Required | Description |
| string | Yes | Text node to modify |
| string | Yes | New text content |
figma_set_opacity
Set node transparency.
Parameter | Type | Required | Description |
| string | Yes | Node to modify |
| number | Yes | Opacity (0-1) |
figma_set_corner_radius
Set corner radius.
Parameter | Type | Required | Description |
| string | Yes | Node to modify |
| number | No | Uniform radius for all corners |
| number | No | Top-left corner radius |
| number | No | Top-right corner radius |
| number | No | Bottom-left corner radius |
| number | No | Bottom-right corner radius |
figma_set_effects
Set effects (shadows, blurs).
Parameter | Type | Required | Description |
| string | Yes | Node to modify |
| array | Yes | Array of effect objects |
Shadow effect:
Blur effect:
figma_apply_style
Apply a local style to a node.
Parameter | Type | Required | Description |
| string | Yes | Node to apply style to |
| string | Yes | Style ID |
| string | Yes | Property:
,
,
,
,
|
figma_set_variable
Set variable value or bind to node property.
Parameter | Type | Required | Description |
| string | Yes | Variable ID |
| string | No | Mode ID (for setting value) |
| any | No | Value to set |
| string | No | Node ID (for binding) |
| string | No | Field to bind (
,
,
, etc.) |
| number | No | Paint array index for fills/strokes (default 0) |
Layout Commands
figma_set_auto_layout
Configure auto-layout on a frame.
Parameter | Type | Required | Description |
| string | Yes | Frame to configure |
| string | No |
,
,
|
| string | No |
,
|
| string | No |
,
|
| string | No |
,
,
,
|
| string | No |
,
,
,
|
| number | No | Top padding |
| number | No | Right padding |
| number | No | Bottom padding |
| number | No | Left padding |
| number | No | Space between items |
| number | No | Space between rows when wrapped |
| string | No |
,
|
figma_set_layout_align
Set child alignment in auto-layout.
Parameter | Type | Required | Description |
| string | Yes | Child node to modify |
| string | No |
,
,
,
,
|
| number | No | Growth factor (0-1) |
| string | No |
,
|
Transform Commands
figma_move_nodes
Move nodes to a new position.
Parameter | Type | Required | Description |
| string[] | Yes | Nodes to move |
| number | No | X position or offset |
| number | No | Y position or offset |
| boolean | No | If true, x/y are offsets (default false) |
figma_resize_nodes
Resize nodes.
Parameter | Type | Required | Description |
| string[] | Yes | Nodes to resize |
| number | No | New width |
| number | No | New height |
figma_delete_nodes
Delete nodes.
Parameter | Type | Required | Description |
| string[] | Yes | Nodes to delete |
figma_group_nodes
Group multiple nodes.
Parameter | Type | Required | Default | Description |
| string[] | Yes | Nodes to group | |
| string | No |
| Group name |
figma_ungroup_nodes
Ungroup group nodes.
Parameter | Type | Required | Description |
| string[] | Yes | Group nodes to ungroup |
figma_rename_node
Rename nodes.
Parameter | Type | Required | Description |
| string | No | Single node ID |
| string[] | No | Batch node IDs |
| string | Yes | New name |
figma_reorder_node
Change z-order (layer order).
Parameter | Type | Required | Description |
| string | Yes | Node to reorder |
| string/number | Yes |
,
, or index number |
figma_set_constraints
Set resize constraints (non-auto-layout frames only).
Parameter | Type | Required | Description |
| string | Yes | Node to configure |
| string | No |
,
,
,
,
|
| string | No |
,
,
,
,
|
Navigation Commands
figma_set_selection
Set the current selection.
Parameter | Type | Required | Description |
| string[] | Yes | Nodes to select (empty to clear) |
figma_set_current_page
Switch to a different page.
Parameter | Type | Required | Description |
| string | Yes | Page ID to switch to |
Export Commands
figma_export_node
Export a node as an image.
Parameter | Type | Required | Default | Description |
| string | Yes | Node to export | |
| string | No |
| Format:
,
,
,
|
| number | No |
| Export scale (1 = 100%) |
Returns base64-encoded data.
Component Commands
figma_detach_instance
Detach instance from component (converts to frame).
Parameter | Type | Required | Description |
| string | Yes | Instance to detach |
Token Optimization
Variable Queries
Use figma_search_variables instead of figma_get_local_variables:
figma_search_variables
Parameter | Type | Default | Description |
| string | Wildcard pattern (
= any chars) | |
| string |
| Variable type filter |
| string | Collection name filter | |
| boolean |
| Minimal data (id, name, value only) |
| number |
| Max results |
Node Traversal
Use the depth parameter in figma_get_nodes:
Depth | Properties | Use Case |
| ~5 | Tree traversal, finding nodes |
| ~10 | Layout inspection |
| ~40 | Detailed node editing |
Finding Nodes
Use search tools instead of traversing the full tree:
Tool | Use Case | Token Efficiency |
| Find frames/elements by name | ~50 tokens/node |
| Browse hierarchy level-by-level | ~50 tokens/node |
| Find specific components | ~50 tokens/result |
| Find 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
lengthparameterVectors only support M, L, Q, C, Z commands (no arcs)
detachInstance()also detaches ancestor instances30-second timeout on all commands
Troubleshooting
Plugin Not Connecting
Ensure the MCP server is running
Check the port: default is 3055, or set
FIGMA_BRIDGE_PORTRestart the plugin in Figma
Click "Reconnect" in the plugin UI
Port Already in Use
The server automatically tries ports 3055-3070. To use a specific port:
Multiple Claude Code Instances
Each Claude Code instance can work with a different Figma file by using different ports:
First instance: Use default port 3055
Second instance: Set
FIGMA_BRIDGE_PORT=3056In 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