Skip to main content
Glama
qq1006492122

figma-dev-tools

by qq1006492122

🎨 Figma Dev Tools v1.4.10

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

English | 中文

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


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

Core Fallback & Restoration

Optimization Item

Description

Version

🧱 Paywall Browser Fallback

Added BrowserFallbackService: When Figma REST API fails due to paywall/permission issues, automatically launches Playwright headless browser to load the design page and capture a screenshot as 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, clearly marked with "Approximate 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 quantitative similarity

v1.4.4

📐 Absolute Positioning Restoration

Fixed layoutMode=NONE nodes missing relativeTransform, correctly mapping floating element rotation/offset

v1.4.4

🎨 Gradients/Multiple Shadows/Inner Shadow

Fixed linear/radial gradient fills, multiple shadows, and inner shadow restoration being lost, all degraded to solid colors

v1.4.4

✂️ Mask/Clip-Path Restoration

Fixed rounded avatars and irregular cropping distortions, mapped to overflow:hidden + border-radius or clip-path

v1.4.4

StrokeDash Dashed/Dotted Lines

Fixed dashed and dotted borders all becoming solid lines

v1.4.4

🔤 Rich Text Multi-Style

Fixed styleOverrideTable not being parsed, causing entire text segments to use the same style

v1.4.4

🌍 i18n Error Message Internationalization

Hardcoded Chinese error messages in figma-client.ts all changed to i18n key references, output based on 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, subsequent screenshots skip the 1-3 second startup phase, idle instances auto-recycled after 60 seconds

v1.4.4

💾 Screenshot Cache

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

v1.4.4

⏱️ Tiered Timeouts

Separate timeouts for navigation/rendering/screenshot (default 20s/10s/5s), precisely pinpointing 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

Automatic retry for network errors and timeout errors (default 2 retries, initial delay 500ms, exponential backoff), parameter errors are not retried

v1.4.4

🔥 Warmup Mechanism

warmup() pre-launches browser instances at service startup, eliminating first-call latency

v1.4.4

📊 Performance Metrics Instrumentation

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

v1.4.4

🐛 Logic Bug Fixes

Fixed 9 logic bugs: inconsistent screenshot selectors, hardcoded dimensions, devModeCss injection risk, unclamped fidelityScore, dependency check order, etc.

v1.4.4

🧪 Test Coverage

Added 35 test cases (BrowserPool + ScreenshotCache + performance optimization configuration), all 95 tests 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 improved

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 秒)
});

Related MCP server: Figma MCP Server

📜 Version History Summary

Version

Theme

Core Content

v1.4.10

Version Number Unification + figd_ Token Authentication Fix

Fixed figd_ type Token authentication (X-Figma-Token header), CLI/GUI version numbers unified from package.json, all document version numbers updated synchronously

v1.4.9

figd_ Token Authentication Fix

Fixed compatibility issue where figd_ type Token must use X-Figma-Token request header instead of Authorization, Token verification fully passed

v1.4.8

--update EBUSY Compatibility + Documentation

--update automatically detects EBUSY and falls back to robocopy, CLI documentation completed (-v/--ver/--update), fixed duplicate icons, detailed error display

v1.4.7

Token Verification Optimization + i18n

Token verification failure shows specific reasons (HTTP 401/403/429), GUI error detail display, CLI error capture enhancement, error messages fully internationalized

v1.4.4

Paywall Fallback + Performance Optimization

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

v1.4.3

Stability and Security Hardening

GUI request body protection, circular reference detection, recursion 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, smart layer hierarchy, SVG inline rendering, animation detection, local encrypted cache, scoring algorithm optimization, H5 adaptation, Token secure 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 verification → editor detection one-click installation → framework preference selection → completion page, zero learning curve for beginners

v1.3.0

🔗 19 MCP Tools

Full coverage from 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, supports Vue/Svelte/HTML/Angular/Solid and any other framework

v1.1.0

⚛️ React + Tailwind First-Class Support

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

v1.3.2

🔧 Flex Layout Auto-Fix

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

v1.3.2

Accessibility Enhancement

Automatically adds semantic tags, alt text, ARIA attributes

v1.3.2

🎨 Design System Alignment

Automatically matches color/spacing/typography/border-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

🧠 Smart Layer Hierarchy

Automatically flattens redundant GROUP/FRAME layers, eliminating ~60% 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 matching → @theme extension suggestions

v1

🖼️ Automatic Asset Pipeline

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

v1.2

🧩 SVG Sprite Generation

Batch merges icons into sprites, supports CSS color control

v1.3.2

🌍 i18n Internationalization

Bilingual Chinese/English support, switch via figma-dev lang switch

v1.3.2

🔐 Secure Token Storage

Stores Token securely in system keychain

v1.3.2

💻 CLI Command Line

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

v1 (gui v1.3.0)

🔄 8+ Editor Support

One-click installation 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, no prior installation or configuration needed

v1.2


🚀 Quick Start

📚 Want a concise, version-synced quick guide? See QUICKSTART.md (Chinese) / QUICKSTART.en-US.md (English). The following is the 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 startup, 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 - Chinese/English bilingual switch

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

  4. Editor Detection - Auto-detect 8+ installed editors, check to install MCP configuration with one click

  5. Framework Preference - Select preferred 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 Execution (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+)

  • Auto-detect package manager (npm/pnpm/yarn/bun)

  • Download/compile tools

  • 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 editor configuration installation.

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

# 克隆或复制 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 avatar in top right → SettingsAccount

  3. Find Personal access tokensGenerate new token

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

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

💡 When using GUI configuration, simply 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 securely stored automatically.

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 Parameters

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):

In an AI editor (e.g., 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 process (v1.3.2):

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

  2. figma_parse_url - Parse the 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 (SVGO auto-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 file basic 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 (flat hierarchy + semantic annotations + asset list)

fileKey/nodeId/maxDepth

v1.2

7

figma_get_screenshot

Get high-resolution 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

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

fileKey/nodeId/maxDepth

v1.3.2

10

figma_generate_jsx

⭐ One-click generate React/Vue+Tailwind TSX (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, recommend 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

⭐ v1.3.2 New: 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 file (auto backup)

tokens/outputDir/format

v1

17

figma_dev_fallback_status

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

None

v1.4.4

18

figma_dev_fallback_capture

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

figmaUrl/devicePixelRatio/framework

v1.4.4

19

figma_verify_fidelity

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

figmaUrl/codeContent/threshold

v1.4.4

Tool Detailed 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 automatically fixed layout issues (icon distortion, text truncation, etc.)

  • Accessibility enhancement report: Semantic tags, alt text, ARIA attributes added

  • 🎨 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 (suggest fixing if below 80)

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

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

Check items:

  • Auto Layout usage conventions

  • Layer naming conventions

  • Whether spacing/size/border-radius uses 4px/8px grid

  • Component reuse status

  • Accessibility minimum click size (48×48px)

  • Nesting depth

  • Text style consistency

  • Color usage conventions

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 (v1.3.2 New, 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 (v1.1.0 New, 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 contains:

    • 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 nodes, color count, asset count, text node count

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

Applicable frameworks:

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

  • ✅ 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 each editor

-

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 info

-

v1

figma-dev lint <url>

✅ Design spec 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 component

--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

figma-dev -v / --ver

📌 View current version

-

v1.4.8

figma-dev --update

🔄 Check and update to latest version (auto handle EBUSY file lock)

-

v1.4.8

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.4.8 新增)
figma-dev -v

# 🔄 检查并更新到最新版本(v1.4.8 新增,自动处理 EBUSY 文件占用)
figma-dev --update

# 设计规范预检(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 the installation with one click. No need to manually find config file paths.

MCP Config Template

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 the 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 install needed):

{
  "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 paths. Zed will automatically use the mcp_servers field.


⚙️ Configuration Notes

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 Config Priority

Token read priority:

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

  2. Token configured and saved via GUI (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 config

  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.10                           │
│     🖥️ 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): Run the GUI visual configuration wizard directly, no need to remember 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 (auto-validated)

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

  4. Click one-click install, done!

Q: How to launch the GUI graphical interface configuration?

Solution (v1.3.0 new): There are three ways to launch 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 tries 54322, 54323

  • Automatically opens default browser after launch

  • Supports switching between Chinese and English

  • Token input real-time validation

  • Automatically detects 8+ editors and one-click install configuration

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 won't start?

Check:

  1. Have you run npm install && npm run build (or pnpm/yarn/bun equivalent)?

  2. Does dist/index.js exist?

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

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

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

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

Q: API request returns 401 Unauthorized?

Solution:

  1. Check if FIGMA_ACCESS_TOKEN is configured correctly

  2. Confirm the token hasn't expired (try generating a new one)

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

  4. Confirm you have access to 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

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

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

Q: Generated icons become ellipses/distorted?

Solution (v1.3.2 auto-fix):

  • This is a classic Flex layout issue: Flex containers default to align-items: stretch which stretches child elements

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

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

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

Solution: Use the new figma_get_structured_data tool from 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.

The CLI also supports:

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

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

Q: The generated component colors/spacing don't match the design?

Solution:

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

  2. The design system alignment feature in v1.3.2 automatically matches color/spacing/font/border-radius/shadow variables

  3. Recommended color format: oklch (natively supported by Tailwind v4); switch to hex if issues arise

  4. Colors that don't match existing tokens are extended via @theme inline; do not write bg-[#hex] directly

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

  6. Before generation, call figma_lint_design to check the design specification

Q: The 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 Frames to define areas)

  3. Call figma_lint_design to check for nesting level issues

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

  5. For large sections, split them and generate block by block to avoid processing overly deep node trees at once

Q: Image assets are not automatically downloaded?

Solution:

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

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

  3. In v1.3.2, SVGs are automatically optimized with SVGO during download, removing redundant attributes

  4. Check whether image nodes in Figma have an IMAGE fill

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

Q: How to make the generated code responsive?

Solution (new in v1.3.2):

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

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

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

Q: The generated code lacks accessibility attributes?

Solution (automatic enhancement in v1.3.2):

  • figma_generate_jsx in v1.3.2 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?

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

  • The tool internally throttles automatically when batch downloading assets

  • For large files, it is recommended to split processing to avoid a high number of requests in a short time

Q: Which frontend frameworks are supported?

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

  • Vue 2/3 / Nuxt: Obtain 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 note: do not use next/image (use regular <img> or publicCdnUrl())

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

💡 In the GUI configuration wizard, you can select your framework preference.

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 automatically handles this difference

Q: How to switch the interface language?

Solution (new in v1.3.2):

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

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

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

💡 In the second step of the GUI configuration interface, you can also directly select the language.

Q: How to securely store the Figma Token?

Solution (recommended v1.3.0+):

  • Simplest: Run figma-dev gui, enter the Token in the GUI interface, automatically verify and store it in secure storage

  • Command line method (new in v1.3.2):

# 交互式保存(推荐,会验证 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 is saved in the system's secure storage:

  • macOS: Keychain

  • Windows: Credential Manager

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


📖 Design Guidelines

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

  • Auto Layout usage conventions

  • Layer naming conventions

  • 4px/8px grid system

  • Component reuse recommendations

  • Accessibility design requirements

  • Best practices from design to code

Before generating code, it is recommended to run figma_lint_design to check the design quality.


🎯 Comparison with Other Solutions

The following comparison is based on publicly available information from 2025-2026, reflecting only the capability differences between figma-dev-tools v1.4.4 and each solution, not the full capabilities of the other parties. Items marked "needs confirmation" indicate that public information does not clearly state the feature.

vs Commercial SaaS Solutions

Comparison Dimension

figma-dev-tools v1.4.4

Builder.io

Anima

Locofy

Seal (NetEase 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 deformation/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" claims)

Partial (design check)

Paywall Fallback (Screenshot Backup)

✅ 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

Comparison 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

✅ (integrated with official MCP)

GUI Visual Configuration

✅ v1.3.0

✅ (Code Connect UI public beta)

❌ (config file driven)

✅ (Figma plugin)

Code Generation

✅ One-click TSX/Vue

❌ (component mapping only, not D2C)

❌ (provides data only, AI generates)

❌ (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 config)

Accessibility (a11y) Enhancement

✅ v1.3.2

✅ (WCAG check)

Automatic Asset Download

✅ (download_figma_images)

Fidelity Verification (Pixel Diff)

✅ v1.4.4

Paywall Fallback (Screenshot Backup)

✅ 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 backup when the Figma REST API fails due to paywalls; 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 "pixel-perfect" claims without automated verification

  • Framework-Agnostic Structured Data: figma_get_structured_data outputs standard JSON, supporting any framework; commercial SaaS solutions often lock into specific frameworks

  • Open-Source + Free + Full Features: MIT license, all 19 MCP tools available without a paid seat


📜 License

MIT © figma-dev-tools contributors

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessNo issues

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Connects Figma designs to AI agents, enabling extraction of production-ready code, assets, and design tokens through natural language descriptions. Supports React, Vue, CSS, and Tailwind with real-time design system analysis.
    81,586
    40
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to read Figma design files and automatically map responsive relationships between mobile and desktop screens to generate accurate frontend code. Eliminates manual copy-pasting by providing direct access to design tokens, dimensions, and screen layouts within AI-powered IDEs.
    -
  • A
    license
    A
    quality
    C
    maintenance
    Converts Figma designs into structured code context with token-aware styling, enabling AI agents to generate production-level frontend code.
    1
    14
    MIT

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