Devign MCP

Devign MCP

Enables any AI model to create, read, and edit Figma designs in real time through the Model Context Protocol.

Category
访问服务器

README

Devign MCP - AI-Powered Figma Design Server

A Model Context Protocol (MCP) server that lets any AI model create, read, and edit Figma designs in real time. Not limited to Claude - works with OpenAI, Gemini, local models, Cursor, VS Code, or any MCP-compatible client.

How It Works

┌──────────────┐     stdio or HTTP     ┌──────────────┐    WebSocket     ┌──────────────┐
│   AI Model   │ ◄──────────────────► │  MCP Server  │ ◄──────────────► │ Figma Plugin │
│ (any model)  │     MCP protocol      │  (Node.js)   │   localhost:3055 │  (in Figma)  │
└──────────────┘                       └──────────────┘                  └──────────────┘

The MCP server exposes 40 design tools to the AI. The Figma plugin runs inside your open Figma file and executes commands on the canvas via the Plugin API. Communication flows over a local WebSocket — no cloud services, no API keys, everything runs on your machine.

Quick Start

Prerequisites

  • Node.js v18+
  • Figma Desktop app
  • An MCP-compatible AI client (Claude Code, Cursor, VS Code Copilot, etc.)

1. Install and Build

git clone <this-repo>
cd devign-figma-mcp
npm install
npm run build

2. Load the Figma Plugin

  1. Open the Figma desktop app
  2. Open any file you want to design in
  3. Go to Menu > Plugins > Development > Import plugin from manifest...
  4. Navigate to packages/figma-plugin/manifest.json and select it
  5. Run the plugin: Menu > Plugins > Development > Devign MCP Bridge

You'll see the plugin panel with a connection status dot. It will show red/Disconnected until you start the MCP server.

3. Start the MCP Server

npm start

The plugin dot should turn green/Connected. You're ready to go.

4. Connect Your AI

Claude Code / Claude Desktop

Add to your MCP config (~/.claude.json or Claude Desktop settings):

{
  "mcpServers": {
    "devign": {
      "command": "node",
      "args": ["/absolute/path/to/devign-figma-mcp/packages/mcp-server/dist/index.js"]
    }
  }
}

Cursor / VS Code

Add to .cursor/mcp.json or VS Code MCP settings:

{
  "servers": {
    "devign": {
      "command": "node",
      "args": ["/absolute/path/to/devign-figma-mcp/packages/mcp-server/dist/index.js"]
    }
  }
}

Any HTTP-capable Client (OpenAI, Gemini, custom apps)

Start the server in HTTP mode:

DEVIGN_TRANSPORT=http npm start

Then point your client to:

  • MCP endpoint: POST http://127.0.0.1:3100/mcp
  • Health check: GET http://127.0.0.1:3100/health

This uses the Streamable HTTP transport from the MCP spec, compatible with any client that supports it.

What You Can Do

Ask your AI things like:

  • "Create a mobile login screen with email/password fields and a submit button"
  • "Read the current page and describe the layout"
  • "Set up a design system with color tokens, text styles, and elevation shadows"
  • "Import this SVG icon and place it in the header"
  • "Create a component with Light and Dark variants"
  • "Apply auto-layout to the card frame with 16px padding and 12px gap"
  • "Export the hero section as a 2x PNG"

Full Tool List (40 tools)

Category Tools
Creation create_frame, add_rectangle, add_ellipse, add_text, add_shape, create_section, clone_node, set_image_fill
Components create_component, list_components, create_instance, set_overrides, swap_component
Vectors create_vector, create_from_svg, boolean_operation (union/subtract/intersect/exclude)
Styling set_styles, list_styles, apply_style
Layout apply_auto_layout
Reading read_current_page, get_node_by_id, get_selection
Mutation edit_node (position, size, rotation, blend modes, constraints), delete_node
Organization group_nodes, flatten_node, create_page
Export export_node (PNG, SVG, JPG, PDF)
Variables list_variables, bind_variable, create_variable_collection, create_variable, set_variable_value
Design System create_paint_style, create_text_style, create_effect_style, combine_as_variants, add_component_property
System ping

MCP Resources

AI clients that support MCP resources can read these directly:

Resource URI Description
Current Page figma://current-page Live node tree of the open page
Selection figma://selection Currently selected nodes
Styles figma://styles All local paint, text, effect, grid styles
Variables figma://variables Variable collections and design tokens
Components figma://components Components on the current page

MCP Prompts

Guided workflows the AI can use:

Prompt Description
create-screen Build a full page/screen from a description
build-design-system Set up variables, styles, and tokens from scratch
audit-accessibility Check contrast, text sizes, and touch targets

Configuration

Environment Variable Default Description
DEVIGN_TRANSPORT stdio Transport mode: stdio or http
DEVIGN_WS_PORT 3055 WebSocket port for plugin connection
DEVIGN_WS_TIMEOUT 15000 Command timeout in ms
DEVIGN_HTTP_PORT 3100 HTTP server port (when DEVIGN_TRANSPORT=http)

Plugin UI

When the plugin is running in Figma, you'll see:

  • Green dot = Connected to MCP server, ready for AI commands
  • Red dot = Disconnected, waiting for MCP server
  • Command counter = How many commands have been processed
  • Activity log = Real-time log of commands flowing between AI and Figma

The plugin auto-reconnects if the server restarts. Keep it open while working.

Architecture

devign-figma-mcp/
├── shared/                 # Shared types and protocol definitions
│   └── src/
│       ├── commands.ts     # All command type constants
│       ├── protocol.ts     # Request/response interfaces
│       └── index.ts
├── packages/
│   ├── mcp-server/         # Node.js MCP server
│   │   └── src/
│   │       ├── index.ts    # Entry point, transport setup
│   │       ├── server.ts   # Tool/resource/prompt registration
│   │       ├── ws-bridge.ts # WebSocket bridge to plugin
│   │       ├── tools/      # 11 tool modules (40 tools total)
│   │       └── utils/      # Zod schemas, error helpers
│   └── figma-plugin/       # Figma plugin (runs in Figma)
│       ├── src/
│       │   ├── main.ts     # Command dispatcher
│       │   ├── ui.ts       # WebSocket client + UI
│       │   └── handlers/   # 11 handler modules
│       ├── manifest.json   # Figma plugin manifest
│       └── build.mjs       # esbuild config
└── package.json            # Workspace root

How commands flow:

  1. AI sends a tool call (e.g. create_frame) to the MCP server
  2. Server validates params with Zod, sends command over WebSocket to the plugin
  3. Plugin's UI thread receives the message and forwards it to the main thread
  4. Main thread dispatches to the appropriate handler, which calls the Figma Plugin API
  5. Result flows back: handler → main thread → UI thread → WebSocket → MCP server → AI

Development

# Watch mode for both server and plugin
npm run dev:server    # in one terminal
npm run dev:plugin    # in another terminal

# Build everything
npm run build

# Build individually
npm run build:server
npm run build:plugin

After changing plugin code, Figma will hot-reload if you ran the plugin via Development > Import plugin from manifest. For server changes, restart the server.

Troubleshooting

Plugin shows "Disconnected"

  • Make sure the MCP server is running (npm start)
  • Check that port 3055 is not in use by another process
  • Try restarting both the server and the plugin

AI says "Figma plugin not connected"

  • Open Figma and run the Devign MCP Bridge plugin
  • Wait for the green dot to appear before sending commands

Commands time out

  • Increase the timeout: DEVIGN_WS_TIMEOUT=30000 npm start
  • Complex operations (SVG import, large exports) may need more time

"Unknown command" errors

  • Rebuild both packages: npm run build
  • Restart the plugin in Figma

HTTP transport not working

  • Make sure you set DEVIGN_TRANSPORT=http before starting
  • Check http://127.0.0.1:3100/health to verify the server is up

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选