{"repo":"TranHoaiHung/figma-ui-mcp","free":true,"listed":false,"github":"https://github.com/TranHoaiHung/figma-ui-mcp","clone":"git clone https://github.com/TranHoaiHung/figma-ui-mcp.git","description":"AI can draw UI directly on the Figma canvas via JavaScript, and read existing designs back as structured data. Works with Claude Code, Cursor, VS Code, and Windsurf. No API KEY required.","language":"JavaScript","stars":224,"topics":["ai","ai-design-tool","ai-tools","antigravity","auto-designing","claude-code","cursor","figma","figma-mcp","figma-plugin","mcp"],"license":"MIT","category":"dev_tool","readme_excerpt":"# figma-ui-mcp\n\n<p align=\"center\">\n  <img src=\"assets/logo-v6.png\" alt=\"figma-ui-mcp — Claude Code to Figma, AI to Figma, MCP Figma Bridge\" width=\"480\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/figma-ui-mcp\"><img src=\"https://img.shields.io/npm/v/figma-ui-mcp?color=blue\" alt=\"npm version\" /></a>\n  <a href=\"https://registry.modelcontextprotocol.io\"><img src=\"https://img.shields.io/badge/MCP-Registry-purple\" alt=\"MCP Registry\" /></a>\n  <a href=\"LICENSE\"><img src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License: MIT\" /></a>\n  <a href=\"https://github.com/TranHoaiHung/figma-ui-mcp/stargazers\"><img src=\"https://img.shields.io/github/stars/TranHoaiHung/figma-ui-mcp?style=social\" alt=\"GitHub stars\" /></a>\n</p>\n\n<p align=\"center\">\n  <strong>Claude Code to Figma</strong> · <strong>Antigravity to Figma</strong> · <strong>Cursor to Figma</strong> · <strong>Any MCP IDE to Figma</strong>\n</p>\n\n<p align=\"center\">\n  <sub>✅ Tested: Claude Code, Antigravity &nbsp;|&nbsp; 🔧 Compatible: Cursor, VS Code, Windsurf, Zed (any MCP stdio client)</sub>\n</p>\n\n**Bidirectional Figma MCP bridge** — let AI assistants (Claude Code, Cursor, Windsurf, Antigravity, VS Code Copilot, or any MCP-compatible IDE) **draw UI directly on Figma canvas** and **read existing designs back** as structured data, screenshots, or code-ready tokens. No Figma API key needed — works entirely over localhost.\n\n> **Requires Figma Desktop** — the plugin communicates with the MCP server over `localhost` HTTP polling. Figma's web app does not allow localhost network access, so **Figma Desktop is required**.\n\n```\nClaude ──figma_write──▶ MCP Server ──HTTP (localhost:38451)──▶ Figma Plugin ──▶ Figma Document\nClaude ◀─figma_read──── MCP Server ◀──HTTP (localhost:38451)── Figma Plugin ◀── Figma Document\n```\n\n### How the localhost bridge works\n\nThe MCP server starts a small HTTP server bound to `localhost:38451`. The Figma plugin (running inside Figma Desktop) uses **long polling** — the server holds requests up to 8s until work arrives, flushing immediately when new ops are queued (near-realtime latency <100ms). All traffic stays on your machine — nothing is sent to any external server.\n\n**Multi-instance support (v2.3.0+):** Multiple Figma files/tabs can connect simultaneously. Each plugin instance sends a `sessionId`, and the bridge routes operations to the correct session. Use the optional `sessionId` param in `figma_write`/`figma_read` to target a specific file.\n\n---\n\n## Features\n\n| Direction | Tool | What it does |\n|-----------|------|-------------|\n| Write | `figma_write` | Draw frames, shapes, text, prototypes via JS code |\n| Read  | `figma_read`  | Extract node trees, colors, typography, screenshots |\n| Info  | `figma_status`| Check plugin connection + active sessions |\n| Docs  | `figma_docs`  | Get full API reference + examples |\n| Rules | `figma_rules` | Generate design system rule sheet — tokens, typography, components |\n\n### What's new in v2.5\n\n| Feature | Description |\n|---------|-------------|\n| **`get_design_context`** | AI-optimized payload for a node — flex layout, token-resolved colors (`var(--name)`), typography with style names, component instances with variant properties. Best single call for design→React/Vue/Swift code. |\n| **`get_component_map`** | List every component instance in a frame with `componentSetName`, `variantLabel`, properties, and `suggestedImport` path. Scaffold import statements in one call. |\n| **`get_unmapped_components`** | Find component instances that have no description in Figma (no code mapping yet). Prompts AI to ask user for correct import paths. |\n| **`figma_rules` tool** | New top-level MCP tool — aggregates color tokens, typography styles, variables (all modes), and component catalog into a single markdown rule sheet. Equivalent to official Figma MCP's `create_design_system_rules`. Call once at session start. |\n| **`get_css` operation** | `figma_read get_css { nodeId }` → ready-to-use CSS string (flex, typography, fill, border, shadow, opacity, transform). One call, paste into code. |\n| **Resolved variables** | `get_node_detail` now resolves `boundVariables` IDs → `{ name, resolvedType, value }`. No more manual ID lookup. |\n| **Resolved style refs** | `fillStyleId` / `textStyleId` now include `fillStyle: { name, hex }` and `textStyle: { name, fontSize, fontFamily }`. |\n| **Instance overrides detail** | `overrides: [{ id, overriddenFields: [\"fills\",\"characters\",...] }]` — full diff vs mainComponent, not just count. |\n| **`componentSetName` + `variantLabel`** | INSTANCE nodes now expose set name (`\"Button\"`) and variant label (`\"State=Primary, Size=Large\"`) separately. |\n| **`insertIndex` for create** | `figma.create({ ..., insertIndex: 2 })` — insert node at exact position in parent, not always at end. |\n| **Typography tokens** | `setupDesignTokens({ fontSizes, fonts, textStyles })` — 1 call bootstrap full typography system with variable-bound text styles. Multi-mode (Compact/Comfortable/Large) supported. |\n| **`applyTextStyle`** | Apply a local text style to a TEXT node by name in 1 call — auto-loads font. |\n| **STRING variables for fonts** | `applyVariable` now binds `fontFamily`, `fontStyle`, `characters` (swap Inter → SF Pro via 1 variable). |\n| **Effects** | `effects: [{ type: \"DROP_SHADOW\" \\| \"INNER_SHADOW\" \\| \"LAYER_BLUR\" \\| \"BACKGROUND_BLUR\", ... }]` on any node. |\n| **Gradient fills** | `fill: { type: \"LINEAR_GRADIENT\" \\| \"RADIAL_GRADIENT\", angle, stops }` in create/modify. |\n| **Individual corner radii** | `topLeftRadius`, `topRightRadius`, `bottomLeftRadius`, `bottomRightRadius` on FRAME/RECT. |\n| **8-digit hex + rgba alpha** | `fill: \"#FFFFFF80\"` or `\"rgba(255,255,255,0.5)\"` — alpha auto-applied to paint opacity. |\n| **SVG arc (A) + commas** | VECTOR `d` paths accept `A` arc command (auto-converted to cubic Bézier) and commas. |\n| **Icon libraries** | 7 free open-source libraries, iOS-filled first: **Ionicons** → Fluent → Bootstrap → Phosphor → **Tabler Filled** → Tabler Outline → Lucide. |\n| **Instance overrides** | `figma.instantiate({ overrides: { \"LayerName\": { text, fill, fontSize } } })` — override props per-layer. |\n| **Batch delete** | `figma.delete({ ids: [...] })` — delete multiple nodes in 1 round-trip. |\n| **Prototyping** | `setReactions` — click/hover/press → navigate/overlay/swap with Smart Animate. |\n| **Scroll behavior** | `setScrollBehavior` — HORIZONTAL / VERTICAL / BOTH overflow. |\n| **Variants & instance swap** | `setComponentProperties` / `swapComponent` — variants + instance swap. |\n| **Component property definitions** *(v2.5.24)* | `addComponentProperty` + `bindComponentProperty` — create TEXT / BOOLEAN / INSTANCE_SWAP properties on master components. Instance text overrides now actually re-measure auto-layout (button grows to fit longer label). |\n| **Multi-instance** | Multiple Figma tabs connect simultaneously via sessions. |\n\nFull version history: see [CHANGELOG.md](CHANGELOG.md).\n\n---\n\n## Quick Start\n\n### Step 1 — Add the MCP server to your AI client\n\nChoose your platform:\n\n<details>\n<summary><strong>Claude Code (CLI)</strong></summary>\n\n```bash\n# Project scope (default)\nclaude mcp add figma-ui-mcp -- npx figma-ui-mcp\n\n# Global scope (all projects)\nclaude mcp add --scope user figma-ui-mcp -- npx figma-ui-mcp\n```\n</details>\n\n<details>\n<summary><strong>Claude Desktop</strong></summary>\n\nEdit config file:\n- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- **Windows**: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"figma\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"figma-ui-mcp\"]\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary><strong>Cursor</strong></summary>\n\nEdit `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):\n\n```json\n{\n  \"mcpServers\": {\n    \"figma\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"figma-ui-mcp\"]\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary><strong>VS Code / GitHub Copilot</strong></summary>\n\nEdit `.vscode/mcp.json` (project) or add to `settings.json` (global):\n\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"figma\": {\n        \"command\": \"npx\",\n        \"args\": [\"-y\", \"figma-ui-mcp\"]\n      }\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary><strong>Windsurf</strong></summary>\n\nEdit `~/.codeium/windsurf/mcp_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"figma\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"figma-ui-mcp\"]\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary><strong>Antigravity (Google)</strong></summary>\n\n1. Open **\"...\" dropdown** at the top of the agent panel\n2. Click **\"Manage MCP Servers\"** → **\"View raw config\"**\n3. Add to `mcp_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"figma\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"figma-ui-mcp\"]\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary><strong>From source (any client)</strong></summary>\n\n```bash\ngit clone https://github.com/TranHoaiHung/figma-ui-mcp\ncd figma-ui-mcp\nnpm install\n# Then point your MCP client to: node /path/to/figma-ui-mcp/server/index.js\n```\n</details>\n\n> **⚠️ IMPORTANT: After adding the MCP server, you MUST restart your IDE / AI client (quit and reopen).** The MCP server only loads on startup — simply saving the config file is not enough. This applies to Claude Code, Cursor, VS Code, Windsurf, and Antigravity.\n\n### Step 2 — Install the Figma plugin\n\n**[⬇ Download plugin.zip](https://github.com/TranHoaiHung/figma-ui-mcp/raw/main/plugin.zip)** — no git clone needed\n\n1. Download and **unzip** `plugin.zip` anywhere on your machine\n2. Open **Figma Desktop** (required — web app cannot access localhost)\n3. Go to **Plugins → Development → Import plugin from manifest...**\n4. Select `manifest.json` from the unzipped folder\n5. Run **Plugins → Development → Figma UI MCP Bridge**\n\nThe plugin UI shows a **green dot** when the MCP server is connected.\n\n### Updating to a newer version\n\n```bash\n# Step 1 — get the new version + plugin path\nnpx figma-ui-mcp@latest --version\n# figma-ui","default_branch":"main","files":66,"tree":[".github/workflows/release.yml",".gitignore",".npmignore","CHANGELOG.md","LICENSE","README.md","assets/cover.png","assets/logo-icon.png","assets/logo-v6.png","assets/logo.png","assets/plugin-icon-128.png","glama.json","package.json","plugin.zip","plugin/code.js","plugin/icon16.png","plugin/icon32.png","plugin/manifest.json","plugin/ui.html","scripts/build-plugin.js","scripts/test-bind-component-property.mjs","scripts/test-bug0910.mjs","scripts/test-component-properties.mjs","scripts/test-dynamic-page.mjs","scripts/test-fixes.mjs","scripts/test-full.mjs","scripts/test-icons-v255.mjs","scripts/test-layout-sizing-axes.mjs","scripts/test-multi-session.mjs","scripts/test-tokens.mjs","scripts/test-v2510.mjs","scripts/test-v2511.mjs","scripts/test-v2514-read.mjs","scripts/test-v2514.mjs","scripts/test-v2515.mjs","scripts/test-v2516-reproduce.mjs","scripts/test-v2517.mjs","scripts/test-v2519.mjs","scripts/test-v252.mjs","scripts/test-v2521.mjs","scripts/test-v2526-feedback.mjs","scripts/test-v254.mjs","scripts/test-v256.mjs","scripts/test-v257.mjs","scripts/test-v258.mjs","scripts/test-v259.mjs","scripts/test-variant-handlers.mjs","server.json","server/api-docs.js","server/bridge-server.js","server/cli.js","server/code-executor.js","server/index.js","server/tool-definitions.js","smithery.yaml","src/plugin/handlers-library.js","src/plugin/handlers-read-detail.js","src/plugin/handlers-read.js","src/plugin/handlers-tokens.js","src/plugin/handlers-write-ops.js","src/plugin/handlers-write.js","src/plugin/main.js","src/plugin/paint-and-effects.js","src/plugin/read-helpers.js","src/plugin/svg-path-helpers.js","src/plugin/utils.js"],"storefront":"/r/TranHoaiHung","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/TranHoaiHung/figma-ui-mcp/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}