Figma MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Figma MCP Generate a Unity prefab from the login frame in this Figma file."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Figma MCP
Figma MCP is a local FastMCP 3 server that converts a selected Figma Design Frame, Component, or Instance into an inspectable packet and a static Unity UGUI Direct YAML Prefab.
The project is intentionally small and independent. It uses the Figma REST API, stores rendered PNGs locally, and does not require a Figma plugin, OAuth flow, or Unity Editor extension.
中文文档:README.zh-CN.md
Requirements
Python 3.10+
uv(recommended) or another Python environment managerA Figma personal access token with
file_content:readUnity 2022.3 LTS or Unity 6 LTS for generated output
Related MCP server: figma-mcp-server
Install
uv sync --extra dev
cp .env.example .envSet the token only in your local .env:
FIGMA_TOKEN=figd_your_token_hereThe token is used only in X-Figma-Token headers sent to
https://api.figma.com. Render downloads use a separate unauthenticated HTTP
client. The token is not stored in packets, generated assets, source maps, or
error details.
Run
Loopback HTTP (default):
uv run figma-mcpThe endpoint is http://127.0.0.1:8127/mcp. Non-loopback HTTP binding is
rejected.
stdio:
./run-stdio.shor:
MCP_TRANSPORT=stdio uv run figma-mcpTools
Tool | Purpose |
| List selectable Frames, Components, Instances, and Component Set variants, including those nested under Sections. |
| Fetch one root, normalize it, batch-render PNG assets, and persist an active or diagnostic Packet. |
| Inspect |
| Transactionally write and statically pre-verify a UGUI Direct YAML Prefab. |
| Independently verify YAML, Sprite meta files, source map, ownership, fileIDs, and Unity version. |
Example flow:
Call
figma_list_frameswith a Figma Design URL or file key.Call
figma_prepare_designwith a node id, exact/unique partial name, or 1-based list index. A URLnode-idtakes precedence.Inspect
view="unity_plan"and review warnings.Call
figma_generate_unity_prefabwith an absolute Unity project path.Call
figma_verify_unity_prefab, then open the project in Unity for actual import, compile, and visual validation.
Cache behavior
Successful active Packets use a stable key derived from the Figma file key,
node id, image scale, semantic ruleset, and an explicit version-id when one is
requested. Frame listings and Packets for different explicit versions are kept
in separate cache namespaces. They persist across server restarts.
force_refresh=true is the only normal way to bypass a complete cache.
Refreshes download into a temporary staging directory. A complete refresh writes
an immutable asset version and atomically replaces the active Packet pointer. If
any render is missing or fails, the previous active Packet is preserved and a
separate diagnostic Packet is saved with generation_ready=false.
Figma render URLs are never treated as cache entries. Every rendered PNG is downloaded immediately and stored with its SHA-256 hash.
Figma-to-Unity rules
Figma child order is preserved. Increasing
z_indexis bottom-to-top and Unity creates same-parent nodes in ascending order.Coordinates are rebased to the selected root and use a top-left origin.
Standard constraints map to
RectTransformanchors.horizontal/vertical Auto Layout maps to LayoutGroup and LayoutElement hints. Wrap/grid combinations retain snapshot coordinates and emit warnings.
Editable text becomes
UnityEngine.UI.Text; unmatched fonts fall back to built-in Arial with a warning.Hidden Figma nodes become inactive GameObjects. Group opacity uses one
CanvasGroup; leaf opacity is applied once to its generated Graphic.Simple solid rectangles become UGUI Images. Vector, image fill, gradient, rounded, stroked, or effect-heavy visual leaves become PNG sprites.
Rotated visual leaves and containers use rendered PNGs so rotation is baked accurately. A rotated container keeps its descendant hierarchy and source mapping, while descendant source visuals are suppressed to avoid duplication.
Complex containers remain hierarchical. Rectangular
clipsContentmaps toRectMask2Dwhere safe; unsupported container visuals emit fidelity warnings.
Interactive generation defaults to conservative: confidence must be at least
0.8, review must not be required, and all references must be complete.
structure_only suppresses inferred Button/Toggle/Input/Dropdown/Slider/
ScrollRect components while retaining presentation hierarchy and safe layout or
mask components.
Explicit name tags include @button, @toggle, @input, @dropdown,
@slider, @scroll, @scrollbar, @tab, @radio, @mask, and @ignore.
They never create business scripts, UnityEvent bindings, navigation, or data
bindings.
Unity ownership policy
The default output root is Assets/FigmaMCP. Generation uses staging, static
pre-verification, deterministic GUIDs, a source map, and an ownership manifest.
overwrite=false is the default. With overwrite=true, only unchanged files
already owned by the same Packet manifest can be replaced; every existing file
is checked against its previous SHA-256. If an owned file was edited manually,
generation returns owned_asset_modified. Set
force_overwrite_modified=true together with overwrite=true only when those
edits may be discarded. Direct YAML regeneration replaces complete owned files;
field-level preservation hints describe a future editor-side importer, not the
current writer. Historical orphaned files are reported but not deleted. A failed
commit rolls back files changed during that transaction.
Contracts
All responses use api_version: "0.1" and a success/error envelope. Public
schemas are version 1:
figma-mcp.packetfigma-mcp.unity-planfigma-mcp.prefab-source-mapfigma-mcp.ownership-manifest
Generated JSON Schemas are in schemas/.
Development
uv run pytest
uv run pytest --cov=figma_mcp --cov-report=term-missing
uv run ruff check src tests
uv run mypy src
uv buildThe test suite is offline: it mocks Figma REST and creates temporary Unity project structures. Passing tests prove the contracts, generated files, and static checks; they do not prove compatibility with every real Figma document, Unity Editor import/compilation, or visual parity.
Scope exclusions
Version 0.1.0 does not implement OAuth, Figma variables, FigJam/Slides, plugin templates, real Unity Prefab Instances/Variants, C# importers, visual diff, or a publishing pipeline.
License
MIT
Available Tools
5 toolsfigma_generate_unity_prefabB
Generate a staged, statically verified UGUI Direct YAML Prefab snapshot.
Inputs: packet_id (required), unity_project_path (required), overwrite, asset_root, +7 more. Returns: object
figma_inspect_designC
Inspect a normal or diagnostic Figma Packet through a compact task-oriented view.
Inputs: packet_id (required), view, node_ids, max_depth, +3 more. Returns: object
figma_list_framesB
List Frame, Component, and Instance roots available in a Figma Design file.
Inputs: url (required), force_refresh. Returns: object
figma_prepare_designB
Fetch, normalize, render, download, validate, and persist one Figma design root.
Inputs: url (required), node, image_scale, force_refresh. Returns: object
figma_verify_unity_prefabA
Statically verify generated Prefab YAML, ownership metadata, source map, sprites, and file ids.
Inputs: prefab_asset_path (required), unity_project_path (required), source_map_asset_path. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct stage of the Figma-to-Unity pipeline: listing frames, preparing design data, generating prefabs, inspecting, and verifying. No two tools appear to overlap in purpose.
All tools follow a consistent `figma_` prefix with a verb_noun pattern: list_frames, prepare_design, generate_unity_prefab, inspect_design, verify_unity_prefab. This makes the toolset predictable and easy to navigate.
Five tools is well-scoped for a focused Figma-to-Unity design-to-prefab workflow. Each tool fills a clear role without unnecessary bloat or missing core steps.
The workflow covers the essential stages: discover frames, prepare a design, generate a prefab, inspect it, and verify it. Minor gaps exist, such as no explicit tool for cleanup or batch operations, but these do not impede the primary pipeline.
Maintenance
Related MCP Connectors
The Figma MCP server brings Figma design context directly into your AI workflow.
Deterministic Figma to Elementor, Gutenberg, Oxygen, Etch and HTML layouts for AI assistants.
Design canvas for agents: create, edit, render and export Figma-shaped designs over MCP.
Write Polyxd UI documents, check them, and show them as real screens in any design-system pack.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with Figma designs through the Figma API, allowing users to export images in multiple formats, extract style data and CSS, analyze design elements, and retrieve SVG code from Figma files. Supports batch operations and comprehensive design element analysis including images, vectors, and components.714 npm11MIT
- AlicenseNot gradedqualityDmaintenanceEnables developers to extract and organize Figma design files, including complete node data (tree structure and images) for AI understanding and code generation.23 PyPIMIT
- AlicenseAqualityDmaintenanceConverts Figma designs into production-ready React components with design token extraction, widget registry integration, and micro-frontend module generation.351 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables seamless integration with Figma API for extracting design tokens, generating production-ready code in multiple frameworks, capturing screenshots, and managing design assets directly from Figma.5MIT