Skip to main content
Glama

Figma MCP — AI-Native UI/UX & Prototyping Engine


⚡ The Challenge & The Solution

Traditional AI design tools produce "Dribbble-grade slop"—glossy, unvalidated happy-path screenshots that fail in real product engineering. Figma MCP was built from the ground up to solve the core architectural and usability gaps in AI-generated design:

Challenge

Traditional AI & Cloud API Limitation

The Figma MCP Solution

1. The "Read-Only" API Barrier

Figma's cloud REST API is strictly read-only for canvas graphics. It cannot create frames, render vectors, configure AutoLayout, or wire prototypes on an active canvas.

Multi-Transport Bidirectional BridgePairs STDIO, Streamable HTTP (/mcp), and SSE with a Hub-and-Spoke loopback WebSocket (ws://localhost:3055) to a desktop plugin with 100% write access to the native figma.* engine.

2. Multi-Roundtrip Latency Explosion

Generating a single screen via primitive calls (create_frame $\rightarrow$ create_rectangle...) requires 100+ roundtrips, exhausting context windows and causing timeout crashes.

Declarative Atomic Tree (generate_ui_tree)Compiles an entire nested screen hierarchy with AutoLayout, typography, colors, and semantic tags in a single payload in $< 200\text{ms}$.

3. "AI Slop" & HCI Deficiency

LLMs produce amateur visual outputs: buttons littered with emojis, uncalibrated leading that clips text, arbitrary spacing (13px, 27px), and tiny inaccessible touch targets ($< 44\text{px}$).

Enterprise Design Guardian & HCI EngineAutomated zero-emoji sanitizer, 8pt spatial grid snapping, intelligent proportional typography leading/tracking, and Apple HIG 44px minimum touch target enforcement.

4. State Incompleteness & First-Run Blindness

Generative AI suffers from "state blindness"—producing exclusively static, populated mockups under ideal conditions. In real-world software, over half of the user lifecycle is spent in non-ideal states (zero-data onboarding, high-latency loading, network faults, and sparse datasets). Neglecting these lifecycle states leaves designs brittle, forces engineering teams to improvise fallback UI in production, and drives high first-run user churn.

The "5 States of UI" Engine (generate_state_matrix)Instantly generates Ideal, Empty Onboarding, Loading Skeleton Shimmer, Empathetic Error with 1-click retry, and Partial/Boundary stress-test states.

5. Dead-End Journeys & Missing Affordances

AI outputs isolated, static screens that trap users without back affordances, lacks tactile interactive states (Hover, Pressed, Focus Rings), and uses vague CTAs ("Submit").

Cognitive Psychology & Journey ValidatorScores screens against Hick's, Fitts's, Miller's, and Jakob's laws (audit_ux_heuristics), detects dead ends (validate_user_journey), and generates accessible focus rings (generate_interactive_variants).

6. Arbitrary Design Drift & Blanket Blindness

AI tools either force rigid, unconfigurable typography defaults or dump sweeping, untracked changes across an artboard without per-phase confirmation.

Niche-Adaptive Typography & Phased Confirmation ProtocolDynamic typography engine (apply_typography_theme) enabling niche-specific pairings (Playfair, Inter, Poppins, Garamond) paired with granular, step-by-step confirmation protocols before canvas modifications.


Related MCP server: figcraft

🏗️ Architecture

flowchart LR
    subgraph AI["AI Client / IDE Environment"]
        Agent["AI Assistant<br/>(Claude Desktop / Cursor / Antigravity)"]
    end

    subgraph Server["Figma MCP Core"]
        MCPServer["Node.js MCP Server<br/>(64 Tools + 3 Resources)"]
        Bridge["Hub-and-Spoke WebSocket Bridge<br/>(ws://localhost:3055)"]
    end

    subgraph Desktop["Figma Desktop Sandbox"]
        Plugin["Figma Companion Plugin<br/>(Design, FigJam & Slides + Keep-Alive)"]
        Canvas["Native Figma Canvas Engine<br/>(AutoLayout, Variables, Prototyping)"]
    end

    Agent <--"STDIO / Streamable HTTP (/mcp) / SSE"--> MCPServer
    MCPServer <--> Bridge
    Bridge <--"Local Loopback (ws://)"--> Plugin
    Plugin <--"Figma Plugin API (figma.*)"--> Canvas

    style AI fill:#0f172a,stroke:#38bdf8,stroke-width:2px,color:#f8fafc
    style Server fill:#0f172a,stroke:#818cf8,stroke-width:2px,color:#f8fafc
    style Desktop fill:#0f172a,stroke:#a855f7,stroke-width:2px,color:#f8fafc
  1. MCP Server (packages/mcp-server): Communicates over STDIO, Streamable HTTP (/mcp), or SSE with LLM clients, exposing 64 specialized design, FigJam, Slides, Variables, and UX tools, while hosting a Hub-and-Spoke loopback WebSocket bridge on port 3055 (allowing Antigravity, Claude Desktop, and Cursor to connect concurrently with automatic Hub failover).

  2. Figma Companion Plugin (packages/figma-plugin): Sandboxed plugin running inside Figma Desktop (Design, FigJam, and Figma Slides) with an unthrottled Web Worker heartbeat loop. Connects to the local bridge and directly executes native figma.* canvas operations, Variables/Modes, AutoLayout hierarchy, and prototype interactions.


⚡ 60-Second Quickstart

Step 1: Install Companion Plugin in Figma Desktop

  1. Download or extract dist-release/figma-companion-plugin.zip (32 KB standalone bundle).

  2. In Figma Desktop, open any design file $\rightarrow$ right-click canvas $\rightarrow$ Plugins $\rightarrow$ Development $\rightarrow$ "Import plugin from manifest...".

  3. Select manifest.json from the extracted folder.

  4. Press Ctrl + Alt + P (Windows) or Cmd + Opt + P (Mac) to launch the plugin window.

Step 2: Configure Your AI Assistant

Your AI client spawns the MCP server automatically in the background using npx -y @chimbuezedavid/figma-mcp—no manual terminal setup required.

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "figma": {
      "command": "npx",
      "args": ["-y", "@chimbuezedavid/figma-mcp"]
    }
  }
}

Cursor IDE

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "figma": {
      "command": "npx",
      "args": ["-y", "@chimbuezedavid/figma-mcp"]
    }
  }
}

Antigravity / Gemini / Custom MCP Client

  • Command: npx -y @chimbuezedavid/figma-mcp

  • Transport: STDIO (or Streamable HTTP at http://127.0.0.1:3000/mcp)

Step 3: Verify the Live Bridge Connection

  • In Figma Desktop, look at the Figma MCP Bridge plugin window.

  • When your AI client starts, the status indicator will automatically switch to:

    ● Connected (ws://localhost:3055)
  • Your active document name and page will synchronize with the server.

Step 4: Your First Prompts (Copy & Paste)

Open Claude Desktop or Cursor and test any of these prompts:

  • Generate a Full AutoLayout Screen:

    "Create a mobile crypto wallet dashboard in Figma using AutoLayout, 8pt spacing, and dark mode."

  • Generate the 5 Essential UX States:

    "Generate the 5 essential UI states for a 'Payment Methods' card using generate_state_matrix."

  • Conduct a Cognitive & HCI Audit:

    "Audit the active canvas with audit_ux_heuristics and report any Hick's or Fitts's Law violations."

  • End-to-End Autonomous UX Architecture:

    "Use the architect_ux_experience prompt to architect a complete 'Subscription Management' user journey with full interactive variants and flow transitions."


🛠️ Complete Toolset Reference (64 Tools)

1. UX Intelligence & Cognitive Architecture

  • generate_state_matrix: Generates the 5 Essential States of UI (Ideal, Empty Onboarding, Loading Skeleton Shimmer, Empathetic Error with 1-click retry, and Partial/Boundary Stress Test) organized neatly inside a labeled Section or Component Set.

  • audit_ux_heuristics: Scores screens against empirical cognitive psychology:

    • Hick’s Law: Calculates decision latency ($T = b \log_2(n+1)$) and flags choice overload ($> 7\pm2$ choices) or competing primary CTAs.

    • Fitts’s Law: Checks touch ergonomics ($< 44\text{px}$) and flags destructive buttons placed dangerously close ($< 60\text{px}$) to primary progression actions.

    • Miller’s Law: Flags unchunked walls of inputs/items exceeding working memory thresholds.

    • Jakob’s Law: Audits standard convention placement for navigation, search, and avatar controls.

  • validate_user_journey: Traverses prototype interaction noodles across artboards to detect orphan screens (unlinked artboards), dead-end screens (trapped users without back or exit affordance), and unprotected destructive actions (lacking confirmation dialogs).

  • generate_interactive_variants: Creates production-ready Figma Component Sets with Default, Hover, Pressed, Focused (WCAG 2.4.7 accessible focus ring), and Disabled states, pre-wired with whileHover and whilePress Smart Animate transitions.

  • lint_ux_microcopy: Audits UX writing anti-patterns (Lorem Ipsum, ambiguous CTAs like "Submit", robotic blaming errors like "Invalid input"), providing empathetic, high-converting copy recommendations.

2. Declarative Generation & Design Guardian

  • plan_screen_architecture: Plans and outlines a screen's UX architecture, layout sections, and component hierarchy before generating nodes.

  • generate_ui_tree: Generates full hierarchical screens with AutoLayout, typography, colors, and tagged interactive elements in a single atomic call:

    • Presets: iPhone 16, iPhone 16 Pro Max, Android, Desktop, Tablet.

    • Elements: frame, card, button, text, divider, spacer.

    • Tag Registry: Assigns semantic tags (e.g. tag: "signup_btn") and returns a map of { [tag]: nodeId } for instant prototyping.

  • lint_design_compliance: Automated HCI & visual design auditor checking 44px touch targets, 8pt grid consistency, calibrated leading, and zero emojis.

  • Zero-Emoji Enforcement: Automatically sanitizes emojis from all text operations, preventing cartoonish outputs and routing to vector SVG paths.

  • Intelligent Typography: Calibrates leading ($1.15\times - 1.5\times$ font size) and proportional tracking based on font size and weight.

  • 8pt Spatial Grid: Automatic snapping of margins, paddings, and gap dimensions.

  • Touch Target Enforcer: Guarantees a minimum $44\times44\text{px}$ bounding box for interactive elements (Apple HIG & Google Material compliance).

3. Interactive Prototyping & Flow Engine

  • set_prototype_interaction: Wires interactive transitions between elements:

    • Triggers: ON_CLICK, ON_HOVER, ON_PRESS, AFTER_TIMEOUT.

    • Navigations: NAVIGATE, OVERLAY, SWAP, BACK, CLOSE.

    • Transitions: SMART_ANIMATE, DISSOLVE, SLIDE_IN, MOVE_IN, INSTANT.

  • set_flow_starting_point: Sets named prototype flow starting points (e.g. "Onboarding Flow").

  • get_prototype_connections: Audits all flow starting points and prototype connection noodles on the page.

  • batch_link_prototype: Wires multiple screen transitions across a user journey in one call.

  • set_overlay_interaction: Configures modal dialogs, slide-over panels, and dropdown overlays with customizable backdrops, animations, and click-outside dismissal rules.

4. Canvas Primitives, Components & Polish

  • create_frame: Creates container frames or artboards (auto-places top-level frames at the next non-overlapping horizontal slot when x/y are omitted).

  • create_rectangle: Creates shapes, cards, or placeholders.

  • create_ellipse: Creates circular/elliptical shapes (avatars, badges, status dots).

  • create_svg_icon: Renders and inserts scalable SVG vector graphics with automatic color tinting.

  • create_component: Creates master design system components.

  • create_component_instance: Instantiates linked component instances from any master component ID.

  • set_effects: Applies elevation shadows, inner shadows, layer blurs, and background blurs (DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR).

  • create_section: Groups and categorizes artboards and user journey paths into organized, labeled Figma Sections.

  • apply_typography_theme: Batch-applies a complete typography system across all text nodes inside a frame or artboard in a single call. Intelligently classifies headings vs. body copy, preloads font weights (Playfair Display, Inter, Poppins, Merriweather, etc.), and recalibrates leading and optical tracking.

  • focus_viewport: Pans and zooms the canvas viewport directly to specified nodes, with optional selection.

  • create_text: Inserts typography with automatic font preloading (Inter, Roboto, etc.).

  • set_autolayout: Applies Flexbox/AutoLayout (direction, gap, padding, axis alignments).

  • update_node: Modifies position, dimensions, fills, corner radius, opacity, visibility, or typography (fontFamily, fontWeight, fontSize).

  • delete_nodes: Deletes one or more nodes by ID.

  • duplicate_node: Clones frames or elements with offsets (ideal for prototype state variants).

  • set_stroke: Configures border colors, thicknesses, and alignments.

  • set_text_content: Updates text copy while preserving typography styles.

  • find_nodes: Searches canvas by keyword or node type.

  • manage_page: Creates or switches active pages.

  • get_document_tokens: Extracts local color paint styles, text typography styles, and effect styles directly from the document.

  • export_node_image: Exports 2x Retina PNG snapshots as live MCP image blocks for direct visual inspection by the AI (defaults to selection or current page if nodeId is omitted).

5. Canvas Diagnostics, Multi-Tab & Semantic Inspection

  • get_figma_status: Checks whether the Figma Desktop companion plugin is connected, bridge mode (hub/spoke), active editorType, and all open Figma tabs.

  • select_figma_file: Switches the active target Figma document when multiple Figma Desktop tabs are connected to the bridge.

  • ping_figma: Tests round-trip WebSocket latency and document verification.

  • get_document_info: Retrieves document name, editorType, pages list, viewport bounds/zoom, top-level canvas children with coordinates/sizes, suggestedNextPosition for non-overlapping placement, and selection details.

  • get_design_context: Extracts a token-efficient semantic design outline of the page (artboards, buttons, cards, inputs, and prototype starting points) without vector noise.

  • inspect_node: Recursively inspects any node by ID with strict depth capping (max 4) to protect LLM context windows, serializing dimensions, layout, fills, text characters, and active fontName (family and weight).

  • get_selection: Inspects details of elements currently highlighted on the canvas.

6. Figma Cloud REST Tools (Headless Access)

Optional: Requires FIGMA_ACCESS_TOKEN for cloud inspection without the desktop app:

  • rest_get_file: Read full file metadata, version history, components, and document tree from Figma Cloud.

  • rest_get_file_nodes: Fetch specific node hierarchies by ID from the cloud.

  • rest_get_images: Render high-resolution PNG, SVG, JPG, or PDF exports of frames via Figma's cloud render engine.

  • rest_get_comments: Read collaboration comment threads, reviews, and pin coordinates.

  • rest_post_comment: Post review feedback directly to a Figma screen pin via REST API.

  • rest_get_variables: Read Figma Enterprise / Organization Variables (color themes, spacing scales, modes).

  • rest_get_components: List published component library definitions and documentation links.

7. FigJam & Figma Slides Native Tools

  • create_sticky_note: Creates a native FigJam sticky note with text, author visibility, wide/square toggle, color, and position.

  • create_connector: Creates a native FigJam connector between two nodes or coordinates with magnet sides, line routing (ELBOWED, STRAIGHT, CURVED), dash patterns, and arrow/ERD caps.

  • create_shape_with_text: Creates native FigJam diagram shapes (ROUNDED_RECTANGLE, DIAMOND, ENG_DATABASE, etc.) with labeled text.

  • create_slide: Creates a 16:9 slide in Figma Slides with optional title, subtitle, layout preset (TITLE, TITLE_AND_BODY, BLANK), and grid position.

  • get_slide_grid: Inspects the current Figma Slides deck structure, rows, columns, and slide ordering.

8. Variables, Media Fills, Code Export & Checkpoints

  • create_variable_collection: Creates a Figma Variable Collection with optional initial modes (e.g., ["Dark", "Light"]).

  • add_variable_mode: Adds a new mode (e.g., "Dark" or "Light") to an existing Variable Collection.

  • create_variable: Creates COLOR, FLOAT, STRING, or BOOLEAN variables and sets per-mode values (hex strings auto-convert to RGBA).

  • get_variables: Lists all local Variable Collections, modes, and variables.

  • bind_variable: Binds a variable to fills, strokes, or scalar node properties (cornerRadius, itemSpacing, opacity, etc.).

  • set_explicit_variable_mode: Switches a frame or node's explicit variable mode (e.g., "Dark" / "Light") in one call.

  • set_variable_mode_action: Attaches a SET_VARIABLE_MODE prototype interaction to a node (requires a paid Figma plan in Present mode).

  • set_image_fill: Applies a real image fill from a URL (figma.createImageAsync), base64 data URI, or local file path.

  • export_tailwind_react: Converts a Figma node tree into a React component with Tailwind CSS utility classes and optional CSS variable fallbacks.

  • create_checkpoint / restore_checkpoint: Snapshots node properties before destructive batch edits and restores them by checkpointId.


🎨 Niche-Adaptive Typography & Granular Plan Protocol

Figma MCP eliminates arbitrary design decisions and blanket approvals by pairing niche-adaptive typographic systems with strict phased confirmation protocols:

1. Niche-Adaptive Typography Engine (Optional, Prompt-Activated)

apply_typography_theme and the archetype system in generate_ui_tree are optional and activate only when you prompt for a typography theme or archetype—normal canvas commands will not interrupt you with font questions.

Built-in ARCHETYPE_FONT_PAIRINGS (generate_ui_tree):

Archetype

Headings

Body

Accent

institutional

Playfair Display

Inter

Cinzel

modern-saas

Inter

Inter

Inter

corporate

Roboto

Inter

Roboto Mono

creative-editorial

Playfair Display

Inter

Playfair Display

With apply_typography_theme, you can also pass any custom headingFont and bodyFont available in Figma to batch-apply a font pairing across an entire artboard hierarchy—with automatic heading detection (fontSize >= 20 or title/heading/headline/h1–h3 layer names), weight preloading, and proportional leading/tracking calibration.

2. Granular Step-by-Step Plan Approval Protocol

Blanket "all-or-nothing" approvals ("Do you approve this 6-phase redesign? Yes/No") create critical blind spots where users cannot approve some phases while adjusting others.

Figma MCP establishes a structured interaction protocol:

  1. Concrete Phase Breakdown: Before modifying the canvas, the AI breaks down the plan into explicit phases with targeted node IDs, exact layout adjustments, and typographic changes.

  2. Per-Phase Confirmation: The user confirms, tweaks, or skips each phase individually using interactive multi-part prompts, ensuring full human-in-the-loop control over the Figma canvas.

3. Unthrottled Web Worker Keep-Alive Bridge

To prevent Chromium/Electron background tab throttling when Figma Desktop or the OS window loses focus, the companion plugin runs an isolated Web Worker heartbeat loop. This guarantees that WebSocket connections to ws://localhost:3055 remain permanently alive with zero disconnections.


📦 MCP Resources & Prompts

Resources (URI-Addressable Design State)

  • figma://document/summary: Document outline, active pages, and selected canvas elements.

  • figma://tokens/active: Complete design token registry (colors, typography styles, effect styles).

  • figma://prototype/flows: Interactive connection graph and flow starting points on the page.

High-Level Prompts (Guided Autonomous Workflows)

  • architect_ux_experience: Guides the AI to conduct a comprehensive UX architectural review, generate the 5 UI states, audit cognitive heuristics, and validate user journey flow continuity.

  • design_product_flow: Guided workflow taking a product concept, generating screens with AutoLayout, registering tags, and wiring interactive animations.

  • wire_interactive_prototype: Guides the agent through discovering interactive targets and establishing seamless user journeys.

  • audit_ux_design: Executes an accessibility, touch target ($\ge 44\text{px}$), spacing consistency, and visual hierarchy audit.


💻 Local Monorepo Development

# 1. Install dependencies
npm install

# 2. Build monorepo workspaces
npm run build

# 3. Run automated test suite (Vitest)
npm test

# 4. Clean port 3055 if locked by an orphaned background process
npm run clean:port

# 5. Package standalone plugin & zip
npm run package

# 6. Run server in development watch mode
npm run dev:server

🌐 Deployment & Transport Modes

1. Local Mode (Default STDIO)

Used by Claude Desktop, Cursor, and Antigravity:

node packages/mcp-server/dist/index.js

2. Remote Mode (Streamable HTTP & SSE)

Run as a cloud service or team gateway on port 3000:

node packages/mcp-server/dist/index.js --transport=http
# or --transport=sse / environment variables:
MCP_TRANSPORT=http PORT=3000 node packages/mcp-server/dist/index.js

Endpoints provided:

  • GET /health: Health check, uptime, bridge status, active sessions, and REST config.

  • POST / GET / DELETE /mcp: Streamable HTTP transport (MCP 2025-03-26 spec, mcp-session-id session management).

  • GET /sse: Legacy SSE connection stream.

  • POST /messages?sessionId=...: Legacy SSE JSON-RPC message ingress.

Optional security environment variables:

  • FIGMA_BRIDGE_SECRET: Shared secret token required on WebSocket upgrades (x-bridge-token header or ?token= query).

  • MCP_AUTH_TOKEN: Bearer token required on /mcp, /sse, and /messages.

  • MCP_HOST / FIGMA_BRIDGE_HOST: Bind addresses (both default to 127.0.0.1 loopback).

3. Docker Container Deployment

Run with Docker Compose:

docker compose up -d --build
curl http://localhost:3000/health

📄 License

MIT © Chimbueze David

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to read and modify Figma designs programmatically, supporting design analysis, element creation, text replacement, annotations, auto-layout configuration, and prototype visualization through natural language commands.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI-powered design operations in Figma, including UI creation, design review, token sync, linting, auditing, and auto-fix through natural language commands.
      12
      MIT
    • A
      license
      B
      quality
      A
      maintenance
      Enables AI-driven UI/UX design and prototyping in Figma by letting agents generate AutoLayout screens, modify canvas elements, and wire interactive prototype flows through natural language.
      47
      MIT