# Technical Architecture Source: https://docs.figma-console-mcp.southleft.com/architecture Deep dive into Figma Console MCP's architecture, deployment modes, component details, and data flows. # Figma Console MCP - Technical Architecture ## Overview Figma Console MCP provides AI assistants with real-time access to Figma for debugging, design system extraction, and design creation. The server supports two deployment modes with different capabilities. ## Deployment Modes ### Remote Mode (SSE/OAuth) **Best for:** Design system extraction, API-based operations, zero-setup experience Remote Mode has two sub-modes depending on whether the Desktop Bridge plugin is paired: #### Read-Only (REST API via OAuth/PAT) ```mermaid theme={null} flowchart TB AI[AI Assistant] AI -->|SSE| WORKER WORKER[Cloudflare Worker] WORKER --> MCP[MCP Protocol] MCP --> CLIENT[REST Client] CLIENT -->|HTTPS| API[Figma API] ``` **Capabilities:** * Design system extraction (variables, styles, components) * File structure queries * Component images #### Read + Write (REST API + Cloud Write Relay) When a user pairs the Desktop Bridge plugin via Cloud Mode, Remote Mode gains full write access through the cloud relay: ```mermaid theme={null} flowchart TB AI[AI Assistant] AI -->|SSE| WORKER[Cloudflare Worker] WORKER --> REST[REST Client] WORKER --> RELAY[Plugin Relay DO] REST -->|HTTPS| API[Figma API] RELAY -->|WebSocket| PLUGIN[Desktop Bridge Plugin] PLUGIN --> FILE[Design File] ``` **Additional Capabilities (with Cloud Relay):** * Design creation via Plugin API * Variable CRUD operations * Component arrangement and organization * Console log capture *** ### Local Mode (Desktop Bridge) **Best for:** Plugin debugging, design creation, variable management, full capabilities ```mermaid theme={null} flowchart TB AI[AI Assistant] AI -->|stdio| SERVER[Local MCP Server] SERVER --> REST[REST Client] SERVER --> WS[WebSocket Server] REST -->|HTTPS| API[Figma API] WS -->|"WebSocket :9223–9232"| PLUGIN[Desktop Bridge Plugin] PLUGIN --> FILE[Design File] ``` **Transport:** * **WebSocket + HTTP** — via Desktop Bridge Plugin on ports 9223–9232. No debug flags needed. Supports real-time selection tracking, document change monitoring, and console capture. * The server tries port 9223 first, then automatically falls back through ports 9224–9232 if another instance is already running. Orphaned processes are automatically detected and terminated on startup. * The HTTP server on the same port exposes `/health` for liveness checks. * All 121 tools work through the WebSocket transport. **Plugin distribution:** * The Desktop Bridge plugin ships as `manifest.json`, `code.js`, and `ui.html` — the full UI (\~60 KB) is loaded directly by Figma at plugin-open time (no bootloader fetch). * Plugin files are copied to `~/.figma-console-mcp/plugin/` on server startup so users have a stable import path; the MCP server keeps the copy in sync with the running build. * Updating the plugin code requires re-importing `manifest.json` in Figma (Plugins → Manage plugins → re-import) because Figma caches plugin files at the application level. Closing and reopening the plugin window is enough for most edits; a full Figma restart is rarely needed. **Capabilities:** * Everything in Remote Mode, plus: * Console log capture (real-time) * Design creation via Plugin API * Variable CRUD operations * Component arrangement and organization * Real-time selection and document change tracking (WebSocket) * Zero-latency local execution *** ## Component Details ### MCP Server Core (`src/local.ts`) The main server implements the Model Context Protocol with stdio transport for local mode. **Key Responsibilities:** * Tool registration (121 tools in Local Mode, 95 in Cloud Mode) * Request routing and validation * Figma API client management * Desktop Bridge communication via WebSocket **Tool Categories:** | Category | Tools | Transport | | - | - | - | | Status & Diagnostics | `figma_get_status`, `figma_diagnose`, `figma_reconnect` | WebSocket | | Console | `figma_get_console_logs`, `figma_watch_console`, `figma_clear_console` | WebSocket | | Screenshots | `figma_take_screenshot`, `figma_capture_screenshot` | WebSocket | | Design System | `figma_get_variables`, `figma_get_styles`, `figma_get_component` | REST API | | Design Creation | `figma_execute`, `figma_create_component_set`, `figma_arrange_component_set` | WebSocket (Plugin) | | Variables | `figma_create_variable`, `figma_update_variable`, etc. | WebSocket (Plugin) | | Token Sync | `figma_export_tokens`, `figma_import_tokens` | Plugin read + Plugin write | | Real-Time | `figma_get_selection`, `figma_get_design_changes` | WebSocket | | Multi-File | `figma_list_open_files`, `figma_execute_across_files` | WebSocket (one plugin connection per file) | | Parity & Docs | `figma_check_design_parity`, `figma_generate_component_doc` | REST API + WebSocket (Plugin) | | Audits | `figma_lint_design`, `figma_audit_component_accessibility`, `figma_audit_design_system_report` | WebSocket (Plugin) + REST API | | Codebase Extraction | `figma_ds_analyze` … `figma_ds_verify` (seven tools) | Local filesystem | *** ### Desktop Bridge Plugin The Desktop Bridge is a Figma plugin that runs inside Figma Desktop and provides access to the full Figma Plugin API. **Architecture:** ```mermaid theme={null} flowchart TB MSG[Message Handler] MSG --> EXEC[Execute] MSG --> VARS[Variables] MSG --> COMP[Components] EXEC --> API[Figma Plugin API] VARS --> API COMP --> API ``` **Communication Protocol:** The MCP server communicates with the Desktop Bridge via WebSocket: 1. **MCP Server** sends JSON command via WebSocket (ports 9223–9232) 2. **Plugin UI** receives and forwards via `postMessage` to plugin code 3. **Plugin Code** executes Figma Plugin API calls 4. **Plugin Code** returns result via `figma.ui.postMessage` 5. **Plugin UI** sends response back via WebSocket 6. **MCP Server** receives correlated response *** ### Transport Layer The MCP server uses a transport abstraction (`IFigmaConnector` interface) with two connector implementations: | Connector | Class | Mode | Transport | | - | - | - | - | | Local WebSocket | `WebSocketConnector` | Local | `ws://localhost:9223–9232` | | Cloud Relay | `CloudWebSocketConnector` | Remote | Fetch RPC to Durable Object | (The local `FigmaDesktopConnector` / Puppeteer-CDP path that lived alongside `WebSocketConnector` for a transitional period was removed in Phase 3 of the cleanup branch — Local Mode now routes every tool through the WebSocket plugin bridge. Cloud Mode still uses Cloudflare's Browser Rendering API for `figma_navigate`, `figma_get_console_logs`, and `figma_take_screenshot`; write/plugin tools route through the Cloud Plugin Relay Durable Object instead.) #### WebSocket Transport (Local) The Desktop Bridge Plugin connects via WebSocket on ports 9223–9232. No special Figma launch flags needed. **Features:** * Real-time selection tracking (`figma_get_selection`) * Document change monitoring (`figma_get_design_changes`) * File identity tracking (file key, name, current page) * Plugin-context console capture * Instant availability check (no network timeout) **Communication flow:** ``` MCP Server ←WebSocket (ports 9223–9232)→ Plugin UI (ui.html) ←postMessage→ Plugin Code (code.js) ←figma.*→ Figma ``` #### Cloud Relay Transport (Remote) The `CloudWebSocketConnector` implements the same `IFigmaConnector` interface but routes commands via fetch RPC to the `PluginRelayDO` Durable Object. The DO maintains a persistent WebSocket connection to the Desktop Bridge plugin. **Communication flow:** ``` Cloud MCP Server →fetch RPC→ PluginRelayDO ←WebSocket (wss://)→ Plugin UI (ui.html) ←postMessage→ Plugin Code (code.js) ←figma.*→ Figma ``` See [Cloud Write Relay](#cloud-write-relay) for full details. #### Multi-Instance Support (v1.10.0+) Multiple MCP server processes can run simultaneously (e.g., Claude Desktop Chat tab, Code tab, Cursor, etc.). Each server binds to the first available port in the range 9223–9232. The Desktop Bridge Plugin scans all ports in the range and connects to every active server. #### Transport Detection The MCP server checks if a WebSocket client is connected (instant, under 1ms). If connected, commands route through WebSocket. If no client is connected, setup instructions are returned. All 121 tools work through the WebSocket transport. *** ### Figma REST API Client Used for design system extraction and file queries. **Endpoints Used:** | Endpoint | Purpose | | - | - | | `GET /v1/files/:key` | File structure and metadata | | `GET /v1/files/:key/nodes` | Specific node data | | `GET /v1/files/:key/styles` | Style definitions | | `GET /v1/files/:key/variables/local` | Variable collections (Enterprise) | | `GET /v1/images/:key` | Rendered images | **Authentication:** * **Remote Mode:** OAuth 2.0 with automatic token refresh * **Local Mode:** Personal Access Token via environment variable *** ## Data Flow Examples ### Design Creation Flow ```mermaid theme={null} sequenceDiagram participant U as User participant A as AI participant M as MCP participant B as Bridge participant F as Figma U->>A: Create button A->>M: figma_execute() M->>B: Send code B->>F: createComponent() F-->>B: Node created B-->>M: {nodeId} A->>M: capture_screenshot() M-->>A: Image A-->>U: Done ``` ### Variable Management Flow ```mermaid theme={null} sequenceDiagram participant U as User participant A as AI participant M as MCP participant B as Bridge participant F as Figma U->>A: Create variable A->>M: create_variable() M->>B: Send command B->>F: createVariable() F-->>B: Created B-->>M: Variable ID M-->>A: Success A-->>U: Done ``` ### Console Debugging Flow ```mermaid theme={null} sequenceDiagram participant U as User participant P as Plugin participant B as Bridge participant M as MCP participant A as AI U->>P: Run plugin P->>B: console.log() B->>M: Log via WebSocket M->>M: Buffer entry U->>A: Show logs A->>M: get_console_logs() M-->>A: Logs A-->>U: Display ``` *** ## Cloud Write Relay The Cloud Write Relay enables web-based AI clients (Claude.ai, v0, Replit, Lovable) to send write commands to Figma through a Cloudflare Durable Object relay. This gives Remote Mode full write capabilities — design creation, variable management, and component arrangement — without requiring a local Node.js process. ### Architecture ``` AI Client (Claude.ai) │ ▼ Cloud MCP Server (/mcp endpoint on Cloudflare Worker) │ ├──► REST Client ──► Figma REST API (read operations) │ └──► fetch RPC │ ▼ PluginRelayDO (Durable Object) │ ▼ WebSocket (wss://) Desktop Bridge Plugin (ui.html) │ ▼ postMessage Plugin Worker (code.js) │ ▼ figma.* Figma Plugin API ``` ### Key Components | Component | File | Purpose | | - | - | - | | `PluginRelayDO` | `src/core/cloud-websocket-relay.ts` | Durable Object that brokers WebSocket between cloud server and plugin | | `CloudWebSocketConnector` | `src/core/cloud-websocket-connector.ts` | `IFigmaConnector` implementation that routes commands via fetch RPC to the relay DO | | `registerWriteTools()` | `src/core/write-tools.ts` | Shared tool registration function used by both local and cloud entry points | ### Pairing Flow ``` AI Client Cloud Server Relay DO Desktop Bridge Plugin │ │ │ │ │ figma_pair_plugin │ │ │ │ ──────────────────────────► │ │ │ │ │ Create relay DO │ │ │ │ ─────────────────────► │ │ │ │ Store code in KV │ │ │ ◄─── 6-char code ──────── │ (5-min TTL) │ │ │ (shown to user) │ │ │ │ │ │ │ │ │ │ WebSocket connect │ │ │ │ wss://.../ws/pair?code= │ │ │ │ ◄──────────────────────────│ │ │ │ Code validated, paired │ │ │ │ ──────────────────────────►│ │ │ │ │ │ figma_execute(...) │ │ │ │ ──────────────────────────► │ fetch RPC │ │ │ │ ─────────────────────► │ forward via WebSocket │ │ │ │ ──────────────────────────►│ │ │ │ │ ──► figma.* │ │ │ ◄─── result ─────────────│ │ │ ◄─── result ──────── │ │ │ ◄─── result ────────────── │ │ │ ``` ### Hibernation-Safe Design The `PluginRelayDO` uses Cloudflare Durable Object hibernation-safe patterns to minimize costs during idle periods between AI turns: * **WebSocket retrieval:** Uses `this.ctx.getWebSockets('plugin')` to retrieve active connections after hibernation wake-up, rather than storing WebSocket references in memory. * **File info storage:** Connected file information is persisted to DO storage (`this.ctx.storage`), not held in instance variables that would be lost during hibernation. * **Wake on message:** The DO wakes from hibernation when either the cloud server sends a fetch RPC or the plugin sends a WebSocket message. ### Tool Registration `registerWriteTools()` is a shared function that registers all Plugin API write tools (design creation, variable CRUD, component arrangement). It is called from both entry points: * **`src/local.ts`** — Local mode, tools route through the local `WebSocketConnector` * **`src/index.ts`** — Remote/cloud mode, tools route through `CloudWebSocketConnector` to the relay DO This ensures tool parity between local and cloud modes. The same set of write tools is available regardless of deployment path. *** ## Security Considerations ### Authentication * **Personal Access Tokens:** Stored in environment variables, never logged * **OAuth Tokens:** Encrypted at rest, automatic refresh * **No credential storage:** Tokens passed per-request ### Sandboxing * **Plugin Execution:** Runs in Figma's sandboxed plugin environment * **Code Validation:** Basic validation before execution * **No filesystem access:** Plugin code cannot access local files ### Cloud Relay Security * **Pairing codes:** Single-use, 6-character codes with a 5-minute TTL stored in Cloudflare KV. Codes are consumed on first use and cannot be replayed. * **Session scoping:** Each pairing creates a dedicated Durable Object instance. One plugin connects per relay — no cross-session leakage. * **Transport encryption:** All cloud relay traffic uses TLS (`wss://` for the plugin WebSocket, HTTPS for fetch RPC). * **Bearer token binding:** After pairing, the relay DO ID is stored in KV keyed by the bearer token (`relay:{bearerToken}`, 24h TTL). Only the authenticated AI client session can route commands to its paired relay. * **No persistent data storage:** The relay passes commands through to the plugin and returns results. Design data is not stored in the Durable Object beyond the active session. ### Data Privacy * **Console Logs:** Stored in memory only, cleared on restart * **Screenshots:** Temporary files with automatic cleanup * **No telemetry:** No data sent to external services *** ## Performance Considerations ### Latency Targets | Operation | Target | Actual | | - | - | - | | Console log retrieval | under 100ms | \~50ms | | Screenshot capture | under 2s | \~1s | | Design creation | under 5s | 1-3s | | Variable operations | under 500ms | \~200ms | ### Memory Management * **Log Buffer:** Circular buffer, configurable size (default: 1000 entries) * **Screenshots:** Disk-based with 1-hour TTL cleanup * **Connection Pooling:** WebSocket connections reused ### Optimization Strategies * Batch operations where possible * Lazy loading of component data * Efficient JSON serialization * Connection keepalive for WebSocket *** ## Development ### Local Development ```bash theme={null} # Install dependencies npm install # Run in development mode npm run dev:local # Build for production npm run build:local ``` ### Testing ```bash theme={null} # Run all tests npm test # Run with coverage npm run test:coverage ``` ### Project Structure ``` figma-console-mcp/ ├── src/ │ ├── local.ts # Main MCP server (local mode) │ ├── index.ts # Cloudflare Workers entry (remote mode) │ ├── core/ │ │ ├── cloud-websocket-relay.ts # PluginRelayDO Durable Object │ │ ├── cloud-websocket-connector.ts # CloudWebSocketConnector (IFigmaConnector) │ │ ├── write-tools.ts # Shared write tool registration │ │ ├── websocket-connector.ts # Local WebSocketConnector (IFigmaConnector) │ │ ├── websocket-server.ts # Local WebSocket server │ │ └── figma-connector.ts # IFigmaConnector interface │ └── types/ # TypeScript definitions ├── figma-desktop-bridge/ │ ├── code.js # Plugin worker (Figma API access) │ ├── ui.html # Plugin UI (local + cloud mode) │ └── manifest.json # Plugin manifest ├── docs/ # Documentation └── tests/ # Test suites ``` # FigJam Support Source: https://docs.figma-console-mcp.southleft.com/figjam AI agents can now create and read FigJam boards — sticky notes, flowcharts, tables, code blocks, and more. A complete guide to the 10 FigJam tools. # AI Meets Collaborative Whiteboarding Figma Console MCP now extends beyond Figma Design files into **FigJam** — Figma's collaborative whiteboarding tool used by millions of teams for brainstorming, planning, diagramming, and retrospectives. This is not a read-only integration. Your AI assistant can **create content on FigJam boards** and **read everything back** — turning FigJam into a programmable canvas for AI-assisted collaboration. *** ## What is FigJam? FigJam is Figma's whiteboarding product, purpose-built for ideation and team collaboration. Teams use it for brainstorming sessions, user flow diagrams, sprint retrospectives, project planning, and technical architecture discussions. It features sticky notes, shapes, connectors, tables, and more — all in a free-form infinite canvas. With Figma Console MCP, every one of those elements is now accessible to AI agents. *** ## What's Now Possible AI assistants connected through Figma Console MCP can now interact with FigJam boards programmatically: Place individual stickies or batch-create up to 200 at once, with 9 color options for categorization and visual grouping. Create shapes (rectangles, diamonds, ellipses, engineering symbols) and connect them with labeled connectors to produce complete diagrams. Create structured tables up to 100 rows by 50 columns, pre-populated with cell data — perfect for comparison matrices and planning grids. Add code blocks with language-specific syntax highlighting directly to the board for technical reviews and documentation. Organize elements into grid, horizontal, or vertical layouts with configurable spacing — no manual dragging required. Retrieve all board elements with full type-specific serialization, including sticky text, shape types, table data, and connector graphs. *** ## The 10 FigJam Tools Every tool is available in both **Local Mode** and **Cloud Mode**. | Tool | Description | | - | - | | `figjam_create_sticky` | Create a single sticky note with text and optional color and position | | `figjam_create_stickies` | Batch-create up to 200 sticky notes in a single call | | `figjam_create_connector` | Connect two nodes with a connector line and optional text label | | `figjam_create_shape_with_text` | Create a labeled shape for flowcharts and diagrams | | `figjam_create_table` | Create a table with rows, columns, and pre-populated cell data | | `figjam_create_code_block` | Add a code snippet with language syntax highlighting | | `figjam_create_section` | Create a section to group related content on the board | | `figjam_auto_arrange` | Arrange nodes in grid, horizontal, or vertical layouts | | `figjam_get_board_contents` | Read all content from a FigJam board with type-specific data | | `figjam_get_connections` | Read the full connection graph — edges, labels, and connected nodes | ### Supported Shapes The `figjam_create_shape_with_text` tool supports the following shape types for building diagrams: | Shape | Use Case | | - | - | | `ROUNDED_RECTANGLE` | Process steps, general-purpose nodes (default) | | `DIAMOND` | Decision points in flowcharts | | `ELLIPSE` | Start/end terminators | | `TRIANGLE_UP` / `TRIANGLE_DOWN` | Directional indicators | | `PARALLELOGRAM_RIGHT` / `PARALLELOGRAM_LEFT` | Input/output operations | | `ENG_DATABASE` | Database references | | `ENG_QUEUE` | Message queues and buffers | | `ENG_FILE` | File operations | | `ENG_FOLDER` | Directory or collection references | ### Sticky Note Colors Nine color options for visual categorization: `YELLOW`, `BLUE`, `GREEN`, `PINK`, `ORANGE`, `PURPLE`, `RED`, `LIGHT_GRAY`, `GRAY`. For full parameter details, default values, and return types, see the [FigJam Tools reference](/tools#figjam-tools). *** ## Use Cases These are real-world scenarios where FigJam support transforms AI-assisted workflows. Each example includes a prompt you can try with your AI assistant. ### Affinity Mapping from Meeting Notes Turn unstructured meeting notes into an organized affinity map — instantly. ``` Generate an affinity map from these meeting notes on a FigJam board. Group related ideas using colored stickies: BLUE for product features, GREEN for technical requirements, PINK for user feedback, and ORANGE for open questions. Arrange each group in a grid layout. ``` The AI uses `figjam_create_stickies` to batch-create all notes, assigns colors by category, and calls `figjam_auto_arrange` to lay them out in clean groups. ### User Flow Diagrams Build complete flowcharts from a verbal description of a user journey. ``` Create a user flow diagram for the checkout process on our FigJam board. Start with "View Cart", then decision diamond "Has Account?", branching to "Sign In" and "Guest Checkout", merging at "Enter Shipping", then "Payment", and ending at "Order Confirmed". ``` The AI creates shapes with `figjam_create_shape_with_text` (rounded rectangles for steps, diamonds for decisions, ellipses for start/end) and wires them together with `figjam_create_connector` using descriptive labels like "Yes" and "No" on the branches. ### Sprint Retrospective Board Set up a structured retro board in seconds, ready for the team to fill in. ``` Create a sprint retrospective board with three sections: - GREEN stickies column: "What went well" with 3 placeholder items - PINK stickies column: "What to improve" with 3 placeholder items - BLUE stickies column: "Action items" with 3 placeholder items Arrange each column vertically with clear spacing between groups. ``` ### Summarize an Existing Board Read a brainstorming board and extract actionable insights. ``` Read this FigJam brainstorming board and summarize the themes. Group the sticky notes by topic, identify the most common ideas, and list any action items or decisions that were captured. ``` The AI calls `figjam_get_board_contents` to retrieve all elements, then analyzes the text content to produce a structured summary — no manual reading required. ### Comparison Tables Create structured decision matrices for stakeholder review. ``` Create a comparison table on this FigJam board for our 3 platform options: AWS, GCP, and Azure. Include rows for: Compute pricing, Database options, CDN performance, Developer experience, and Enterprise support. Fill in what you know. ``` The AI uses `figjam_create_table` to generate a pre-populated table that the team can review and annotate collaboratively. ### Code Review on the Board Share code directly on the whiteboard for collaborative technical discussion. ``` Add this TypeScript function to the FigJam board as a code block so the team can review it during our architecture session: async function processOrder(order: Order): Promise { const validated = await validateOrder(order); const payment = await chargePayment(validated); return generateReceipt(payment); } ``` The AI uses `figjam_create_code_block` with `TYPESCRIPT` syntax highlighting to render the snippet with proper formatting. ### Analyze a Flowchart Understand the structure and relationships in an existing diagram. ``` What are all the connections in this flowchart? Show me the full graph of how elements are connected, including any labels on the connector lines. ``` The AI calls `figjam_get_connections` to return the complete edge list with start/end nodes and labels, then presents the graph structure in a readable format — useful for documenting existing flows or identifying missing connections. *** ## How It Works ### Editor Type Detection The Desktop Bridge plugin reports `figma.editorType` when it connects to the MCP server. The 10 FigJam tools are always listed. When the plugin is running inside a FigJam board they act on the board. When it is running in a Figma Design file, a runtime guard in the plugin returns an error instead of changing anything. There is no configuration toggle or mode switch. ### Same Plugin, New Canvas FigJam support uses the **same Desktop Bridge plugin** you already have installed. There is no separate plugin for FigJam. Open any FigJam board, run the Desktop Bridge plugin, and the FigJam tools become available alongside the standard toolset. ### Runtime Safety If a FigJam tool is called while connected to a Figma Design file, it returns a clear error message explaining that FigJam tools require a FigJam board. This prevents accidental misuse and gives the AI assistant enough context to guide the user. ### Compatibility | Mode | FigJam Support | | - | - | | Local (NPX/Git) | Full support | | Cloud Mode | Full support | | Remote (Read-Only) | Not available (requires Desktop Bridge) | *** ## Getting Started Open any FigJam board in Figma Desktop. You can create a new board from the Figma home screen or open an existing one. Launch the Desktop Bridge plugin from **Plugins > Development > Figma Desktop Bridge**. The plugin connects to the MCP server and reports that the editor type is FigJam. Start with a simple prompt like *"Create a yellow sticky note that says Hello from AI"* to verify the connection, then move on to more complex workflows like flowcharts, tables, and batch operations. If you have not set up the Desktop Bridge plugin yet, follow the [Setup Guide](/setup) first. The same plugin installation works for both Figma Design files and FigJam boards. *** ## Community Contributors FigJam support was built by the community and merged into the main project. Recognition goes to the contributors who made this possible: * **klgral (G Klas)** — Authored the original FigJam write tools: sticky notes, batch stickies, connectors, shapes, tables, code blocks, and auto-arrange. * **lukemoderwell (Luke Moderwell)** — Authored the FigJam read tools (`figjam_get_board_contents` and `figjam_get_connections`) and contributed documentation. Figma Console MCP is open source. If you want to contribute new tools or improvements, visit the [GitHub repository](https://github.com/southleft/figma-console-mcp). # Figma MCP vs. Figma Console MCP Source: https://docs.figma-console-mcp.southleft.com/figma-mcp-vs-figma-console-mcp How Figma's official MCP server and Figma Console MCP differ, where they overlap, and how to use them together. Figma's official MCP server and Figma Console MCP both connect AI assistants to Figma, and both can read from and write to Figma files. They were built for different jobs, and many teams run both in the same MCP client. * **The official Figma MCP server** is Figma's hosted server. It focuses on design-to-code context, Code Connect, and creating content in Figma: design files, FigJam diagrams, motion, and shaders. * **Figma Console MCP** is an open-source server focused on design-system operations: deterministic audits and design-code parity checks, token sync with round-trip IDs, component documentation, version-history diffs, extracting a design system from a codebase, and plugin console debugging. This page reflects both servers as of September 2026. Figma's server changes often, so check [Figma's documentation](https://developers.figma.com/docs/figma-mcp-server/) for its current capabilities. *** ## At a Glance **Made by Figma.** A hosted server you sign in to with OAuth. It provides design context for code generation, Code Connect mappings, library search, and writes to Figma through `use_figma`, which runs Plugin API JavaScript. It can also create files, generate FigJam diagrams, and work with motion, shaders, and generative plugins. Tool surface: about 40 as of September 2026, including Weave tools for running AI models and tools. **Made by Southleft.** A design-system-focused server that runs on your machine (or in Cloud Mode) and talks to Figma through the Desktop Bridge plugin and the REST API. Most operations are dedicated, schema-validated tools rather than generated scripts, and it also runs arbitrary Plugin API code through `figma_execute`. 121 tools. Plugin API + REST API. Open source (MIT). *** ## Shared Ground Both servers can do the following. How they do it differs: the official server usually does it through a general tool such as `use_figma` plus a skill, and Console MCP usually has a dedicated tool for it. | Capability | Figma MCP | Console MCP | | - | - | - | | Read file structure, components, and styles | `get_metadata`, `get_design_context` | `figma_get_file_data`, `figma_get_component`, `figma_get_styles`, and others | | Screenshots | `get_screenshot` | `figma_take_screenshot`, `figma_capture_screenshot` | | Read variables | `get_variable_defs` | `figma_get_variables`, `figma_get_token_values` | | Search design-system assets | `search_design_system`, `get_libraries` | `figma_search_components`, library component and variable tools | | Run Plugin API JavaScript (writes to Figma) | `use_figma` | `figma_execute` | | Read FigJam boards | `get_figjam` | `figjam_get_board_contents`, `figjam_get_connections` | | Skills (markdown workflow guides for agents) | Yes (`get_figma_skill`, plus skills in Figma's plugin) | Yes | *** ## What the Official Figma MCP Is Built For These are areas where the official server has first-party capabilities that Console MCP does not provide: | Capability | Official tools | | - | - | | Design context for code generation | `get_design_context`, `get_metadata`, `get_screenshot` | | Code Connect: map Figma components to code components | `get_code_connect_map`, `add_code_connect_map`, `get_code_connect_suggestions`, `send_code_connect_mappings`, and related tools | | Create new Figma, FigJam, and Slides files | `create_new_file` | | Generate FigJam diagrams from Mermaid | `generate_diagram` | | Motion context and video export | `get_motion_context`, `export_video` | | Create and edit shaders | `create_shader`, `update_shader`, `get_shader`, `list_shaders`, `list_file_shaders` | | Generative plugins | `create_generative_plugin`, `update_generative_plugin`, and related tools | | Upload and download assets | `upload_assets`, `download_assets` | | Hosted by Figma, OAuth sign-in, no local install | — | Code Connect is the main reason to reach for the official server when generating code. It tells the AI which code component corresponds to each Figma component, so generated code uses your real components instead of recreating them. *** ## What Figma Console MCP Is Built For Console MCP concentrates on operating a design system across Figma and code. Each of these has dedicated tools: ### Deterministic checks Rule-based checks that return the same result for the same input, so they can gate a merge or a release: * **Accessibility**: `figma_lint_design` (WCAG checks on the canvas), `figma_audit_component_accessibility` (state, focus, and color-blind scorecard for a component), and `figma_scan_code_accessibility` (axe-core scan of HTML, Local Mode). * **Design-code parity**: `figma_check_design_parity` compares a Figma component with its code implementation and reports each discrepancy. * **Design-system health**: `figma_audit_design_system_report` scores naming, token architecture, component metadata, accessibility, consistency, and coverage, and says which findings the MCP can fix. * **Extracted-system fidelity**: `figma_ds_verify` checks that tokens extracted from a codebase parse, resolve, and are ready to import into Figma. ### Bidirectional token sync * `figma_export_tokens` writes Figma variables to 10 formats: DTCG JSON (legacy or 2025.10 dialect), CSS custom properties, Tailwind v4 and v3, SCSS, TypeScript, flat and nested JSON, Style Dictionary v3, and Tokens Studio. * `figma_import_tokens` applies DTCG JSON back to Figma: value updates, new collections and variables, renames matched by the Figma variable ID stored in `$extensions`, alias writes, and deletes only under `strategy: "replace"`. * Export refuses to overwrite a token file generated from a different Figma file, or one that would lose tokens the export doesn't manage. ### Variables on any Figma plan Figma's Variables REST API requires an Enterprise plan. Console MCP reads and writes variables through the Plugin API in the Desktop Bridge plugin, so variable tools work on every plan, including batch creates and updates of up to 100 variables per call. ### Component documentation and history * `figma_generate_component_doc` produces markdown documentation from Figma and your code: anatomy, per-variant color, spacing, and typography tokens, annotations, a design-code parity section, and (with the `history` option) a changelog built from Figma version history and `git log`. * Version-history tools (`figma_get_file_versions`, `figma_diff_versions`, `figma_generate_changelog`, `figma_blame_node`) diff snapshots and find when, and by whom, a property or variant was introduced. ### Codebase → design system → Figma Seven `figma_ds_*` tools (Local Mode) analyze a production codebase, extract its styling as DTCG tokens with per-token provenance, scaffold a design-system package with Storybook, and verify it. The extracted tokens import into Figma variables with `figma_import_tokens`. ### Plugin debugging and live file awareness (Local Mode) Console log capture from the Desktop Bridge plugin (`figma_get_console_logs`, `figma_watch_console`), the current selection (`figma_get_selection`), buffered document changes (`figma_get_design_changes`), multi-file targeting and `figma_execute_across_files`, and a plain-language health check (`figma_diagnose`). ### Other dedicated tools Structured tools for variables, components and component sets (`figma_create_component_set`), Slots, node editing, annotations, comments, FigJam, and Slides. See the [Tools Reference](/tools). *** ## Structured Tools and Scripted Writes Both servers can change a Figma file by running Plugin API code: `use_figma` on the official server, `figma_execute` in Console MCP. Console MCP also provides dedicated tools for common operations. For example, `figma_batch_create_variables` takes a JSON array of variables, and `figma_create_component_set` builds a variant set from an axes matrix. Their inputs are schema-validated and their errors name the problem. Neither approach is universally better. A script is flexible and handles one-off changes. A dedicated tool is predictable and easier to review, which matters most for repeated design-system operations such as syncing hundreds of tokens across modes. *** ## How They Connect to Figma | | Figma MCP | Console MCP | | - | - | - | | **Runs where** | Hosted by Figma | Your machine (`npx` or a git clone), Southleft's hosted Cloud Mode, or your own Cloudflare deployment | | **Connection to Figma** | Figma's service | Desktop Bridge plugin over WebSocket, plus the Figma REST API | | **Authentication** | OAuth | Personal access token; OAuth for the hosted remote endpoints | | **Web AI clients** | Any client that supports remote MCP servers | Cloud Mode: Yes (96 tools) after pairing the Desktop Bridge plugin | | **Source code** | Operated by Figma | Open source (MIT), self-hostable | For Figma's current plan requirements and usage limits, see [Figma's documentation](https://developers.figma.com/docs/figma-mcp-server/). Figma Console MCP is free. It calls the Figma REST API with your own token, so Figma's REST API rate limits apply. *** ## Who Should Use Which **The official Figma MCP** fits when: * You want design context for implementing a screen or component * You use Code Connect to map Figma components to your codebase * You want a hosted server with no local install **Figma Console MCP** fits when: * You need to check whether coded components match their Figma specs * You want design tokens exported to your stack's format, or code-side token edits pushed back to Figma * You want generated component documentation with token mappings and a design and code changelog * You want to self-host or read the source **The official Figma MCP** fits when: * You want an agent to create designs, files, or FigJam diagrams * You work with motion or shaders **Figma Console MCP** fits when: * You maintain token collections with many modes and want batch, schema-validated variable operations * You want repeatable accessibility and design-system health audits * You want to audit design-code drift * You want version-history diffs, changelogs, or blame for components * You want to read or write annotations, or post review comments on components Both servers can be configured in the same MCP client. One workflow: 1. **Set up the system** with Console MCP: token collections and modes, component sets with variable bindings, and a health audit. 2. **Generate code** with the official server's `get_design_context` and Code Connect. 3. **Check the result** with Console MCP's parity and accessibility tools, then fix discrepancies with either server. 4. **Document** components with `figma_generate_component_doc`. *** ## Quick Reference | Question | Figma MCP | Console MCP | | - | - | - | | *Can it read my designs?* | Yes | Yes | | *Can it write to my designs?* | Yes (`use_figma`) | Yes (dedicated tools and `figma_execute`) | | *Does it have Code Connect?* | Yes | No | | *Can it create new files?* | Yes (`create_new_file`) | No | | *Does it export tokens to code formats and import them back?* | Not as dedicated tools | Yes (10 export formats, DTCG import) | | *Does it compare a Figma component with its code?* | Not as a dedicated tool | Yes (`figma_check_design_parity`) | | *Where does it run?* | Hosted by Figma | Your machine, Cloud Mode, or your own deployment | | *Is the source available?* | See Figma's documentation | Yes (MIT) | | *Who makes it?* | Figma | Southleft | *** ## How This Page Has Changed When this comparison was first written, the official Figma MCP was read-only and focused on design-to-code, and write access was the main difference between the two servers. That is no longer true. The official server now writes to Figma, creates files, and covers motion, shaders, and diagrams. Console MCP's focus has narrowed to design-system operations. This page was rewritten in September 2026 to reflect both. **Figma Console MCP** is an open-source project built by [Southleft](https://southleft.com). It is not a Figma product and is not supported by Figma. The official **Figma MCP server** is built and maintained by Figma. *** ## Get Started Full 121 tool access in about 10 minutes. Figma's documentation for its MCP server. # Figma Console MCP Source: https://docs.figma-console-mcp.southleft.com/index A design-system-focused MCP server for Figma: bidirectional Figma-code sync, writes to Figma, and deterministic checks for parity, accessibility, and design-system health. **Accuracy & safety fixes (latest v1.40.9):** Nine patches since v1.40.0's Design System Extraction, driven by community reports. Generated component docs now describe every variant accurately — backgrounds, hidden layers and the properties that show them, per-corner radius and border tokens, typography and layer structure across variants, and source links pinned to a commit. `figma_export_tokens` can no longer overwrite a token file from the wrong Figma file, overrides in extended variable collections are visible, min/max sizing survives every JSON extraction path, colors set to another color at an opacity export and import with their link intact, and the published package passes `npm audit` cleanly. Server-only — no plugin re-import needed. [See what's new →](https://github.com/southleft/figma-console-mcp/blob/main/CHANGELOG.md#1409---2026-10-02) # Your Design System as an API Design systems shouldn't be static documents locked in a visual tool. They should be **queryable**, **programmable**, and **always in sync** with your codebase. Figma Console MCP is a design-system-focused MCP server. It connects AI assistants to Figma through the Desktop Bridge plugin and the REST API, so they can read your design system, change it, and check it against your code. Figma ⇄ code. Export variables to 10 token formats and import DTCG edits back with round-trip IDs, extract a design system from an existing codebase, and compare components with their code. Variables, components and component sets, Slots, annotations, FigJam boards, and Slides, plus any Plugin API code through `figma_execute`. Rule-based checks that return the same result every run: design-code parity, accessibility on the canvas and in code, and design-system health. Exact token names and values, variants, variable bindings, and states as structured, verifiable data. The server doesn't prescribe a framework or house style, so the AI writes code in your team's own stack and conventions instead of guessing values from a screenshot. *** ## The Problem Every time a developer opens Figma, eyeballs the padding, and writes `margin: 16px` instead of `var(--spacing-md)`—that's design system debt. Every design token manually transcribed to CSS, every component spec described in a Slack message, every "just check Figma" that leads to approximation—it compounds. **What if your design system was queryable?** ``` "Get the Button component specs and implement it in React with our design tokens." ``` Real component data. Real token values. Real code that uses your actual design system. *** ## Three Workflows ### Make Your Work Programmable Your design system is a product. Developers are your users. Give them an API. Create tokens and components as you normally would Design tokens export to CSS, Tailwind, or Sass automatically Single source of truth that developers can query directly **Result:** Developers stop guessing at values. Design debt decreases. Documentation stays accurate. ### Query Design Systems Directly Stop treating Figma as a screenshot machine. Add the MCP server to your AI assistant Ask for token values, component specs, or visual references Get code that uses your actual design system variables **Result:** Implement components correctly the first time. Auto-generate token files. Debug plugins without Figma's dev tools. ### Design from Any AI Chat Use Claude.ai, v0, Replit, or Lovable to create and modify Figma designs — no local install needed. Run the Desktop Bridge plugin in your file Say "Connect to my Figma plugin" — enter the pairing code in the plugin Create components, update variables, and manipulate designs through natural language **Result:** Full write access from any web-based AI client. Variables on any Figma plan. No Node.js required. *** ## Capabilities Extract variables, styles, and components as structured data. Export to CSS custom properties, Tailwind config, Sass variables, or JSON. * `figma_get_design_system_kit` — **Full design system in one call** — tokens, components, styles, visual specs, and resolved values * `figma_get_variables` — Design tokens with multi-format export * `figma_get_styles` — Color, text, and effect styles * `figma_get_component` — Component metadata or reconstruction spec * `figma_get_design_system_summary` — Overview of entire system Turn a production codebase into a design system — analyze, tokenize, scaffold, port, verify. Local Mode only (these tools read and write your local filesystem). The extracted tokens import straight into Figma variables via `figma_import_tokens`. * `figma_ds_analyze` — Scan one or more app codebases: framework/styling/vendor detection, usage-ranked component inventory (vendored / wrapped / pure-vendor / bespoke), variant inference from real call sites, duplicate detection, and architecture classification (atomic levels, specializations, missing primitives) * `figma_ds_extract_tokens` — Mine styling into DTCG tokens with per-token provenance: multi-mode CSS custom properties, SCSS variables, Tailwind config values, shadcn HSL triples, utility-class frequency mining * `figma_ds_scaffold` — Generate the design-system package: token files, token/typography/iconography showcase pages, framework peer deps * `figma_ds_setup_storybook` — Wire a fresh Storybook workshop to the extraction: the app's real theme layers and fonts, plus a theme toolbar from the extracted modes * `figma_ds_extract_component` — Per-component porting manifest with a ready-to-adapt CSF3 story scaffold * `figma_ds_verify` — Deterministic fidelity evals + Figma round-trip readiness * `figma_ds_status` — Porting progress persisted across sessions Score your design system's health with a deterministic six-category audit — naming & semantics, token architecture, component metadata, accessibility, consistency, and coverage — from any MCP client. * `figma_audit_design_system_report` — Scored report as data: bounded summary, per-category chunked drill-down, clamped full JSON. Live-first fileKey-verified data with the source disclosed; 5-minute cache; every finding states whether this MCP can auto-fix it (with the exact tools) or needs a design decision * `figma_audit_design_system` — The same audit as a visual dashboard (MCP Apps hosts with `ENABLE_MCP_APPS=true`) Inspect components and variables from team libraries the current file has subscribed — without needing the library file's URL or an Enterprise plan. * `figma_get_library_component_by_key` — **Resolve any component key to full props + variants + visual specs.** Tries `/v1/component_sets/{key}` then falls back to `/v1/components/{key}`. Returns `componentPropertyDefinitions`, every variant with its published key, and per-variant visual specs. * `figma_get_library_components` — Discover all components in a library file (requires the library file URL/key) * `figma_get_library_variables` — **List library tokens.** Plugin API path works on every Figma plan; filter by `libraryName`, `collectionName`, or `resolvedType`. * `figma_import_library_variable` — Import a library variable into the current file. Returns a local `id` ready for `figma_set_fills` or any variable-binding tool. Real-time console log capture from your Figma plugins. No more console.log archaeology. * `figma_get_console_logs` — Retrieve logs with filtering * `figma_watch_console` — Real-time log streaming * `figma_take_screenshot` — Capture UI state for debugging Execute Figma Plugin API code directly. Build, modify, and organize components programmatically. * `figma_execute` — Run any Plugin API code, optionally in a specific connected file via `fileKey` (Local Mode) * `figma_execute_across_files` — Run the same script in several connected files at once (Local Mode) * `figma_create_component_set` — Build a full variant set from an axes matrix (or combine existing components) in one call — variant keys returned, ready to instantiate * `figma_arrange_component_set` — Organize variants with labels * `figma_create_slot` / `figma_append_to_slot` — Add slots to components and populate them on instances (Figma Slots, GA at Config 2026), plus `figma_get_slots`, `figma_reset_slot`, and `figma_add_slot_property` * `figma_create_variable` — Add design tokens * Plus dedicated tools for creating, moving, resizing, cloning, renaming, and deleting nodes, and for text, fills, strokes, image fills, instance properties, and component properties Compare a Figma component with its code implementation and generate documentation from both. * `figma_check_design_parity` — Deterministic comparison of a Figma component with its code: visual properties, spacing, typography, token usage, component API, accessibility, and metadata, with a parity score and a fix list * `figma_generate_component_doc` — Markdown component documentation: anatomy, per-variant color, spacing, and typography tokens, annotations, and a parity section. The optional `history` parameter adds a changelog from Figma version history and `git log` * `figma_get_component_for_development_deep` / `figma_analyze_component_set` — Full component trees with resolved token names, and variant sets as state machines with CSS pseudo-class mappings Work with a file's Figma version history. * `figma_get_file_versions` / `figma_get_file_at_version` — List versions and snapshot a file or node at a past version * `figma_diff_versions` / `figma_get_changes_since_version` — Structured diffs, including component property and binding changes * `figma_generate_changelog` — Markdown changelog for release notes * `figma_blame_node` — Find when, and by whom, a property or variant was introduced Bidirectional design token synchronization — a full code⇄Figma round-trip that replaces Style Dictionary and Tokens Studio's export pipeline. * `figma_export_tokens` — Export variables to DTCG JSON (legacy hex or DTCG 2025.10 object dialect via `dtcgDialect`), CSS custom properties, Tailwind v4/v3, SCSS, TypeScript, JSON, Style Dictionary v3, or Tokens Studio. Round-trip safe via `$extensions["figma-console-mcp"]`; scopes and codeSyntax metadata included. * `figma_import_tokens` — Push code-side edits back with a **full apply phase**: value updates, creates for missing collections/variables, renames matched by variable ID, real `VARIABLE_ALIAS` writes, and deletes gated strictly behind `strategy: "replace"`. Accepts both DTCG dialects; dry-run previews. * `figma_setup_design_tokens` — Bootstrap a collection + modes + variables atomically, with alias values via DTCG brace references (`"{color.blue.600}"`) AI sees your components visually and as structured data. Implementation guidance that matches the design. * `figma_get_component_for_development` — Visual reference + specs * `figma_capture_screenshot` — Node-specific renders * `figma_get_component_image` — Export as PNG/SVG Create and read FigJam collaborative whiteboards. Build affinity maps, flowcharts, retrospective boards, and more. * `figjam_create_sticky` / `figjam_create_stickies` — Single or batch sticky notes with 9 colors * `figjam_create_connector` — Connect nodes with labeled lines for flowcharts * `figjam_create_shape_with_text` — Diamonds, ellipses, and engineering shapes * `figjam_create_table` — Structured tables with cell data * `figjam_get_board_contents` / `figjam_get_connections` — Read everything on the board [Full FigJam Guide →](/figjam) Manage entire Figma Slides presentations. Create, edit, reorder, and navigate slides programmatically. * `figma_list_slides` / `figma_get_slide_content` — Read slide data and content trees * `figma_create_slide` / `figma_duplicate_slide` / `figma_delete_slide` — Slide lifecycle * `figma_set_slide_transition` — 22 transition styles with 8 easing curves * `figma_reorder_slides` — Restructure presentation order * `figma_add_text_to_slide` / `figma_add_shape_to_slide` — Add content to slides [Full Slides Guide →](/slides) Full-spectrum WCAG coverage across design and code: * **Design-side lint** — 14 WCAG checks with AA/best-practice level tagging: contrast, non-text contrast, color-only, focus indicators, disabled context, spacing, alt text, heading hierarchy, reflow, reading order, token misuse * **Component audit** — State coverage scoring, focus indicator quality, color-blind simulation (protanopia, deuteranopia, tritanopia) * **Code-side scan** — axe-core with 104 rules via JSDOM: ARIA, labels, landmarks, semantics, headings * **Parity bridge** — 9 checks ensuring design accessibility intent survives code implementation [Full Accessibility Guide →](/tools#-accessibility-tools) *** ## Choose Your Setup **Full capabilities — 121 tools** All tools including real-time monitoring. Requires Node.js and a Figma token. **Web AI clients — 96 tools** Full write access from Claude.ai, v0, Replit, or Lovable. Pair with a code — no Node.js needed. **Quick exploration — read-only** Zero setup, just paste a URL. Read design data and take screenshots. ### Quick Start: NPX Setup (Recommended) Visit [figma.com/developers/api#access-tokens](https://www.figma.com/developers/api#access-tokens) and create a Personal Access Token Add the server to your MCP client config (Claude Code, Cursor, Windsurf, Claude Desktop, etc.): ```json theme={null} { "mcpServers": { "figma-console": { "command": "npx", "args": ["-y", "figma-console-mcp@latest"], "env": { "FIGMA_ACCESS_TOKEN": "figd_YOUR_TOKEN_HERE" } } } } ``` Install the Desktop Bridge Plugin — one-time import, no debug flags needed. Run it in your Figma file to connect. Restart your MCP client to load the new config Detailed instructions for NPX, Cloud Mode, Local Git, and Remote installation across all AI clients. *** ## Resources New to MCP? Start here. AI-powered whiteboarding — stickies, flowcharts, tables AI-powered presentations — create, transition, navigate Real scenarios and workflows Complete reference for 121 tools Common issues and solutions *** **Open Source** — MIT licensed. Self-host for enterprise requirements or contribute on [GitHub](https://github.com/southleft/figma-console-mcp). **Support this project** — Figma Console MCP is free and open source. If it's improved your workflow, consider [sponsoring its development](https://github.com/sponsors/southleft). # What is Figma Console MCP? Source: https://docs.figma-console-mcp.southleft.com/introduction A beginner's guide to understanding MCP, Figma Console MCP, and how AI assistants can transform your design workflow. # Understanding Figma Console MCP New to AI-powered design tools? This guide explains everything you need to know—no technical background required. *** ## What is an MCP? **MCP** stands for **Model Context Protocol**. Think of it as a universal translator that lets AI assistants (like Claude, GitHub Copilot, Cursor, or ChatGPT) communicate with external tools and services. Without MCP, AI assistants are limited to what they already know. With MCP, they can: * **Connect** to tools like Figma, GitHub, or databases * **Read** real data from your actual projects * **Take action** on your behalf (with your permission) **Simple analogy:** If an AI assistant is like a helpful colleague, MCPs are like giving them access to your tools. Instead of describing your Figma file over chat, they can actually *look at it*. *** ## What is Figma Console MCP? **Figma Console MCP** is an MCP server for working with design systems in Figma. It does four things: 1. **Works in both directions.** It moves design tokens from Figma to code and back, turns an existing codebase into a design system you can bring into Figma, and compares Figma components with their code. 2. **Writes to Figma.** It creates and edits variables, components, component sets, Slots, annotations, FigJam boards, and Slides, and can run any Figma Plugin API code. 3. **Runs deterministic checks.** Rule-based checks for design-code parity, accessibility, and design-system health give the same result every time, so you can rely on them before a release. 4. **Gives the AI facts to write code from.** It returns exact token names and values, variants, variable bindings, and states as structured data. It doesn't push a framework or coding style, so the code the AI writes follows your team's own stack and conventions. ### What it enables: Pull design tokens, components, and styles as structured data Bidirectional token sync between Figma and your codebase (10 export formats, DTCG import) Build UI components and layouts directly in Figma through conversation Accessibility scanning with WCAG checks, component scorecards, and code analysis ### In plain English: Instead of manually copying values from Figma, you can ask: ``` "What's the padding on the Button component?" ``` Instead of transcribing tokens to CSS, you can say: ``` "Export all color variables as CSS custom properties" ``` Instead of building UI by hand, you can describe: ``` "Create a card component with an image, title, and action button" ``` The AI reads your actual design system, uses your real tokens, and generates accurate code—or creates designs directly in Figma. *** ## Why Does This Matter? ### The Problem Every time a developer opens Figma, eyeballs the padding, and writes `margin: 16px` instead of `var(--spacing-md)`—that's design system debt. **Common pain points:** * Design tokens manually transcribed to CSS (and often wrong) * Component specs described in Slack messages * "Just check Figma" that leads to guesswork and approximation * Designs and code drift apart over time ### The Solution **What if your design system was queryable?** Figma Console MCP makes this real. Your design system becomes: * **Programmable** — Tokens export to CSS, Tailwind, or Sass automatically * **Queryable** — AI can look up any value, any component, any style * **Alive** — Single source of truth that developers can access directly * **Creative** — AI can create designs using your actual tokens and components **Result:** Developers stop guessing at values. Design debt decreases. Designs and code stay in sync. *** ## Who Is This For? ### Make Your Design System Programmable Your design system is a product. Developers are your users. Give them an API. **With Figma Console MCP, you can:** * Export design tokens in any format (CSS, Tailwind, Sass, JSON) * Generate documentation automatically * Let developers query component specs directly * Create consistent UI through AI-assisted design **Example prompt:** ``` "Generate a style guide from my color and typography variables" ``` ### Query Design Systems, Don't Guess Stop treating Figma as a screenshot machine. **With Figma Console MCP, you can:** * Get exact token values without opening Figma * Implement components with accurate specs * Auto-generate token files from source * Stay in sync with design updates **Example prompt:** ``` "Get the Button component specs and implement it in React using our design tokens" ``` ### Full-Spectrum Accessibility Scanning WCAG coverage across design and code, without maintaining a rule database. **With Figma Console MCP, you can:** * Lint designs for 14 WCAG checks with AA/best-practice level tagging * Audit components for state coverage, focus quality, and color-blind safety * Scan HTML code with axe-core (104 rules) for ARIA, labels, and semantics * Compare design intent vs code implementation with parity checks **Example prompt:** ``` "Run an accessibility audit on the Button component and scan the code for issues" ``` ### Manage Large Token Libraries Effortlessly Scale your design system management with AI assistance. **With Figma Console MCP, you can:** * Audit token usage across components * Batch create variables for new themes * Document components automatically * Ensure consistency across large libraries **Example prompt:** ``` "Add a Dark mode to all color variables with appropriate values" ``` *** ## How Do I Get Started? **First, decide what you want to do:** | I want to... | Setup | Time | | - | - | - | | **Create and modify designs with AI** | NPX Setup (Recommended) | \~10 min | | **Design from Claude.ai, v0, Replit, or Lovable** | Cloud Mode | \~5 min | | **Just explore my design data** (read-only) | Remote Mode | \~2 min | ### Recommended: NPX Setup (Full Capabilities) Get all 121 tools including design creation, variable management, and component instantiation. Visit [Figma Help](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) and create a Personal Access Token Add the server config with your token to Claude Code, Cursor, Windsurf, Claude Desktop, or any MCP client Install the Desktop Bridge Plugin — one-time import, no debug flags needed. Run it in your Figma file to connect. Restart your MCP client to load the new config ### Cloud Mode (Web AI Clients) Using Claude.ai, v0, Replit, or Lovable? Get full write access (96 tools) without installing Node.js. Open the plugin in Figma Desktop (Plugins → Development → Figma Desktop Bridge) Say "Connect to my Figma plugin" — your AI generates a 6-character pairing code Toggle Cloud Mode in the plugin, enter the code, and click Connect ### Remote Mode (Read-Only) If you just want to explore or evaluate the tool, use Remote Mode. It's read-only but requires zero setup. Claude menu → Settings → Connectors Name: `Figma Console (Read-Only)` / URL: `https://figma-console-mcp.southleft.com/sse` **Remote mode without pairing is read-only.** For write access from web AI clients, use Cloud Mode above. For full capabilities with real-time monitoring, use NPX Setup. Detailed step-by-step instructions for all setup methods and AI clients. *** ## What Can I Do With It? Here are real prompts you can try right now: ### Design System Extraction ``` Get all design variables from https://figma.com/design/YOUR_FILE_ID ``` ``` Export color styles as Tailwind config ``` ``` Show me the Button component with a visual reference image ``` ### Component Implementation ``` Get the Card component specs and help me implement it in React ``` ``` What's the spacing between elements in the navigation bar? ``` ### Accessibility Scanning ``` Run an accessibility check on this page and show me all WCAG violations ``` ``` Audit the Button component for accessibility completeness and color-blind safety ``` ### Design Creation (Local & Cloud Mode) ``` Create a notification toast with icon, title, and dismiss button ``` ``` Build a user profile card using the Avatar and Button components ``` *** ## Three Ways to Connect Figma Console MCP offers three connection tiers with different capabilities: | Feature | Local (NPX/Git) | Cloud Mode | Remote (Read-Only) | | - | - | - | - | | **Total tools** | **121** | **96** after pairing | Read-only subset | | **Setup** | \~10 minutes | \~5 minutes | \~2 minutes | | **Create designs** | ✅ | ✅ | ❌ | | **Edit designs** | ✅ | ✅ | ❌ | | **Manage variables** | ✅ | ✅ | ❌ | | **Read design data** | ✅ | ✅ | ✅ | | **Accessibility scanning** | ✅ | ✅ | ❌ | | **Variables on any plan** | ✅ | ✅ | Enterprise only | | **Requires Node.js** | Yes | No | No | **Start with NPX Setup** for the complete experience. **Use Cloud Mode** to design from any web AI client without local installs. **Use Remote** for quick read-only exploration. Understand the technical differences and choose the right setup. *** ## Frequently Asked Questions No! You interact through natural language. Just describe what you want in plain English, and the AI handles the technical details. Yes. Remote mode uses OAuth (the same secure login as "Sign in with Google"). Your credentials are never shared with the MCP server—only temporary access tokens. Local mode keeps everything on your machine. No. They're complementary, and you can run both in the same client. Figma's official MCP server focuses on design-to-code context, Code Connect, and creating content in Figma. Figma Console MCP focuses on design-system operations: token sync, parity and accessibility checks, health audits, component documentation, and version history. See [Figma MCP vs. Figma Console MCP](/figma-mcp-vs-figma-console-mcp). Any MCP-compatible client: Claude Desktop, Claude Code, GitHub Copilot (VS Code 1.102+), Cursor, Windsurf, Zed, and others. Web-based clients like Claude.ai, v0, Replit, and Lovable work via Cloud Mode. If your AI tool supports MCP servers, it works with Figma Console MCP. Only for Local Mode (NPX/Git). Cloud Mode runs entirely in Cloudflare Workers — you just need Figma Desktop with the Desktop Bridge plugin. Remote read-only mode needs nothing at all. Yes! Figma Console MCP is open-source (MIT license). The hosted remote server is free to use. You can also self-host if you prefer. *** ## Next Steps Connect your AI assistant in minutes Real-world examples and workflows Complete reference for 121 tools *** **Open Source** — Figma Console MCP is MIT licensed. Contribute, customize, or self-host for enterprise requirements on [GitHub](https://github.com/southleft/figma-console-mcp). # MCP Apps Source: https://docs.figma-console-mcp.southleft.com/mcp-apps Interactive UI experiences powered by the MCP Apps protocol extension. Browse design tokens, inspect components, and more — rendered inline in your AI assistant. MCP Apps are rich, interactive UI panels that render directly inside your AI assistant. Instead of receiving plain text responses, you get fully interactive applications — with search, filtering, click-to-copy, and real-time data refresh. **Experimental** — MCP Apps use the [ext-apps protocol extension](https://github.com/anthropics/anthropic-cookbook/tree/main/misc/model_context_protocol/ext-apps) and require an MCP client with ext-apps support. The protocol may evolve. *** ## How MCP Apps Work MCP Apps extend the Model Context Protocol with a UI layer. When an AI tool returns a result, it can also include an interactive HTML application that renders inline in the conversation. ```mermaid theme={null} sequenceDiagram participant U as User participant A as AI Assistant participant M as MCP Server participant App as MCP App UI U->>A: Browse my design tokens A->>M: figma_browse_tokens() M-->>A: Summary text M-->>App: Token data (via app tool) App->>App: Render interactive UI Note over App: Search, filter, click-to-copy App->>M: token_browser_refresh() M-->>App: Fresh data ``` **Key concepts:** * **Server-side tools** register with the MCP server and handle data fetching * **App-only tools** are hidden from the AI model and callable only from the UI * **Resource URIs** point the host to the HTML application to render * **App SDK** (`@modelcontextprotocol/ext-apps`) handles the lifecycle, theming, and communication *** ## Available Apps ### Token Browser Browse all design tokens from your Figma file in an interactive table. **Features:** * Organized by variable collection with expandable sections * Filter by type (Colors, Numbers, Strings) and search by name * Per-collection mode columns (Light, Dark, Custom) matching Figma's layout * Color swatches with hex/rgba values and alias reference resolution * Click any token name or value to copy it to your clipboard **Usage:** ``` Browse the design tokens in the current file ``` The AI calls `figma_browse_tokens` which returns a brief summary to the conversation and renders the full interactive Token Browser inline. The tool uses the file currently connected through the Desktop Bridge plugin — no URL required. ### Design System Dashboard Audit your design system with a Lighthouse-style health scorecard rendered inline. **Features:** * Overall weighted score (0–100) with six category gauges: Naming, Tokens, Components, Accessibility, Consistency, Coverage * Expandable category sections with individual findings, severity indicators, and actionable details * Diagnostic locations linking findings to specific variables, components, or collections * Tooltips explaining each check's purpose and scoring criteria * Refresh button to re-run the audit without consuming AI context **Usage:** ``` Audit the design system in the current file ``` The AI calls `figma_audit_design_system` which returns a brief text summary and renders the full interactive dashboard inline. The tool uses the file currently connected through the Desktop Bridge plugin — no URL required. The same scoring engine is available without MCP Apps as `figma_audit_design_system_report`, which returns the report as data to any MCP client. The dashboard scores six categories: | Category | Weight | What it checks | | - | - | - | | Naming & Semantics | 25% | Semantic variable naming, component naming conventions | | Token Architecture | 20% | Alias usage, depth layering, mode support, descriptions | | Component Metadata | 20% | Descriptions, variant structure, standalone vs. set ratio | | Accessibility | 10% | Contrast-ready tokens, focus state components, readable naming | | Consistency | 15% | Delimiter usage, casing patterns, scale adherence, mode naming | | Coverage | 10% | Token type coverage, core component presence, variable count | *** ## Enabling MCP Apps MCP Apps are gated behind an environment variable and only available in Local Mode. ```json theme={null} { "mcpServers": { "figma-console-local": { "command": "node", "args": ["/path/to/figma-console-mcp/dist/local.js"], "env": { "FIGMA_ACCESS_TOKEN": "figd_YOUR_TOKEN_HERE", "ENABLE_MCP_APPS": "true" } } } } ``` When `ENABLE_MCP_APPS` is not set or set to `"false"`, no app tools are registered and existing functionality is completely unaffected. *** ## Architecture Each MCP App follows a modular structure: ``` src/apps// server.ts # Tool + resource registration (compiled by tsc) ui/ mcp-app.html # HTML shell with styles (bundled by Vite) mcp-app.ts # App logic using ext-apps SDK (inlined into HTML) ``` **Build pipeline:** 1. **TypeScript** compiles `server.ts` to `dist/apps//server.js` 2. **Vite** bundles the UI into a single self-contained `dist/apps//mcp-app.html` 3. The server registers a resource URI that serves the built HTML file 4. The host renders the HTML inline when the tool is called Apps use the official [`@modelcontextprotocol/ext-apps`](https://www.npmjs.com/package/@modelcontextprotocol/ext-apps) SDK for lifecycle management, host theming, and server communication. *** ## Building Apps The build system supports multiple apps via the `APP_NAME` environment variable: ```bash theme={null} # Build a specific app cross-env APP_NAME=token-browser vite build # Build all apps (runs as part of npm run build) npm run build:apps ``` Adding a new app requires: 1. Create `src/apps//server.ts` with tool and resource registration 2. Create `src/apps//ui/mcp-app.html` and `mcp-app.ts` 3. Add a `cross-env APP_NAME= vite build` entry to the `build:apps` script 4. Register the app in `src/local.ts` inside the `ENABLE_MCP_APPS` gate *** ## Roadmap Planned MCP Apps: * **Component Gallery** — Visual browser for searching and previewing components with variant exploration * **Style Inspector** — Interactive panel for exploring color, text, and effect styles with live previews * **Variable Diff Viewer** — Side-by-side comparison of token values across modes and branches *** ## Learn More * [MCP Apps Protocol Extension](https://github.com/anthropics/anthropic-cookbook/tree/main/misc/model_context_protocol/ext-apps) — Official specification * [`@modelcontextprotocol/ext-apps` on npm](https://www.npmjs.com/package/@modelcontextprotocol/ext-apps) — Client and server SDK * [Architecture](/architecture) — How Figma Console MCP works under the hood # Mode Comparison Source: https://docs.figma-console-mcp.southleft.com/mode-comparison Understand the differences between Remote, Cloud Mode, Local, and NPX installation methods and when to use each. # Installation Methods & Execution Modes - Complete Comparison This document clarifies the differences between installation methods and execution modes to help you choose the right setup. ## Understanding the Architecture The MCP server has **three execution modes** and **four setup methods**: ### Execution Modes (Where Code Runs) 1. **Remote Mode** - Runs in Cloudflare Workers (cloud, read-only) 2. **Cloud Mode** - Runs in Cloudflare Workers + Cloud Write Relay (cloud, read/write) 3. **Local Mode** - Runs on your machine (Node.js, full capabilities) ### Setup Methods (How You Connect) 1. **Remote SSE/HTTP** - URL-based connection (uses Remote Mode, read-only) 2. **Cloud Mode** - Remote endpoint + Cloud Write Relay via Desktop Bridge plugin (uses Cloud Mode) 3. **NPX** - npm package distribution (uses Local Mode) 4. **Local Git** - Source code clone (uses Local Mode) ### Authentication Methods (How You Authenticate) 1. **OAuth** - Automatic browser-based auth (Remote SSE only) 2. **Personal Access Token (PAT)** - Bearer token (Remote `/mcp` endpoint, Cloud Mode) 3. **Personal Access Token (PAT)** - Environment variable (NPX + Local Git) 4. **Pairing Code** - 6-character code to connect Desktop Bridge plugin to cloud relay (Cloud Mode only) **Key Insight:** Your choice of mode determines both capability level and setup complexity. ## 🎯 Quick Decision Guide ### ⚠️ Critical: Tool Count Differences | Mode | Tools Available | Write Access | Needs Node.js | Real-time | | - | - | - | - | - | | **Local Mode** (NPX or Git) | **121** | Yes | Yes | Yes | | **Cloud Mode** (Remote + Relay) | **96** | Yes | No | No | | **Remote Mode** (read-only) | Read-only subset | No | No | No | > **Bottom line:** Remote mode is read-only until you pair the plugin. Cloud Mode adds write access (96 tools) without Node.js. Local has everything (121 tools) including real-time monitoring. > **Two hosted endpoints.** The Cloud Mode count is for the `/mcp` endpoint that web AI clients use. The `/sse` endpoint that Claude Desktop and Claude Code connect to also lists the console-log, screenshot, navigation, status, and reload tools, which need a headless browser session that only `/sse` keeps open. Remote mode is either endpoint before you pair the plugin. ### Use NPX Setup (Recommended for Most Users) * ✅ **All 121 tools** including design creation and real-time monitoring * ✅ Automatic updates with `@latest` * ✅ Desktop Bridge Plugin support (recommended connection — no debug flags needed) * ✅ Variables without Enterprise plan * ⚠️ Requires Node.js 18+ and `FIGMA_ACCESS_TOKEN` (manual, one-time) ### Use Cloud Mode (Web AI Clients) * ✅ **96 tools** — full write access (create, edit, delete) plus REST API reads * ✅ No Node.js required — only Figma Desktop with the Desktop Bridge plugin * ✅ Works with Claude.ai, v0, Replit, Lovable, any MCP-capable web platform * ✅ Variables without Enterprise plan (via Plugin API) * ⚠️ Requires pairing the Desktop Bridge plugin via a 6-character code * ❌ No real-time selection tracking, document changes, or console streaming ### Use Local Git (For Contributors) * ✅ **All 121 tools** including design creation * ✅ Full source code access * ✅ Modify and test changes * ⚠️ Requires `FIGMA_ACCESS_TOKEN` (manual) * ⚠️ Manual updates via `git pull && npm run build` ### Use Remote Mode (Read-Only Exploration) * ✅ **TRUE zero-setup** - Just paste a URL * ✅ **OAuth authentication** - No manual tokens * ✅ Works without Figma Desktop restart * ❌ **Read-only** — cannot create or modify designs * ❌ Cannot use Desktop Bridge plugin * ❌ Variables require Enterprise plan *** ## Setup Methods Comparison | Aspect | Remote (read-only) | Cloud Mode | NPX | Local Git | | - | - | - | - | - | | **Execution** | Cloudflare Workers | Cloudflare Workers + Relay | Local Node.js | Local Node.js | | **Code** | `src/index.ts` | `src/index.ts` + relay | `dist/local.js` (npm) | `dist/local.js` (source) | | **Authentication** | OAuth (automatic) | PAT + pairing code | PAT (manual) | PAT (manual) | | **Setup Complexity** | ⭐ Zero-setup | Moderate (plugin + pairing) | Manual token + plugin install | Manual token + plugin install | | **Distribution** | URL only | URL + plugin | npm package | git clone | | **Updates** | Automatic (server-side) | Automatic (server-side) | `@latest` auto-updates | Manual `git pull + build` | | **Figma Desktop** | Not required | Required (Desktop Bridge) | Required (Desktop Bridge) | Required (Desktop Bridge) | | **Desktop Bridge** | ❌ Not available | ✅ Required for relay | ✅ Available | ✅ Available | | **Node.js Required** | No | No | Yes | Yes | | **Source Access** | No | No | No | Yes | | **Tools** | Read-only subset | 96 (read/write) | 121 (full) | 121 (full) | | **Use Case** | Quick evaluation | Web AI clients | Most users | Developers | *** ## Feature Availability Matrix | Feature | Remote (read-only) | Cloud Mode | Local Mode | Notes | | - | - | - | - | - | | **Read Design Data** | ✅ | ✅ | ✅ | All modes use Figma REST API | | **Design Creation (write)** | ❌ | ✅ | ✅ | Cloud via relay, Local via WebSocket | | **Variable Management** | ⚠️ | ✅ | ✅ | Remote requires Enterprise. Cloud/Local use Plugin API (any plan) | | **Screenshots** | ✅ | ✅ | ✅ | All use Figma REST API | | **Design System Reads** | ✅ | ✅ | ✅ | Variables, components, styles via Figma API | | **Codebase → Design System Extraction** (`figma_ds_*`) | ❌ | ❌ | ✅ | Local-only — reads and writes your local filesystem | | **Design-System Health Report** (`figma_audit_design_system_report`) | ❌ | ❌ | ✅ | Local-only | | **Component Search & Summaries** (`figma_search_components`, `figma_get_component_details`, `figma_get_design_system_summary`, `figma_get_token_values`) | ❌ | ❌ | ✅ | Local-only; Cloud Mode can use `figma_get_design_system_kit` and the library tools | | **Multi-File Execution** (`figma_execute_across_files`, `fileKey` targeting) | ❌ | ❌ | ✅ | Cloud Mode pairs with one plugin instance | | **Desktop Bridge Plugin** | ❌ | ✅ (required) | ✅ | Plugin required for Cloud relay and Local write access | | **Real-time Selection Tracking** | ❌ | ❌ | ✅ | Local-only — requires persistent WebSocket | | **Document Change Monitoring** | ❌ | ❌ | ✅ | Local-only — requires persistent WebSocket | | **Console Log Streaming** | ❌ | ❌ | ✅ | Local-only — zero-latency via WebSocket | | **Console Logs (on-demand)** | ✅ | ✅ | ✅ | Remote uses Browser Rendering API; Cloud + Local use the Desktop Bridge plugin | | **OAuth Authentication** | ✅ | ❌ | ❌ | Remote SSE only | | **Zero Setup** | ✅ | ❌ | ❌ | Remote: just paste URL | | **No Node.js Required** | ✅ | ✅ | ❌ | Cloud Mode only needs Figma Desktop + plugin | | **Reliable Component Descriptions** | ⚠️ | ✅ | ✅ | API has bugs; plugin method is reliable | | **Works Behind Corporate Firewall** | ⚠️ | ⚠️ | ✅ | Remote/Cloud require internet, Local works offline | | **Multi-User Shared Token** | ✅ | ❌ | ❌ | Remote uses per-user OAuth | ### Legend * ✅ Available * ❌ Not Available * ⚠️ Limited/Conditional *** ## Architecture Comparison ### Remote Mode Architecture (Read-Only) ``` Claude Desktop/Code ↓ (SSE over HTTPS) Cloudflare Workers MCP Server ↓ (Browser Rendering API) Headless Browser (in CF Workers) ↓ (HTTPS) Figma Web App ↓ (REST API) Figma Files & Design Data ``` **Key Points:** * Headless browser runs in Cloudflare's infrastructure (Browser Rendering API) * Cannot access `localhost` on your machine * OAuth tokens stored in Cloudflare KV * \~10-30s cold start for first request * Read-only tools (REST API reads, console/screenshot/navigate via headless browser) ### Cloud Mode Architecture (Read/Write via Relay) ``` Claude.ai / v0 / Replit / Lovable ↓ (Streamable HTTP) Cloudflare Workers MCP Server (/mcp) ↓ (fetch RPC) Plugin Relay Durable Object ↓ (WebSocket) Desktop Bridge Plugin (ui.html) ↓ (postMessage) Plugin Worker (code.js) ↓ (Plugin API) Figma Design Data ``` **Key Points:** * No Node.js required — relay runs entirely in Cloudflare Workers * Desktop Bridge plugin connects to the cloud relay via WebSocket * Pairing flow: AI generates 6-character code → user enters in plugin → connected * 96 tools available after pairing — write/manipulation + REST API reads + design system + slides + figjam + annotations + comments + version history * Variables work on any Figma plan (uses Plugin API, not Enterprise REST API) * Pairing code expires after 5 minutes ### Local Mode Architecture (Full Capabilities) ``` Claude Desktop/Code/Cursor/Windsurf ↓ (stdio transport) Local MCP Server (Node.js) ↓ (WebSocket, ports 9223–9232) Figma Desktop Bridge Plugin ↓ (Plugin API) Variables & Components Data ``` **Key Points:** * Install the Desktop Bridge Plugin once — no debug flags needed * Server automatically selects an available port (9223–9232) for multi-instance support * All 121 tools work through WebSocket * Plugin can access local variables (no Enterprise API needed) * Instant console log capture via WebSocket * Real-time selection tracking and document change monitoring *** ## Tool Availability by Mode ### Core Tools Available in Both Modes | Tool | Remote | Local | Notes | | - | - | - | - | | `figma_navigate` | ✅ | ✅ | Remote navigates the cloud headless browser; Local switches the active file among connected plugins | | `figma_get_console_logs` | ✅ | ✅ | Both capture logs, Local has lower latency | | `figma_watch_console` | ✅ | ✅ | Real-time log streaming | | `figma_take_screenshot` | ✅ | ✅ | Both use Figma REST API | | `figma_reload_plugin` | ✅ | ✅ | Reloads current page | | `figma_clear_console` | ✅ | ✅ | Clears log buffer | | `figma_get_status` | ✅ | ✅ | Check connection status | | `figma_get_design_system_kit` | ✅ | ✅ | Full design system in one call — tokens, components, styles, visual specs | | `figma_get_variables` | ✅\* | ✅\*\* | \*Enterprise API required. \*\*Can use Desktop Bridge plugin | | `figma_get_component` | ✅\* | ✅\*\* | \*Descriptions may be missing. \*\*Reliable via plugin | | `figma_get_styles` | ✅ | ✅ | Both use Figma REST API | | `figma_get_file_data` | ✅ | ✅ | Both use Figma REST API | | `figma_get_component_image` | ✅ | ✅ | Both use Figma REST API | | `figma_get_component_for_development` | ✅ | ✅ | Both use Figma REST API | | `figma_get_file_for_plugin` | ✅ | ✅ | Both use Figma REST API | ### Key Differences **Variables API:** * **Remote Mode:** Requires Figma Enterprise plan for Variables API * **Local Mode:** Can bypass Enterprise requirement using Desktop Bridge plugin **Component Descriptions:** * **Remote Mode:** Figma REST API has known bugs (descriptions often missing) * **Local Mode:** Desktop Bridge plugin uses `figma.getNodeByIdAsync()` (reliable) *** ## Prerequisites & Setup Time ### Remote (Read-Only) **Prerequisites:** None **Setup Time:** 2 minutes **Steps:** 1. Open Claude Desktop → Settings → Connectors 2. Click "Add Custom Connector" 3. Paste URL: `https://figma-console-mcp.southleft.com/sse` 4. Done ✅ (OAuth happens automatically on first API use) ### Cloud Mode **Prerequisites:** * Figma Desktop installed * Desktop Bridge plugin imported and running in your file * A web AI client connected to `https://figma-console-mcp.southleft.com/mcp` (with Figma PAT as Bearer token) **Setup Time:** 5 minutes **Steps:** 1. Connect your web AI client to the `/mcp` endpoint with your Figma PAT 2. Tell your AI to connect to your Figma plugin (natural language) 3. AI generates a 6-character pairing code 4. In the Desktop Bridge plugin, toggle "Cloud Mode" and enter the code 5. Done ✅ — 96 tools with full write access ### NPX **Prerequisites:** * Node.js 18+ * Figma Desktop installed * Figma Personal Access Token ([get one](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens)) **Setup Time:** 10 minutes **Steps:** 1. Get Figma Personal Access Token 2. Add to MCP config with `FIGMA_ACCESS_TOKEN` env var 3. Install the Desktop Bridge Plugin (one-time — Plugins → Development → Import from manifest) 4. Restart your MCP client ### Local Git **Prerequisites:** * Node.js 18+ * Git * Figma Desktop installed * Figma Personal Access Token ([get one](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens)) **Setup Time:** 15 minutes **Steps:** 1. Clone repository: `git clone https://github.com/southleft/figma-console-mcp.git` 2. Run `npm install && npm run build:local` 3. Get Figma Personal Access Token 4. Configure MCP client JSON config with path to `dist/local.js` 5. Set `FIGMA_ACCESS_TOKEN` environment variable 6. Install the Desktop Bridge Plugin (one-time — Plugins → Development → Import from manifest) 7. Restart your MCP client *** ## Authentication Comparison ### Remote SSE - OAuth (Automatic) ⭐ Simplest **Method:** Remote read-only mode (SSE endpoint) **How it works:** 1. First design system tool call triggers OAuth 2. Browser opens automatically to Figma authorization page 3. User authorizes app (one-time) 4. Token stored in Cloudflare KV (persistent across sessions) 5. Automatic token refresh when expired **Benefits:** * ✅ **TRUE zero-setup** - No manual token creation * ✅ Per-user authentication * ✅ Automatic token refresh * ✅ Works with Free, Pro, and Enterprise Figma plans **Limitations:** * ⚠️ Requires internet connection * ⚠️ Initial authorization flow required (one-time) * ❌ Read-only — no write access ### Cloud Mode - PAT + Pairing Code **Method:** Cloud Mode with write relay **How it works:** 1. User creates PAT and provides it as Bearer token when connecting to `/mcp` endpoint 2. AI generates a 6-character pairing code (valid for 5 minutes) 3. User enters code in Desktop Bridge plugin (Cloud Mode toggle) 4. Relay authenticates the plugin-to-cloud connection 5. All write operations flow through the authenticated relay **Benefits:** * ✅ Write access without Node.js * ✅ Pairing code adds a second factor of trust (plugin must be in the right file) * ✅ Variables on any Figma plan via Plugin API **Limitations:** * ❌ Manual PAT creation required * ❌ Pairing code expires after 5 minutes * ⚠️ Must re-pair if connection drops ### NPX + Local Git - Personal Access Token (Manual) **Method:** Both NPX and Local Git modes **How it works:** 1. User creates PAT at [https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) 2. Set as `FIGMA_ACCESS_TOKEN` environment variable in MCP config 3. MCP server uses PAT for all API calls 4. No automatic refresh (token valid for 90 days) **Benefits:** * ✅ Works offline (for console debugging) * ✅ No browser-based OAuth flow * ✅ Simpler for single-user setups * ✅ Full 121 tools including real-time monitoring **Limitations:** * ❌ **Manual token creation required** * ❌ Must manually refresh every 90 days * ❌ Single shared token (no per-user auth) * ❌ **Requires Desktop Bridge Plugin** (one-time import) **Why NPX ≠ Simpler:** Despite being distributed via npm, NPX has identical authentication complexity to Local Git. The only difference is distribution method, not setup complexity. *** ## Figma Desktop Bridge Plugin ### Required for Both Local Mode and Cloud Mode The Desktop Bridge Plugin is the bridge between Figma and the MCP server. It communicates via WebSocket — no special Figma launch flags needed, and it persists across Figma restarts. * **Local Mode:** Plugin connects directly to the local MCP server via WebSocket (ports 9223-9232) * **Cloud Mode:** Plugin connects to the Cloudflare relay via WebSocket after pairing with a 6-character code **Plugin Setup:** 1. Open Figma Desktop (normal launch — no debug flags needed) 2. Go to **Plugins → Development → Import plugin from manifest...** 3. Select `figma-desktop-bridge/manifest.json` from the figma-console-mcp directory 4. Run the plugin in your Figma file — it auto-connects via WebSocket > **One-time import.** Once imported, the plugin stays in your Development plugins list. **What the plugin provides:** | Feature | Without Plugin | With Plugin (Cloud Mode) | With Plugin (Local Mode) | | - | - | - | - | | Variables API | Enterprise plan required | ✅ Free/Pro plans work | ✅ Free/Pro plans work | | Variable data | REST API (limited) | ✅ Full local variables | ✅ Full local variables | | Component descriptions | Often missing (API bug) | ✅ Always present | ✅ Always present | | Design creation (write) | ❌ | ✅ Via cloud relay | ✅ Via local WebSocket | | Data freshness | Cache + API limits | Per-request via relay | ✅ Real-time from Figma | | Selection tracking | ❌ | ❌ | ✅ Real-time via WebSocket | | Document change monitoring | ❌ | ❌ | ✅ Real-time via WebSocket | **Local Mode Transport:** The server automatically selects an available port in the range 9223–9232, supporting multiple simultaneous MCP instances. All 121 tools work through the WebSocket transport. **Cloud Mode Transport:** The plugin connects to the Cloudflare relay after pairing. Write operations are relayed from the cloud MCP server through the Durable Object to the plugin. 96 tools are available. ### Plugin Does NOT Work with Remote Read-Only Mode Remote read-only mode runs in Cloudflare Workers which cannot connect to `localhost` on your machine. The Desktop Bridge Plugin requires either a local MCP server (NPX or Local Git) or Cloud Mode pairing. *** ## When to Switch Modes ### Switch from Remote (read-only) → Cloud Mode if: * ❌ You need to create or modify designs from a web AI client * ❌ You need variables but don't have Enterprise plan * ❌ Component descriptions are missing in API responses ### Switch from Remote (read-only) → NPX/Local Git if: * ❌ You need real-time selection tracking or document change monitoring * ❌ You're developing Figma plugins (need console log streaming) * ❌ You need the full Local Mode tool set * ❌ You need offline access ### Switch from Cloud Mode → NPX/Local Git if: * ❌ You need real-time selection tracking or document changes * ❌ You need console log streaming * ❌ You need MCP Apps (Token Browser, Design System Dashboard) * ❌ You want to extract a design system from a codebase (`figma_ds_*` tools) * ❌ You need the design-system health report, component search, or multi-file execution * ❌ Connection drops between AI turns are disruptive to your workflow ### Switch from NPX/Local Git → Cloud Mode if: * ✅ You want to use web AI clients (Claude.ai, v0, Replit, Lovable) * ✅ You don't need real-time monitoring features * ✅ You can't or don't want to install Node.js ### Switch from NPX/Local Git → Remote (read-only) if: * ✅ You got Enterprise plan (Variables API now available) * ✅ You're no longer developing plugins * ✅ You want zero-maintenance OAuth setup * ✅ You want per-user authentication * ✅ You only need read access ### Switch from NPX → Local Git if: * ✅ You want to modify source code * ✅ You want to test unreleased features * ✅ You're developing the MCP server itself ### Switch from Local Git → NPX if: * ✅ You don't need source code access * ✅ You want automatic updates * ✅ You want simpler distribution (no git operations) *** ## Cost Comparison All setup methods are completely free: ### Remote / Cloud Mode (Free - Hosted by Project) * ✅ Free to use * ✅ Hosted on Cloudflare Workers * ✅ No infrastructure costs for users * ⚠️ Shared rate limits (fair use) ### NPX (Free - Self-Hosted) * ✅ Free to use * ✅ Runs on your machine * ✅ No external dependencies after setup * ⚠️ Uses your CPU/memory ### Local Git (Free - Self-Hosted) * ✅ Free to use * ✅ Runs on your machine * ✅ Full source code access * ⚠️ Uses your CPU/memory *** ## Troubleshooting by Mode ### Remote Mode Common Issues * **"OAuth authentication failed"** → Try re-authenticating via auth\_url * **"Browser connection timeout"** → Cold start (wait 30s, try again) * **"Variables API 403 error"** → Enterprise plan required (use Cloud Mode or Local Mode instead) ### Cloud Mode Common Issues * **Pairing code expired** → Ask your AI to generate a new pairing code (codes expire after 5 minutes) * **Connection drops between AI turns** → Re-pair by asking your AI to reconnect and entering a fresh code in the plugin * **"Cloud Mode" toggle not visible** → Re-import the manifest from `~/.figma-console-mcp/plugin/manifest.json` to refresh Figma's cached plugin code (Cloud Mode was added in v1.12.0) * **Plugin shows "Disconnected" in Cloud Mode** → Check your internet connection; the relay requires both the plugin and the cloud server to be online * **Write operations not working** → Verify the Desktop Bridge plugin is running in the file you want to modify ### Local Mode Common Issues * **"Failed to connect to Figma Desktop"** → Install the Desktop Bridge Plugin (Plugins → Development → Import from manifest) and run it in your file * **"No plugin UI found"** → Make sure the Desktop Bridge Plugin is running in your Figma file * **"Variables cache empty"** → Close and reopen Desktop Bridge plugin * **Plugin shows "Disconnected"** → Make sure the MCP server is running (start/restart your MCP client) *** ## Summary **For most users: Start with NPX Setup** ⭐ * All 121 tools including design creation and real-time monitoring * Automatic updates with `@latest` * Desktop Bridge plugin support * Variables without Enterprise plan **Use Cloud Mode when:** * You use web AI clients (Claude.ai, v0, Replit, Lovable) * You need write access but can't install Node.js * You don't need real-time selection/document tracking **Use Local Git when:** * You're developing the MCP server * You want to modify source code * You need unreleased features * You're testing changes before contributing **Use Remote (read-only) when:** * You just want to explore/evaluate the tool * You only need read-only access to design data * You want zero-setup experience * You don't need design creation capabilities **Key Takeaway:** The three modes offer a clear capability progression: * **Remote (read-only):** view data, screenshots, design system extraction * **Cloud Mode:** 96 tools — adds full write access (create, edit, delete) via relay * **Local Mode (NPX/Git):** 121 tools — adds real-time monitoring (selection, changes, console) The difference is not just authentication, but **fundamental capabilities**: * **Remote:** Cannot create, modify, or delete anything in Figma * **Cloud:** Full design creation and variable management via the Desktop Bridge relay * **Local:** Everything in Cloud, plus real-time selection tracking, document change monitoring, and console log streaming # OAuth Setup Source: https://docs.figma-console-mcp.southleft.com/oauth-setup Configure OAuth authentication for the Figma Console MCP server, enabling automatic browser-based authentication. # OAuth Setup Guide This guide explains how to set up OAuth authentication for the Figma Console MCP server, allowing users to authenticate with their own Figma accounts. ## Overview OAuth authentication enables: * ✅ **Per-user authentication** - Each user authenticates with their own Figma account * ✅ **Secure token storage** - Tokens stored securely in Cloudflare Workers KV (encrypted at rest) * ✅ **No credential sharing** - No need to share personal access tokens * ✅ **Browser-based flow** - Seamless authentication experience * ✅ **Automatic token management** - Tokens managed transparently ## Architecture ``` User → Claude Code → Remote MCP Server ↓ Browser OAuth Flow → Figma Authorization ↓ Token stored in Workers KV (per-session) ↓ All API calls use user's personal token ``` *** ## For Server Administrators ### Step 1: Create a Figma OAuth App 1. Go to [Figma Developers](https://www.figma.com/developers) 2. Click **"My Apps"** → **"Create new app"** 3. Fill in app details: * **App name**: `Figma Console MCP` (or your preferred name) * **App description**: `AI-powered Figma debugging and design system tools` * **App website**: `https://github.com/southleft/figma-console-mcp` 4. Add **Redirect URL**: ``` https://figma-console-mcp.southleft.com/oauth/callback ``` Replace `figma-console-mcp.southleft.com` with your actual deployment URL. 5. **Save** and copy: * ✅ **Client ID** (public) * ✅ **Client Secret** (private - only shown once!) ### Step 2: Configure Cloudflare Secrets Set the OAuth credentials as Cloudflare Workers secrets: ```bash theme={null} # Set Client ID wrangler secret put FIGMA_OAUTH_CLIENT_ID # Paste your Client ID when prompted # Set Client Secret wrangler secret put FIGMA_OAUTH_CLIENT_SECRET # Paste your Client Secret when prompted ``` **Important**: Never commit these secrets to version control! ### Step 3: Deploy Your MCP Server ```bash theme={null} npm run deploy ``` Or via Cloudflare Dashboard: 1. Go to **Workers & Pages** → **figma-console-mcp** 2. Navigate to **Settings** → **Variables** 3. Add encrypted environment variables: * `FIGMA_OAUTH_CLIENT_ID` * `FIGMA_OAUTH_CLIENT_SECRET` ### Step 4: Verify Configuration Check your deployment's health endpoint: ```bash theme={null} curl https://figma-console-mcp.southleft.com/health ``` Response should include: ```json theme={null} { "status": "healthy", "oauth_configured": true, "endpoints": ["/oauth/authorize", "/oauth/callback", ...] } ``` *** ## For End Users ### Installation Users simply connect to your remote MCP server - no OAuth setup needed on their end! ```bash theme={null} claude mcp add --transport sse figma-console https://figma-console-mcp.southleft.com/sse ``` ### Authentication Flow 1. **First API Call**: When a user calls a Figma API tool for the first time, they'll receive an error with an authentication URL 2. **Browser Opens**: Their browser automatically opens the Figma OAuth page 3. **User Authorizes**: User logs in with Figma and authorizes the app 4. **Success**: Browser shows success message and closes automatically 5. **All Set**: Subsequent API calls work seamlessly with their personal token ### Example User Experience ``` User: "Get variables from my Figma file" Claude: Authentication required. Opening browser... [Browser opens → User logs in → Success!] Claude: ✅ Retrieved 247 design variables from your file ``` *** ## Security Considerations ### Token Storage * Tokens stored in Cloudflare Workers KV (encrypted at rest) * Scoped per-session (not shared between users) * Automatically cleaned up when tokens expire (90-day TTL) ### OAuth Scopes Currently requesting: * `file_content:read` - Read access to Figma file content * `library_content:read` - Read access to library/component content * `file_variables:read` - Read access to design variables (for Enterprise accounts) ### Token Refresh * ✅ Automatic token refresh implemented * Tokens are automatically refreshed when expired using the refresh token * Users only need to re-authenticate if refresh fails or after extended inactivity ### Best Practices ✅ **DO**: * Keep Client Secret confidential * Use HTTPS for all OAuth callbacks * Rotate secrets periodically * Monitor OAuth usage via Figma dashboard ❌ **DON'T**: * Commit secrets to version control * Share Client Secret publicly * Use OAuth for untrusted deployments *** ## Troubleshooting ### "OAuth not configured" Error **Symptom**: Users see `OAuth not configured` error **Solution**: Ensure `FIGMA_OAUTH_CLIENT_ID` and `FIGMA_OAUTH_CLIENT_SECRET` are set in Cloudflare Workers secrets ```bash theme={null} # Check if secrets are set wrangler secret list # Set missing secrets wrangler secret put FIGMA_OAUTH_CLIENT_ID ``` ### "Invalid redirect\_uri" Error **Symptom**: OAuth callback fails with redirect URI mismatch **Solution**: Ensure redirect URL in Figma app settings exactly matches your deployment URL: ``` https://your-domain.com/oauth/callback ``` ### Token Expired **Symptom**: Users see "Token expired. Please re-authenticate." **Solution**: User needs to call any Figma API tool to trigger re-authentication flow ### Debugging OAuth Flow Enable debug logging: ```bash theme={null} # Check Cloudflare Workers logs wrangler tail ``` *** ## Migration from Personal Access Tokens If you're currently using `FIGMA_ACCESS_TOKEN` (deprecated): 1. Set up OAuth as described above 2. Keep `FIGMA_ACCESS_TOKEN` for backward compatibility 3. New users will automatically use OAuth 4. Existing token-based users can continue until tokens expire 5. Eventually remove `FIGMA_ACCESS_TOKEN` when all users migrated *** ## OAuth App Settings ### Scopes Requested * `file_content:read` - Read Figma file content * `library_content:read` - Read library/component data * `file_variables:read` - Read design variables (Enterprise) ### Webhook Configuration (Optional) Future enhancement: Set up webhooks for token revocation notifications *** ## Support * **Documentation**: [https://github.com/southleft/figma-console-mcp](https://github.com/southleft/figma-console-mcp) * **Issues**: [https://github.com/southleft/figma-console-mcp/issues](https://github.com/southleft/figma-console-mcp/issues) * **Figma OAuth Docs**: [https://www.figma.com/developers/api#oauth2](https://www.figma.com/developers/api#oauth2) # Reconstruction Format Source: https://docs.figma-console-mcp.southleft.com/reconstruction-format Generate node tree specifications for programmatic component creation with the Figma Component Reconstructor plugin. # Reconstruction Format Guide The reconstruction format generates node tree construction specifications compatible with the Figma Component Reconstructor plugin, enabling programmatic component creation. ## Overview ### Two Export Formats **Metadata Format (Default)** * Comprehensive documentation of component properties * Ideal for style guides, design systems, and documentation * Includes variant information, design tokens, and quality metrics **Reconstruction Format** ⭐ NEW * Complete node tree specification for programmatic creation * All properties needed to recreate components in Figma * Compatible with Figma Component Reconstructor plugin ## Usage ### Basic Usage ```javascript theme={null} // Get reconstruction specification const result = await figma_get_component({ fileUrl: 'https://figma.com/design/abc123', nodeId: '123:456', format: 'reconstruction' }); ``` ### Output Structure The reconstruction format returns the node specification directly at the root level (compatible with Figma Component Reconstructor plugin): ```json theme={null} { "name": "Badge Success Dot", "type": "ELLIPSE", "width": 8, "height": 8, "x": 0, "y": 0, "fills": [{ "type": "SOLID", "color": { "r": 0.21, "g": 0.70, "b": 0.44, "a": 1.0 }, "opacity": 1, "visible": true }], "strokes": [], "effects": [], "opacity": 1, "blendMode": "NORMAL", "children": [] } ``` Auto-layout frames also carry their layout and sizing, including min/max constraints, and each child's position relative to its parent: ```json theme={null} { "name": "Card", "type": "COMPONENT", "x": 0, "y": 0, "width": 320, "height": 56, "layoutMode": "HORIZONTAL", "primaryAxisSizingMode": "AUTO", "counterAxisSizingMode": "AUTO", "itemSpacing": 12, "paddingLeft": 16, "paddingRight": 16, "paddingTop": 8, "paddingBottom": 8, "layoutSizingHorizontal": "HUG", "minWidth": 320, "maxWidth": 640, "children": [ { "name": "Body", "type": "FRAME", "x": 16, "y": 8, "width": 252, "height": 40, "layoutSizingHorizontal": "FILL", "minHeight": 40, "maxHeight": 200 } ] } ``` The reconstruction format always reads the node tree from the Figma REST API, so it needs a Figma access token even when the Desktop Bridge plugin is connected. **Note:** Unlike the metadata format which wraps the response with `fileKey`, `nodeId`, and `source` fields, the reconstruction format returns the raw spec for direct plugin compatibility. ## Supported Node Types The reconstruction format supports all major Figma node types: * **Layout Containers**: `FRAME`, `COMPONENT`, `COMPONENT_SET`, `INSTANCE`, `GROUP`, `SECTION` * **Shapes**: `RECTANGLE`, `ELLIPSE`, `POLYGON`, `STAR`, `VECTOR`, `LINE` * **Text**: `TEXT` (with font properties) * **Special**: `BOOLEAN_OPERATION`, `SLICE` ## Properties Extracted ### Common Properties (All Nodes) * `name` - Node name * `type` - Node type * `x`, `y` - Position * `width`, `height` - Dimensions * `opacity` - Opacity (0-1) * `blendMode` - Blend mode * `visible` - Visibility flag * `locked` - Lock status * `description` - Node description * `constraints` - Layout constraints ### Visual Properties * `fills` - Fill paints (solid, gradient, image) * `strokes` - Stroke paints * `strokeWeight` - Stroke thickness * `strokeAlign` - Stroke alignment * `effects` - Shadow and blur effects * `cornerRadius` - Corner radius * `rectangleCornerRadii` - Individual corner radii ### Layout Properties (Frames/Components) * `layoutMode` - Auto-layout mode (`NONE`, `HORIZONTAL`, `VERTICAL`) * `paddingLeft`, `paddingRight`, `paddingTop`, `paddingBottom` - Padding * `itemSpacing` - Gap between items * `primaryAxisAlignItems` - Main axis alignment * `counterAxisAlignItems` - Cross axis alignment * `clipsContent` - Clipping flag ### Text Properties * `characters` - Text content * `fontSize` - Font size * `fontName` - Font family and style * `textAlignHorizontal` - Horizontal alignment * `textAlignVertical` - Vertical alignment * `lineHeight` - Line height * `letterSpacing` - Letter spacing ## Color Format Colors are in Figma's normalized 0-1 RGB format (NOT 0-255): ```json theme={null} { "color": { "r": 0.21, // Red: 0.0 to 1.0 "g": 0.70, // Green: 0.0 to 1.0 "b": 0.44, // Blue: 0.0 to 1.0 "a": 1.0 // Alpha: 0.0 to 1.0 } } ``` ## Working with Component Sets For `COMPONENT_SET` nodes (variants), the response includes available variants: ```json theme={null} { "spec": { "type": "COMPONENT_SET", "name": "Button", "children": [...] }, "availableVariants": [ "Type=Primary, Size=Medium", "Type=Secondary, Size=Medium", "Type=Primary, Size=Large" ], "note": "This is a COMPONENT_SET with multiple variants..." } ``` To extract a specific variant, you can filter the children array or use a custom implementation. ## Validation Reconstruction specs are validated server-side against plugin requirements. Invalid specs will return error messages. The spec itself doesn't include validation fields - it's just the raw node specification. ### Validation Checks * ✅ Required fields (name, type) * ✅ Valid node types * ✅ Dimension constraints (width/height ≥ 0) * ✅ Opacity range (0-1) * ✅ Color value range (0-1 for RGB) * ✅ Recursive validation of children ## Use Cases ### 1. Version Control for Components Export component specifications to JSON files for version control: ```bash theme={null} # Export component spec figma_get_component --format reconstruction > button-v1.json # Track changes over time git add button-v1.json git commit -m "Update button component" ``` ### 2. Component Migration Migrate components between files or projects: ```javascript theme={null} // Export from source file const sourceSpec = await figma_get_component({ fileUrl: 'https://figma.com/design/source', nodeId: '123:456', format: 'reconstruction' }); // Import to target file using Figma Component Reconstructor plugin // Use sourceSpec.spec with the plugin ``` ### 3. Programmatic Component Generation Generate components from code or design systems: ```javascript theme={null} // Generate button variants programmatically const variants = ['primary', 'secondary', 'tertiary']; const sizes = ['small', 'medium', 'large']; for (const variant of variants) { for (const size of sizes) { const spec = generateButtonSpec(variant, size); // Use spec with Figma Component Reconstructor plugin } } ``` ### 4. Design System Synchronization Keep design systems in sync between tools: ```javascript theme={null} // Export design system components const components = ['Button', 'Input', 'Card', 'Badge']; const specs = {}; for (const component of components) { specs[component] = await figma_get_component({ nodeId: componentIds[component], format: 'reconstruction' }); } // Store or sync with external design system await designSystem.sync(specs); ``` ## Comparison: Metadata vs Reconstruction | Feature | Metadata Format | Reconstruction Format | | - | - | - | | **Purpose** | Documentation, references | Programmatic creation | | **Enrichment** | ✅ Design tokens, quality metrics | ❌ Not applicable | | **File Size** | Larger (includes metadata) | Smaller (spec only) | | **Color Format** | Various formats | Normalized 0-1 RGB | | **Validation** | ❌ Not validated | ✅ Validated against plugin | | **Use With** | Style guides, docs | Component Reconstructor plugin | | **Best For** | Understanding, documenting | Building, migrating | ## Limitations ### Current Limitations 1. **Font Loading**: TEXT nodes may require font availability in target file 2. **Image References**: IMAGE fills reference images by URL (may need re-uploading) 3. **Plugin Data**: Custom plugin data is not included in reconstruction spec 4. **Complex Vectors**: Complex vector paths may lose some detail 5. **Instances**: INSTANCE nodes reference component IDs (must exist in target) ### Best Practices * ✅ Test reconstruction with simple shapes first (RECTANGLE, ELLIPSE) * ✅ Verify color values are in 0-1 range * ✅ Check validation output before using spec * ✅ Handle COMPONENT\_SET children appropriately * ✅ Ensure fonts are available when reconstructing TEXT nodes * ✅ Store specs in version control for tracking changes ## Examples ### Simple Shape ```javascript theme={null} // Export a simple rectangle const rect = await figma_get_component({ nodeId: '1:2', format: 'reconstruction' }); // Output spec { "name": "Background", "type": "RECTANGLE", "width": 200, "height": 100, "x": 0, "y": 0, "fills": [{ "type": "SOLID", "color": { "r": 0.95, "g": 0.95, "b": 0.95, "a": 1 }, "opacity": 1, "visible": true }], "cornerRadius": 8 } ``` ### Auto-Layout Frame ```javascript theme={null} // Export a frame with auto-layout const frame = await figma_get_component({ nodeId: '2:3', format: 'reconstruction' }); // Output spec { "name": "Card", "type": "FRAME", "width": 320, "height": 200, "layoutMode": "VERTICAL", "paddingTop": 16, "paddingBottom": 16, "paddingLeft": 16, "paddingRight": 16, "itemSpacing": 12, "primaryAxisAlignItems": "MIN", "counterAxisAlignItems": "CENTER", "fills": [{ "type": "SOLID", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "opacity": 1, "visible": true }], "effects": [{ "type": "DROP_SHADOW", "color": { "r": 0, "g": 0, "b": 0, "a": 0.1 }, "offset": { "x": 0, "y": 2 }, "radius": 8, "visible": true }], "children": [...] } ``` ## Support For issues or questions about the reconstruction format: 1. Check validation errors in the response 2. Verify node types are supported 3. Ensure color values are in 0-1 range 4. Review [Figma Component Reconstructor plugin documentation](https://github.com/southleft/figma-console-mcp) 5. [Open an issue](https://github.com/southleft/figma-console-mcp/issues) with example spec ## Future Enhancements Planned improvements: * [ ] Support for variant property extraction * [ ] Advanced vector path reconstruction * [ ] Image embedding options * [ ] Component property definitions * [ ] Instance overrides support * [ ] Batch export for multiple components # Security & Privacy Source: https://docs.figma-console-mcp.southleft.com/security Security architecture, data handling, and compliance information Figma Console MCP is designed with security as a priority. The project is **fully open source** (MIT licensed), allowing complete code auditing by security teams. ## Architecture Security ### Deployment Modes **Recommended for security-sensitive environments** * Runs entirely on localhost via stdio * Zero external network calls * All communication stays local **For browser-based MCP clients** * SSE transport via Cloudflare Workers * OAuth tokens handled server-side * All traffic encrypted (HTTPS) ### Data Handling | Aspect | Details | | - | - | | **Data Storage** | None. No design data is persisted or cached to disk. | | **Telemetry** | None. No analytics, tracking, or usage data collection. | | **Logging** | Local only. Logs stay on your machine. | | **Credentials** | Stored in your local MCP config, never transmitted to third parties. | ## Authentication Figma Console MCP uses **Figma's native authentication**: * Generated in Figma account settings * Stored locally in your MCP client config * Never transmitted except to `api.figma.com` * Scoped permissions based on token configuration * Uses Figma's official OAuth 2.0 flow * Tokens managed via Figma's authorization servers * No custom credential handling ## Code Execution (`figma_execute`) The `figma_execute` tool runs JavaScript in Figma's plugin context: Code runs in Figma's **plugin sandbox**, not your system. It cannot access your filesystem, network, or other applications. **Sandbox limitations:** * No filesystem access * No network access outside Figma's plugin APIs * Cannot access other browser tabs or system resources * Can only modify the currently open Figma file **Mitigations:** * Desktop Bridge must be manually started * All execution is user-initiated * Changes covered by Figma's version history ## Data Access Scope | Data Type | Access | | - | - | | Variables/Tokens | Read | | Components | Read | | Styles | Read | | File Structure | Read | | Console Logs | Read | | Design Modifications | Write (via Desktop Bridge) | * Your filesystem * Other applications * Browser data * Network resources outside Figma * Other Figma files (only current file) ## Network Security All network communication is limited to: * `api.figma.com` — Figma's official REST API (HTTPS) * `localhost:9223–9232` — WebSocket Bridge (Desktop Bridge Plugin communication, port range for multi-instance support) * `*.workers.dev` — Remote mode only (HTTPS) ### WebSocket Bridge Security * **Localhost-only binding** — The WebSocket server binds to `localhost` only, not accessible from external networks * **No authentication required** — Since it's localhost-only, the attack surface is limited to local processes * **Request/response correlation** — Each command uses a unique correlation ID to prevent response confusion * **Per-file isolation** — Multiple connected Figma files maintain independent state (selection, changes, console logs) **No external dependencies at runtime** — No third-party analytics, CDNs, or external API calls beyond Figma. ## Vendor Trust & Compliance ### Vendor Identity Figma Console MCP is built and maintained by **Southleft, LLC**. For security or legal inquiries that require a direct contact (vendor questionnaires, DPAs, procurement reviews), email **[info@southleft.com](mailto:info@southleft.com)**. For vulnerability reports, prefer the [private security advisory](https://github.com/southleft/figma-console-mcp/security/advisories/new) flow. ### Formal Attestations Southleft does **not currently hold SOC 2, ISO 27001, or equivalent third-party attestations** for Figma Console MCP. The product is intentionally designed so that — particularly in Local mode — there is no vendor-side data processing that would require such attestations: * No Southleft-hosted service in the data path * No data persistence, telemetry, or analytics * No accounts, no user database, no logs leaving your machine The complete source is MIT-licensed and available for audit on [GitHub](https://github.com/southleft/figma-console-mcp). Releases are published to npm as [`figma-console-mcp`](https://www.npmjs.com/package/figma-console-mcp). ### Data Processing & DPA | Mode | Southleft's Role | DPA Applicability | | - | - | - | | **Local Mode** | Not a data processor. Southleft has no access to design data, credentials, or user information. All traffic is between your machine and Figma. | A DPA is not applicable — Southleft does not receive or process customer data. | | **Remote Mode** | Operates the Cloudflare Worker that brokers OAuth and proxies requests to Figma. No design data is persisted. | A DPA can be provided on request. Email [info@southleft.com](mailto:info@southleft.com). | ### Sub-processors | Mode | Sub-processors | | - | - | | **Local Mode** | None. | | **Remote Mode** | Cloudflare (Workers hosting, traffic transit), Figma (authentication and design API). | Figma is always in scope as the upstream platform regardless of mode, since Figma Console MCP is a client to the Figma API. ### Compliance Posture | Standard | Status | | - | - | | **SOC 2 / ISO 27001** | Not currently attested. Minimal surface in Local mode (no vendor-side data storage or processing). | | **GDPR** | No personal data collected or processed by Southleft. Customers remain controllers of any data they choose to send to Figma via the tool. | | **HIPAA** | Not applicable. The product is not designed for or marketed to handle PHI. | ## Enterprise Considerations ### Recommended Enterprise Setup Deploy with stdio transport for zero external network calls Run your own Cloudflare Worker instance. See [Self-Hosting Guide](/self-hosting). Only `api.figma.com` needs network access Complete source available on [GitHub](https://github.com/southleft/figma-console-mcp) ## Vulnerability Reporting To report a security vulnerability: 1. Open a [private security advisory](https://github.com/southleft/figma-console-mcp/security/advisories/new) on GitHub 2. Include steps to reproduce and potential impact 3. We aim to respond within 48 hours Please use GitHub's private security advisory feature rather than public issues. ## Security Checklist * Open source and auditable (MIT license) * No data persistence or storage * No telemetry or analytics * Platform-native authentication (Figma OAuth/PATs) * Code execution sandboxed in Figma plugin environment * Local-only deployment option available * All network traffic encrypted (HTTPS) * No third-party runtime dependencies ## Questions? For security inquiries, open a [GitHub Discussion](https://github.com/southleft/figma-console-mcp/discussions) or use the [private security advisory](https://github.com/southleft/figma-console-mcp/security/advisories/new) feature for sensitive matters. # Self-Hosting Source: https://docs.figma-console-mcp.southleft.com/self-hosting Deploy your own instance of Figma Console MCP on Cloudflare Workers for enterprise requirements or custom configurations. # Self-Hosting Guide Deploy your own instance of Figma Console MCP on Cloudflare Workers. ## Why Self-Host? **Use the public server** (`https://figma-console-mcp.southleft.com`) for most use cases. **Self-host when:** * You need guaranteed uptime/SLA * You want custom rate limits * You need enterprise security/compliance * You want to modify the code * You're processing sensitive design data ## Quick Deploy [![Deploy to Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/southleft/figma-console-mcp) Or via CLI: ```bash theme={null} git clone https://github.com/southleft/figma-console-mcp.git cd figma-console-mcp npm install npm run deploy ``` ## Prerequisites 1. **Cloudflare Account** (free or paid) * Sign up at [https://dash.cloudflare.com/sign-up](https://dash.cloudflare.com/sign-up) 2. **Wrangler CLI** (installed automatically via `npm install`) * Cloudflare's deployment tool 3. **Browser Rendering API Access** (required for cloud-mode console/screenshot/navigate tools) * **Free tier:** 10 minutes/day, 3 concurrent browsers * **Paid tier:** 10 hours/month, then \$0.09/browser hour * Automatically available on Workers 4. **Figma OAuth App** (for per-user authentication) * Create one at [https://www.figma.com/developers/apps](https://www.figma.com/developers/apps) * Set `FIGMA_OAUTH_CLIENT_ID` and `FIGMA_OAUTH_CLIENT_SECRET` as Wrangler secrets ## Step-by-Step Deployment ### 1. Clone and Install ```bash theme={null} git clone https://github.com/southleft/figma-console-mcp.git cd figma-console-mcp npm install ``` ### 2. Authenticate Wrangler ```bash theme={null} npx wrangler login ``` This opens a browser to authenticate with Cloudflare. ### 3. Configure Your Deployment Edit `wrangler.jsonc` (optional): ```jsonc theme={null} { "name": "figma-console-mcp", // Change to your preferred name "main": "dist/index.js", "compatibility_date": "2024-01-01", "browser": { "binding": "BROWSER" }, "limits": { "cpu_ms": 30000 // Adjust if needed } } ``` ### 4. Set Environment Variables #### Required: Figma Access Token ```bash theme={null} npx wrangler secret put FIGMA_ACCESS_TOKEN # Paste your token when prompted ``` Get your token at: [https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) #### Optional: Custom Configuration ```bash theme={null} # Log level (default: info) npx wrangler secret put LOG_LEVEL # Enter: trace, debug, info, warn, error, or fatal # Browser timeout (default: 120000ms) npx wrangler secret put BROWSER_TIMEOUT # Enter milliseconds ``` ### 5. Build and Deploy ```bash theme={null} # Build for production npm run build:cloudflare # Deploy to Cloudflare Workers npm run deploy ``` Expected output: ``` ( Built successfully!  Uploading... ( Deployment complete! https://figma-console-mcp..workers.dev ``` ### 6. Test Your Deployment ```bash theme={null} # Health check curl https://figma-console-mcp..workers.dev/health # Should return: { "status": "healthy", "service": "Figma Console MCP", "version": "1.25.0", "endpoints": { "mcp": ["/sse", "/mcp"], "oauth_mcp_spec": ["/.well-known/oauth-authorization-server", "/authorize", "/token", "/oauth/register"], "oauth_legacy": ["/oauth/authorize", "/oauth/callback"], "utility": ["/health"] }, "oauth_configured": true } ``` ### 7. Configure Your MCP Client Update your AI client config to use your instance: **Claude Desktop:** ```json theme={null} { "mcpServers": { "figma-console": { "command": "npx", "args": ["mcp-remote", "https://figma-console-mcp..workers.dev/sse"] } } } ``` **Important:** Replace `` with your actual Cloudflare Workers subdomain. *** ## Custom Domain (Optional) ### 1. Add Custom Domain in Cloudflare Dashboard 1. Go to Workers & Pages � figma-console-mcp 2. Click "Custom Domains" 3. Click "Add Custom Domain" 4. Enter your domain (e.g., `mcp.example.com`) 5. Cloudflare handles DNS automatically ### 2. Update MCP Client Config ```json theme={null} { "mcpServers": { "figma-console": { "command": "npx", "args": ["mcp-remote", "https://mcp.example.com/sse"] } } } ``` *** ## Environment Configuration ### All Available Secrets Set these via `npx wrangler secret put SECRET_NAME`: | Secret | Required | Default | Description | | - | - | - | - | | `FIGMA_ACCESS_TOKEN` | Yes | - | Your Figma API token | | `LOG_LEVEL` | No | `info` | Logging verbosity (trace/debug/info/warn/error/fatal) | | `BROWSER_TIMEOUT` | No | `120000` | Browser operation timeout (ms) | | `MAX_CONSOLE_LOGS` | No | `1000` | Max console logs to buffer | ### Setting Secrets ```bash theme={null} # Interactive (recommended) npx wrangler secret put FIGMA_ACCESS_TOKEN # Via file (less secure) echo "figd_your_token" | npx wrangler secret put FIGMA_ACCESS_TOKEN ``` ### Viewing Secrets ```bash theme={null} # List all secrets (values hidden) npx wrangler secret list ``` ### Deleting Secrets ```bash theme={null} npx wrangler secret delete SECRET_NAME ``` *** ## Monitoring & Logs ### Real-Time Logs ```bash theme={null} # Tail production logs npx wrangler tail # Filter for errors npx wrangler tail --format pretty | grep ERROR # Filter by level npx wrangler tail --status error ``` ### Analytics View analytics in Cloudflare Dashboard: 1. Go to Workers & Pages � figma-console-mcp 2. Click "Analytics" tab 3. See: * Request count * Error rate * CPU time used * Duration percentiles *** ## Costs ### Browser Rendering API The cloud-mode console/screenshot/navigate tools launch a headless browser via Cloudflare's Browser Rendering API. * **Free Tier:** 10 minutes/day, 3 concurrent browsers * **Paid Tier:** 10 hours/month included, then \$0.09/browser hour ### Workers + Durable Objects The deployment also uses Workers, two Durable Object classes (the MCP session and the plugin relay), and two KV namespaces for OAuth state. * **Workers Free Tier:** 100,000 requests/day — fine for personal use. * **Workers Paid Tier (\$5/month):** 10 million requests/month, plus Durable Objects + KV included. **Estimated monthly cost for typical usage:** * Solo developer: **\$0** (free tier) * Small team (5 people): **\$5–15/month** * Medium team (20 people): **\$20–50/month** *** ## Updating Your Deployment ### Update Code ```bash theme={null} cd figma-console-mcp git pull origin main npm install npm run build:cloudflare npm run deploy ``` ### Rollback to Previous Version ```bash theme={null} npx wrangler rollback ``` ### View Deployment History ```bash theme={null} npx wrangler deployments list ``` *** ## Security Best Practices ### 1. Protect Your Secrets *  Use `wrangler secret put` (encrypted at rest) * L Don't commit secrets to git * L Don't put secrets in `wrangler.jsonc` ### 2. Token Permissions * Use a dedicated Figma access token for the MCP * Scope token to minimum required permissions * Rotate tokens periodically ### 3. Rate Limiting (Advanced) For rate limiting, use Cloudflare's built-in Rate Limiting rules: 1. Go to Cloudflare Dashboard → **Security** → **WAF** → **Rate limiting rules** 2. Create a rule to limit requests per IP (e.g., 100 requests/minute) 3. Apply to your worker's route Alternatively, use Cloudflare's **Rate Limiting binding** for programmatic control - see [Cloudflare Rate Limiting docs](https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/). ### 4. Access Control (Advanced) Add authentication: ```typescript theme={null} // Require API key const authKey = request.headers.get('X-API-Key'); if (authKey !== env.API_KEY) { return new Response('Unauthorized', { status: 401 }); } ``` Then set the API key: ```bash theme={null} npx wrangler secret put API_KEY ``` *** ## Troubleshooting ### Deployment Fails **Error:** "Authentication required" ```bash theme={null} npx wrangler login ``` **Error:** "Browser Rendering not enabled" 1. Go to Cloudflare Dashboard 2. Workers & Pages → Settings 3. Enable Browser Rendering 4. Try deploying again **Error:** OAuth secrets missing 1. Confirm `wrangler secret list` shows both `FIGMA_OAUTH_CLIENT_ID` and `FIGMA_OAUTH_CLIENT_SECRET` 2. If missing, set them via `wrangler secret put FIGMA_OAUTH_CLIENT_ID` and re-deploy ### Browser Launch Fails **Check logs:** ```bash theme={null} npx wrangler tail --format pretty ``` **Common issues:** * Browser Rendering API quota exceeded → Upgrade plan * KV namespace IDs mismatch — verify `wrangler.jsonc` against your account's KV bindings * Cold start delay — normal, wait and retry * Plugin relay disconnected — Cloud Mode users need to re-pair the Desktop Bridge plugin ### High Costs **Check usage:** ```bash theme={null} npx wrangler metrics --worker figma-console-mcp ``` **Reduce costs:** * Implement request caching * Add rate limiting * Reduce browser timeout * Close browser sessions faster *** ## Advanced Configuration ### Custom Worker Name ```jsonc theme={null} // wrangler.jsonc { "name": "my-custom-mcp", // Change this "main": "dist/index.js", ... } ``` ### Multiple Environments **Production:** ```bash theme={null} npx wrangler deploy --env production ``` **Staging:** ```bash theme={null} npx wrangler deploy --env staging ``` **Configure in `wrangler.jsonc`:** ```jsonc theme={null} { "name": "figma-console-mcp", "env": { "production": { "name": "figma-console-mcp-prod", "vars": { "ENVIRONMENT": "production" } }, "staging": { "name": "figma-console-mcp-staging", "vars": { "ENVIRONMENT": "staging" } } } } ``` ### Durable Objects (Persistent Sessions) For multi-user sessions, enable Durable Objects: ```jsonc theme={null} // wrangler.jsonc { "durable_objects": { "bindings": [ { "name": "SESSIONS", "class_name": "BrowserSession", "script_name": "figma-console-mcp" } ] }, "migrations": [ { "tag": "v1", "new_classes": ["BrowserSession"] } ] } ``` *** ## CI/CD Integration ### GitHub Actions Create `.github/workflows/deploy.yml`: ```yaml theme={null} name: Deploy to Cloudflare Workers on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: '18' - run: npm ci - run: npm run build:cloudflare - uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} ``` Set secrets in GitHub: * `CLOUDFLARE_API_TOKEN` * `CLOUDFLARE_ACCOUNT_ID` *** ## Support For self-hosting issues: * \=� [Cloudflare Workers Docs](https://developers.cloudflare.com/workers/) * \=� [GitHub Discussions](https://github.com/southleft/figma-console-mcp/discussions) * \= [Report Issues](https://github.com/southleft/figma-console-mcp/issues) For Cloudflare-specific issues: * [Cloudflare Community](https://community.cloudflare.com/) * [Cloudflare Support](https://support.cloudflare.com/) # Setup Guide Source: https://docs.figma-console-mcp.southleft.com/setup Complete setup instructions for connecting Figma Console MCP to Claude Desktop, OpenAI Codex, GitHub Copilot, Cursor, Windsurf, and other AI clients. # Figma Console MCP - Setup Guide Complete setup instructions for connecting Figma Console MCP to various AI clients including Claude Desktop, OpenAI Codex, GitHub Copilot (VS Code), Cursor, Windsurf, and more. *** ## 🎯 Choose Your Setup **First, decide what you want to do:** | I want to... | Setup Method | Time | | - | - | - | | **Create, modify, and develop with AI** | [NPX Setup](#-npx-setup-recommended) (Recommended) | \~10 min | | **Design from Claude.ai, v0, Replit, or Lovable** | [Cloud Mode](#-cloud-mode-web-ai-clients) | \~5 min | | **Full capabilities with manual update control** | [Local Git Setup](#-local-git-setup-alternative) | \~15 min | | **Set up with OpenAI Codex** (GUI config) | [Codex Setup](#-openai-codex) | \~5 min | | **Just explore my design data** (read-only) | [Remote Mode](#-remote-mode-read-only-exploration) | \~2 min | ### ⚠️ Important: Capability Differences | Capability | NPX / Local Git | Cloud Mode | Remote (read-only) | | - | - | - | - | | Read design data | ✅ | ✅ | ✅ | | **Create components & frames** | ✅ | ✅ | ❌ | | **Edit existing designs** | ✅ | ✅ | ❌ | | **Manage design tokens/variables** | ✅ | ✅ | ❌ | | Screenshot validation | ✅ | ✅ | ✅ | | Desktop Bridge plugin | ✅ | ✅ (required) | ❌ | | Variables without Enterprise | ✅ | ✅ | ❌ | | Real-time selection/change tracking | ✅ | ❌ | ❌ | | Console log streaming | ✅ | ❌ | ❌ | | Codebase → design system extraction (`figma_ds_*`) | ✅ | ❌ | ❌ | | Requires Node.js | Yes | No | No | | **Total tools available** | **121** | **96** after pairing | Read-only subset | > **Bottom line:** Remote mode is **read-only** until you pair the plugin. Cloud Mode adds **write access** (96 tools) without Node.js. Local (NPX/Git) has **everything** (121 tools) including real-time monitoring. *** ## 🎓 Community Setup Guides New to MCP servers, JSON configs, and terminal commands? These designer-friendly guides walk through the full NPX setup process step by step — created by designers, for designers. ### Joey Banks — Video Walkthrough [Joey Banks](https://www.linkedin.com/in/joeyabanks) walks through setting up Figma Console MCP and using it to programmatically create 242 color swatches with linked variables, hex values, and RGB info — a task that would take hours manually.