figma-spec-mcp

figma-spec-mcp

Bridge Figma designs to any platform with structured specs for Unity, React, Flutter, SwiftUI, and more, including layout audit, design tokens, and accessibility checks.

Category
访问服务器

README

figma-spec-mcp

Version: 1.0.0-beta.4 License: MIT MCP Compatible

<p align="center"> <img src="assets/banner.png" alt="figma-spec-mcp — Bridge Figma to Game Engines" width="720" /> </p>

Bridge Figma to any platform — Unity UGUI mappings built-in, structured output for React, Flutter, SwiftUI, and more. Layout audit, design tokens, accessibility checks, prototype flows, version diffs, and platform-ready specs — all through MCP.

Works with any MCP-compatible client: Claude Code, Claude Desktop, Cursor, VS Code + Copilot, Windsurf, Cline, Continue.dev, Zed.

Security note: Your Figma access token is passed as a tool argument. Never commit it to version control. Use environment variables or your AI client's secret management to supply it at runtime.


Platform Support

Platform What you get
Unity map_to_unity — RectTransform data, layout groups, anchoring, UGUI component mapping
React map_to_react — JSX tree, Tailwind/CSS classes, shadcn/MUI/Chakra/Radix component mapping, TypeScript props
React Native map_to_react_native — View/Text/TouchableOpacity, StyleSheet, React Native Paper/NativeBase mapping
Flutter map_to_flutter — Widget tree, Material/Cupertino components, ThemeData extraction
SwiftUI map_to_swiftui — VStack/HStack/ZStack, modifier chains, Color asset extraction
Tailwind CSS extract_design_tokens → Tailwind config export
Any platform generate_implementation_contract → structured spec with scope, assets, states, and acceptance criteria

Your AI agent reads the structured output and generates platform-specific code. No manual translation needed.


Quick Start

1. Get a Figma access token → figma.com/developers/api#access-tokens

2. Add to your MCP config (Claude Desktop, Cursor, VS Code, or any MCP client):

{
  "mcpServers": {
    "figma-spec-mcp": {
      "command": "npx",
      "args": ["-y", "figma-spec-mcp@beta"]
    }
  }
}

3. Restart your AI client and use the tools.

Your file key is in the Figma URL: figma.com/file/<FILE_KEY>/...


Why figma-spec-mcp?

Most Figma MCP tools forward raw API responses. figma-spec-mcp adds stable envelopes, focused derivations, and reusable engineering outputs:

  • Deterministic JSON responses with a shared response envelope
  • Built-in disk cache with freshness metadata on every result
  • Source traceability for tokens, mappings, and extracted relationships
  • Platform-ready outputs for Unity, codebase mapping, and image export workflows

Tools

  • inspect_layout — Inspects a Figma frame and returns hierarchy, layout structure, spacing, constraints, annotations, and basic accessibility warnings.
  • extract_design_tokens — Extracts color, typography, and spacing tokens from a Figma file and exports them as CSS variables, Style Dictionary JSON, or Tailwind config.
  • map_to_react — Maps a Figma frame to a React component tree with Tailwind/CSS classes, component library suggestions (shadcn, MUI, Chakra, Radix), asset hints, and TypeScript prop interfaces from variants.
  • map_to_react_native — Maps a Figma frame to React Native components (View, Text, TouchableOpacity, TextInput) with StyleSheet output and React Native Paper/NativeBase library mapping.
  • map_to_flutter — Maps a Figma frame to a Flutter Widget tree (Container, Column, Row, Stack) with Material/Cupertino component mapping and ThemeData extraction.
  • map_to_swiftui — Maps a Figma frame to SwiftUI views (VStack, HStack, ZStack) with modifier chains and Color asset extraction.
  • map_to_unity — Produces a Unity UGUI-oriented mapping with RectTransform data, layout groups, suggested components, notes, and warnings.
  • resolve_components — Resolves instance nodes to their backing component definitions and returns source file and source node references.
  • extract_flows — Extracts prototype transitions from a page or frame and returns directed flow connections plus a deterministic frame order.
  • bridge_to_codebase — Scans a local project and maps Figma component names to likely implementation files using filename heuristics.
  • diff_versions — Compares two Figma file versions and reports added, removed, and modified nodes.
  • extract_variants — Reads a component set and returns structured variant metadata, parsed properties, dimensions, layout details, fills, and typography.
  • export_images — Exports one or more Figma nodes as PNG, JPG, SVG, or PDF and returns the image URLs.
  • audit_accessibility — Audits a frame for accessibility issues such as contrast, touch targets, font size, missing alt text, and color-only distinctions.
  • simplify_context — Produces a token-efficient, LLM-oriented summary tree by collapsing wrappers, grouping repeated nodes, and truncating deep hierarchies.
  • lint_handoff_readiness — Audits a frame for engineering handoff readiness: unnamed layers, absolute positioning soup, missing auto-layout, orphaned nodes, oversized images.
  • generate_implementation_contract — Produces a structured implementation spec with scope, assets, states, interactions, dependencies, typography, colors, and acceptance criteria.
  • extract_missing_states — Scans components for missing UI states (hover, pressed, disabled, loading, error, empty) against a standard expected-state set.
  • flow_to_test_cases — Converts prototype flows into QA-ready test cases with navigation steps, expected outcomes, and flow coverage gaps.

Features

v0.1 — Core

  • inspect_layout, extract_design_tokens, map_to_unity
  • Disk cache with SHA-256 keying and 1h TTL

v0.2 — Intelligence

  • Token name preservation from Figma styles
  • Depth-limited chunking for large files
  • Mixed/rich text runs extraction
  • Annotation extraction, framework-aware hints (Unity, React, SwiftUI, Web)

v0.3 — Workflows

  • resolve_components — multi-file component traversal
  • extract_flows — prototype flow graph
  • bridge_to_codebase — Figma → repo file matching
  • diff_versions — structured version diff
  • extract_variants — component set batch extraction

v0.4 — Quality & DX

  • export_images — PNG/JPG/SVG/PDF export
  • audit_accessibility — WCAG 2.1 contrast, touch targets, font size
  • simplify_context — AI-optimized, token-efficient output
  • Tool registry pattern for easy contribution
  • Rate limit handling (429 + Retry-After)

v0.5 — Handoff & QA

  • lint_handoff_readiness — design-to-code readiness audit with scoring
  • generate_implementation_contract — structured implementation scope + acceptance criteria
  • extract_missing_states — component state coverage analysis
  • flow_to_test_cases — prototype flows → QA test scenarios

v0.6 — Multi-Platform Mappers

  • map_to_react — Figma → React with Tailwind/CSS, shadcn/MUI/Chakra/Radix, TypeScript props
  • map_to_react_native — Figma → React Native with StyleSheet, Paper/NativeBase component mapping
  • map_to_flutter — Figma → Flutter Widget tree with Material/Cupertino, ThemeData extraction
  • map_to_swiftui — Figma → SwiftUI with modifier chains, Color asset extraction
  • Normalized UI AST foundation — shared platform-agnostic tree powering all 4 platform mappers

Response Shape

All 19 tools return a consistent top-level envelope:

{
  "schema_version": "0.1.0",
  "source": { "file_key": "abc123", "node_id": "1:23" },
  "freshness": {
    "fresh": true,
    "timestamp": "2026-03-26T10:00:00.000Z",
    "ttl_ms": 3600000
  },
  "warnings": [],
  "data": {}
}

Tool-specific results live in data, and most tools also include low-level cache metadata there.


Caching

Responses are cached to disk (default: $TMPDIR/figma-spec-mcp-cache/) by file key and request shape with a 1-hour TTL. Cache metadata is included in responses:

"cache": {
  "cachedAt": "2026-03-26T10:00:00.000Z",
  "expiresAt": "2026-03-26T11:00:00.000Z",
  "fileVersion": "123456789",
  "fresh": true
}

Development

git clone https://github.com/zaferdace/figma-spec-mcp
cd figma-spec-mcp
npm install
npm run build
node dist/index.js

Roadmap

  • [x] map_to_react — React component tree with Tailwind/CSS, component library mapping, TypeScript props
  • [x] map_to_react_native — React Native with StyleSheet, Paper/NativeBase mapping
  • [x] map_to_flutter — Flutter Widget tree with Material/Cupertino, ThemeData
  • [x] map_to_swiftui — SwiftUI views with modifier chains, Color assets
  • [ ] detect_design_drift — Compare Figma design against codebase implementation
  • [ ] map_to_unreal_umg — Unreal Engine UMG widget mapping
  • [ ] map_to_godot_control — Godot Control node mapping
  • [ ] Webhook-triggered spec generation

License

MIT © Zafer Dace

推荐服务器

Baidu Map

Baidu Map

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

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

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

官方
精选
本地
TypeScript
VeyraX

VeyraX

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

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

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

官方
精选
Exa MCP Server

Exa MCP Server

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

官方
精选