Figma MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Figma MCP ServerCreate a 300x200 frame named 'Hero' on the current page"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Figma MCP Server
An MCP (Model Context Protocol) server that gives AI assistants like Claude full control over Figma — create frames, components, variables, export assets, and build complete UI designs through natural language.
How It Works
Claude / Cursor
↕ stdio (JSON-RPC)
MCP Server (Node.js)
↕ WebSocket
WS Bridge (127.0.0.1:9001)
↕ Plugin API
Figma Plugin (Figma Desktop)You ask Claude to create or modify a design
Claude calls an MCP tool — the MCP server validates the arguments
The server sends a command over a local WebSocket to the bridge
The bridge forwards it to the Figma plugin running in Figma Desktop
The plugin executes
figma.*API calls and returns the resultClaude receives the result and continues building
Prerequisites
Node.js v18 or later
Figma Desktop — the web version does not support plugins with network access
Claude Desktop or Cursor (or any MCP-compatible client)
Installation
1. Clone and install dependencies
git clone https://github.com/your-username/figma-mcp.git
cd figma-mcp
npm install2. Build the project
npm run buildThis compiles src/mcp-server/ and src/websocket-server/ to dist/. The Figma plugin (src/figma-plugin/) is plain JavaScript and needs no compilation.
3. Start the WebSocket bridge
npm run socketFor development with auto-reload:
npm run dev:socketYou should see:
{"level":"info","component":"bridge","msg":"Listening on 127.0.0.1:9001"}4. Load the plugin in Figma Desktop
Open Figma Desktop
Go to Plugins → Development → Import plugin from manifest...
Select
src/figma-plugin/manifest.jsonRun it from Plugins → Development → Figma MCP Bridge
The plugin UI shows "Connected" when the bridge connection is established.
5. Connect your AI client
Claude Desktop
Add to claude_desktop_config.json (find it at ~/Library/Application Support/Claude/ on macOS or %APPDATA%\Claude\ on Windows):
{
"mcpServers": {
"figma": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/figma-mcp/dist/mcp-server/index.js"]
}
}
}Cursor
Add to your MCP config (.cursor/mcp.json or via Cursor Settings → MCP):
{
"mcpServers": {
"figma": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/figma-mcp/dist/mcp-server/index.js"]
}
}
}Replace /ABSOLUTE/PATH/TO/figma-mcp with the actual path to this repo.
Restart your AI client after saving the config. The Figma tools will appear automatically.
Available Tools
67 tools organized into categories:
Reading & Inspection
Tool | Description |
| Get document structure: all pages, top-level frames, and metadata |
| Get all currently selected nodes with their properties |
| Get detailed properties of a specific node by ID |
| Search for nodes by type and/or name pattern across the document |
Creating Shapes & Elements
Tool | Description |
| Create a layout frame — the primary container for UI design |
| Create a rectangle (background fills, dividers, placeholder shapes) |
| Create an ellipse or circle (avatars, status dots, decorative circles) |
| Create a text node with typography settings |
| Create a line (dividers, separators, strokes) |
| Create a regular polygon (triangle, hexagon, etc.) |
| Create a star shape with configurable point count and inner radius |
| Create a vector node from SVG path data |
| Create a node from an SVG markup string |
Modifying Nodes
Tool | Description |
| Update position, size, opacity, visibility, name, or fills of any node |
| Update text content or typography of an existing text node |
| Apply auto layout to a frame for automatic spacing and alignment |
| Set child-level layout properties inside an auto-layout frame |
| Set solid or gradient fills on any node |
| Set stroke (border/outline) with color, dash patterns, and line caps |
| Set individual corner radii for asymmetric rounding |
| Set visual effects: drop shadow, inner shadow, blur, background blur |
| Add a drop shadow for depth and elevation |
| Set the rotation angle of a node in degrees |
| Set layer blend mode (multiply, screen, overlay, etc.) |
| Set responsive pinning/resize constraints |
| Add column, row, or pixel grids to a frame |
| Set underline or strikethrough on a text node |
| Set text case transformation (upper, title, small caps, etc.) |
| Apply bullet or numbered list formatting to a text node |
| Lock or unlock a node to protect it from accidental edits |
Organizing Nodes
Tool | Description |
| Group multiple nodes into a visual group |
| Ungroup a group and move its children to the parent |
| Permanently remove a node and its children |
| Duplicate a node with all its properties and children |
| Move a node to a specific z-order index within its parent |
| Merge a node and its children into a single vector |
| Combine shapes with union, intersect, subtract, or exclude |
Components & Instances
Tool | Description |
| Convert a node into a reusable Figma component |
| Place an instance of an existing component |
| List all components defined in the document |
| Combine multiple components into a variant set |
| Detach an instance from its master component |
| Swap the component an instance references |
| Import a component from a shared library by key |
Style System
Tool | Description |
| Create a reusable color/paint style (design token) |
| Create a reusable text style (typography token) |
| Create a reusable effect style (elevation/shadow token) |
| List all paint, text, and effect styles in the document |
| Apply a style to a node by style ID |
Variables & Design Tokens
Tool | Description |
| Create a variable collection with support for multiple modes (e.g. Light/Dark) |
| Create a design token variable: color, number, string, or boolean |
| Bind a variable to a node property for theme-aware designs |
| List all variable collections and their variables |
Images
Tool | Description |
| Fetch an image from a public URL and apply it as a fill |
| Read a local image file and apply it as a fill |
| Apply an image fill using raw base64 data |
Export
Tool | Description |
| Export a node as PNG, JPG, SVG, or PDF — auto-saved and returned as an image |
Pages & Sections
Tool | Description |
| Create a new page in the Figma document |
| Create a section on the canvas to visually organize frames |
| Navigate to a specific page by ID |
Workflow & Utility
Tool | Description |
| Scroll and zoom the canvas to center on a node |
| Set the canvas selection to specific nodes |
| List all fonts available in the Figma environment |
| Create multiple nodes in a single call |
| Update properties of multiple nodes in a single call |
| Show a toast notification in the Figma UI |
Example Prompts
Landing Page Hero Section
"Create a 1440×900 hero section frame. Add a dark navy background, a large white heading 'Build faster with AI', a subtitle below it in lighter gray, and a blue rounded CTA button. Center everything with auto layout."
Card Component
"Create a card component — 320×400 frame, 12px corner radius, subtle drop shadow, 16px padding. Include a gray image placeholder at the top, a bold title, a description, and a 'Learn more' link at the bottom."
Design System Setup
"Set up a basic design system in this document. Create color styles for Primary (#4F46E5), Background (#F9FAFB), and Text (#111827). Create text styles for Heading H1 (32px bold Inter), Body (16px regular Inter), and Caption (12px regular Inter)."
Component with Variants
"Create a button component with three variants: Primary (blue fill, white text), Secondary (white fill, blue border), and Destructive (red fill, white text). Combine them into a variant set."
Dark/Light Theme with Variables
"Create a variable collection called 'Theme' with Light and Dark modes. Add a 'Background' color variable: white (#FFFFFF) in Light, dark gray (#1A1A2E) in Dark. Add a 'Text/Primary' color variable: dark (#111827) in Light, white (#F9FAFB) in Dark."
Image-Based Layout
"Create a 1200×600 feature section. Fetch the image from https://images.unsplash.com/photo-example and apply it to the left half. On the right half, add a heading and description with auto layout."
Configuration
Environment Variables
Copy .env.example to .env to customize the defaults:
Variable | Default | Description |
|
| Host the bridge binds to — keep loopback-only |
|
| Port the bridge listens on |
|
| WebSocket URL the MCP server connects to |
|
| How long (ms) the MCP server waits for a plugin response |
|
|
|
|
| Set |
| (stderr) | Absolute path to write logs to a file instead of stderr |
Export Directory
Exported nodes are auto-saved to ./exports/ by default. Override with the FIGMA_EXPORT_DIR environment variable:
FIGMA_EXPORT_DIR=/my/designs/exports npm run socketDevelopment
# Build TypeScript
npm run build
# Watch mode (auto-reload bridge)
npm run dev:socket
# Run all tests
npm test
# Watch tests
npm run test:watch
# Coverage report (80% threshold)
npm run test:coverageProject Structure
figma-mcp/
├── src/
│ ├── shared/ # Wire protocol & constants (shared between server and bridge)
│ │ ├── constants.ts # COMMAND_NAMES (single source of truth), defaults
│ │ ├── protocol.ts # Message types, error codes
│ │ ├── index.ts # Barrel re-export
│ │ └── logger/ # Structured logging (pino-based)
│ │ ├── logger.ts # createLogger() factory
│ │ ├── metrics.ts # MetricsCollector (counters, histograms)
│ │ └── redact.ts # Sensitive field redaction
│ │
│ ├── mcp-server/ # MCP server (Claude ↔ bridge)
│ │ ├── index.ts # Server setup, tool registration, server-side tools
│ │ ├── ws-client.ts # WebSocket client with reconnect logic
│ │ ├── request-tracker.ts # Promise-based request/response matching
│ │ └── tools/ # Tool schemas split by category
│ │ ├── index.ts # Merges all partial registries → TOOL_REGISTRY
│ │ ├── shared-schemas.ts # Reusable Zod schemas (RGBAColor, Fill, Typography…)
│ │ ├── read-tools.ts
│ │ ├── create-tools.ts
│ │ ├── modify-tools.ts
│ │ ├── organize-tools.ts
│ │ ├── viewport-tools.ts
│ │ ├── style-tools.ts
│ │ ├── layout-tools.ts
│ │ ├── component-tools.ts
│ │ ├── style-system-tools.ts
│ │ ├── image-tools.ts
│ │ ├── export-tools.ts
│ │ ├── typography-tools.ts
│ │ ├── constraint-tools.ts
│ │ ├── batch-tools.ts
│ │ ├── vector-tools.ts
│ │ ├── page-tools.ts
│ │ ├── traversal-tools.ts
│ │ ├── variable-tools.ts
│ │ ├── workflow-tools.ts
│ │ ├── design-system-tools.ts
│ │ ├── manipulation-tools.ts
│ │ └── extra-shape-tools.ts
│ │
│ ├── websocket-server/ # WebSocket bridge (routes commands between MCP and plugin)
│ │ ├── index.ts # FigmaBridge class and entry point
│ │ ├── config.ts # BridgeConfig + loadConfig()
│ │ └── validation.ts # Message validation, ProtocolError
│ │
│ └── figma-plugin/ # Figma plugin (plain JS, no build step)
│ ├── manifest.json # Plugin manifest
│ ├── code.js # Plugin sandbox — handles all figma.* API calls
│ └── ui.html # Hidden iframe — holds the WebSocket connection
│
├── tests/
│ ├── mcp-server/
│ │ ├── tools.test.ts # Zod schema validation for all tools
│ │ └── request-tracker.test.ts
│ ├── websocket-server/
│ │ └── bridge.test.ts # Bridge routing and client management
│ ├── integration/
│ │ └── roundtrip.test.ts # Full MCP → bridge → mock plugin round-trips
│ └── shared/
│ ├── logger.test.ts
│ └── metrics.test.ts
│
├── exports/ # Auto-created when export_node is used
├── logs/ # Optional log output directory
├── .env.example # Environment variable reference
├── package.json
├── tsconfig.json
└── vitest.config.tsTroubleshooting
Plugin shows "Disconnected" or never connects
Make sure
npm run socketis running and shows "Listening on 127.0.0.1:9001"Confirm the plugin is active in Plugins → Development → Figma MCP Bridge
If port 9001 is in use by another process, change the port:
WS_PORT=9002 npm run socketThen update
WS_URLin.envto match.
Commands time out
Confirm the plugin shows "Connected" — commands cannot reach Figma without an active connection
Font operations (text nodes) load fonts asynchronously — the default 30s timeout handles most cases
For slow operations, increase the timeout:
WS_TIMEOUT_MS=60000Check that Figma Desktop is responsive and not showing any error dialogs
Bridge port already in use (EADDRINUSE)
A previous bridge process is still running. On macOS/Linux:
lsof -i :9001
kill <PID>On Windows (PowerShell):
Get-Process -Id (Get-NetTCPConnection -LocalPort 9001).OwningProcess | Stop-ProcessMCP tools do not appear in Claude / Cursor
Make sure
npm run buildcompleted without TypeScript errorsVerify the absolute path in your MCP config points to
dist/mcp-server/index.jsRestart your AI client after every config change
Check your client's MCP logs for connection errors
Images not loading (set_image_from_url)
The URL must be publicly accessible (no auth, no paywalls)
Supported formats: PNG, JPEG, GIF, WebP, SVG
Maximum file size: 5 MB (oversized images are auto-optimized before being sent)
Architecture Notes
Security: The bridge binds to
127.0.0.1only — it is never exposed to the network. The plugin'snetworkAccess.allowedDomainsis set tononein production.Message size: Maximum WebSocket message is 8 MB to support high-resolution image fills.
Reconnection: The plugin auto-reconnects with exponential backoff (1s base, 2× multiplier, 30s max) if the bridge restarts.
Server-side tools:
set_image_from_urlandset_image_from_pathrun entirely in Node.js (fetch + encode) and forward toset_image_fill— they never require extra plugin code.Logging: All Node.js logs go to stderr to avoid corrupting MCP's JSON-RPC on stdout. Set
LOG_PRETTY=truefor readable development output.
Contributing
Add the command name to
COMMAND_NAMESinsrc/shared/constants.tsCreate the tool schema in the appropriate file under
src/mcp-server/tools/Add the handler in
src/figma-plugin/code.jsAdd the command to
ALLOWED_COMMANDSin bothcode.jsandui.htmlAdd tests in
tests/mcp-server/tools.test.ts
See CLAUDE.md for the full contributor guide.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hadi21k/figma-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server