Figma Agent MCP
ā” Figma Agent MCP
Local-first AI Design Agent for Figma via Model Context Protocol (MCP) ā WebSocket Bridge ā Native Figma Plugin.
Inspect, create, mutate, style, validate, and optimize Figma designs natively with deterministic typed tools, design-system awareness, token compression, and turnkey composite workflows.
šļø System Architecture
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā AI Client (Claude / Cursor / Antigravity / LLM) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā MCP Protocol (stdio / Hardened SSE)
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā MCP Server (@figma-agent/mcp-server ā 50 Tools) ā
ā - Tool Registry & Validation - Session Router ā
ā - Context Compiler (Compact) - Composite Skills Runtime ā
ā - Design System Resolver - Semantic Token Matching ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Command Engine (@figma-agent/command-engine) ā
ā - Batch Command Pipeline - Scoped Idempotency Cache ā
ā - Symbolic Ref Resolution - Compensating Node Cleanup ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Local WebSocket (ws://127.0.0.1:3055)
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Bridge Server (@figma-agent/bridge-server) ā
ā - Channel Pairing (128-bit) - Request/Response Matcher ā
ā - Heartbeat & Auto-reconnect - 50+ Concurrent Sockets ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Figma Plugin (@figma-agent/figma-plugin) ā
ā - Typed Command Dispatcher - Pure Font Engine ā
ā - Native Node Mutation - Zero External Dependencies ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Figma Plugin API
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Figma Canvas ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāš Key Highlights
š Local-First & Secure: Binds to
127.0.0.1by default. 128-bit secret channel pairing. No arbitrary JavaScript execution inside Figma. Hardened SSE transport with Bearer token authentication and origin allowlists.š§© 50 Deterministic MCP Tools: Comprehensive coverage across Read, Create, Mutate, Auto Layout, Visual Styles, Components, Variables/Tokens, Typography, Export, and Design System Resolution.
šÆ Semantic Design-System Resolver: Bridges human intent (
"primary button","#6366F1") to matching Components and Tokens with perceptual color distance ($\Delta E$) and automated node auditing.ā” Context Compiler & Pruning: Compresses massive node trees into semantic Markdown or Compact DSL with adaptive depth pruning and token budget enforcement under 100ms. Typically achieves substantial context reduction; benchmark fixtures show >70% reduction in tested scenarios.
š”ļø Built-in Validation & WCAG 2.1 Engine: Relative luminance and contrast ratio calculation (AA/AAA) for normal text, large text, and UI components; Auto Layout linter; 4px/8px token grid auditor.
š Sequential Batch Execution & Cleanup: High-throughput execution of command pipelines with dynamic symbolic ref resolution, SHA-256 idempotency deduplication with conflict detection, and compensating creation rollback on failure.
š Turnkey Agent Skills: Pre-packaged composite workflows for instant Design System generation, WCAG accessibility auto-repair, and wireframe-to-hifi card conversion.
š¦ Monorepo Layout
figma-agent-mcp/
āāā apps/
ā āāā mcp-server/ # 50 MCP Tools + Bridge Client + Session Service + Hardened SSE
ā āāā bridge-server/ # High-throughput WebSocket router (ws) with 128-bit key pairing
ā āāā figma-plugin/ # Pure TypeScript native Figma Plugin (IIFE bundle)
āāā packages/
ā āāā protocol/ # CommandEnvelope, CommandResult, Error codes, Zod schemas
ā āāā figma-schema/ # Canonical FigmaCommandMap, Layout, Style, Text schemas
ā āāā command-engine/ # Batch execution pipeline, transactions, scoped idempotency
ā āāā context-compiler/ # Token optimizer, tree pruner, Markdown & DSL serializers
ā āāā design-system/ # 4px/8px Spacing, Typography & Corner Radius scale matchers
ā āāā validator/ # WCAG 2.1 contrast engine, Auto Layout & design token rules
ā āāā skill-runtime/ # Strictly-typed composite skills runtime & execution engine
ā āāā telemetry/ # Percentile metrics collector (p50, p95, p99)
ā āāā shared/ # Hex/RGBA converters, Pino logger, host validation helpers
āāā tests/
āāā integration/ # 33 Vitest suites (171 tests) covering all phases & benchmarksš Quickstart & Setup
1. Build the Monorepo
git clone https://github.com/TrungLee003/figma-agent-mcp.git
cd figma-agent-mcp
pnpm install
pnpm build2. Start the Bridge Server
pnpm --filter @figma-agent/bridge-server start
# Bridge server listening at ws://127.0.0.1:30553. Load the Figma Plugin
In Figma Desktop: go to Plugins ā Development ā Import plugin from manifest...
Select
apps/figma-plugin/manifest.json.Open the plugin: it will automatically generate a cryptographically secure 128-bit Channel ID & Secret pair.
Click š Copy Config in the plugin window. The ready-to-use MCP client configuration snippet is copied directly to your clipboard.
4. Start the MCP Server (Stdio or Hardened SSE)
# Mode A: Stdio Transport (standard for Claude Desktop, Cursor, Antigravity)
pnpm --filter @figma-agent/mcp-server start
# Mode B: Hardened SSE Transport (HTTP Server-Sent Events with Bearer Auth & Loopback checks)
pnpm --filter @figma-agent/mcp-server start -- --sse --port=3056 --token=YOUR_BEARER_TOKENāļø AI Client Configuration
š¤ 1. Claude Desktop
Add to your claude_desktop_config.json (%APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"figma": {
"command": "node",
"args": ["d:/Code/Figma MCP/apps/mcp-server/dist/cli.js"],
"env": {
"FIGMA_AGENT_BRIDGE_HOST": "127.0.0.1",
"FIGMA_AGENT_BRIDGE_PORT": "3055",
"FIGMA_AGENT_CHANNEL_ID": "default-channel"
}
}
}
}š» 2. Cursor IDE
Add to your Cursor MCP Configuration (Settings ā Features ā MCP or .cursor/mcp.json):
{
"mcpServers": {
"figma-agent": {
"command": "node",
"args": ["d:/Code/Figma MCP/apps/mcp-server/dist/cli.js"],
"env": {
"FIGMA_AGENT_BRIDGE_HOST": "127.0.0.1",
"FIGMA_AGENT_BRIDGE_PORT": "3055",
"FIGMA_AGENT_CHANNEL_ID": "default-channel"
}
}
}
}š§ 3. Google Antigravity / Gemini CLI
Add to your Antigravity MCP settings (~/.gemini/antigravity/mcp_config.json):
{
"mcpServers": {
"figma-agent": {
"command": "node",
"args": ["d:/Code/Figma MCP/apps/mcp-server/dist/cli.js"],
"env": {
"FIGMA_AGENT_BRIDGE_HOST": "127.0.0.1",
"FIGMA_AGENT_BRIDGE_PORT": "3055"
}
}
}
}ā” 4. OpenAI Codex / Codex CLI / OpenAI Operator
Add to your Codex MCP configuration (~/.codex/config.json or codex-settings.json):
{
"mcpServers": {
"figma-agent": {
"command": "node",
"args": ["d:/Code/Figma MCP/apps/mcp-server/dist/cli.js"],
"env": {
"FIGMA_AGENT_BRIDGE_HOST": "127.0.0.1",
"FIGMA_AGENT_BRIDGE_PORT": "3055",
"FIGMA_AGENT_CHANNEL_ID": "default-channel"
}
}
}
}Or register via Codex CLI:
# Add Figma Agent MCP to Codex CLI
codex mcp add figma-agent -- node "d:/Code/Figma MCP/apps/mcp-server/dist/cli.js"
# Inspect available tools via MCP Inspector
npx @modelcontextprotocol/inspector node "d:/Code/Figma MCP/apps/mcp-server/dist/cli.js"š 5. Windsurf / Codeium IDE
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"figma-agent": {
"command": "node",
"args": ["d:/Code/Figma MCP/apps/mcp-server/dist/cli.js"],
"env": {
"FIGMA_AGENT_BRIDGE_HOST": "127.0.0.1",
"FIGMA_AGENT_BRIDGE_PORT": "3055",
"FIGMA_AGENT_CHANNEL_ID": "default-channel"
}
}
}
}š Complete MCP Tools Reference (50 Tools)
All 50 MCP tools are strictly typed via Zod schemas, execute deterministically, and provide robust failure metadata.
1. Connection & Session Management (2 tools)
Tool Name | Parameters | Description |
| none | Get current WebSocket bridge connection status, latency, and session capabilities. |
|
| Switch or join a specific Figma document channel session. |
2. Inspection & Read (6 tools)
Tool Name | Parameters | Description |
|
| Retrieve the document root hierarchy with bounded depth. |
|
| Get currently selected nodes in the active Figma canvas. |
|
| Read detailed properties and subtree of a specific node. |
|
| Batch fetch multiple nodes by ID. |
|
| Retrieve local Master Components and Component Sets with variant props. |
|
| List local paint, text, and effect styles with serialized paints. |
3. Node Creation (4 tools)
Tool Name | Parameters | Description |
|
| Create a container Frame with optional Auto Layout. |
|
| Create a Text node with reliable font loading. |
|
| Create a Rectangle vector node. |
|
| Create a Section organization container. |
4. Node Mutation & Geometry (6 tools)
Tool Name | Parameters | Description |
|
| Move a node to absolute coordinate positions. |
|
| Resize node dimensions. |
|
| Rename node layer title. |
|
| Permanently delete a node from canvas (safety guarded). |
|
| Duplicate an existing node hierarchy. |
|
| Reparent and reorder a node in the layer tree. |
5. Auto Layout & Responsive Sizing (2 tools)
Tool Name | Parameters | Description |
|
| Configure responsive Flexbox-like Auto Layout. |
|
| Set container and child axis sizing behavior. |
6. Visual Styles & Effects (5 tools)
Tool Name | Parameters | Description |
|
| Apply background colors, gradients, and images. |
|
| Apply border strokes, weights, and alignments. |
|
| Set border corner radius with iOS continuous smoothing. |
|
| Adjust layer opacity. |
|
| Apply drop shadows, inner shadows, and blurs. |
7. Components & Instances (5 tools)
Tool Name | Parameters | Description |
|
| Convert a node into a reusable Master Component. |
|
| Instantiate a component variant. |
|
| Override component variant properties. |
|
| Detach component instance to regular editable frames (safety guarded). |
|
| Retrieve local Master Components and Component Sets with variant props. |
8. Variables & Design Tokens (6 tools)
Tool Name | Parameters | Description |
|
| List local variables and token collections. |
|
| Create a semantic Design Token variable. |
|
| Update variable value for a specific mode. |
|
| Bind a node property to a Design Token variable. |
|
| Create a shared Paint Style in the file. |
(Reused Inspect) |
| Query shared styles. |
9. Assets, Images & Export (3 tools)
Tool Name | Parameters | Description |
|
| Export node as Base64 image data or UTF-8 SVG string. |
|
| Configure export presets on a node. |
|
| Upload and apply an image fill from Base64. |
10. Text & Typography (6 tools)
Tool Name | Parameters | Description |
|
| Update text string content. |
|
| Update font size (whole text or range). |
|
| Change font family and weight with auto font-loading. |
|
| Set text alignment. |
|
| Set line height spacing. |
|
| Set letter spacing (tracking). |
11. Context Optimization & Pruning (1 tool)
Tool Name | Parameters | Description |
|
| Compile and compress Figma trees with token budget enforcement and compact DSL representation. |
12. Validation & Accessibility (2 tools)
Tool Name | Parameters | Description |
|
| Audit node tree for WCAG 2.1 contrast, Auto Layout rules, token scales, and layer naming health. |
|
| Calculate WCAG 2.1 relative luminance and contrast ratio (AA/AAA). |
13. Composite Skills & Batch Execution (3 tools)
Tool Name | Parameters | Description |
| none | Discover available high-level Agent Skills. |
|
| Execute a multi-step composite workflow. |
|
| Execute multiple Figma commands sequentially with dynamic symbolic reference resolution ( |
14. Design System Semantic Resolution (1 tool)
Tool Name | Parameters | Description |
|
| Semantically resolve human intent (e.g. "primary button", "#6366F1", 16px) to matching components/tokens with perceptual $\Delta E$ distance and node token auditing. |
š” Example: Building a Hierarchical UI Card in 1 Batch Call
{
"transactionId": "tx-pricing-01",
"idempotencyKey": "idem-card-01",
"rollbackOnFailure": true,
"commands": [
{
"command": "figma.create_frame",
"ref": "card",
"payload": { "width": 360, "height": 480, "name": "Pricing Card" }
},
{
"command": "figma.create_text",
"ref": "title",
"parentRef": "card",
"payload": { "text": "Pro Plan", "font": { "family": "Inter", "style": "Bold", "size": 24 } }
},
{
"command": "figma.create_rectangle",
"ref": "btn",
"parentRef": "card",
"payload": { "width": 312, "height": 44, "cornerRadius": 8, "name": "CTA Button" }
},
{
"command": "figma.set_fills",
"nodeRef": "btn",
"payload": { "fills": [{ "type": "SOLID", "color": "#3B82F6" }] }
}
]
}Returns refMap: { "card": "123:456", "title": "123:457", "btn": "123:458" }.
š¤ Composite Agent Skills (9 Skills)
š§± Core General Skills (6)
skill.inspect_design: Read comprehensive node hierarchy, bounds, styles, typography, layout properties, and design token binding recommendations.skill.create_screen: Construct a complete responsive screen container with header bar, content area, Auto Layout, and Fill/Hug sizing rules.skill.edit_selection: Batch mutate visual fills, strokes, opacity, corner radius, and text characters on currently selected canvas nodes.skill.create_component: Create a reusable Master Component with Auto Layout, styling, and typed component property definitions.skill.apply_design_system: Audit a node subtree and automatically apply recommended Variable token bindings (figma.bind_variable).skill.validate_design: Run complete WCAG 2.1 contrast, Auto Layout, and token scale rules against a layout subtree.
ā” Specialized Workflows (3)
skill.create_design_system: Turnkey generation of Color Variable tokens (color/primary,color/background,color/surface,color/text-primary), Paint Styles, and a responsiveButton/Primarymaster component.skill.auto_fix_accessibility: Audits layout hierarchy for WCAG 2.1 contrast violations and automatically repairs low-contrast text colors to achieve AA compliance.skill.convert_wireframe_to_hifi: Transforms a low-fidelity wireframe container into a polished High-Fidelity UI Card with modern surface fills, soft drop shadows, and continuous corner smoothing.
š§Ŗ Testing & Verification
Run the comprehensive test suite (171 passing tests across 33 test files):
# Run format checking
pnpm format:check
# Run full build
pnpm build
# Run unit and integration tests
pnpm test
# Strict TypeScript typechecking
pnpm typecheck
# ESLint audit
pnpm lintBenchmark Results:
ā” WebSocket Concurrency: 50 concurrent client connections with burst heartbeats: p95 < 100ms, 0 dropouts.
š³ Massive Tree Scaling: Context compilation of 6,111 nodes with 1,000 token budget: < 100ms execution time, >70% context reduction in benchmark scenarios.
š”ļø Fault Tolerance: Automatic reconnection and error handling with
retryableflags on socket dropouts.
š License
MIT Ā© 2026 Figma Agent MCP Contributors
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/TrungLee003/figma-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server