Figma MCP Tool

Figma MCP Tool

Enables interaction with Figma designs through the Figma API, allowing users to export images in multiple formats, extract style data and CSS, analyze design elements, and retrieve SVG code from Figma files. Supports batch operations and comprehensive design element analysis including images, vectors, and components.

Category
访问服务器

README

Figma MCP Tool

English | 简体中文

A Model Context Protocol (MCP) server that integrates with the Figma API to export images and extract style data.

Features

  • 🖼️ Image export: Export node images from a Figma URL; supports PNG, JPG, SVG, PDF
  • 🎨 Style extraction: Fetch detailed style data for design elements; supports CSS generation
  • 📦 Batch export: Export multiple nodes in one go
  • 🔄 Smart retry: Built-in retry to handle network hiccups and API limits
  • 🛡️ Robust errors: Clear error handling and troubleshooting guidance
  • 🧩 Design element analysis: Deeply analyze images, vectors, components in designs 🆕
  • 📋 SVG extraction: Get SVG code for vector graphics directly 🆕

Install and Run

Option 1: Run via npx (recommended, no install)

npx figma-mcp-full-server figd_your_figma_token_here

Option 2: Global install

# Install globally
npm install -g figma-mcp-full-server

# Run
figma-mcp-full-server figd_your_figma_token_here

Option 3: Local project install

# Install in your project
npm install figma-mcp-full-server

# Run
npx figma-mcp-full-server figd_your_figma_token_here
# or
node_modules/.bin/figma-mcp-full-server figd_your_figma_token_here

Option 4: Run from source (for development)

git clone <repository>
cd figma-mcp
npm install
npm run build

# Run
npm start figd_your_figma_token_here
# or
node build/index.js figd_your_figma_token_here

Quick Start

1. Get a Figma access token

  1. Log in to Figma
  2. Open Settings
  3. Find the "Personal access tokens" section
  4. Click "Create new token"
  5. Copy the token (starts with figd_)

2. Configure in Claude Desktop

Edit the Claude config file (pick your OS):

macOS/Linux: ~/.config/claude-desktop/config.json
Windows: %APPDATA%\Claude Desktop\config.json

Choose one of the following setups:

Setup A: Run via npx (recommended)

{
  "mcpServers": {
    "figma-mcp-full-server": {
      "command": "npx",
      "args": ["figma-mcp-full-server"],
      "env": {
        "FIGMA_TOKEN": "figd_your_figma_token_here"
      }
    }
  }
}

Setup B: Global install

npm install -g figma-mcp-full-server
{
  "mcpServers": {
    "figma-mcp-full-server": {
      "command": "figma-mcp-full-server",
      "env": {
        "FIGMA_TOKEN": "figd_your_figma_token_here"
      }
    }
  }
}

Setup C: Use from a project

npm install figma-mcp-full-server
{
  "mcpServers": {
    "figma-mcp-full-server": {
      "command": "npx",
      "args": ["figma-mcp-full-server"],
      "cwd": "/path/to/your/project",
      "env": {
        "FIGMA_TOKEN": "figd_your_figma_token_here"
      }
    }
  }
}

Setup D: Run from source

{
  "mcpServers": {
    "figma-mcp": {
      "command": "node",
      "args": [
        "/absolute/path/to/figma-mcp/build/index.js"
      ],
      "cwd": "/absolute/path/to/figma-mcp",
      "env": {
        "FIGMA_TOKEN": "figd_your_figma_token_here"
      }
    }
  }
}

⚠️ Notes:

  • Recommended: Setup A (npx) — no install, always latest
  • Global install: good if you use it often
  • Project install: pin a version per project
  • From source: for development and customization
  • Replace figd_your_figma_token_here with your real Figma token

3. Restart Claude Desktop

Restart Claude Desktop to apply the config.

Usage

Once configured, use it directly in Claude:

Get Figma images

Please fetch images from this Figma URL:
https://www.figma.com/design/EXAMPLE_FILE_ID/Design-Name?node-id=123-456&t=abc123-0

Get style data and generate CSS

Please get style data from this design and generate CSS:
https://www.figma.com/design/EXAMPLE_FILE_ID/Design-Name?node-id=123-456&t=abc123-0

Get file info

Please show the basic info for this Figma file:
https://www.figma.com/design/EXAMPLE_FILE_ID/Design-Name

Get design elements 🆕

Please analyze what design elements this Figma node contains:
https://www.figma.com/design/EXAMPLE_FILE_ID/Design-Name?node-id=123-456&t=abc123-0

Get image assets 🆕

Please extract all image assets under this Figma node:
https://www.figma.com/design/EXAMPLE_FILE_ID/Design-Name?node-id=123-456&t=abc123-0

Get SVG data 🆕

Please get the SVG code for this Figma node:
https://www.figma.com/design/EXAMPLE_FILE_ID/Design-Name?node-id=123-456&t=abc123-0

Available Tools

This MCP server provides 7 tools:

Basics

  1. get_figma_image — Get node image by Figma URL
  2. get_figma_styles — Get node style data; optional CSS output
  3. export_multiple_images — Batch export multiple nodes
  4. get_file_info — Get basic file info

Design element tools 🆕

  1. get_node_images — Get all image assets under a node
  2. get_node_svg — Get SVG data for a node
  3. extract_node_elements — Extract all design elements (images, vectors, components)

Troubleshooting

Common issues

1. "Cannot find module"

  • Cause: Using a .ts entry instead of the built .js
  • Fix: Use /path/to/build/index.js instead of index.ts

2. "Access denied"

  • Cause: Invalid Figma token or insufficient file permission
  • Fix: Verify token, ensure file is public or accessible

3. MCP server won’t start

  • Cause: Wrong paths or Node.js version too low
  • Fix:
    • Use absolute paths
    • Ensure Node.js ≥ 18
    • Rebuild: npm run build

4. "No exportable images found"

  • Cause: URL missing node-id parameter
  • Fix: Ensure URL includes ?node-id=xxxxx-xxxxx

Manual test

cd /path/to/figma-mcp
node build/index.js figd_your_token_here

You should see: Figma MCP server started

Validate config

# macOS/Linux
cat ~/.config/claude-desktop/config.json | python -m json.tool

# Windows
type "%APPDATA%\Claude Desktop\config.json" | python -m json.tool

Technical Details

Smart retry

  • Handles transient network issues automatically
  • Exponential backoff
  • Error classification and recovery

Batch processing

  • Automatically splits large node sets (90 per batch)
  • Avoids URL length limits
  • Concurrency control and resource management

Error handling

  • Detailed messages and remediation tips
  • Friendly feedback
  • Complete logging

Development

Dev mode

npm run dev
# Then set FIGMA_TOKEN in your environment

Project structure

figma-mcp/
├── src/
│   ├── index.ts             # MCP server entry
│   ├── figma-service.ts     # Figma API service
│   ├── image-extractor.ts   # Image export
│   ├── style-extractor.ts   # Style extraction
│   └── element-extractor.ts # Design element extraction 🆕
├── build/                   # Build output
├── package.json
└── README.md

New Features 🆕

Design element analysis

  • Image asset recognition: Find all images, including embedded and external
  • Vector extraction: Extract SVG paths, shapes, icons
  • Component analysis: Identify components and instances
  • Hierarchy traversal: Deeply walk the node tree

SVG data

  • Full SVG export: Complete SVG code with styles and paths
  • Vector fidelity: Preserve vector properties for lossless scaling
  • Inline styles: SVG contains complete styles, ready to use

Smart element detection

  • Auto categorization: Images, vectors, text, components
  • De-duplication: Remove duplicate resource references
  • Detail control: Overview vs detailed output modes

Security Best Practices

  1. Token safety: Use env vars for the Figma token; never hardcode
  2. Access control: Rotate tokens regularly
  3. Least privilege: Grant the minimum required file access

License

MIT License


Support

If you run into issues:

  1. Ensure Node.js ≥ 18
  2. Verify your Figma token
  3. Validate your JSON config
  4. Check Claude Desktop logs
  5. Manually start the MCP server

Once configured, you can use Figma files directly in Claude!

Contact

<img src="contact.JPG" alt="Contact" width="360" />

<img src="程序员热榜.jpg" alt="程序员热榜公众号" width="360" />

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选