Logo Figma MCP Local

Figma MCP Local

Cộng đồng
MiHarsh

A Model Context Protocol server + Figma desktop plugin that lets AI coding agents (Cursor, VS Code Copilot, Claude Desktop, Windsurf, Cline, etc.) consume Figma design data from local files — no…

Nhà phát hànhMiHarsh
Kho mãFigma-local-MCP
Ngôn ngữTypeScript
Bản fork
1
Sao
24
Công cụ có sẵn
1
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Figma MCP Local cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 1 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    24 sao và 1 bản fork từ kho mã được liên kết.

A Model Context Protocol server + Figma desktop plugin that lets AI coding agents (Cursor, VS Code Copilot, Claude Desktop, Windsurf, Cline, etc.) consume Figma design data from local files — no Figma API key, no rate limits, no internet required.

The plugin packages your design as a single ZIP containing the JSON tree plus pre-rendered PNG screenshots (for multimodal visual grounding), pre-rendered SVG icons (no path-data reconstruction), and image-fill bytes. The server then exposes three composable tools that hand the agent exactly what it needs to generate pixel-accurate, semantically-correct UI code.

Built on top of Framelink MCP — uses the same extractor pipeline to simplify raw Figma data into compact, LLM-friendly output. This project adds the offline export path, visual grounding, semantic enrichment, and an agent-directing protocol.

🤖 Fully vibe-coded — this entire project (plugin + MCP tool + docs) was generated via AI-assisted development. Contributions are welcome!

Why this over the official Framelink MCP?

The official Framelink MCP is excellent for real-time API workflows. This project optimizes for a different shape: offline, designer-curated exports with visual context baked in. Concrete differences:

CapabilityFramelink MCP (API-based)figma-local-mcp (this project)
Figma API key / OAuthRequiredNot needed
Free-tier rate limitsHit aggressively on real designsNone — fully local
Internet during useRequired for every requestNot required after export
Visual groundingImage download tool on demandPre-rendered PNG @2x of top-level frames, bundled in ZIP, returned as native MCP image content block
Icon fidelitySVG via API (multiple round-trips)Pre-rendered SVG markup in sidecar files; agent inlines verbatim
Image fillsimageRef → API downloadBytes bundled locally; assetPath injected into the simplified output
Component semanticscomponentId + name+ heuristic semanticRole (button, textbox, dropdown, checkbox, dialog, …) on every INSTANCE so the agent generates <input> / <select> / <button> instead of generic <div>
Agent guidanceTool description onlyTop-level REQUIRED_NEXT_ACTIONS checklist + per-node renderHint + ABSENT-ASSET RULE that explicitly forbids fabricating stock icons / placeholder URLs / invented SVG when an asset wasn't exported
Cross-page componentsAPI resolves automaticallyPlugin walks INSTANCE → mainComponent across pages and bundles the missing definitions in scope
Per-node named stylesAvailable via APIPer-node styles map captured by plugin, named styles resolved end-to-end
Workflow shapeReal-time: agent ↔ Figma APIDesigner exports once → commits ZIP to repo → agents work offline forever
ReproducibilityLive data shifts with editsZIP is checked-in, deterministic, code-review-able

Use this when you want zero-friction, reproducible, visually-grounded design context in your repo.
Use Framelink when you need live API access (continuously syncing screens, programmatic image downloads outside a designer workflow).

They also compose cleanly side-by-side in the same MCP config.

Why?

The official Framelink MCP server is excellent, but it requires a Figma API key. Free-tier Figma accounts hit aggressive rate limits, making it impractical for heavy use. This project solves that:

  1. Export design data + assets from Figma using a desktop plugin (one-time, no API key)
  2. Process the exported JSON through the same extractor pipeline, enriched with asset paths + semantic roles
  3. Feed the simplified output to your AI coding agent, which chains into get_node_image / get_node_svg for pixel-perfect output

Same quality output as the API-based approach — zero API calls.

How It Works

┌──────────────┐   Export ZIP    ┌────────────────────────────┐   Unzip into project   ┌──────────────────────────┐
│  Figma       │ ──────────────► │  myfile.zip                │ ─────────────────────► │  your-project/designs/   │
│  (Plugin)    │                 │  ├─ myfile.json            │                        │  ├─ myfile.json          │
│              │                 │  └─ myfile.assets/         │                        │  └─ myfile.assets/       │
│              │                 │     ├─ node_*.png  (frames)│                        │     ├─ *.png  (frames)   │
│              │                 │     ├─ icon_*.svg  (icons) │                        │     ├─ *.svg  (icons)    │
│              │                 │     └─ image_*.png (fills) │                        │     └─ *.png  (fills)    │
└──────────────┘                 └────────────────────────────┘                        └────────────┬─────────────┘
                                                                                                   │
                                                                                            Agent prompt:
                                                                                      "Implement the design
                                                                                    from ./designs/myfile.json"
                                                                                                   │
                                                                                                   ▼
┌──────────────┐  Simplified JSON   ┌──────────────────┐    Reads JSON     ┌──────────────────────────┐
│  Agent       │ ◄───────────────── │   MCP Server     │ ◄──────────────── │  get_figma_data_from_json│
│  writes code │  + asset paths +   │  (extractor      │   + manifest      │                          │
│              │  REQUIRED_NEXT_…   │   pipeline +     │   + asset paths   │  Agent then chains:      │
│              │   ◄─ PNG bytes ──  │   asset wiring)  │ ◄──── reads ────  │  get_node_image  ──┐     │
│              │   ◄─ SVG markup ─  │                  │       sidecars    │  get_node_svg    ──┤     │
└──────────────┘                    └──────────────────┘                   └────────────────────┘     │
                                                                                                      │
                                                                                                      ▼
                                                                                          Pixel-accurate,
                                                                                          semantically-correct
                                                                                          UI code

The agent doesn't just see coordinates and colors — it views the rendered design (multimodal PNG) and inlines real SVGs, so generated UI matches the design instead of drifting from it.

Quick Start

Option A: Use via npx (recommended)

No clone required. Just configure your editor's MCP config:

json
{
  "mcpServers": {
    "figma-local": {
      "command": "npx",
      "args": ["-y", "figma-local-mcp", "--stdio"]
    }
  }
}

Then skip to step 2 (build the Figma plugin).

Option B: Clone and build locally

1. Build the MCP server

bash
git clone https://github.com/MiHarsh/figma-local-mcp.git
cd figma-local-mcp
pnpm install
pnpm build

2. Install the Figma plugin

Option A: Install from the Figma Community (recommended) — zero build, auto-updates.

  1. Open the plugin's Community page: https://www.figma.com/community/plugin/1626137893880787983/framelink-exporter
  2. Click Open in… → your Figma file (or Try it out)
  3. The plugin is now available under Plugins → Framelink Exporter in every file

Option B: Sideload the pre-built plugin

  1. Go to the latest GitHub Release
  2. Download figma-plugin.zip
  3. Unzip to any folder
  4. Open the Figma desktop app
  5. Go to Plugins → Development → Import plugin from manifest...
  6. Select manifest.json from the unzipped folder
  7. The plugin appears under Plugins → Development → Framelink Exporter

Option C: Build from source

bash
cd figma-plugin
npm install
npm run build

Then import figma-plugin/manifest.json in Figma as above.

3. Export design data

  1. Open any Figma file
  2. Run the plugin: Plugins → Development → Framelink Exporter
  3. Select the nodes/frames you want to export
  4. Pick which assets to include (PNG frame renders, SVG icons, image-fill bytes — all on by default)
  5. Click Export as ZIP — a .zip downloads automatically containing your JSON + an <filename>.assets/ folder
  6. Unzip into your project (e.g. ./designs/); the plugin auto-closes with a Figma toast confirming the export

4. Configure MCP in your editor

Add to your editor's MCP config (mcp.json, .cursor/mcp.json, etc.):

Via npx (recommended — no clone needed):

json
{
  "mcpServers": {
    "figma-local": {
      "command": "npx",
      "args": ["-y", "figma-local-mcp", "--stdio"]
    }
  }
}

Via local clone — Mac / Linux:

json
{
  "mcpServers": {
    "figma-local": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/figma-local-mcp/dist/bin.js", "--stdio"]
    }
  }
}

Via local clone — Windows:

json
{
  "mcpServers": {
    "figma-local": {
      "type": "stdio",
      "command": "node",
      "args": ["C:\\path\\to\\figma-local-mcp\\dist\\bin.js", "--stdio"]
    }
  }
}

No FIGMA_API_KEY needed. No env block needed. No PORT needed (stdio mode doesn't use HTTP). Just the path to dist/bin.js.

5. Use it

Open your editor's agent/chat mode and ask:

Build a React component matching ./designs/my_dashboard.json

A capable agent will then chain three tool calls automatically:

  1. get_figma_data_from_json({ filePath }) → simplified design tree + REQUIRED_NEXT_ACTIONS checklist + per-node imagePath / svgPath / renderHint / semanticRole
  2. get_node_image({ filePath, nodeId }) → rendered PNG of the root frame as a native MCP image content block (the agent sees the design)
  3. get_node_svg({ filePath, nodeId }) for every node carrying svgPath → exact icon markup, inlined verbatim

The result: code that uses <input type="email"> not <div> (because semanticRole: textbox), real SVGs not invented path data, and matches the layout/spacing of the actual design because the agent grounded its output in the rendered image.

MCP Tools

get_figma_data_from_json

Reads a Framelink-exported JSON file and returns the simplified design tree. When the export carries an asset manifest, the response is enriched with:

  • REQUIRED_NEXT_ACTIONS — top-level checklist of follow-up tool calls (e.g. "View root frame screenshot: get_node_image(filePath, '1:23')")
  • renderHint on every node with an exported asset — imperative directive to call get_node_image / get_node_svg
  • componentName + semanticRole on every INSTANCE — heuristic mapping to UI primitives (button, textbox, dropdown, checkbox, dialog, card, tab, navigation, badge, icon, …)
  • assetPath on every image fill — local sidecar PNG path so agents reference real bytes, not placeholder URLs
  • ABSENT-ASSET RULE in the metadata usage field — explicitly forbids the agent from fabricating stock icons / placeholder image URLs / invented SVG when an asset wasn't exported
ParameterRequiredDescription
filePathYesAbsolute or relative path to the exported JSON file
depthNoMax tree traversal depth. Only use if explicitly requested

get_node_image

Returns the rendered PNG screenshot of a Figma node as an MCP image content block that multimodal agents (Claude, GPT-4o, Gemini) view directly. Call this for any node carrying imagePath — it's the single biggest fidelity unlock for code generation.

ParameterRequiredDescription
filePathYesSame JSON path you passed to get_figma_data_from_json
nodeIdYesFigma node id (e.g. "1:23") — must carry imagePath in the simplified output

get_node_svg

Returns the exact SVG markup of an icon / vector subtree. Use for every node tagged IMAGE-SVG that carries svgPath. Inline the output verbatim into your React/Vue/Svelte component — no path-data reconstruction needed.

ParameterRequiredDescription
filePathYesSame JSON path you passed to get_figma_data_from_json
nodeIdYesFigma node id of the vector subtree

Example prompts:

Implement the design from ./designs/dashboard.json

Build the login page from the exported Figma file at C:\projects\app\designs\login_2026-04-14.json

Figma Plugin

The figma-plugin/ directory contains a Figma desktop plugin that exports design data + assets as a single ZIP. See figma-plugin/README.md for the full plugin docs.

Export Options

  • Scope — selected nodes (GetFileNodesResponse shape) or current page (GetFileResponse shape)
  • Assets (all on by default)
    • Render selected frames as PNG (@2x) — visual grounding
    • Export icon subtrees as SVG — actual vector markup
    • Include image-fill bytes — raster fills referenced by imageRef
  • Limit traversal depth — cap how deep the tree serialization goes

What Gets Captured

CategoryProperties
LayoutabsoluteBoundingBox, constraints, auto-layout (layoutMode, itemSpacing, padding*, sizing modes)
Visualsfills, strokes, effects, opacity, cornerRadius, blendMode, clipsContent
Per-node named-style refsstyles map ({fill, text, effect, stroke} → styleId) so the extractor resolves design-system style names
Textcharacters, style (font family/size/weight/alignment/line height/letter spacing), styleOverrideTable
ComponentscomponentProperties, componentPropertyDefinitions, componentId, component set metadata, plus cross-scope component metadata for instances whose main component lives outside the export scope
AssetsTop-level framelinkExport block carrying the manifest for PNGs, SVGs, and image-fill bytes
StructureFull node tree with id, name, type, visible, children

Plugin Development

bash
cd figma-plugin
npm run watch    # Rebuild on file changes

CLI Flags

FlagDescription
--stdioRun in stdio mode (required for MCP clients)
--jsonOutput in JSON instead of YAML
--port <n>HTTP server port (default: 3333)
--host <h>HTTP server host (default: 127.0.0.1)

Run alongside the official Framelink MCP

If you also need real-time API access (live data, programmatic image downloads outside a designer-curated export), the two servers compose cleanly — different tool names, different workflows, no conflict:

json
{
  "mcpServers": {
    "figma-api": {
      "command": "npx",
      "args": ["-y", "figma-developer-mcp", "--figma-api-key=YOUR-KEY", "--stdio"]
    },
    "figma-local": {
      "command": "npx",
      "args": ["-y", "figma-local-mcp", "--stdio"]
    }
  }
}

Contributing

Contributions are welcome! Some directions still on the table:

  • Smarter cross-scope component definition resolution (variants, nested instances)
  • get_node / list_figma_frames tools for non-truncating navigation of large files
  • boundVariables (Figma Variables → design tokens) capture in the plugin
  • Better naming-hygiene normalization (collapse Frame 23, Group 4 boilerplate names)
  • Prototype interaction data (hover / click / transitions)

Fork it, hack on it, open a PR.

Credits

Built on top of Framelink MCP for Figma by GLips. The extractor pipeline that simplifies raw Figma data is theirs — this project adds the offline export layer.

License

MIT

Cài đặt

TypingMind
{
  "mcpServers": {
    "figma-local-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "figma-local-mcp",
        "--stdio"
      ]
    }
  }
}

Công cụ có sẵn

  • get_figma_data_from_json

    Process a locally exported Figma JSON file (from the Framelink Figma plugin) and return simplified design data. Use this instead of get_figma_data when working with exported JSON files to avoid Figma API rate limits.

Dùng MCP Figma MCP Local với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Figma MCP Local, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Figma MCP Local làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Figma MCP Local.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "figma-local-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "figma-local-mcp"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Figma MCP Local, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Figma MCP Local.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Figma MCP Local giúp tôi làm việc này không?
Figma MCP Local
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Figma MCP Local.

Câu hỏi thường gặp

Máy chủ MCP Figma MCP Local dùng để làm gì?

Figma MCP Local là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Figma MCP Local với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Figma MCP Local với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Figma MCP Local với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Figma MCP Local, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Figma MCP Local với TypingMind?

Figma MCP Local hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Figma MCP Local cung cấp những công cụ nào trong TypingMind?

Figma MCP Local cung cấp 1 công cụ MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Figma MCP Local không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Figma MCP Local yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇