figma-mcp

figma-mcp

Enables AI coding assistants to draw UI directly on a Figma Desktop canvas and read existing designs back as structured JSON, tokens, CSS, and screenshots, all over a localhost bridge without external API keys.

Category
Visit Server

README

figma-mcp

High-performance, bidirectional Model Context Protocol (MCP) server written in Rust connecting AI coding assistants directly to Figma Desktop.

Enables AI agents (Claude Code, Cursor, Windsurf, Antigravity, VS Code, Zed) to draw UI directly on the Figma canvas and read existing designs back as structured JSON trees, design tokens, CSS, and screenshots β€” with zero external API keys needed.


⚑ Highlights

  • Pure Rust Native Performance: Starts in < 1ms, uses ~3MB RAM, zero GC pauses.
  • Bidirectional Bridge: AI can both write UI (draw vectors, components, frames, autolayout) and read designs (extract hierarchy, compute styles, capture canvas).
  • Sandboxed JS Runtime: Powered by Boa (pure Rust ECMAScript engine) for safe execution of design scripts.
  • Built-in Asset CDN: Auto-fetches and normalizes SVG icons from 7 icon libraries (Ionicons, Lucide, Tabler, Bootstrap, Fluent, Phosphor).
  • Multi-Tab / Multi-Session Support: Seamlessly connects to multiple open Figma files simultaneously.
  • 100% Localhost Privacy: All communication stays strictly on 127.0.0.1:38451 via HTTP long-polling.

πŸ›οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               Terminal (Standalone Server)              β”‚
β”‚                       figma-mcp                         β”‚
β”‚  β€’ MCP SSE Transport (/sse, /message)                   β”‚
β”‚  β€’ Sandboxed JS Runtime (Boa)                           β”‚
β”‚  β€’ Built-in Asset & Icon Resolver                       β”‚
β”‚  β€’ Async WebSocket & HTTP Long-Polling Bridge (Axum)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚ (ws://127.0.0.1:38451)  β”‚ (http://127.0.0.1:38451/sse)
                β”‚                         β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚   Figma Desktop   β”‚     β”‚ AI Assistant(s)   β”‚
      β”‚ (Plugin Bridge)   β”‚     β”‚ Antigravity/Cursorβ”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚ Claude Code / Zed β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

1. One-Line Launch with NPX (No Rust toolchain needed)

You can launch figma-mcp on any Mac, Linux, or Windows machine with zero setup:

npx figma-mcp

This automatically downloads the prebuilt native binary for your architecture and starts the server.

Or if configuring in Cursor / Claude Desktop / Windsurf / Antigravity MCP Settings:

{
  "mcpServers": {
    "figma-mcp": {
      "command": "npx",
      "args": ["-y", "figma-mcp", "--stdio"]
    }
  }
}

2. Or Build from Source (Rust)

Prerequisites: Rust toolchain (cargo >= 1.80).

git clone https://github.com/BuiHung1612/figma-mcp.git
cd figma-mcp
cargo build --release
./target/release/figma-mcp

3. Install the Figma Plugin

  1. Open Figma Desktop.
  2. Go to Plugins β†’ Development β†’ Import plugin from manifest...
  3. Select the file: plugin/manifest.json from this repository.
  4. Run the plugin (Plugins β†’ Development β†’ Figma MCP Bridge).
  5. The plugin UI will show a green dot (Connected).

4. Configure Your MCP Client

Google Antigravity (SSE Transport - Recommended)

Add to your ~/.gemini/config/mcp_config.json or project .agents/mcp_config.json:

{
  "mcpServers": {
    "figma-mcp": {
      "serverUrl": "http://127.0.0.1:38451/sse"
    }
  }
}

Claude Code / Cursor / Windsurf / VS Code

You can connect via SSE or stdio:

Option A: SSE Transport (Recommended)

{
  "mcpServers": {
    "figma-mcp": {
      "url": "http://127.0.0.1:38451/sse"
    }
  }
}

Option B: Stdio Subprocess (via NPX)

{
  "mcpServers": {
    "figma-mcp": {
      "command": "npx",
      "args": ["-y", "figma-mcp", "--stdio"]
    }
  }
}

πŸ› οΈ MCP Tools Reference

figma-mcp exposes 7 first-class MCP tools:

figma_get_selection

Ultra-fast, token-compressed inspection of currently selected layers/frames on the Figma canvas. Returns compacted layout and typography hierarchy with 60-80% fewer tokens.

figma_inspect_node

Inspects a specific node by ID or name, returning complete design context, CSS, auto-layout rules, and typography.

figma_export_asset

Exports any Figma node/layer directly into PNG, JPG, or SVG.

  • outputPath: When specified (e.g. src/assets/logo.png), saves directly to disk and returns minimal JSON metadata instead of filling context window with large base64 strings!

figma_status

Checks live bridge connection status, connected Figma tabs, active file name, and latency statistics.

figma_write

Executes JavaScript draw commands inside the sandboxed VM to build or modify designs on the Figma canvas.

  • Supports Auto-layout (layoutMode, itemSpacing, padding), typography, fills, strokes, corner radius, drop shadows, and component creation.
  • Supports icon loading: figma.loadIcon("ionicons", "heart", { size: 24, fill: "#ff4757" }).
  • Supports image insertion: figma.loadImage(url, { width: 300, height: 200 }).

figma_read

Universal reader for advanced queries: get_design, scan_design, screenshot, export_svg, get_variables, get_styles, search_nodes. Supports outputPath for file exports.

figma_docs

Fetches built-in documentation, design rules, layout guidelines, and code examples for figma_write.

  • section: "all" | "rules" | "layout" | "api" | "tokens" | "icons"

figma_rules

Audits the current Figma document and generates consistency rules and token definitions to guide AI generation.


πŸ’» Development & Testing

# Run server directly in debug mode
cargo run

# Build release binary
cargo build --release

# Run automated MCP test suite
./scripts/test-rust-mcp.sh

# Rebuild Figma plugin bundle (if plugin-src/ is modified)
node scripts/build-plugin.js

πŸ“„ License

MIT Β© BuiHung1612 β€” Free to use, modify, and distribute. See LICENSE for details.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured