Figma MCP Server for AI Design Integration
Enable AI-driven Figma workflows with an MCP server to let agents read and programmatically modify designs for seamless design automation.
npx -y @sonnylazuardi/cursor-talk-to-figma-mcpOverview
This MCP (Model Context Protocol) server connects AI agents (for example Cursor or Claude Code) to Figma, letting agentic workflows read from and programmatically modify Figma documents. The server acts as a bridge between an AI agent that understands design intent and a Figma plugin that exposes document and selection state, enabling automation patterns such as bulk content updates, instance override propagation, prototype connection creation, and layout adjustments.
For developers building AI-driven design tooling, this project removes much of the plumbing required to inspect node structures, manipulate design properties, and synchronize changes between an agent and Figma. It uses a WebSocket relay plus an MCP server implementation so agents can call discrete “tools” (MCP endpoints) to perform targeted operations inside Figma.
Repository: https://github.com/sonnylazuardi/cursor-talk-to-figma-mcp
Features
- Read document metadata, selection, and detailed node trees
- Programmatic node creation (frames, rectangles, text)
- Batch and single text updates, with chunked scanning for large documents
- Auto-layout and spacing controls (layout mode, padding, sizing, alignment)
- Styling operations (fills, strokes, corner radii)
- Annotation management (create/update annotations in Markdown)
- Prototype connector handling and connection creation (FigJam connectors)
- Utility tools: set focus, set selections, scan by node types
Installation / Configuration
Prerequisites: Bun (runtime), Cursor (or another agent supporting MCP), and Figma (desktop or web).
- Install Bun:
|
- Add the MCP server to your Cursor MCP configuration (
~/.cursor/mcp.json):
- Start the WebSocket relay that connects the Figma plugin to the MCP server:
- Install the Figma development plugin:
- In Figma: Plugins > Development > New Plugin > Link existing plugin
- Point to
src/cursor_mcp_plugin/manifest.jsonin the repo, or install the published community plugin if available.
Local development: point Cursor to your local server script:
Windows + WSL notes:
- Install Bun via PowerShell:
powershell -c "irm bun.sh/install.ps1|iex"
- Allow socket binding across interfaces by uncommenting hostname in
src/socket.ts:
// hostname: "0.0.0.0",
- Then run:
Available Tools
The MCP server exposes many tool endpoints. Below is a condensed reference — use the MCP tooling from your agent to invoke these.
| Tool | Purpose | Example action |
|---|---|---|
| get_document_info | Inspect high-level document state | List pages and current page id |
| get_selection / get_nodes_info | Read selected nodes or specific nodes | Retrieve node types and styles |
| read_my_design | Detailed node export of current selection | Feed node tree to LLM for summarization |
| set_selections / set_focus | Select and focus nodes in viewport | Jump to a node programmatically |
| get_annotations / set_annotation | Read and create Markdown annotations | Attach QA notes to frames |
| create_rectangle / create_frame / create_text | Create basic elements | Programmatically scaffold a layout |
| scan_text_nodes / set_text_content* | Bulk text scanning and updates | Replace copy across many text nodes |
| set_layout_mode / set_padding / set_item_spacing | Auto-layout adjustments | Convert a frame to vertical auto-layout |
| set_fill_color / set_stroke_color / set_corner_radius | Styling changes | Apply brand color to buttons |
| set_default_connector / create_connections | Prototype connector workflows | Create FigJam connectors from flow mapping |
Tools marked with * have batch variants (e.g., set_multiple_text_contents) for efficiency.
Use Cases
- Bulk text content replacement: Update product copy or localization by scanning text nodes, chunking large documents, and issuing batched text updates in a single agentic command.
- Propagate instance overrides: Copy overrides (like color, text, or property changes) from a source component instance and apply them to many target instances to avoid repetitive manual edits.
- Generate prototypes: Use get_reactions and create_connections to extract prototype flows and programmatically build connector lines or FigJam mappings for handoff or documentation.
- Automated layout fixes: Detect a frame that should use auto-layout, set layout mode to vertical/horizontal, adjust padding and spacing, and reflow children to match design guidelines.
- Annotation-driven QA: Agents can scan for annotations, summarize findings, and update or add new annotations with Markdown content to guide designers.
Getting started tips
- Start the socket and MCP before opening the Figma plugin; the plugin joins a channel to relay messages.
- Use get_document_info and get_selection early to understand the document structure your agent will operate on.
- When operating on many nodes, prefer the “scan” and “set_multiple_*” endpoints to avoid rate and payload issues.
- Review the repository examples for concrete MCP calls and the Figma plugin implementation to see the request/response shape.
For full source and examples, see the project on GitHub: https://github.com/sonnylazuardi/cursor-talk-to-figma-mcp