Skip to main content
Glama
qq1006492122

figma-dev-tools

by qq1006492122

🎨 Figma Dev Tools v1.4.4

Figma → Any Frontend Framework Design-to-Code One-Click Conversion MCP Server

English | 中文

A complete toolchain bridging Figma design and frontend development, supporting 🖥️ GUI visual configuration wizard, intelligent design token extraction, high-fidelity component generation (React/Vue/Svelte/HTML, etc.), automatic asset download, and cross-editor MCP integration. Optimized for AI Agents, addressing core pain points such as div soup, context explosion, hardcoded hex values, asset path handling, Flex layout distortion, missing accessibility, responsive adaptation, and paywall fallback.


✨ v1.4.4 Paywall Fallback + High-Fidelity Restoration + Performance Optimization

Core Fallback and Restoration

Optimization Item

Description

Version

🧱 Paywall Browser Fallback

Added BrowserFallbackService: When Figma REST API fails due to paywall/permissions, automatically starts a Playwright headless browser to load the design page and take a screenshot as a fallback

v1.4.4

🤖 Visual Approximation Mode

Added VisualApproximationService: When node JSON is unavailable, feeds the screenshot to a VLM to generate approximate code skeleton, explicitly marking "Approximation Mode ~75%" + TODO list

v1.4.4

📏 DPR/Screen Size Awareness

Screenshots output at 1x/2x/3x based on the user's actual devicePixelRatio, matching rendering differences across operating systems

v1.4.4

🎯 Fidelity Scoring Tool

Added figma_verify_fidelity MCP tool: Pixel diff between Figma screenshot and generated code screenshot, outputting a quantitative similarity score

v1.4.4

📐 Absolute Positioning Restoration

Fixed nodes with layoutMode=NONE losing relativeTransform, correctly mapping rotation/offset for floating elements

v1.4.4

🎨 Gradients/Multiple Shadows/Inner Shadow

Fixed issues where linear/radial gradient fills, multiple shadows, and inner shadows were lost or degraded to solid colors

v1.4.4

✂️ mask/clip-path Restoration

Fixed distortion of rounded avatars and irregular shapes, mapping to overflow:hidden + border-radius or clip-path

v1.4.4

strokeDash Dashed/Dotted Lines

Fixed issue where dashed and dotted borders were all rendered as solid lines

v1.4.4

🔤 Rich Text Multi-Span Styles

Fixed issue where styleOverrideTable was not parsed, causing the entire text segment to use the same style

v1.4.4

🌍 i18n Error Message Internationalization

Hardcoded Chinese error messages in figma-client.ts changed to i18n key references, output based on the GUI-selected language (zh-CN/en-US), defaulting to Chinese

v1.4.4

Performance Optimization (New in v1.4.4)

Optimization Item

Description

Version

🚀 Browser Instance Pool

Added BrowserPool: Maintains reusable Playwright browser instances, skipping the 1-3 second startup phase for subsequent screenshots, automatically recycling after 60 seconds of idle time

v1.4.4

💾 Screenshot Cache

Added ScreenshotCache: Caches screenshot results based on url+nodeId+dpr, with LRU eviction + TTL expiry, returning repeated requests in milliseconds

v1.4.4

⏱️ Graded Timeouts

Configure separate timeouts for navigation/rendering/screenshot (default 20s/10s/5s), precisely identifying the timeout phase

v1.4.4

🧠 Hybrid Smart Wait Strategy

domcontentloaded + canvas element visibility + network idle detection, solving the issue where Figma SPA networkidle never completes

v1.4.4

🔁 Exponential Backoff Retry

Automatically retries on network errors and timeout errors (default 2 retries, initial delay 500ms, exponential backoff), does not retry on parameter errors

v1.4.4

🔥 Warmup Mechanism

warmup() pre-starts browser instances when the service starts, eliminating latency on the first call

v1.4.4

📊 Performance Metrics Instrumentation

getPerformanceStats() exposes statistics for the browser pool and screenshot cache (hit rate/instance count/usage count)

v1.4.4

🐛 Logic Black Hole Fixes

Fixed 9 logic black holes: inconsistent screenshot selectors, hardcoded sizes, devModeCss injection risk, unclamped fidelityScore, dependency check order, etc.

v1.4.4

🧪 Test Coverage

Added 35 new test cases (BrowserPool + ScreenshotCache + performance optimization configuration), totaling 95 tests all passing

v1.4.4

Performance Comparison (Before and After v1.4.4 Optimization)

Scenario

Before Optimization

After Optimization

Improvement

Subsequent Screenshots (Same Session)

5-8 seconds

1-2 seconds

3-4x

Repeated Requests (Cache Hit)

5-8 seconds

<100ms

50x+

Network Jitter Recovery

Direct Failure

Automatic Retry

Availability Improvement

Performance Optimization Configuration (Optional, Backward Compatible)

// 通过 BrowserFallbackService 配置
const service = new BrowserFallbackService({
  navigationTimeout: 20000,    // 导航超时(毫秒)
  renderTimeout: 10000,        // 渲染等待超时(毫秒)
  screenshotTimeout: 5000,     // 截图操作超时(毫秒)
  waitStrategy: 'hybrid',      // 等待策略:hybrid/conservative/aggressive
  maxRetries: 2,               // 最大重试次数
  retryBaseDelay: 500,         // 重试初始延迟(毫秒)
  enableScreenshotCache: true, // 启用截图缓存
  screenshotCacheTtl: 3600000, // 缓存有效期(毫秒,默认 1 小时)
  browserIdleTimeout: 60000,   // 浏览器空闲超时(毫秒,默认 60 秒)
});

📜 Version History Summary

Version

Theme

Core Content

v1.4.4

Paywall Fallback + Performance Optimization

Browser fallback screenshot, visual approximation mode, fidelity scoring, performance optimization (instance pool/cache/graded timeouts)

v1.4.3

Stability and Security Hardening

GUI request body protection, circular reference detection, recursive depth protection, cache consistency

v1.4.1

Code Quality Optimization

Zero any types, zero oxlint warnings, unified code standards

v1.4.0

Major Update

XSS security protection, intelligent hierarchy repair, SVG inline rendering, animation detection, local encrypted cache, scoring algorithm optimization, H5 adaptation, secure Token storage

v1.3.x

Foundational Capabilities

GUI visual configuration, i18n internationalization, accessibility enhancement, Flex fixes, design system alignment, responsive inference, design specification checks


✨ Feature Highlights

Feature

Description

Version

🖥️ GUI Visual Configuration Wizard

Browser-based graphical interface configuration: welcome page → language selection → Token configuration + real-time validation → editor detection one-click install → framework preference selection → completion page, zero learning curve for beginners

v1.3.0

🔗 19 MCP Tools

Complete coverage of the full workflow: URL parsing → Token extraction → component generation → asset download → paywall fallback → fidelity verification

v1.4.4

🧠 Framework-Agnostic Structured Data

Outputs id/name/role/type/size/layout/styles/text/asset/children JSON, supporting any framework like Vue/Svelte/HTML/Angular/Solid

v1.1.0

⚛️ First-Class React + Tailwind Support

Semantic tag selection + Tailwind mapping + cn() merging + TODO markers, one-click generation of high-fidelity TSX

v1.3.2

🔧 Automatic Flex Layout Fix

Intelligently fixes Flex issues like icon distortion, text truncation, overflow

v1.3.2

Accessibility Enhancement

Automatically adds semantic tags, alt, ARIA attributes

v1.3.2

🎨 Design System Alignment

Automatically matches color/spacing/font/radius/shadow variables

v1.3.2

📱 Responsive Inference

Intelligently infers breakpoints and provides responsive prefix suggestions

v1.3.2

Design Specification Pre-check

Checks design quality before code generation and provides fix suggestions

v1.3.2

🧠 Intelligent Hierarchy Simplification

Automatically flattens redundant GROUP/FRAME, eliminating ~60% of meaningless nested divs

v1

📊 Progressive Context

metadata overview (~4KB) → designContext details, avoiding context explosion

v1.2

🎯 Multi-Level Token Matching

codeSyntax.WEB → exact hex → CIE76 color difference fuzzy → @theme extension suggestions

v1

🖼️ Automatic Asset Pipeline

Detects images/SVGs → downloads to public/ → SVGO optimization → generates publicCdnUrl() references

v1.2

🧩 SVG Sprite Generation

Merges batch icons into a Sprite, supports CSS color control

v1.3.2

🌍 i18n Internationalization

Bilingual support for Chinese and English, switch via figma-dev lang switch

v1.3.2

🔐 Secure Token Storage

Securely stores Token in the system keychain

v1.3.2

💻 CLI Command Line

Supports script and CI/CD integration, usable without MCP, new commands added: gui/structured/lint/lang/token

v1 (gui v1.3.0)

🔄 8+ Editor Support

One-click install for Trae, VS Code, Cursor, Windsurf, Claude Desktop, Zed, Cline, Roo Code (GUI auto-detection)

v1 (gui v1.3.0)

🚀 Zero-Configuration Startup

Supports npx -y figma-dev-tools --figma-api-key=xxx for direct execution without prior installation or configuration

v1.2


🚀 Quick Start

📚 Looking for a concise, version-synced quick start guide? See QUICKSTART.md (Chinese) / QUICKSTART.en-US.md (English). The following is a detailed explanation.

No need to memorize any commands, complete all configuration through the browser graphical interface:

# 直接启动 GUI 配置面板
npx figma-dev-tools gui

# 或全局安装后
figma-dev gui

After starting, the browser will open automatically (default port 54321, automatically tries 54322/54323 if occupied), follow the guided steps:

  1. Welcome Page - Learn about figma-dev-tools features

  2. Language Selection - Bilingual switch between Chinese/English

  3. Token Configuration - Enter Figma Token, real-time validity verification

  4. Editor Detection - Automatically detects 8+ installed editors, one-click MCP configuration installation after selection

  5. Framework Preference - Select commonly used framework (React/Vue/HTML)

  6. Completion Page - Configuration successful, provides usage tutorial links

💡 You can also start GUI mode via the wizard command:

figma-dev wizard --gui
figma-dev init --gui

Method One: Zero-Configuration npx Direct Run (Fastest)

No installation required, start the MCP server with one command:

# 直接通过 npx 运行,传入 API Key
npx -y figma-dev-tools --figma-api-key=your-figma-token-here

Use in the editor's MCP configuration:

{
  "mcpServers": {
    "figma-dev-tools": {
      "command": "npx",
      "args": ["-y", "figma-dev-tools", "--figma-api-key=figd_your_token_here"]
    }
  }
}
# npm
npx figma-dev-tools install

# pnpm
pnpm dlx figma-dev-tools install

# yarn
yarn dlx figma-dev-tools install

# bun
bunx figma-dev-tools install

The installation script will automatically:

  • Detect installed AI editors (Trae/VS Code/Cursor/Windsurf/Claude Desktop/Zed/Cline/Roo Code, 8+)

  • Automatically detect package manager (npm/pnpm/yarn/bun)

  • Download/compile the tool

  • Configure MCP settings for the corresponding editor (Zed uses the mcp_servers field)

  • Generate .env.example template

💡 Even simpler: Run figma-dev gui to use the graphical interface for one-click detection and installation of editor configuration.

Method Three: Project Dependency Installation

# npm
npm install figma-dev-tools --save-dev

# pnpm
pnpm add figma-dev-tools -D

# yarn
yarn add figma-dev-tools --dev

# bun
bun add figma-dev-tools -d

Method Four: Install from Local Source Code

# 克隆或复制 figma-dev-tools 目录到项目中
cp -r figma-dev-tools/ your-project/tools/
cd your-project/tools/figma-dev-tools
npm install   # 或 pnpm install / yarn install / bun install
npm run build # 或 pnpm build / yarn build / bun run build

1. Get Figma Access Token

  1. Log in to Figma

  2. Click the avatar in the top right corner → SettingsAccount

  3. Find Personal access tokensGenerate new token

  4. Enter a name, check File content (Read only) permission

  5. Copy the generated Token (⚠️ shown only once)

💡 When using GUI configuration, paste the Token directly into the browser interface for automatic verification and saving.

2. Configure Token

Method A: GUI Visual Configuration (Recommended v1.3.0+)

figma-dev gui

Enter the Token in the browser interface, real-time validity verification, then automatically and securely store it.

Method B: Secure Storage (Recommended v1.3.2+)

# 交互式保存 Token 到系统密钥链
figma-dev token set

# 或直接通过参数
figma-dev token set -t figd_your_token_here

Method C: Via Command Line Arguments

npx figma-dev-tools --figma-api-key=your-figma-token-here
# 或短参数
npx figma-dev-tools -t your-figma-token-here

Method D: Via .env File

Create a .env file in the figma-dev-tools/ directory:

FIGMA_ACCESS_TOKEN=your-figma-token-here

Method E: MCP Configuration env

Add to the editor's MCP configuration:

{
  "mcpServers": {
    "figma-dev-tools": {
      "command": "node",
      "args": ["<path>/dist/index.js"],
      "env": {
        "FIGMA_ACCESS_TOKEN": "your-figma-token-here"
      }
    }
  }
}

3. First Figma → Code Example

React + Tailwind (Recommended, v1.4.0 Enhanced Edition):

In an AI editor (like Trae), simply chat:

帮我用 figma-dev-tools 还原这个 Figma 设计稿:
https://www.figma.com/design/xxxxx/MyProject?node-id=23-11032

场景名:landing-page
组件名:HeroSection

The AI will automatically execute the following enhanced workflow (v1.3.2):

  1. figma_lint_design - Design specification pre-check (optional, prompts issues)

  2. figma_parse_url Parse link

  3. figma_get_metadata Get page structure overview

  4. figma_get_screenshot Get visual baseline

  5. figma_generate_jsx One-click TSX code generation (includes Flex fixes, a11y enhancement, design system alignment, responsive inference)

  6. figma_download_assets Download image assets (automatic SVGO optimization)

Other Frameworks (Vue/Svelte/HTML, etc.):

Use the figma_get_structured_data tool to get a framework-agnostic JSON structure:

帮我用 figma_get_structured_data 获取这个 Figma 节点的结构化数据,然后生成 Vue 组件:
https://www.figma.com/design/xxxxx/MyProject?node-id=23-11032

CLI Quick Experience

# 🖥️ 启动 GUI 可视化配置面板(v1.3.0 新,小白推荐)
npx figma-dev-tools gui

# 查看文件信息
npx figma-dev info "https://www.figma.com/design/xxxxx/MyProject?node-id=23-11032"

# 设计规范预检(v1.3.2 新)
npx figma-dev lint "https://www.figma.com/design/xxxxx/MyProject?node-id=23-11032"

# 生成 React 组件(增强版)
npx figma-dev jsx "https://www.figma.com/design/xxxxx/MyProject?node-id=23-11032" \
  --name HeroSection --scene landing-page

# 获取框架无关结构化数据(v1.1.0 新)
npx figma-dev structured "https://www.figma.com/design/xxxxx/MyProject?node-id=23-11032" \
  --format json --output ./hero-structured.json

# 同步 Design Tokens
npx figma-dev sync "https://www.figma.com/design/xxxxx/MyProject" \
  --format oklch --output ./src/styles

# 语言设置(v1.3.2 新)
npx figma-dev lang switch  # 交互式切换中英文
npx figma-dev lang set zh-CN

# Token 安全管理(v1.3.2 新)
npx figma-dev token set     # 保存 Token 到密钥链
npx figma-dev token list    # 列出已保存 Token

🔧 MCP Tool Reference

A total of 19 MCP tools, arranged by usage flow:

#

Tool Name

Function

Key Parameters

Version

1

figma_parse_url

Parse Figma URL, extract fileKey/nodeId

url

v1

2

figma_validate_token

Validate Figma Access Token validity

accessToken

v1

3

figma_get_file

Get basic file info (page list, component count)

fileKey / figmaUrl

v1

4

figma_list_components

List Components/ComponentSets in file

fileKey

v1.2

5

figma_get_metadata

High-level structure overview (~4KB, avoid context explosion)

fileKey/nodeId/depth

v1.2

6

figma_get_design_context

Streamlined design context (flattened hierarchy + semantic annotations + resource list)

fileKey/nodeId/maxDepth

v1.2

7

figma_get_screenshot

Get high-res screenshot of node

fileKey/nodeId/scale

v1

8

figma_get_structured_data

⭐ Framework-agnostic structured data (id/name/role/type/size/layout/styles/text/asset/children)

fileKey/nodeId/maxDepth

v1.1.0

9

figma_lint_design

⭐ New in v1.3.2: Code restoration quality pre-check

fileKey/nodeId/maxDepth

v1.3.2

10

figma_generate_jsx

⭐ One-click React/Vue+Tailwind TSX generation (includes Flex fixes/a11y/design system/responsive, v1.4.0 adds Vue 3/UnoCSS)

fileKey/nodeId/componentName/sceneName

v1.4.0 enhanced

11

figma_generate_component

Basic component generation (legacy, recommended: generate_jsx)

fileKey/nodeId/styleFormat

v1

12

figma_download_assets

Download assets to public// + SVGO optimization + publicCdnUrl

fileKey/sceneName/assetNodeIds

v1.2

13

figma_create_icon_sprite

⭐ New in v1.3.2: Generate SVG Sprite

svgDir/outputPath/typesPath

v1.3.2

14

figma_extract_tokens

Extract design tokens (Variables+Styles)

fileKey/colorFormat

v1

15

figma_generate_styles

Generate CSS Variables / Tailwind v4 @theme

tokens/outputFormat

v1

16

figma_sync_to_project

Write tokens to project files (auto backup)

tokens/outputDir/format

v1

17

figma_dev_fallback_status

⭐ New in v1.4.4: Query paywall fallback system status (Playwright availability, config, fallback priority)

None

v1.4.4

18

figma_dev_fallback_capture

⭐ New in v1.4.4: Trigger browser fallback screenshot (screenshot on paywall + Dev Mode CSS + visual approximation mode)

figmaUrl/devicePixelRatio/framework

v1.4.4

19

figma_verify_fidelity

⭐ New in v1.4.4: Fidelity verification (pixel diff + difference heatmap + quantitative score 0-100%)

figmaUrl/codeContent/threshold

v1.4.4

Detailed Tool Parameters

figma_generate_jsx (v1.4.0 enhanced, most commonly used)

{
  figmaUrl?: string;           // Figma 链接(可替代 fileKey+nodeId)
  fileKey?: string;            // Figma 文件 Key
  nodeId?: string;             // 目标节点 ID
  componentName?: string;      // 组件名(如 HeroSection)
  sceneName?: string;          // 场景名(用于资源路径,如 landing-page)
  maxDepth?: number;           // 节点树最大遍历深度,默认 15(1-30)
  framework?: 'react' | 'vue'; // 目标框架,默认 react(v1.4.0 新增 vue)
  styleFormat?: 'tailwind' | 'unocss'; // 样式方案,默认 tailwind(v1.4.0 新增 unocss)
  skipEnhancements?: boolean;  // 是否跳过 v1.2.0 增强(Flex/a11y/设计系统/响应式)
  skipLintCheck?: boolean;     // 是否跳过设计规范检查提示
  accessToken?: string;        // 可选,优先用环境变量
}

v1.4.0 Enhanced Output:

  • Complete React + TypeScript + Tailwind TSX code (Prettier formatted)

  • 🔧 Flex Fix Report: Lists auto-fixed layout issues (icon distortion, text truncation, etc.)

  • Accessibility Enhancement Report: Semantic tags, alt text, ARIA attribute additions

  • 🎨 Design System Suggestions: Color/spacing/border-radius/shadow variable matching suggestions

  • 📱 Responsive Suggestions: Breakpoint inference, sm/md/lg prefix suggestions

  • ⚠️ List of tokens requiring @theme extension

  • 🖼️ List of assets to download (nodeId, name, type)

  • 🧩 Reusable component hints

  • Node simplification statistics

  • ✅ Design specification score hint (recommend fixing if below 80)

figma_lint_design (new in v1.3.2, code restoration quality pre-check)

{
  figmaUrl?: string;           // Figma 链接
  fileKey?: string;            // Figma 文件 Key
  nodeId?: string;             // 目标节点 ID(可选,默认检查整个文件)
  maxDepth?: number;           // 最大检查深度,默认 15(1-30)
  accessToken?: string;        // 可选
}

Checks:

  • Auto Layout usage standards

  • Layer naming conventions

  • Spacing/size/border-radius using 4px/8px grid

  • Component reuse status

  • Accessibility minimum touch target size (48×48px)

  • Nested hierarchy depth

  • Text style consistency

  • Color usage standards

Output:

  • 0-100 quality score

  • Error/warning/info category statistics

  • Issue list broken down by category

  • Specific fix suggestions

  • See: FIGMA-DESIGN-GUIDELINES.md

figma_create_icon_sprite (new in v1.3.2, SVG Sprite generation)

{
  svgDir: string;              // 包含 SVG 文件的目录
  outputPath: string;          // sprite.svg 输出路径
  typesPath?: string;          // 可选,TypeScript 类型文件路径
  prefix?: string;             // symbol id 前缀,默认 "icon-"
  removeFill?: boolean;        // 是否移除 fill 以便 CSS color 控制,默认 true
}

figma_get_structured_data (new in v1.1.0, multi-framework support)

{
  figmaUrl?: string;           // Figma 链接(可替代 fileKey+nodeId)
  fileKey?: string;            // Figma 文件 Key
  nodeId: string;              // 目标节点 ID(必需)
  maxDepth?: number;           // 最大节点树深度,默认 15(1-30)
  accessToken?: string;        // 可选,优先用环境变量
}

Output Content:

  • Complete framework-agnostic JSON structure, each node includes:

    • id / name - Node identifier

    • role - Semantic role (button/card/image/text/icon/section, etc.)

    • type - Figma node type (FRAME/TEXT/RECTANGLE/GROUP/INSTANCE, etc.)

    • size - { width, height }

    • layout - Flex layout properties (display/flexDirection/justifyContent/alignItems/gap/padding, etc.)

    • styles - Style properties (color/backgroundColor/borderRadius/shadow/fontSize/fontWeight, etc.)

    • text - Text content (TEXT nodes only)

    • asset - Asset info (image nodes: type, format, download URL)

    • children - Child node array

  • Preview summary: semantic roles, node types, sizes, total node count, color count, asset count, text node count

  • structuredContent - Complete structured node tree, can be traversed directly to generate code for any framework

Supported Frameworks:

  • ✅ React / Next.js / Remix (better with generate_jsx)

  • ✅ Vue 2/3 / Nuxt

  • ✅ Svelte / SvelteKit

  • ✅ Native HTML / CSS

  • ✅ Angular

  • ✅ SolidJS

  • ✅ Qwik

  • ✅ Astro

  • ✅ Any frontend framework

figma_download_assets

{
  figmaUrl?: string;
  fileKey: string;
  sceneName: string;           // 对应 public/<场景>/ 目录
  assetNodeIds: string[];      // 从 generate_jsx 获取的 nodeId 列表
  projectRoot?: string;        // 项目根目录,默认自动检测
  scale?: number;              // 导出倍率 1-4,默认 2
  svgFormat?: 'svg' | 'png';   // 矢量格式,默认 svg
  optimizeSvg?: boolean;       // 使用 SVGO 优化 SVG,默认 true
}

figma_extract_tokens

{
  figmaUrl?: string;
  fileKey: string;
  nodeId?: string;             // 可选,仅提取该节点下的 tokens
  colorFormat?: 'hex' | 'rgb' | 'oklch' | 'hsl';  // 默认 oklch(Tailwind v4 推荐)
  spacingUnit?: 'px' | 'rem';  // 默认 px
  tokenPrefix?: string;        // Token 名称前缀
}

💻 CLI Command Reference

# 全局安装后使用
npm install -g figma-dev-tools
figma-dev <command> [options]

# 或 npx 直接运行
npx figma-dev-tools <command> [options]

# 🖥️ v1.3.0 新:启动 GUI 可视化配置面板
npx figma-dev-tools gui

# 传入 API Key
npx figma-dev-tools --figma-api-key=your-token <command>
npx figma-dev-tools -t your-token <command>

# 切换语言(v1.3.2 新)
npx figma-dev-tools -l zh-CN <command>

Command

Function

Common Options

Version

figma-dev gui

🖥️ Launch GUI visual configuration panel

--port <n> Specify port (default 54321)

v1.3.0

figma-dev install

One-click install MCP config to editors

-

v1

figma-dev uninstall

Uninstall installed MCP config

-

v1

figma-dev validate <token>

Validate Token

-

v1

figma-dev wizard

Interactive configuration wizard

--gui Launch GUI mode

v1.3.0

figma-dev init

Initialize config (interactive wizard)

--gui Launch GUI mode

v1.3.0

figma-dev lang

🌍 Language settings (set/list/switch)

set <lang> / switch

v1.3.2

figma-dev token

🔐 Token security management (set/get/list/delete/default)

set -t <token>

v1.3.2

figma-dev info <url>

View file information

-

v1

figma-dev lint <url>

✅ Design specification pre-check

--node <id> --depth <n> --format md/json --output <file>

v1.3.2

figma-dev metadata <url>

Get metadata overview

--node <id> --depth <n>

v1.1.0

figma-dev structured <url>

Get framework-agnostic structured data

--node <id> --depth <n> --format pretty/json --output <file>

v1.1.0

figma-dev jsx <url>

Generate enhanced JSX/Vue components (Flex/a11y/design system/responsive, v1.4.0 adds Vue 3/UnoCSS)

--name <ComponentName> --scene <name> --depth <n> `--framework react

vue --style tailwind

unocss --skip-lint --inline-svg`

v1.4.0

figma-dev component <url>

Generate basic components

--name <name> --node <id> --js --style tailwind --no-children --output <dir>

v1

figma-dev assets <url>

Download assets (SVGO optimized)

--node <id> --nodes <id1,id2> --scene <name> --scale <n> `--svg-format svg

png --project-root `

v1.1.0

figma-dev sync <url>

Sync Tokens

--node <id> --format oklch `--spacing-unit px

rem --prefix --output-format all --file-name `

v1

figma-dev screenshot <url>

Take screenshot

--node <id> --format png --scale 2 --download <dir>

v1

figma-dev mcp

Start MCP server (stdio)

-

v1

figma-dev tutorial

View tutorial docs (alias help, auto-open browser)

--no-browser

v1.3.0

figma-dev cache

📦 Cache management (status/clear)

status / clear -f

v1.4.0

figma-dev privacy

🔒 Privacy notice (view data security commitment + .gitignore check)

-

v1.4.0

CLI Examples:

# 🖥️ 启动 GUI 可视化配置面板(v1.3.0 新,小白推荐)
figma-dev gui

# 指定端口启动 GUI
figma-dev gui --port 3000

# 通过向导命令启动 GUI 模式
figma-dev wizard --gui
figma-dev init --gui

# 设计规范预检(v1.3.2 新)
figma-dev lint "https://www.figma.com/design/xxx/yyy?node-id=23-11032"

# 一键生成 Hero 区 React 组件(增强版)
figma-dev jsx "https://www.figma.com/design/xxx/yyy?node-id=23-11032" \
  --name HeroSection \
  --scene landing-page \
  --depth 8

# 获取框架无关结构化数据(JSON 格式输出到文件)
figma-dev structured "https://www.figma.com/design/xxx/yyy?node-id=23-11032" \
  --depth 8 \
  --format json \
  --output ./hero-data.json

# 批量下载资源(自动 SVGO 优化)
figma-dev assets "https://www.figma.com/design/xxx/yyy?node-id=23-11032" \
  --scene landing-page \
  --nodes "23-11032,23-11050,23-11080" \
  --scale 2

# 生成 SVG Sprite(v1.3.2 新,需先下载图标)
# 通过 MCP 工具 figma_create_icon_sprite 调用

# 保存 Token 到系统密钥链(v1.3.2 新)
figma-dev token set -t figd_your_token_here

# 切换到中文界面(v1.3.2 新)
figma-dev lang set zh-CN

🖥️ Supported Editors (8+)

Editor

One-click Install

GUI Auto-detect

Config Format

Manual Config Path

Trae

✅ Auto-detect install

mcpServers

Project root .mcp.json or User Settings

VS Code

✅ Auto-detect install

mcpServers

.vscode/mcp.json or User Settings JSON

Cursor

✅ Auto-detect install

mcpServers

~/.cursor/mcp.json (global) or project .cursor/mcp.json

Windsurf

✅ Auto-detect install

mcpServers

~/.codeium/windsurf/mcp_config.json

Claude Desktop

✅ Auto-detect install

mcpServers

~/Library/Application Support/Claude/claude_desktop_config.json (macOS)%APPDATA%\Claude\claude_desktop_config.json (Windows)

Zed

✅ Auto-detect install

mcp_servers

~/.zed/settings.json

Cline (VS Code/Cursor plugin)

✅ Auto-detect install

mcpServers

VS Code/Cursor global storage cline_mcp_settings.json

Roo Code (VS Code/Cursor plugin)

✅ Auto-detect install

mcpServers

VS Code/Cursor global storage mcp_settings.json

💡 Simplest configuration: Run figma-dev gui Launch the graphical interface, automatically detect all editors installed on your computer, check the editors you want to configure, and complete installation with one click. No need to manually find config file paths.

MCP Configuration Templates

Standard format (Trae/VS Code/Cursor/Windsurf/Claude Desktop/Cline/Roo Code):

{
  "mcpServers": {
    "figma-dev-tools": {
      "command": "node",
      "args": ["<path-to-figma-dev-tools>/dist/index.js"],
      "env": {
        "FIGMA_ACCESS_TOKEN": "your-figma-token-here"
      }
    }
  }
}

Zed format (note field name is mcp_servers):

{
  "mcp_servers": {
    "figma-dev-tools": {
      "command": "node",
      "args": ["<path-to-figma-dev-tools>/dist/index.js"],
      "env": {
        "FIGMA_ACCESS_TOKEN": "your-figma-token-here"
      }
    }
  }
}

Zero-config npx method (no local installation):

{
  "mcpServers": {
    "figma-dev-tools": {
      "command": "npx",
      "args": ["-y", "figma-dev-tools", "--figma-api-key=figd_your_token_here"]
    }
  }
}

💡 Use npx figma-dev-tools install or figma-dev gui It will automatically detect editors and fill in the correct path. Zed will automatically use the mcp_servers field.


⚙️ Configuration Instructions

Environment Variables (.env)

Copy .env.example to .env and fill in:

# 必需:Figma Personal Access Token
# 获取地址:https://www.figma.com/developers/api#access-tokens
FIGMA_ACCESS_TOKEN=your-figma-token-here

# 可选:Figma OAuth Token(企业版使用)
FIGMA_OAUTH_TOKEN=

# 可选:自定义 Figma API 端点(企业代理)
FIGMA_API_BASE=https://api.figma.com

# 可选:默认导出倍率(1-4,默认 2)
FIGMA_DEFAULT_SCALE=2

# 可选:默认颜色格式(hex/rgb/oklch/hsl,默认 oklch)
FIGMA_DEFAULT_COLOR_FORMAT=oklch

# 可选:资源输出基础目录(默认 public)
FIGMA_ASSETS_BASE_DIR=public

# 可选:资源 CDN 前缀(默认 /)
FIGMA_CDN_PREFIX=/

# v1.3.2 新增:默认语言(zh-CN/en-US)
FIGMA_DEFAULT_LANG=zh-CN

# v1.3.0 新增:GUI 默认端口(默认 54321)
FIGMA_GUI_PORT=54321

MCP Configuration Priority

Token reading priority:

  1. Command line argument --figma-api-key / -t / --token

  2. Token configured and saved via GUI interface (v1.3.0 new, automatically stored in secure storage)

  3. Default token in secure storage (v1.3.2 new, saved via figma-dev token set)

  4. accessToken parameter passed when calling MCP tools

  5. env.FIGMA_ACCESS_TOKEN in MCP configuration

  6. FIGMA_ACCESS_TOKEN in .env file

  7. System environment variable FIGMA_ACCESS_TOKEN


🏗️ Architecture Diagram

┌──────────────────────────────────────────────────────────────────────────────────┐
│                         用户界面层                                                 │
│  ┌──────────────┐  ┌──────────────────────────────────────────────────────────┐  │
│  │  💻 CLI 终端  │  │  🖥️ GUI 可视化配置面板 (v1.3.0)                           │  │
│  │  命令行交互   │  │  ┌──────┐ ┌──────┐ ┌───────┐ ┌────────┐ ┌──────────┐   │  │
│  │              │  │  │欢迎页│→│语言选│→│Token配│→│编辑器检│→│ 完成页    │   │  │
│  │              │  │  │      │ │择    │ │置验证 │ │测一键装│ │ 教程链接  │   │  │
│  └──────┬───────┘  │  └──────┘ └──────┘ └───────┘ └────────┘ └──────────┘   │  │
│         │          └──────────────────────────┬─────────────────────────────┘  │
│         │                                     │ 端口 54321/54322/54323          │
└─────────┼─────────────────────────────────────┼────────────────────────────────┘
          │                                     │
          └─────────────────┬───────────────────┘
                            │ HTTP (GUI) / stdio (MCP)
                            ▼
┌──────────────────────────────────────────────────────────────────────────────────┐
│                      figma-dev-tools MCP Server v1.4.4                            │
│     🖥️ GUI | 🌍 i18n | ♿ a11y | 🔧 Flex Fix | 📱 Responsive | 🔒 XSS | 🗂️ Hierarchy │
│                                                                                   │
│  ┌─────────────┐    ┌──────────────┐    ┌─────────────────────────────────────┐ │
│  │  figma-url  │───▶│figma-client  │───▶│           Figma REST API            │ │
│  │  解析器      │    │ API 客户端    │    │            (figma.com)              │ │
│  └─────────────┘    └──────┬───────┘    └─────────────────────────────────────┘ │
│                            │ 🔒 AES-256-GCM 本地加密缓存                         │
│           ┌────────────────┼────────────────┐                                   │
│           ▼                ▼                ▼                                   │
│  ┌─────────────┐  ┌──────────────┐  ┌───────────────┐                          │
│  │node-processor│ │design-context│ │tokens-extractor│                          │
│  │ 节点精简     │ │ 渐进式上下文  │ │ Token 提取     │                          │
│  │ GROUP扁平化  │ │ metadata概览  │ │ Variables+Styles│                         │
│  │ 🗂️层级自动修复│ │ context详情   │ │                │                          │
│  │ 语义角色标注 │ │              │ │                │                          │
│  └──────┬──────┘  └──────┬───────┘  └───────┬───────┘                          │
│         │                │                   │                                  │
│         └────────┬───────┴───────────┬───────┘                                  │
│                  ▼                   ▼                                          │
│         ┌──────────────┐   ┌────────────────┐   ┌──────────────────┐          │
│         │token-matcher │   │tailwind-mapper │   │ design-linter    │          │
│         │多级Token匹配 │   │完整属性映射    │   │ ✅ 设计规范检查   │          │
│         │codeSyntax→   │   │flex/padding/   │   │ Auto Layout/命名  │          │
│         │精确→模糊匹配 │   │gap/shadow等    │   │ 间距/尺寸/无障碍  │          │
│         │              │   │               │   │ 🗂️父子层级错位检测│          │
│         └──────┬───────┘   └───────┬────────┘   └────────┬─────────┘          │
│                │                   │                     │                    │
│                └─────────┬─────────┘                     │                    │
│                          ▼                               ▼                    │
│                ┌──────────────────┐        ┌──────────────────────┐           │
│                │  code-generator  │───────▶│ v1.4.0 Enhancements │           │
│                │  React JSX生成   │        │ ┌──────────────────┐ │           │
│                │  语义标签+cn()    │        │ │ 🔧 flex-fixer    │ │           │
│                │  TODO标记        │        │ │ ♿ a11y-enhancer  │ │           │
│                │  🔒 XSS全链路防护 │        │ │ 🎨 design-system │ │           │
│                │  Prettier格式化  │        │ │ 📱 responsive    │ │           │
│                └────────┬─────────┘        │ │ 🎨 svg-inline    │ │           │
│         ┌───────────────┴──────────────┐   │ │ ✨ animation     │ │           │
│         ▼               ▼              ▼   │ └──────────────────┘ │           │
│  ┌──────────────┐ ┌──────────────┐ ┌──────────────┐              │           │
│  │asset-        │ │ vue-generator│ │ svg-inline   │              │           │
│  │downloader    │ │ Vue SFC生成  │ │ renderer     │              │           │
│  │图片/SVG下载  │ │              │ │ 矢量→内联SVG │              │           │
│  │SVGO优化      │ └──────────────┘ │ svgo优化     │              │           │
│  │publicCdnUrl()│                  └──────────────┘              │           │
│  └──────┬───────┘                                                │           │
│         │                                                        │           │
│         └──────────────┬─────────────────────────────────────────┘           │
│                        ▼                                                      │
│              ┌────────────────┐      ┌──────────────┐  ┌─────┐              │
│              │  file-writer   │      │  CLI 命令    │  │i18n │              │
│              │  文件写入       │      │ gui/lint/    │  │ zh/ │              │
│              │  CSS/Tailwind/ │      │ lang/token/  │  │ en  │              │
│              │  JSON/TSX/Vue  │      │ jsx/structur │  └─────┘              │
│              │  Prettier格式化│      │ ed/sync/asset│                       │
│              └────────┬───────┘      └──────┬───────┘                       │
│                       │                   │                                 │
│                       ▼                   ▼                                 │
│  ┌──────────────────┐  ┌──────────────────┐  ┌──────────────────────────────┐ │
│  │svg-sprite-gen    │  │  token-store     │  │ 🖥️ GUI 服务器 (v1.3.0)       │ │
│  │SVG Sprite生成    │  │  🔐 安全存储      │  │ ┌───────┐ ┌───────┐ ┌──────┐ │ │
│  │TS类型定义        │  │  Keychain/凭据管  │  │ │index  │ │ app   │ │style │ │ │
│  └──────────────────┘  └──────────────────┘  │ │.html  │ │.js    │ │.css  │ │ │
│                                              │ └───────┘ └───────┘ └──────┘ │ │
│                                              │ 静态资源 + Express 服务        │ │
│                                              └──────────────────────────────┘ │
│                                                                               │
└───────────────────────────────────────────────────────────────────────────────┘

📋 Project Structure

figma-dev-tools/
├── bin/
│   └── figma-dev.js           # CLI 入口(v1.3.0 新增 gui 命令)
├── mcp-standalone.mjs         # 零配置 MCP 入口(v1.1.0 新)
├── gui/                       # 🖥️ v1.3.0 新:GUI 可视化配置面板
│   ├── index.html             # GUI 主页面
│   ├── app.js                 # 前端交互逻辑
│   └── styles.css             # GUI 样式
├── src/
│   ├── index.ts               # MCP 服务器入口(v1.4.0 新增 svg-inline/hierarchy/cache)
│   ├── types.ts               # TypeScript 类型定义
│   ├── i18n/                  # 🌍 v1.3.2 新:国际化
│   │   ├── index.ts           # i18n 核心
│   │   ├── zh-CN.ts           # 中文语言包
│   │   └── en-US.ts           # 英文语言包
│   ├── cli/
│   │   └── index.ts           # CLI 命令定义
│   ├── services/
│   │   ├── figma-client.ts    # Figma REST API 客户端(含本地加密缓存)
│   │   ├── node-processor.ts  # ⭐ 节点树精简 + 语义标注 + 🗂️层级自动修复
│   │   ├── design-context.ts  # ⭐ 渐进式上下文服务
│   │   ├── token-matcher.ts   # ⭐ 多级 Token 匹配
│   │   ├── tailwind-mapper.ts # ⭐ Tailwind 属性映射
│   │   ├── code-generator.ts  # ⭐ JSX 代码生成(v1.4.0:XSS防护+import分组排序+交互推断+语义标签)
│   │   ├── vue-generator.ts   # 🟢 v1.4.0:Vue SFC 代码生成
│   │   ├── flex-fixer.ts      # 🔧 Flex 布局修复
│   │   ├── a11y-enhancer.ts   # ♿ 无障碍增强
│   │   ├── design-system.ts   # 🎨 设计系统对齐
│   │   ├── responsive-inferrer.ts # 📱 响应式推断
│   │   ├── design-linter.ts   # ✅ 设计规范检查(含🗂️层级错位检测)
│   │   ├── hierarchy-fixer.ts # 🗂️ v1.4.0:智能层级修复(父子错位自动修复)
│   │   ├── svg-inline-renderer.ts # 🎨 v1.4.0:SVG内联渲染(svgo优化+LRU缓存)
│   │   ├── animation-detector.ts  # ✨ v1.4.0:动效检测(基础框架,预留扩展)
│   │   ├── component-mapper.ts    # 🧩 v1.4.0:组件库映射(shadcn/ui等检测提示)
│   │   ├── interaction-inferrer.ts # 🤖 v1.4.0:交互逻辑推断(按钮/表单/Tab/弹窗状态自动推断)
│   │   ├── watch-mode.ts     # 👁️ v1.4.0:Watch模式(轮询Figma变更自动重生成代码)
│   │   ├── cache.ts           # ⚡ v1.4.0:AES-256-GCM本地加密缓存(LRU+TTL)
│   │   ├── code-formatter.ts  # 💅 Prettier 代码格式化
│   │   ├── asset-downloader.ts# ⭐ 资源下载管线(SVGO 优化)
│   │   ├── svg-sprite-generator.ts # 🧩 SVG Sprite 生成
│   │   ├── token-store.ts     # 🔐 Token 安全存储
│   │   ├── tokens-extractor.ts# Tokens 提取
│   │   └── file-writer.ts     # 文件写入
│   ├── types/
│   │   └── nodes.ts           # 节点类型定义
│   └── utils/
│       ├── figma-url.ts       # URL 解析
│       ├── color.ts           # 颜色转换 + CIE76 色差
│       ├── cn.ts              # className 合并工具(tailwind-merge + clsx)
│       ├── security.ts        # 🔒 v1.4.0:XSS安全防护(6个安全函数)
│       └── errors.ts          # 错误处理
├── dist/                      # 编译输出
├── .env.example               # 环境变量模板
├── FIGMA-DESIGN-GUIDELINES.md # 📖 Figma 设计规范指南
├── DEVELOPMENT.md             # 开发文档
├── OPTIMIZATION-ANALYSIS.md   # 优化分析
├── package.json               # v1.4.0
├── tsconfig.json
├── README.md                  # 本文件
├── LICENSE                    # MIT 许可证
└── SKILL.md                   # AI Agent 使用指南

❓ FAQ / Troubleshooting

Q: I'm a beginner, first time using it, don't know how to configure?

Solution (v1.3.0 new feature - easiest way): Directly run the GUI visual configuration wizard, no need to memorize any commands:

npx figma-dev-tools gui

The browser will automatically open the configuration interface. Follow the guided steps and click:

  1. Select Chinese language

  2. Paste your Figma Token (automatically validated)

  3. Check the editors to configure (automatically detects installed ones)

  4. Click one-click install, done!

Q: How to start the GUI graphical configuration interface?

Solution (v1.3.0 new): There are three ways to start the GUI:

# 方式一:直接启动 gui 命令(推荐)
figma-dev gui
# 或 npx figma-dev-tools gui

# 方式二:向导命令加 --gui 参数
figma-dev wizard --gui

# 方式三:初始化命令加 --gui 参数
figma-dev init --gui
  • Default port: 54321

  • If 54321 is occupied, automatically try 54322, 54323

  • Automatically open default browser after startup

  • Supports switching between Chinese and English

  • Real-time validation of Token input validity

  • Automatically detect 8+ editors and install configuration with one click

Q: Can the GUI use a custom port?

Solution (v1.3.0 new):

# 指定端口启动
figma-dev gui --port 3000

# 或通过环境变量
FIGMA_GUI_PORT=3000 figma-dev gui

Q: MCP server cannot start?

Check:

  1. Have you executed npm install && npm run build (or corresponding pnpm/yarn/bun commands)

  2. Does dist/index.js file exist

  3. Node.js version ≥ 20 (check with node -v)

  4. Is the path in MCP configuration correct (absolute path recommended)

  5. Zero-config method can directly use npx -y figma-dev-tools --figma-api-key=xxx

  6. Recommended to use GUI configuration first: figma-dev gui, it will automatically complete all configurations for you

Q: API request returns 401 Unauthorized?

Solution:

  1. Check if FIGMA_ACCESS_TOKEN is correctly configured

  2. Confirm the token has not expired (try generating a new one)

  3. Confirm the token has File content (Read only) permission checked

  4. Confirm you have permission to access that Figma file (file must be visible via link or you are a collaborator)

  5. v1.3.0+ can use GUI interface to input Token, real-time validation of validity

  6. v1.3.2+ can use figma-dev token set for secure storage, avoiding plaintext configuration errors

  7. Try passing the Token directly via --figma-api-key parameter

Q: Generated icons become oval/distorted?

Solution (v1.3.2 auto-fix):

  • This is a classic Flex layout issue: Flex container defaults align-items: stretch which stretches child elements

  • v1.3.2's figma_generate_jsx has automatically detected and added align-items: center + flex-shrink: 0 + fixed width/height fix

  • If the problem persists, call figma_lint_design to check Auto Layout settings in the design file

Q: I use Vue/Svelte/other frameworks, not React?

Solution: Use the figma_get_structured_data tool added in v1.1.0, which outputs a framework-agnostic JSON structure containing complete node hierarchy, styles, text, and asset information. You can generate code for any framework based on this data.

CLI also supports:

npx figma-dev structured "https://www.figma.com/design/xxx/yyy?node-id=23-11032" --format json

💡 In the "Framework Preference" step of GUI configuration, you can select your commonly used framework.

Q: Generated component colors/spacing don't match the design file?

Solution:

  1. Ensure Variables are used in Figma to define colors/spacing, and codeSyntax.WEB is set

  2. v1.3.2's design system alignment feature will automatically match color/spacing/font/border-radius/shadow variables

  3. Recommended color format oklch (Tailwind v4 native support), switch to hex if issues arise

  4. Colors not matching existing tokens will be extended via @theme inline, do not write bg-[#hex] directly

  5. Check TODO comments and design system suggestion reports in generated code

  6. Call figma_lint_design before generation to check design file specifications

Q: Generated code has many redundant nested divs?

Solution:

  1. Use figma_generate_jsx from v1.4.0 instead of the older figma_generate_component

  2. UI designers should avoid multiple layers of meaningless Group nesting (use Frame to define areas)

  3. Call figma_lint_design to check for nesting level issues

  4. Check if nodes marked as layout-only in the generated code are incorrectly retained

  5. It is recommended to split large blocks and generate them one by one to avoid processing overly deep node trees in a single pass

Q: Image assets are not automatically downloaded?

Solution:

  1. You must call the figma_download_assets tool, passing in the pendingAssets[].nodeId from the generate_jsx output

  2. Ensure the sceneName parameter is set (assets will be placed in the public/<scene name>/ directory)

  3. v1.3.2 automatically uses SVGO to optimize SVGs during download, removing redundant attributes

  4. Check if the image nodes in Figma have an IMAGE fill

  5. Network issue: Figma's image CDN may require a proxy

Q: How to make the generated code responsive?

Solution (v1.3.2 new feature):

  1. figma_generate_jsx from v1.3.2 automatically infers responsive breakpoints and provides sm/md/lg prefix suggestions in the responsive recommendation report

  2. It is recommended to design for mobile and desktop separately, or use Auto Layout constraints

  3. Manually adjust class names to add responsive prefixes (e.g., md:flex-row) based on the responsive suggestions

Q: The generated code lacks accessibility attributes?

Solution (v1.3.2 automatic enhancement):

  • figma_generate_jsx from v1.3.2 already automatically adds:

    • Semantic HTML tags (<button> instead of <div onClick>, <h1>-<h6>, etc.)

    • Image alt text

    • ARIA labels and roles

    • Minimum accessible click size hints

  • The accessibility enhancement report lists all added enhancements

  • Call figma_lint_design to check for accessibility issues in the design

Q: API request rate limits?

  • The Figma API has rate limits (approximately 60 requests/minute)

  • The tool internally throttles automatically when batch downloading assets

  • It is recommended to split large files for processing to avoid a high volume of requests in a short time

Q: Which frontend frameworks are supported?

  • React + Tailwind CSS: First-class support (TSX code generation + full v1.3.2 enhancements)

  • Vue 2/3 / Nuxt: Get structured data via figma_get_structured_data, AI can generate Vue SFC

  • Svelte / SvelteKit: Same as above

  • Angular: Same as above

  • SolidJS / Qwik: Same as above

  • Native HTML / CSS: Same as above

  • Astro: Same as above

  • Next.js: Supported, but be careful not to use next/image (use regular <img> or publicCdnUrl())

  • Vite + React: Recommended, best match for generated code

💡 You can select your framework preference in the GUI configuration wizard.

Q: Zed editor configuration not working?

Solution: Zed uses the mcp_servers field (underscore), not mcpServers (camelCase).

  • Use figma-dev gui graphical interface for one-click configuration, which automatically handles Zed's field differences

  • Or use npx figma-dev-tools install, which also handles this difference automatically

Q: How to switch the interface language?

Solution (v1.3.2 new):

# CLI 交互式切换
figma-dev lang switch

# 直接设置
figma-dev lang set zh-CN  # 中文
figma-dev lang set en-US  # English

# 或通过环境变量
FIGMA_DEFAULT_LANG=zh-CN

💡 You can also select the language directly in the second step of the GUI configuration interface.

Q: How to securely store the Figma Token?

Solution (v1.3.0+ recommended):

  • Simplest: Run figma-dev gui, enter the Token in the GUI interface, which automatically verifies and saves it to secure storage

  • Command line method (v1.3.2 new):

# 交互式保存(推荐,会验证 Token)
figma-dev token set

# 直接保存
figma-dev token set -t figd_your_token_here

# 列出已保存 Token
figma-dev token list

# 查看 Token(掩码显示)
figma-dev token get

# 设置默认 Token
figma-dev token default work

The Token will be saved in the system's secure storage:

  • macOS: Keychain

  • Windows: Credential Manager

  • Linux: libsecret (falls back to an encrypted file if unavailable)


📖 Design Guidelines

See FIGMA-DESIGN-GUIDELINES.md, a complete Figma design guideline for designers and AI, including:

  • Auto Layout usage conventions

  • Layer naming conventions

  • 4px/8px grid system

  • Component reuse suggestions

  • Accessibility design requirements

  • Best practices from design to code

It is recommended to run figma_lint_design to check the design quality before generating code.


🎯 Comparison with Other Solutions

The following comparison is based on publicly available information from 2025-2026, reflecting the capability differences between figma-dev-tools v1.4.4 and other solutions, and does not represent the full capabilities of the latter. "Needs confirmation" indicates that public information is not explicitly stated.

vs Commercial SaaS Solutions

Dimension

figma-dev-tools v1.4.4

Builder.io

Anima

Locofy

Seal (NetEase Seal D2C)

Positioning

Open-source MCP toolchain

Commercial SaaS + AI platform

Commercial SaaS

Commercial SaaS

Internal enterprise tool / Figma plugin

Price

Free and open-source (MIT)

Freemium (Pro $24/mo+)

Freemium ($20/mo+)

Freemium ($29/mo+)

Free (registration required)

MCP Protocol Support

GUI Visual Configuration

✅ v1.3.0 (Browser GUI)

✅ (Fusion Canvas)

✅ (AI Playground)

✅ (Figma Plugin)

✅ (Figma Plugin)

React Code Generation

✅ TSX + Tailwind

Vue Code Generation

✅ v1.4.0 (Vue 3 SFC + UnoCSS)

Framework-Agnostic Structured Data

✅ v1.1.0 (JSON output)

Design Tokens Extraction

✅ Variables + Styles

Needs confirmation

Needs confirmation

Flex Layout Auto-Fix

✅ v1.3.2 (Icon distortion/text truncation)

Partial (Auto responsive)

✅ (Auto layout restoration)

Accessibility (a11y) Enhancement

✅ v1.3.2 (Semantic tags/alt/ARIA)

✅ (Review agents)

Needs confirmation

✅ (Agent Mode)

Needs confirmation

Automatic Asset Download

✅ publicCdnUrl + SVGO

Needs confirmation

Fidelity Verification (Pixel Diff)

✅ v1.4.4 (pixelmatch + heatmap)

Needs confirmation ("pixel-perfect" claim)

Partial (Design check)

Paywall Fallback (Screenshot Safety Net)

✅ v1.4.4 (Playwright + visual approximation)

Multi-Editor Integration

✅ 8+ (GUI auto-detect one-click install)

✅ (VS Code/Cursor)

✅ (Frontier Extension)

✅ (Cursor/Windsurf etc.)

CLI Command Line

✅ 20+ commands

✅ (Visual Copilot CLI)

Needs confirmation

Needs confirmation

i18n Internationalization

✅ v1.3.2 (Chinese/English bilingual)

Needs confirmation

✅ (Agent Mode instructions)

Needs confirmation

Token Secure Storage

✅ v1.3.2 (System keychain)

Needs confirmation

Needs confirmation

Needs confirmation

vs Open Source / Official Tools

Dimension

figma-dev-tools v1.4.4

@figma/code-connect

Framelink Figma MCP

figma-mcp (Community)

Design Lint AI

Positioning

Open-source MCP toolchain

Figma official component mapping

Open-source MCP (8k+ stars)

Open-source MCP (multiple projects)

Figma plugin

Price

Free and open-source (MIT)

Free (requires Dev/Full seat)

Free and open-source (MIT)

Free and open-source

Freemium (Pro $19/mo+)

MCP Protocol Support

✅ (Integration with official MCP)

GUI Visual Configuration

✅ v1.3.0

✅ (Code Connect UI public beta)

❌ (Configuration file driven)

✅ (Figma Plugin)

Code Generation

✅ One-click TSX/Vue

❌ (Component mapping only, not D2C)

❌ (Provides data only, generated by AI)

❌ (Provides data only)

N/A (Not a code generation tool)

Design Tokens Extraction

✅ (variables + code syntax)

✅ (Token validation)

Flex Layout Auto-Fix

✅ v1.3.2

Partial (Auto-Layout configuration)

Accessibility (a11y) Enhancement

✅ v1.3.2

✅ (WCAG check)

Automatic Asset Download

✅ (download_figma_images)

Fidelity Verification (Pixel Diff)

✅ v1.4.4

Paywall Fallback (Screenshot Safety Net)

✅ v1.4.4

N/A (Official features don't involve paywalls)

Multi-Editor Integration

✅ 8+ (GUI auto-detect)

✅ (VS Code/Cursor/Android Studio etc.)

✅ (All MCP clients)

✅ (All MCP clients)

CLI Command Line

✅ 20+ commands

✅ (figma connect CLI)

✅ (npx start)

❌ (Team API)

i18n Internationalization

✅ v1.3.2

SVG Sprite Generation

✅ v1.3.2

Differentiating Advantages

  • Paywall Fallback: figma-dev-tools v1.4.4's unique BrowserFallbackService automatically starts Playwright screenshot fallback when the Figma REST API fails due to a paywall. None of the competitors offer a similar mechanism.

  • Fidelity Verification Loop: figma_verify_fidelity provides pixel diff + difference heatmap + quantitative score (0-100%). Other tools mostly stay at the "pixel-perfect" claim level without automated verification.

  • Framework-Agnostic Structured Data: figma_get_structured_data outputs standard JSON, supporting any framework. Commercial SaaS often locks you into specific frameworks.

  • Open Source + Free + Full Features: MIT license, no paid seat required to use all 19 MCP tools.


📜 License

MIT © figma-dev-tools contributors

-
license - not tested
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • The Figma MCP server brings Figma design context directly into your AI workflow.

  • Connect AI coding agents to Anima Playground, Figma, and your design system.

  • UI design from prompts, screenshots, and URLs for AI coding agents and theme tokens.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/qq1006492122/figma-dev-tools'

If you have feedback or need assistance with the MCP directory API, please join our Discord server