Bidirectional Figma MCP — AI draws UI on Figma canvas, reads designs back
io.github.TranHoaiHung/figma-ui-mcp — Model Context Protocol (MCP) Server
This MCP server provides a bidirectional bridge to Figma. It can draw UI onto a Figma canvas and also read designs back from Figma. Described as a “figma-mcp” and “figma-plugin,” it focuses on connecting AI tooling with the Figma design workflow.
🛠️ Key Features
Bidirectional Figma integration: UI drawing to the canvas
Reads designs back from Figma
MCP “Figma Bridge” for design-to-model synchronization
🚀 Use Cases
Generate or place UI components directly in Figma
Ingest existing Figma designs for downstream processing
Use with developer tooling such as Claude Code and Cursor
⚡ Developer Benefits
Works within the Model Context Protocol ecosystem
Targets Figma via an MCP interface and references a Figma plugin
Supports common AI + design-tool workflows (e.g., “auto-designing”)
⚠️ Limitations
No additional capabilities, tool list, authentication, or setup details are provided in the available source excerpt
Claude Code to Figma · Antigravity to Figma · Cursor to Figma · Any MCP IDE to Figma
✅ Tested: Claude Code, Antigravity | 🔧 Compatible: Cursor, VS Code, Windsurf, Zed (any MCP stdio client)
Bidirectional Figma MCP bridge — let AI assistants (Claude Code, Cursor, Windsurf, Antigravity, VS Code Copilot, or any MCP-compatible IDE) draw UI directly on Figma canvas and read existing designs back as structured data, screenshots, or code-ready tokens. No Figma API key needed — works entirely over localhost.
Requires Figma Desktop — the plugin communicates with the MCP server over localhost HTTP polling. Figma's web app does not allow localhost network access, so Figma Desktop is required.
code
Claude ──figma_write──▶ MCP Server ──HTTP (localhost:38451)──▶ Figma Plugin ──▶ Figma Document
Claude ◀─figma_read──── MCP Server ◀──HTTP (localhost:38451)── Figma Plugin ◀── Figma Document
How the localhost bridge works
The MCP server starts a small HTTP server bound to localhost:38451. The Figma plugin (running inside Figma Desktop) uses long polling — the server holds requests up to 8s until work arrives, flushing immediately when new ops are queued (near-realtime latency <100ms). All traffic stays on your machine — nothing is sent to any external server.
Multi-instance support (v2.3.0+): Multiple Figma files/tabs can connect simultaneously. Each plugin instance sends a sessionId, and the bridge routes operations to the correct session. Use the optional sessionId param in figma_write/figma_read to target a specific file.
Generate design system rule sheet — tokens, typography, components
What's new in v2.5
Feature
Description
get_design_context
AI-optimized payload for a node — flex layout, token-resolved colors (var(--name)), typography with style names, component instances with variant properties. Best single call for design→React/Vue/Swift code.
get_component_map
List every component instance in a frame with componentSetName, variantLabel, properties, and suggestedImport path. Scaffold import statements in one call.
get_unmapped_components
Find component instances that have no description in Figma (no code mapping yet). Prompts AI to ask user for correct import paths.
figma_rules tool
New top-level MCP tool — aggregates color tokens, typography styles, variables (all modes), and component catalog into a single markdown rule sheet. Equivalent to official Figma MCP's create_design_system_rules. Call once at session start.
get_node_detail now resolves boundVariables IDs → { name, resolvedType, value }. No more manual ID lookup.
Resolved style refs
fillStyleId / textStyleId now include fillStyle: { name, hex } and textStyle: { name, fontSize, fontFamily }.
Instance overrides detail
overrides: [{ id, overriddenFields: ["fills","characters",...] }] — full diff vs mainComponent, not just count.
componentSetName + variantLabel
INSTANCE nodes now expose set name ("Button") and variant label ("State=Primary, Size=Large") separately.
insertIndex for create
figma.create({ ..., insertIndex: 2 }) — insert node at exact position in parent, not always at end.
Typography tokens
setupDesignTokens({ fontSizes, fonts, textStyles }) — 1 call bootstrap full typography system with variable-bound text styles. Multi-mode (Compact/Comfortable/Large) supported.
applyTextStyle
Apply a local text style to a TEXT node by name in 1 call — auto-loads font.
STRING variables for fonts
applyVariable now binds fontFamily, fontStyle, characters (swap Inter → SF Pro via 1 variable).
Effects
effects: [{ type: "DROP_SHADOW" | "INNER_SHADOW" | "LAYER_BLUR" | "BACKGROUND_BLUR", ... }] on any node.
addComponentProperty + bindComponentProperty — create TEXT / BOOLEAN / INSTANCE_SWAP properties on master components. Instance text overrides now actually re-measure auto-layout (button grows to fit longer label).
Multi-instance
Multiple Figma tabs connect simultaneously via sessions.
git clone https://github.com/TranHoaiHung/figma-ui-mcp
cd figma-ui-mcp
npm install
# Then point your MCP client to: node /path/to/figma-ui-mcp/server/index.js
⚠️ IMPORTANT: After adding the MCP server, you MUST restart your IDE / AI client (quit and reopen). The MCP server only loads on startup — simply saving the config file is not enough. This applies to Claude Code, Cursor, VS Code, Windsurf, and Antigravity.
Download and unzipplugin.zip anywhere on your machine
Open Figma Desktop (required — web app cannot access localhost)
Go to Plugins → Development → Import plugin from manifest...
Select manifest.json from the unzipped folder
Run Plugins → Development → Figma UI MCP Bridge
The plugin UI shows a green dot when the MCP server is connected.
Updating to a newer version
bash
# Step 1 — get the new version + plugin path
npx figma-ui-mcp@latest --version
# figma-ui-mcp v2.5.12 — plugin: /.../.npm/_npx/.../figma-ui-mcp/plugin# Step 2 — restart Claude / your IDE so the MCP server reloads# Step 3 — re-link the Figma plugin (manual, one-time per update)# Figma Desktop → Plugins → Development → Manage plugins in development# Remove old "Figma UI MCP Bridge" → "+" → Import plugin from manifest...# Select manifest.json from the plugin path printed in Step 1# Step 4 — verify# Ask your AI: "figma_status"# pluginVersion in the response should match the npm version above
The Figma plugin does not auto-update — re-linking (Step 3) is required whenever the plugin changes.
Iterate: After the first draw, say "fix the spacing" or "make the buttons bigger" — the AI reads and modifies existing nodes
Use selection: Select a frame in Figma and ask "improve this design" — the AI reads your selection first
Multi-screen flows: "Now draw the signup screen next to the login screen" — the AI positions frames side by side
Workflow summary
code
You: "Connect to figma-ui-mcp"
AI: ✅ Connected to Figma
You: "Draw a mobile onboarding screen with 3 steps"
AI: [calls figma_docs → figma_write → figma_read screenshot]
AI: ✅ Done — here's what I created: [inline screenshot]
You: "The title text is not centered"
AI: [calls figma_read get_selection → figma_write modify → screenshot]
AI: ✅ Fixed — text is now centered
You: "Now draw the next onboarding screen beside it"
AI: [reads page_nodes to find position → draws at x+440]
AI: ✅ Done — 2 screens side by side
code
figma_status — check connection (always call first)
figma_docs — load API reference (call before drawing)
figma_write — draw / modify UI on canvas
figma_read — extract design data, screenshots, SVG
Usage Examples
Draw a screen
Ask Claude: "Draw a dark dashboard with a sidebar, header, and 4 KPI cards"
Set overflow scrolling: NONE / HORIZONTAL / VERTICAL / BOTH
Variant & Component Swapping
Operation
Description
figma.setComponentProperties({ id, properties })
Set variant, boolean, text, or instance swap properties on an INSTANCE
figma.swapComponent({ id, componentId })
Swap the main component of an instance
figma.getComponentProperties({ id })
Read all properties + definitions from component/instance
Available Read Operations (figma_read)
Operation
Description
get_selection
Full design tree of selected node(s) + design tokens
get_design
Full node tree for a frame/page (depth param: default 10, or "full")
get_page_nodes
Top-level frames on the current page
screenshot
Export node as PNG — displays inline in Claude Code
export_svg
Export node as SVG markup
export_image
Export node as base64 PNG/JPG — for saving to disk (format, scale params)
get_design_context
AI-optimized design→code payload — flex layout, token-resolved fills as var(--name), typography with style names, component instances with variant properties + componentsUsed / tokensUsed summaries. Best single call for generating React/Vue/Swift code.
get_component_map
Component instance map — every INSTANCE in a frame with componentSetName, variantLabel, properties, and suggestedImport path. Deduplicates into uniqueComponents[] with usage counts.
get_unmapped_components
Code-mapping audit — lists instances with no description in Figma (unmapped[]). Use to prompt user for correct import paths before code generation.
get_node_detail
Structured properties for single node — fills, layout, typography, effects, bound variables (resolved to name+value), style refs (resolved to name+hex), instance overrides (full field list), componentSetName + variantLabel
get_css
Ready-to-use CSS string for a node — background, flex, border, radius, shadow, typography, opacity, transform. Best for design-to-code.
get_styles
All local paint, text, effect, grid styles
get_local_components
Component listing with descriptions + variant properties
get_viewport
Current viewport position, zoom, bounds
get_variables
Local variables (Design Tokens) — collections, modes, values
search_nodes
Find nodes by type, name, fill color, font, size — supports includeHidden
scan_design
Progressive scan for large files — all text, colors, fonts, images, icons
includeHidden param (boolean, default false) — available on get_selection, get_design, search_nodes, scan_design. When false (default), nodes with visible: false are skipped. Pass true to include hidden layers.
Working with an Existing Project
When opening a Figma file that already has a design system, always read before drawing.
figma mcp, claude code to figma, cursor to figma, ai to figma, figma ai plugin, figma mcp bridge, figma mcp server, figma design to code, code to figma design, ai ui design, figma automation, figma plugin ai, model context protocol figma, claude figma, windsurf figma, vs code figma, antigravity figma, ai design tool, figma api alternative, figma localhost plugin, draw ui with ai, ai generate figma design, figma design system ai, mcp server figma, figma read design, figma write design, bidirectional figma, figma desktop plugin, npx figma-ui-mcp