@figmcp/mcp-server
v1.3.1
Published
MCP Server for Figma - Connect Claude to Figma via Model Context Protocol
Maintainers
Readme
@figmcp/mcp-server
MCP (Model Context Protocol) Server for Figma - Connect Claude to Figma for AI-powered design workflows.
Installation
npm install @figmcp/mcp-serverOr use directly with npx:
npx @figmcp/mcp-serverQuick Start
1. Start the WebSocket Relay Server
# Using Docker (recommended)
docker run -d -p 3055:3055 -p 3056:3056 vanitax/figmcp-relay
# With authentication enabled
docker run -d -p 3055:3055 -p 3056:3056 \
-e AUTH_REQUIRED=true \
-e OP_SERVICE_ACCOUNT_TOKEN=your-token \
-e OP_API_KEYS_VAULT_REF=op://vault/item \
vanitax/figmcp-relayOr with docker-compose:
services:
figmcp-relay:
image: vanitax/figmcp-relay
ports:
- "3055:3055"
- "3056:3056"
environment:
- AUTH_REQUIRED=true
- OP_SERVICE_ACCOUNT_TOKEN=${OP_SERVICE_ACCOUNT_TOKEN}
- OP_API_KEYS_VAULT_REF=${OP_API_KEYS_VAULT_REF}2. Install the Figma Plugin
- In Figma: Plugins → Development → Import plugin from manifest
- Select the
manifest.jsonfile from the plugin package
3. Configure Claude Code
Add to your MCP configuration (.mcp.json or ~/.claude/mcp_servers.json):
{
"mcpServers": {
"figmcp": {
"command": "npx",
"args": ["@figmcp/mcp-server"],
"env": {
"FIGMCP_API_KEY": "your-api-key"
}
}
}
}4. Connect
- Open Figma and run the FigMCP plugin
- Enter your API key in the plugin's Advanced settings
- Click Connect
- In Claude Code, the Figma tools will be available
Environment Variables
MCP Server
| Variable | Default | Description |
|----------|---------|-------------|
| FIGMCP_API_KEY | - | API key for authentication |
| FIGMCP_WS_URL | ws://localhost:3055 | WebSocket relay server URL |
| FIGMCP_HTTP_URL | http://localhost:3056 | HTTP API URL |
Relay Server
| Variable | Default | Description |
|----------|---------|-------------|
| AUTH_REQUIRED | false | Enable authentication |
| OP_SERVICE_ACCOUNT_TOKEN | - | 1Password service account token |
| OP_API_KEYS_VAULT_REF | - | 1Password vault reference (op://vault/item) |
| TOKEN_REFRESH_INTERVAL | 300000 | Token refresh interval (ms) |
| RATE_LIMIT_MAX | 50 | WebSocket rate limit (msg/sec) |
| HTTP_RATE_LIMIT_MAX | 100 | HTTP rate limit (req/min) |
Available Tools
Connection
list_figma_channels- List available Figma plugin channelsconnect_to_figma- Connect to a Figma pluginget_connection_status- Check connection status
Document
get_document_info- Get document informationget_current_page- Get current page infoget_selection- Get selected nodesget_node_info- Get node detailsfocus_node- Focus viewport on a node
Creation
create_frame- Create a framecreate_rectangle- Create a rectanglecreate_ellipse- Create an ellipse/circlecreate_line- Create a linecreate_vector- Create a vector path (SVG)create_polygon- Create a polygoncreate_star- Create a starcreate_text- Create textcreate_component- Create a componentcreate_instance- Create component instancegroup_nodes- Group nodes
Styling
set_fill_color- Set fill colorset_stroke- Set strokeset_corner_radius- Set corner radiusset_opacity- Set opacityset_visible- Set visibilityset_rotation- Set rotationset_effects- Set effects (shadow, blur)
Layout
move_node- Move a noderesize_node- Resize a nodeset_auto_layout- Set auto layout
Manipulation
delete_node- Delete a nodeclone_node- Clone a noderename_node- Rename a nodeset_text_content- Set text contentflatten_node- Flatten to vectorexport_node- Export as image
Batch Operations (Performance)
batch_create- Create multiple nodes in one call (up to 50)batch_edit- Edit multiple nodes in one call (up to 50)
Batch Create Example:
{
"operations": [
{ "type": "frame", "params": { "name": "Card", "width": 300, "height": 200 } },
{ "type": "rectangle", "params": { "name": "BG", "fillColor": "#FFFFFF" } },
{ "type": "text", "params": { "content": "Hello", "fontSize": 16 } }
]
}Batch Edit Example:
{
"operations": [
{ "nodeId": "1:2", "action": "move", "params": { "x": 100, "y": 50 } },
{ "nodeId": "1:3", "action": "setFillColor", "params": { "color": "#FF0000" } },
{ "nodeId": "1:4", "action": "resize", "params": { "width": 200, "height": 100 } }
]
}Architecture
Claude Code ──MCP──> MCP Server ──WebSocket──> Relay Server ──WebSocket──> Figma Plugin
│ │
└── FIGMCP_API_KEY └── 1Password tokensSecurity Features
- HMAC Signature Auth: WebSocket connections authenticated via SHA256 signatures
- Command Signing: Write operations (create/delete) require signed commands
- Rate Limiting: Both WebSocket and HTTP endpoints are rate-limited
- Channel Isolation: Each API key can only access its own channels
- Permission Controls: Plugin-side controls for create/delete operations
License
MIT
