@muloka/figma-console-mcp 0.5.7 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +111 -848
  2. package/dist/apps/design-system-dashboard/mcp-app.html +107 -94
  3. package/dist/apps/design-system-dashboard/server.d.ts +1 -1
  4. package/dist/apps/design-system-dashboard/server.d.ts.map +1 -1
  5. package/dist/apps/token-browser/mcp-app.html +95 -82
  6. package/dist/apps/token-browser/server.d.ts +1 -1
  7. package/dist/apps/token-browser/server.d.ts.map +1 -1
  8. package/dist/core/accessibility-tools.d.ts +1 -1
  9. package/dist/core/accessibility-tools.d.ts.map +1 -1
  10. package/dist/core/accessibility-tools.js +18 -15
  11. package/dist/core/accessibility-tools.js.map +1 -1
  12. package/dist/core/annotation-tools.d.ts +1 -1
  13. package/dist/core/annotation-tools.d.ts.map +1 -1
  14. package/dist/core/annotation-tools.js +35 -26
  15. package/dist/core/annotation-tools.js.map +1 -1
  16. package/dist/core/comment-tools.d.ts +2 -2
  17. package/dist/core/comment-tools.d.ts.map +1 -1
  18. package/dist/core/comment-tools.js +60 -51
  19. package/dist/core/comment-tools.js.map +1 -1
  20. package/dist/core/config.d.ts.map +1 -1
  21. package/dist/core/config.js +2 -17
  22. package/dist/core/config.js.map +1 -1
  23. package/dist/core/console-monitor.d.ts +1 -1
  24. package/dist/core/console-monitor.d.ts.map +1 -1
  25. package/dist/core/console-monitor.js +2 -2
  26. package/dist/core/console-monitor.js.map +1 -1
  27. package/dist/core/deep-component-tools.d.ts +1 -1
  28. package/dist/core/deep-component-tools.d.ts.map +1 -1
  29. package/dist/core/deep-component-tools.js +15 -9
  30. package/dist/core/deep-component-tools.js.map +1 -1
  31. package/dist/core/design-code-tools.d.ts +1 -1
  32. package/dist/core/design-code-tools.d.ts.map +1 -1
  33. package/dist/core/design-code-tools.js +51 -45
  34. package/dist/core/design-code-tools.js.map +1 -1
  35. package/dist/core/design-system-tools.d.ts +1 -1
  36. package/dist/core/design-system-tools.d.ts.map +1 -1
  37. package/dist/core/design-system-tools.js +39 -36
  38. package/dist/core/design-system-tools.js.map +1 -1
  39. package/dist/core/diagnose-tool.d.ts +4 -4
  40. package/dist/core/diagnose-tool.d.ts.map +1 -1
  41. package/dist/core/diagnose-tool.js +12 -14
  42. package/dist/core/diagnose-tool.js.map +1 -1
  43. package/dist/core/figjam-tools.d.ts +2 -2
  44. package/dist/core/figjam-tools.d.ts.map +1 -1
  45. package/dist/core/figjam-tools.js +159 -129
  46. package/dist/core/figjam-tools.js.map +1 -1
  47. package/dist/core/figma-tools.d.ts +1 -1
  48. package/dist/core/figma-tools.d.ts.map +1 -1
  49. package/dist/core/figma-tools.js +280 -253
  50. package/dist/core/figma-tools.js.map +1 -1
  51. package/dist/core/identity.d.ts +49 -9
  52. package/dist/core/identity.d.ts.map +1 -1
  53. package/dist/core/identity.js +137 -28
  54. package/dist/core/identity.js.map +1 -1
  55. package/dist/core/library-tools.d.ts +1 -1
  56. package/dist/core/library-tools.d.ts.map +1 -1
  57. package/dist/core/library-tools.js +45 -36
  58. package/dist/core/library-tools.js.map +1 -1
  59. package/dist/core/logger.d.ts +0 -1
  60. package/dist/core/logger.d.ts.map +1 -1
  61. package/dist/core/logger.js +1 -13
  62. package/dist/core/logger.js.map +1 -1
  63. package/dist/core/slides-tools.d.ts +2 -2
  64. package/dist/core/slides-tools.d.ts.map +1 -1
  65. package/dist/core/slides-tools.js +223 -172
  66. package/dist/core/slides-tools.js.map +1 -1
  67. package/dist/core/slot-tools.d.ts +1 -1
  68. package/dist/core/slot-tools.d.ts.map +1 -1
  69. package/dist/core/slot-tools.js +101 -86
  70. package/dist/core/slot-tools.js.map +1 -1
  71. package/dist/core/tokens/config.d.ts +88 -266
  72. package/dist/core/tokens/config.d.ts.map +1 -1
  73. package/dist/core/tokens/config.js +2 -3
  74. package/dist/core/tokens/config.js.map +1 -1
  75. package/dist/core/tokens/schemas.d.ts +104 -113
  76. package/dist/core/tokens/schemas.d.ts.map +1 -1
  77. package/dist/core/tokens/schemas.js +2 -2
  78. package/dist/core/tokens/schemas.js.map +1 -1
  79. package/dist/core/tokens-tools.d.ts +5 -3
  80. package/dist/core/tokens-tools.d.ts.map +1 -1
  81. package/dist/core/tokens-tools.js +9 -2
  82. package/dist/core/tokens-tools.js.map +1 -1
  83. package/dist/core/types/index.d.ts +1 -1
  84. package/dist/core/types/index.d.ts.map +1 -1
  85. package/dist/core/variable-resolver.d.ts +3 -3
  86. package/dist/core/variable-resolver.js +5 -5
  87. package/dist/core/variable-resolver.js.map +1 -1
  88. package/dist/core/version-tools.d.ts +4 -4
  89. package/dist/core/version-tools.d.ts.map +1 -1
  90. package/dist/core/version-tools.js +162 -144
  91. package/dist/core/version-tools.js.map +1 -1
  92. package/dist/core/websocket-connector.d.ts +2 -3
  93. package/dist/core/websocket-connector.d.ts.map +1 -1
  94. package/dist/core/websocket-connector.js +2 -3
  95. package/dist/core/websocket-connector.js.map +1 -1
  96. package/dist/core/write-tools.d.ts +2 -2
  97. package/dist/core/write-tools.d.ts.map +1 -1
  98. package/dist/core/write-tools.js +564 -471
  99. package/dist/core/write-tools.js.map +1 -1
  100. package/dist/local.d.ts +8 -1
  101. package/dist/local.d.ts.map +1 -1
  102. package/dist/local.js +341 -199
  103. package/dist/local.js.map +1 -1
  104. package/package.json +10 -18
package/README.md CHANGED
@@ -6,926 +6,189 @@
6
6
  [![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io/)
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
8
 
9
- **Install:** `npx @muloka/figma-console-mcp` — the `npx figma-console-mcp` commands in the upstream documentation below install *upstream* instead. Versioned independently on a `0.x` line.
9
+ An MCP server that connects AI agents to **Figma Desktop**: read and write variables and design tokens, components and their properties, nodes, styles, comments, annotations, FigJam boards and Slides decks; diff file versions; audit design-code parity and accessibility; and run Plugin API code — 112 tools in all.
10
10
 
11
- ## What this fork changes
12
-
13
- - **Honest error reporting** — the eight single-op variable/collection/mode write tools check the bridge's result envelope, so a plugin-side failure surfaces its real error text instead of a false success or a masking TypeError; batch-create failure rows identify variables that were created before the throw (`created`/`id`/`valueSet: false`)
14
- - **Mode-limit safety** — `figma_setup_design_tokens` and `figma_create_variable_collection` roll the collection back on a mode-limit failure instead of orphaning it, and the setup tool returns your file's real ceiling as `planModeLimit`; the schema's stale 4-mode cap is now a 40 sanity bound (current Figma plans allow 10/20/unlimited — the runtime limit governs)
15
- - **No orphaned nodes on failure** — `figma_create_connector` validates endpoints before creating (a stale nodeId can no longer strand an endpoint-less connector), and create-child / add-text-to-slide / create-table remove their partially-created node on error; batch stickies report the id of any sticky a failed row left behind. `figma_create_child` also gains the POLYGON/STAR/VECTOR types the plugin always supported
16
- - **Per-command dispatch budgets** — long-running bridge commands (variable refresh and component scans at 300s, lint/audit at 120s, large component sets) no longer get silently cut off at 30s: the server's real timeout rides in each WS frame and the dispatcher honors it, on both local and cloud transports ([upstream #94](https://github.com/southleft/figma-console-mcp/issues/94) lineage)
17
- - **Streamable HTTP transport** in local mode — set `MCP_HTTP_PORT` to serve MCP at `http://localhost:<port>/mcp` and connect multiple local clients to one running instance ([upstream #48](https://github.com/southleft/figma-console-mcp/issues/48)). Loopback only: it binds `127.0.0.1`, and every request must match an exact loopback `Host` (`localhost:<port>`, `127.0.0.1:<port>`, or `[::1]:<port>`) and carry either no `Origin` (non-browser clients) or an `http:`/`https:` loopback one, so web pages can't reach it through DNS rebinding — anything else gets a 403. Per-request HTTP servers wrap tools for `_mcp` identity tagging and close cleanly on response close. The HTTP port is published as `mcpHttpPort` in the instance's port-discovery file, and stays there if the file is deleted and the heartbeat re-creates it. (Upstream added its own, separate HTTP endpoint in v1.44.0 under `FIGMA_MCP_HTTP_PORT`, advertised as `mcpHttpUrl`; this fork's `MCP_HTTP_PORT` / `mcpHttpPort` are unchanged.)
18
- - **Per-call file targeting** — all 31 write tools (`figma_execute`, variable/collection/mode tools, node manipulation, component creation/instantiation, and design lint/audit tools) take an optional `fileKey`. With it, the call runs only in that file, whatever the active file or target lock, so several clients can work in different files at once without the active file shifting underneath them. If that file isn't connected the call is refused, naming the file and listing the connected ones, rather than landing in the active file. Without it, nothing changes. `figma_execute` results carry `fileContext` — `{ fileName, fileKey }` of the file the code actually ran in — and `resultAnalysis`, so a caller can verify the targeting from the response. Both arrive on success once the Desktop Bridge plugin has been re-imported from v0.5.4 or later (and `fileContext` arrives on syntax/runtime failures too after re-importing from the updated plugin); an earlier plugin drops them, so a missing `fileContext` means the targeting is unverified. Local mode only; the cloud relay refuses a `fileKey` ([details](docs/tools.md#targeting-a-file-filekey))
19
- - **Security ahead of the v1.36.0 base** — MCP SDK 1.32 (fixes, among others, a single oversized HTTP request exhausting server memory); `figma_scan_code_accessibility` never executes `<script>` tags or inline handlers from the HTML it scans (they previously ran inside the server's Node process); `ui.html` activity-log HTML escapes quotes
20
- - **`VariableID:` alias support & hex validation** in `figma_batch_create_variables`, `figma_batch_update_variables`, and `figma_setup_design_tokens` ([upstream #52](https://github.com/southleft/figma-console-mcp/issues/52)); invalid color strings throw instead of writing `NaN` channels, and `#RGB`/`#RGBA`/`#RRGGBB`/`#RRGGBBAA` are all supported
21
- - **Daemon & bridge reliability** — ESM-safe startup orphan cleanup with 3-way PID verification (never kills or removes files for unrelated/inconclusive PIDs) and multi-candidate eviction; guarded WebSocket heartbeat pings; post-write variable cache invalidation; synchronous-throw handling and socket-identity tracking (with 10s connect timeout) in the Desktop Bridge UI; failure-path `data` forwarding so `CREATE_STICKIES` partial-failure orphan IDs reach callers
22
- - **`page`/`pageSize` honored in `figma_get_variables` `format: "full"`** ([upstream #98](https://github.com/southleft/figma-console-mcp/issues/98))
23
- - **Plugin + server build versions surfaced** in the Desktop Bridge UI and diagnostics
24
- - **CI + plugin-asset guards** — Node 22/24 test matrix, a per-file typecheck ratchet, and regression tests that parse the plugin files and run Figma's own import-expression scanner against `code.js` so a comment can never again brick the plugin loader
25
-
26
- ## Relationship to upstream
27
-
28
- - Frozen at the upstream **v1.36.0** base — this fork does **not** track upstream releases.
29
- - Upstream fixes are cherry-picked selectively when they matter to this fork's use cases, with original authorship preserved (so far: the v1.38.2 orphan-reaper fix, the v1.39.1 plugin-update-banner direction fix, the v1.39.0 relay fix that lets `figma_execute`'s `fileContext`/`resultAnalysis` reach the server, and the Local Mode part of the v1.41.0 accessibility-scan script-isolation fix).
30
- - Bugs and requests for this fork go to [this repo's issue tracker](https://github.com/muloka/figma-console-mcp/issues) — do not file them upstream.
31
- - The hosted `*.southleft.com` endpoints referenced in the documentation below are upstream's service, not this fork's.
32
- - **Plugin re-imports never announce themselves in this fork.** `PLUGIN_VERSION` tracks the vendored upstream lineage (not the fork's `0.x`), so Figma's "update available" banner only ever fires after an upstream sync — never for fork-side plugin changes. When a fork release says `figma-desktop-bridge/` changed (e.g. v0.5.0's orphan cleanup and dispatch budgets, v0.5.4's `fileContext` relay), re-import the manifest manually; the upstream re-import guidance further down doesn't account for this.
33
- - Upstream's docs site and sponsorship: [![Documentation](https://img.shields.io/badge/docs-docs.figma--console--mcp.southleft.com-0D9488)](https://docs.figma-console-mcp.southleft.com) [![Sponsor](https://img.shields.io/badge/Sponsor-southleft-ea4aaa?logo=github-sponsors&logoColor=white)](https://github.com/sponsors/southleft)
34
-
35
- ---
11
+ It runs on your machine (**Local Mode**) and talks to Figma through the bundled **Desktop Bridge** plugin. Upstream's Cloud Mode (Cloudflare Workers, remote SSE, OAuth) is not part of this fork — see [Relationship to upstream](#relationship-to-upstream).
36
12
 
37
- # Figma Console MCP Server
38
-
39
- *Upstream documentation as of the v1.36.0 base — applies as written.*
40
-
41
- > **Your design system as an API.** Model Context Protocol server that bridges design and development—giving AI assistants complete access to Figma for **extraction**, **creation**, **debugging**, and **bidirectional token sync**.
42
-
43
- > **🆕 Target Lock for Parallel Work (v1.36.0):** `figma_navigate` now takes a `lock: true` flag that pins the active file — so an AI agent can keep working in one Figma file while you work in another, without commands silently routing to the wrong file. New connections, reconnects, and your own selection/page changes in other files no longer move the target; the pin auto-releases if that file disconnects. `figma_list_open_files` reports a `targetLocked` flag for a pre-write guard. Server-only release — **no plugin re-import needed**. [See what's new →](CHANGELOG.md#1360---2026-07-16)
44
-
45
- ## What is this?
46
-
47
- Figma Console MCP connects AI assistants (like Claude) to Figma, enabling:
48
-
49
- - **🎨 Design system extraction** - Pull variables, components, and styles
50
- - **🔁 Bidirectional token sync** - Export Figma variables to DTCG JSON (legacy or 2025.10 dialect) + 9 more formats; push code-side edits back to Figma with full apply — creates, renames, alias re-targeting, and replace-gated deletes. Replaces Style Dictionary and Tokens Studio's export pipeline.
51
- - **📸 Visual debugging** - Take screenshots for context
52
- - **✏️ Design creation** - Create UI components, frames, and layouts directly in Figma — including one-call component-set creation from a variant axes matrix
53
- - **🔧 Variable management** - Create, update, rename, and delete design tokens
54
- - **🕰 Version history & time-series awareness** - List versions, diff snapshots, generate markdown changelogs, trace property/variant introduction via binary-search blame
55
- - **⚡ Real-time monitoring** - Watch console logs from the Desktop Bridge plugin
56
- - **📌 FigJam boards** - Create stickies, flowcharts, tables, and code blocks on collaborative boards
57
- - **🎞️ Slides presentations** - Build and manage Figma Slides decks programmatically
58
- - **♿ Accessibility scanning** - 14 WCAG design checks with conformance level tagging, component scorecards, axe-core code scanning, design-to-code parity
59
- - **🛡 Cross-MCP identity** - Every tool response carries `_mcp: "figma-console-mcp"` and errors are prefixed `[figma-console-mcp]` so attribution stays unambiguous in agents running multiple Figma MCPs
60
- - **☁️ Cloud Write Relay** - Web AI clients (Claude.ai, v0, Replit) can design in Figma via cloud pairing
61
- - **🔄 Four ways to connect** - Remote SSE, Cloud Mode, NPX, or Local Git
13
+ **Install with `npx @muloka/figma-console-mcp`.** `npx figma-console-mcp` installs *upstream* instead. This fork is versioned independently on a `0.x` line.
62
14
 
63
15
  ---
64
16
 
65
- ## ⚡ Quick Start
17
+ ## Setup
66
18
 
67
- ### Choose Your Setup
19
+ You need **Node.js 22+**, **Figma Desktop** (not just the web app), and an MCP client (Claude Code, Claude Desktop, Cursor, Windsurf, …).
68
20
 
69
- **First, decide what you want to do:**
21
+ ### 1. Create a Figma personal access token
70
22
 
71
- | I want to... | Setup Method | Time |
72
- |--------------|--------------|------|
73
- | **Create and modify designs with AI** | [NPX Setup](#-npx-setup-recommended) (Recommended) | ~10 min |
74
- | **Design from the web** (Claude.ai, v0, Replit, Lovable) | [Cloud Mode](#-cloud-mode-web-ai-clients) | ~5 min |
75
- | **Contribute to the project** | [Local Git Setup](#for-contributors-local-git-mode) | ~15 min |
76
- | **Just explore my design data** (read-only) | [Remote SSE](#-remote-sse-read-only-exploration) | ~2 min |
23
+ In Figma, [create a personal access token](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) with these scopes: **File content** (read), **File versions** (read), **Variables** (read; Enterprise plans only, so skip it on other plans: the server reads variables through the Desktop Bridge on every plan), **Comments** (read and write). Copy it — it starts with `figd_`.
77
24
 
78
- ### ⚠️ Important: Capability Differences
25
+ ### 2. Add the server to your MCP client
79
26
 
80
- | Capability | NPX / Local Git | Cloud Mode | Remote SSE |
81
- |------------|-----------------|------------|------------|
82
- | Read design data | ✅ | ✅ | ✅ |
83
- | **Create components & frames** | ✅ | ✅ | ❌ |
84
- | **Edit existing designs** | ✅ | ✅ | ❌ |
85
- | **Manage design tokens/variables** | ✅ | ✅ | ❌ |
86
- | **FigJam boards (stickies, flowcharts)** | ✅ | ✅ | ❌ |
87
- | Real-time monitoring (console, selection) | ✅ | ❌ | ❌ |
88
- | Desktop Bridge plugin | ✅ | ✅ | ❌ |
89
- | Requires Node.js | Yes | **No** | No |
90
- | **Total tools available** | **112** | **101** | **9** |
27
+ **Claude Code:**
91
28
 
92
- > **Bottom line:** Remote SSE is **read-only** with 9 tools. **Cloud Mode** unlocks write access (101 tools) from web AI clients without Node.js. NPX/Local Git gives the full 112 tools with real-time monitoring.
93
-
94
- ---
95
-
96
- ### 🚀 NPX Setup (Recommended)
97
-
98
- **Best for:** Designers who want full AI-assisted design capabilities.
99
-
100
- **What you get:** All 112 tools including design creation, variable management, and component instantiation.
101
-
102
- #### Prerequisites
103
-
104
- - [ ] **Node.js 18+** — Check with `node --version` ([Download](https://nodejs.org))
105
- - [ ] **Figma Desktop** installed (not just the web app)
106
- - [ ] **An MCP client** (Claude Code, Cursor, Windsurf, Claude Desktop, etc.)
107
-
108
- #### Step 1: Get Your Figma Token
109
-
110
- 1. Go to [Manage personal access tokens](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) in Figma Help
111
- 2. Follow the steps to **create a new personal access token**
112
- 3. Enter description: `Figma Console MCP`
113
- 4. Set scopes: **File content** (Read), **File versions** (Read), **Variables** (Read), **Comments** (Read and write)
114
- 5. **Copy the token** — you won't see it again! (starts with `figd_`)
115
-
116
- #### Step 2: Configure Your MCP Client
117
-
118
- **Claude Code (CLI):**
119
29
  ```bash
120
- claude mcp add figma-console -s user -e FIGMA_ACCESS_TOKEN=figd_YOUR_TOKEN_HERE -e ENABLE_MCP_APPS=true -- npx -y figma-console-mcp@latest
30
+ claude mcp add figma-console -s user -e FIGMA_ACCESS_TOKEN=figd_YOUR_TOKEN -- npx -y @muloka/figma-console-mcp@latest
121
31
  ```
122
32
 
123
- **Cursor / Windsurf / Claude Desktop:**
124
-
125
- Add to your MCP config file (see [Where to find your config file](#-where-to-find-your-config-file) below):
33
+ **Claude Desktop, Cursor, Windsurf** (JSON config):
126
34
 
127
35
  ```json
128
36
  {
129
37
  "mcpServers": {
130
38
  "figma-console": {
131
39
  "command": "npx",
132
- "args": ["-y", "figma-console-mcp@latest"],
133
- "env": {
134
- "FIGMA_ACCESS_TOKEN": "figd_YOUR_TOKEN_HERE",
135
- "ENABLE_MCP_APPS": "true"
136
- }
40
+ "args": ["-y", "@muloka/figma-console-mcp@latest"],
41
+ "env": { "FIGMA_ACCESS_TOKEN": "figd_YOUR_TOKEN" }
137
42
  }
138
43
  }
139
44
  }
140
45
  ```
141
46
 
142
- #### 📂 Where to Find Your Config File
143
-
144
- If you're not sure where to put the JSON configuration above, here's where each app stores its MCP config:
145
-
146
47
  | App | macOS | Windows |
147
48
  |-----|-------|---------|
148
- | **Claude Desktop** | `~/Library/Application Support/Claude/claude_desktop_config.json` | `%APPDATA%\Claude\claude_desktop_config.json` |
149
- | **Claude Code (CLI)** | `~/.claude.json` | `%USERPROFILE%\.claude.json` |
150
- | **Cursor** | `~/.cursor/mcp.json` | `%USERPROFILE%\.cursor\mcp.json` |
151
- | **Windsurf** | `~/.codeium/windsurf/mcp_config.json` | `%USERPROFILE%\.codeium\windsurf\mcp_config.json` |
152
-
153
- > **Tip for designers:** The `~` symbol means your **home folder**. On macOS, that's `/Users/YourName/`. On Windows, it's `C:\Users\YourName\`. You can open these files in any text editor — even TextEdit or Notepad.
154
- >
155
- > **Can't find the file?** If it doesn't exist yet, create it. The app will pick it up on its next restart. Make sure the entire file is valid JSON (watch for missing commas or brackets).
156
- >
157
- > **Claude Code users:** You can skip manual editing entirely. Just run the `claude mcp add` command above and it handles everything for you.
158
-
159
- #### Step 3: Connect to Figma Desktop
160
-
161
- **Desktop Bridge Plugin:**
162
- 1. Open Figma Desktop normally (no special flags needed) and open a file
163
- 2. Go to **Plugins → Development → Import plugin from manifest...**
164
- 3. Select `~/.figma-console-mcp/plugin/manifest.json` (stable path, auto-created by the MCP server)
165
- 4. Run the plugin in your Figma file — it scans ports 9223–9232 and connects automatically to your running MCP server
49
+ | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | `%APPDATA%\Claude\claude_desktop_config.json` |
50
+ | Cursor | `~/.cursor/mcp.json` | `%USERPROFILE%\.cursor\mcp.json` |
51
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` | `%USERPROFILE%\.codeium\windsurf\mcp_config.json` |
166
52
 
167
- > **Heads-up on plugin updates.** Figma caches plugin files (`code.js` and `ui.html`) at the application level. The MCP server refreshes the files at `~/.figma-console-mcp/plugin/` on every startup, but Figma keeps using its cached copy until you re-import the manifest.
168
- >
169
- > **Re-importing is _required_ only when a release notes entry says so** — typically when the plugin adds a new method the server needs (e.g. v1.22.4, v1.10.0). For most upgrades the new server stays wire-compatible with the previous plugin, and re-importing is **optional**: you'll still get every functional change, just not the cosmetic plugin-side touches (status-pill copy, `pluginVersion` reporting).
170
- >
171
- > When you do re-import: Plugins → Manage plugins → re-import `~/.figma-console-mcp/plugin/manifest.json`. The stable path never changes, so it's a one-click step.
53
+ Restart the client afterwards.
172
54
 
173
- #### Step 4: Restart Your MCP Client
55
+ ### 3. Import the Desktop Bridge plugin
174
56
 
175
- Restart your MCP client to load the new configuration.
176
-
177
- #### Step 5: Test It!
178
-
179
- ```
180
- Check Figma status
181
- ```
182
- → Should show connection status with active WebSocket transport
183
-
184
- ```
185
- Create a simple frame with a blue background
186
- ```
187
- → Should create a frame in Figma (confirms write access!)
188
-
189
- **📖 [Complete Setup Guide](docs/setup.md)**
190
-
191
- ---
192
-
193
- ### For Contributors: Local Git Mode
194
-
195
- **Best for:** Developers who want to modify source code or contribute to the project.
196
-
197
- **What you get:** Same 112 tools as NPX, plus full source code access.
198
-
199
- #### Quick Setup
57
+ The server keeps the plugin at a stable path, `~/.figma-console-mcp/plugin/manifest.json`, and refreshes it on every start. To print the exact path:
200
58
 
201
59
  ```bash
202
- # Clone and build
203
- git clone https://github.com/southleft/figma-console-mcp.git
204
- cd figma-console-mcp
205
- npm install
206
- npm run build:local
60
+ npx @muloka/figma-console-mcp --print-path
207
61
  ```
208
62
 
209
- #### Configure Your MCP Client
63
+ In Figma Desktop, open a file, then **Plugins → Development → Import plugin from manifest…** and pick that `manifest.json`. On macOS the folder is hidden, so the file dialog won't show it: press **Cmd+Shift+G** in the dialog and paste the path.
210
64
 
211
- Add to your config file (see [Where to find your config file](#-where-to-find-your-config-file)):
65
+ Run the plugin in each file you want the agent to work in. It scans ports 9223–9232 and connects to your running server on its own. Ask your agent to *"check Figma status"* (`figma_get_status`) to confirm the connection.
212
66
 
213
- ```json
214
- {
215
- "mcpServers": {
216
- "figma-console": {
217
- "command": "node",
218
- "args": ["/absolute/path/to/figma-console-mcp/dist/local.js"],
219
- "env": {
220
- "FIGMA_ACCESS_TOKEN": "figd_YOUR_TOKEN_HERE",
221
- "ENABLE_MCP_APPS": "true"
222
- }
223
- }
224
- }
225
- }
226
- ```
67
+ ### When to re-import the plugin
227
68
 
228
- Then follow [NPX Steps 3-5](#step-3-connect-to-figma-desktop) above.
69
+ Figma caches plugin files (`code.js`, `ui.html`) and keeps using its cached copy until you re-import the manifest, even though the server refreshes the files on disk.
229
70
 
230
- **📖 [Complete Setup Guide](docs/setup.md)**
71
+ - **Re-import when a release says `figma-desktop-bridge/` changed.** Otherwise the new server stays compatible with the plugin you have.
72
+ - **Figma's "update available" banner never fires for this fork's plugin changes.** The plugin's `PLUGIN_VERSION` tracks the upstream lineage it was vendored from (currently 1.35.0), not this fork's `0.x`, so re-imports never announce themselves. Watch the release notes instead.
73
+ - To re-import: **Plugins → Manage plugins**, then import the same `manifest.json` again.
231
74
 
232
75
  ---
233
76
 
234
- ### 📡 Remote SSE (Read-Only Exploration)
235
-
236
- **Best for:** Quickly evaluating the tool or read-only design data extraction.
237
-
238
- **What you get:** 9 read-only tools — view data, take screenshots, read logs, design-code parity. **Cannot create or modify designs.**
77
+ ## Configuration
239
78
 
240
- #### Claude Desktop (UI Method)
79
+ | Variable | Default | What it does |
80
+ |---|---|---|
81
+ | `FIGMA_ACCESS_TOKEN` | — | Personal access token for Figma REST calls (file data, versions, comments, images). |
82
+ | `MCP_HTTP_PORT` | off | Also serve MCP over Streamable HTTP at `http://localhost:<port>/mcp` — see below. |
83
+ | `FIGMA_WS_PORT` | `9223` | Preferred Desktop Bridge WebSocket port. If it's taken (another instance), the server tries the next ports in a 10-port range. |
84
+ | `FIGMA_WS_HOST` | `localhost` | Interface the WebSocket server binds. |
85
+ | `ENABLE_MCP_APPS` | off | `true` registers the two [MCP Apps](#mcp-apps-optional). |
86
+ | `LOG_LEVEL` | `info` | Server log level (logs go to stderr). |
241
87
 
242
- 1. Open Claude Desktop → **Settings** → **Connectors**
243
- 2. Click **"Add Custom Connector"**
244
- 3. Enter:
245
- - **Name:** `Figma Console (Read-Only)`
246
- - **URL:** `https://figma-console-mcp.southleft.com/sse`
247
- 4. Click **"Add"** — Done! ✅
88
+ ### Sharing one server between clients (`MCP_HTTP_PORT`)
248
89
 
249
- OAuth authentication happens automatically when you first use design system tools.
250
-
251
- #### Claude Code
252
-
253
- > **⚠️ Known Issue:** Claude Code's native `--transport sse` has a [bug](https://github.com/anthropics/claude-code/issues/2466). Use `mcp-remote` instead:
90
+ stdio only serves the client that started the server. Set `MCP_HTTP_PORT` and the same process also serves MCP over Streamable HTTP, so several local clients can share one Desktop Bridge connection. Start the server with the variable set, either from a terminal or by adding `MCP_HTTP_PORT` to the `env` of the client that launches it:
254
91
 
255
92
  ```bash
256
- claude mcp add figma-console -s user -- npx -y mcp-remote@latest https://figma-console-mcp.southleft.com/sse
257
- ```
258
-
259
- **💡 Tip:** For full capabilities, use [NPX Setup](#-npx-setup-recommended) instead of Remote SSE.
260
-
261
- #### Other Clients (Cursor, Windsurf, etc.)
262
-
263
- ```json
264
- {
265
- "mcpServers": {
266
- "figma-console": {
267
- "command": "npx",
268
- "args": ["-y", "mcp-remote", "https://figma-console-mcp.southleft.com/sse"]
269
- }
270
- }
271
- }
272
- ```
273
-
274
- #### Upgrading to Full Capabilities
275
-
276
- Ready for design creation? Follow the [NPX Setup](#-npx-setup-recommended) guide above, or try [Cloud Mode](#-cloud-mode-web-ai-clients) if you don't want to install Node.js.
277
-
278
- **📖 [Complete Setup Guide](docs/setup.md)**
279
-
280
- ---
281
-
282
- ### ☁️ Cloud Mode (Web AI Clients)
283
-
284
- **Best for:** Using Claude.ai, v0, Replit, or Lovable to create and modify Figma designs — no Node.js required.
285
-
286
- **What you get:** 101 tools including full write access — design creation, variable management, component instantiation, and all REST API tools. Only real-time monitoring (console logs, selection tracking, document changes) requires Local Mode.
287
-
288
- #### Prerequisites
289
-
290
- - [ ] **Figma Personal Access Token** — [Create one here](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) (starts with `figd_`)
291
- - [ ] **Figma Desktop** with the Desktop Bridge plugin installed (see [Desktop Bridge setup](#step-3-connect-to-figma-desktop))
292
- - [ ] **A web AI client** that supports MCP (Claude.ai, Lovable, v0, Replit, etc.)
293
-
294
- #### Step 1: Add the MCP Connector
295
-
296
- Add this endpoint to your AI platform's MCP settings:
297
-
298
- **URL:** `https://figma-console-mcp.southleft.com/mcp`
299
- **Auth:** Your Figma PAT as Bearer token
300
-
301
- In **Claude.ai**: Settings → Connectors → Add Custom Connector → paste the URL above.
302
- In **Lovable/v0/Replit**: Look for "Add MCP Server" or "Integrations" in settings → paste the URL and add your token.
303
-
304
- #### Step 2: Pair the Plugin
305
-
306
- 1. **Open the Desktop Bridge plugin** in Figma Desktop (Plugins → Development → Figma Desktop Bridge)
307
- 2. **Tell your AI assistant:**
308
- ```
309
- Connect to my Figma plugin
310
- ```
311
- 3. **The AI gives you a 6-character pairing code** (expires in 5 minutes)
312
- 4. **In the plugin:** Toggle "Cloud Mode" → enter the code → click Connect
313
- 5. **You're paired!** Full write access is now available
314
-
315
- #### What You Can Do
316
-
317
- Once paired, use natural language to design:
318
- ```
319
- Create a card component with a header image, title, description, and action button
320
- Set up a color token collection with Light and Dark modes
321
- Add a "High Contrast" mode to my existing token collection
322
- ```
323
-
324
- #### How It Works
325
-
326
- Your AI client sends write commands through the cloud MCP server, which relays them via WebSocket to the Desktop Bridge plugin running in your Figma Desktop. The plugin executes the commands using the Figma Plugin API and returns results back through the same path.
327
-
93
+ MCP_HTTP_PORT=3333 FIGMA_ACCESS_TOKEN=figd_YOUR_TOKEN npx -y @muloka/figma-console-mcp@latest
328
94
  ```
329
- AI Client → Cloud MCP Server → Durable Object Relay → Desktop Bridge Plugin → Figma
330
- ```
331
-
332
- > **Variables on any plan:** Cloud Mode uses the Plugin API (not the Enterprise REST API), so variable management works on Free, Pro, and Organization plans.
333
-
334
- **📖 [Complete Setup Guide](docs/setup.md)**
335
-
336
- ---
337
-
338
- ## 📊 Installation Method Comparison
339
-
340
- | Feature | NPX (Recommended) | Cloud Mode | Local Git | Remote SSE |
341
- |---------|-------------------|------------|-----------|------------|
342
- | **Setup time** | ~10 minutes | ~5 minutes | ~15 minutes | ~2 minutes |
343
- | **Total tools** | **112** | **101** | **112** | **9** (read-only) |
344
- | **Design creation** | ✅ | ✅ | ✅ | ❌ |
345
- | **Variable management** | ✅ | ✅ | ✅ | ❌ |
346
- | **Component instantiation** | ✅ | ✅ | ✅ | ❌ |
347
- | **FigJam boards** | ✅ | ✅ | ✅ | ❌ |
348
- | **Real-time monitoring** | ✅ | ❌ | ✅ | ❌ |
349
- | **Desktop Bridge plugin** | ✅ | ✅ | ✅ | ❌ |
350
- | **Variables (no Enterprise)** | ✅ | ✅ | ✅ | ❌ |
351
- | **Console logs** | ✅ (zero latency) | ❌ | ✅ (zero latency) | ✅ |
352
- | **Read design data** | ✅ | ✅ | ✅ | ✅ |
353
- | **Requires Node.js** | Yes | **No** | Yes | No |
354
- | **Authentication** | PAT (manual) | OAuth (automatic) | PAT (manual) | OAuth (automatic) |
355
- | **Automatic updates** | ✅ (`@latest`) | ✅ | Manual (`git pull`) | ✅ |
356
- | **Source code access** | ❌ | ❌ | ✅ | ❌ |
357
-
358
- > **Key insight:** Remote SSE is read-only. Cloud Mode adds write access for web AI clients without Node.js. NPX/Local Git give the full 112 tools.
359
-
360
- **📖 [Complete Feature Comparison](docs/mode-comparison.md)**
361
-
362
- ---
363
-
364
- ## 🎯 Test Your Connection
365
-
366
- After setup, try these prompts:
367
-
368
- **Basic test (all modes):**
369
- ```
370
- Navigate to https://www.figma.com and check status
371
- ```
372
-
373
- **Design system test (requires auth):**
374
- ```
375
- Get design variables from [your Figma file URL]
376
- ```
377
-
378
- **Cloud Mode test:**
379
- ```
380
- Connect to my Figma plugin
381
- ```
382
- → Follow the pairing flow, then try: "Create a simple blue rectangle"
383
-
384
- **Plugin test (Local Mode only):**
385
- ```
386
- Show me the primary font for [your theme name]
387
- ```
388
-
389
- ---
390
-
391
- ## 🔐 Authentication
392
-
393
- ### Remote Mode - OAuth (Automatic)
394
-
395
- When you first use design system tools:
396
- 1. Browser opens automatically to Figma authorization page
397
- 2. Click "Allow" to authorize (one-time)
398
- 3. Token stored securely and refreshed automatically
399
- 4. Works with Free, Pro, and Enterprise Figma plans
400
-
401
- ### Local Mode - Personal Access Token (Manual)
402
-
403
- 1. Visit https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens
404
- 2. Generate token with scopes: **File content** (Read), **File versions** (Read), **Variables** (Read), **Comments** (Read and write)
405
- 3. Add to MCP config as `FIGMA_ACCESS_TOKEN` environment variable
406
-
407
- ---
408
95
 
409
- ## 🛠️ Available Tools
410
-
411
- ### Status & Diagnostics
412
- - `figma_get_status` - Check WebSocket bridge connection and file context
413
- - `figma_diagnose` - Designer-readable health check + setup guidance
414
- - `figma_reconnect` - Force reconnect to the Desktop Bridge plugin
415
- - `figma_navigate` - Switch the active file target among connected plugins (Local), or navigate the cloud headless browser (Remote/Cloud)
416
-
417
- ### Console Debugging
418
- - `figma_get_console_logs` - Retrieve console logs
419
- - `figma_watch_console` - Real-time log streaming
420
- - `figma_clear_console` - Clear log buffer
421
- - `figma_reload_plugin` - Reload current page
422
-
423
- ### Visual Debugging
424
- - `figma_take_screenshot` - Capture UI screenshots
425
-
426
- ### Design System Extraction
427
- - `figma_get_design_system_kit` - **Full design system in one call** — tokens, components, styles, visual specs
428
- - `figma_get_variables` - Extract design tokens/variables
429
- - `figma_get_component` - Get component data (metadata or reconstruction spec)
430
- - `figma_get_component_for_development` - Component + image
431
- - `figma_get_component_image` - Just the image
432
- - `figma_get_styles` - Color, text, effect styles
433
- - `figma_get_file_data` - Full file structure
434
- - `figma_get_file_for_plugin` - Optimized file data
435
-
436
- ### 📚 Shared Library Inspection
437
- - `figma_get_library_component_by_key` - **Resolve any component key to full properties + variants + visual specs** — without needing the source library file's URL. Works for both COMPONENT_SET and standalone COMPONENT keys. Adaptive compression at >500KB.
438
- - `figma_get_library_components` - Discover all components in a library file (requires library file URL/key)
439
- - `figma_get_library_variables` - List every variable from team libraries the current file has subscribed. **Works on every Figma plan** — uses the Plugin API path, not the Enterprise-only REST endpoint. Filter by `libraryName`, `collectionName`, or `resolvedType`.
440
- - `figma_import_library_variable` - Import a library variable into the current file. Returns a local `id` ready to pass to `figma_set_fills` / `figma_update_variable` / any variable-binding tool.
441
-
442
- ### ☁️ Cloud Relay
443
- - `figma_pair_plugin` - Generate a pairing code to connect a Desktop Bridge plugin via the cloud relay
444
-
445
- ### ✏️ Design Creation (Local Mode + Cloud Mode)
446
- - `figma_execute` - **Power tool**: Run any Figma Plugin API code to create designs
447
- - Create frames, shapes, text, components
448
- - Apply auto-layout, styles, effects
449
- - Build complete UI mockups programmatically
450
- - `figma_create_component_set` - **Create a component set with variants in one declarative call**
451
- - Generate every variant combination from an axes matrix (e.g. `{ State: ["default", "hover", "disabled"], Size: ["sm", "lg"] }` → 6 variants) off a base component, or combine existing components
452
- - `Prop=Value` variant naming, `combineAsVariants` under the hood, optional auto-arranged labeled grid
453
- - Returns each variant's key, ready for `figma_instantiate_component`
454
- - `figma_arrange_component_set` - **Organize variants into professional component sets**
455
- - Convert multiple component variants into a proper Figma component set
456
- - Applies native purple dashed border visualization automatically
457
- - Creates white container frame with title, row labels, and column headers
458
- - Row labels vertically centered with each grid row
459
- - Column headers horizontally centered with each column
460
- - Use natural language like "arrange these variants" or "organize as component set"
461
- - `figma_set_description` - **Document components with rich descriptions**
462
- - Add descriptions to components, component sets, and styles
463
- - Supports markdown formatting for rich documentation
464
- - Descriptions appear in Dev Mode for developers
465
-
466
- ### 🧩 Figma Slots (Local Mode + Cloud Mode)
467
- - `figma_create_slot` - **Add a slot to a component** via the GA `createSlot()` API — the linked SLOT property is created automatically; works on standalone components and variants inside a component set
468
- - `figma_get_slots` - List slots on a component, component set (aggregated across variants), or instance — ids, names, property keys, dimensions, and current children
469
- - `figma_append_to_slot` - **Populate an instance's slot** by cloning an existing node or creating new content (`setProperties` rejects slot values by design — this is the population path)
470
- - `figma_reset_slot` - Clear a slot's content on an instance
471
- - `figma_add_slot_property` - Retrofit an existing frame as a slot via a manual SLOT property binding, with `description` and `preferredValues`
472
-
473
- ### 🔍 Design-Code Parity (All Modes)
474
- - `figma_check_design_parity` - Compare Figma component specs against code implementation, producing a scored diff report with actionable fix items
475
- - `figma_generate_component_doc` - Generate platform-agnostic markdown documentation by merging Figma design data with code-side info
476
-
477
- ### 🔁 Token Sync (Local Mode + Cloud Mode)
478
- - `figma_export_tokens` - **Export Figma variables to design token files in your codebase.** Canonical DTCG JSON (legacy hex dialect by default, or DTCG 2025.10 object colors/dimensions via `dtcgDialect: "2025"`) plus CSS, Tailwind v4/v3, SCSS, TS, JSON, Style Dictionary, and Tokens Studio formats. Diff-aware merge against existing source files (only writes what changed). `tokens.config.json` autodiscovery means zero-arg calls after first setup. Scopes and codeSyntax metadata round-trip via `$extensions`. Replaces Style Dictionary and Tokens Studio's export pipeline for popular styling methods.
479
- - `figma_import_tokens` - **Push code-side token edits back to Figma with a full apply phase.** Diffs against current Figma state, then applies value updates, **creates** missing collections/variables, applies **renames**, writes real **alias** (`VARIABLE_ALIAS`) references, and — only under `strategy: "replace"` — deletes Figma-only variables. Round-trip safe — Figma variable IDs preserved in DTCG `$extensions["figma-console-mcp"]` so renames on either side don't create duplicates. Accepts both DTCG dialects. Dry-run strategy for safe previews. In Cloud Mode, pass tokens inline via `payload` or `files` (no local filesystem access).
480
-
481
- ### 🔧 Variable Management (Local Mode + Cloud Mode)
482
- - `figma_create_variable_collection` - Create new variable collections with modes
483
- - `figma_create_variable` - Create COLOR, FLOAT, STRING, or BOOLEAN variables
484
- - `figma_update_variable` - Update variable values in specific modes
485
- - `figma_rename_variable` - Rename variables while preserving values
486
- - `figma_delete_variable` - Delete variables
487
- - `figma_delete_variable_collection` - Delete collections and all their variables
488
- - `figma_add_mode` - Add modes to collections (e.g., "Dark", "Mobile")
489
- - `figma_rename_mode` - Rename existing modes
490
- - `figma_batch_create_variables` - Create up to 100 variables in one call (10-50x faster)
491
- - `figma_batch_update_variables` - Update up to 100 variable values in one call
492
- - `figma_setup_design_tokens` - Create complete token system (collection + modes + variables) atomically — values accept DTCG brace references (`"{color.blue.600}"`) that resolve to real variable aliases
493
-
494
- ### 📌 FigJam Board Tools (Local Mode + Cloud Mode)
495
- - `figjam_create_sticky` - Create a sticky note with color options
496
- - `figjam_create_stickies` - Batch create up to 200 stickies
497
- - `figjam_create_connector` - Connect nodes with labeled connector lines
498
- - `figjam_create_shape_with_text` - Create flowchart shapes (diamond, ellipse, etc.)
499
- - `figjam_create_table` - Create tables with cell data
500
- - `figjam_create_code_block` - Add code snippets with syntax highlighting
501
- - `figjam_auto_arrange` - Arrange nodes in grid, horizontal, or vertical layouts
502
- - `figjam_get_board_contents` - Read all content from a FigJam board
503
- - `figjam_get_connections` - Read the connection graph (flowcharts, relationships)
504
-
505
- ### 🎞️ Slides Presentation Tools (Local Mode + Cloud Mode)
506
- - `figma_list_slides` - List all slides with IDs, positions, and skip status
507
- - `figma_get_slide_content` - Get the full content tree of a slide
508
- - `figma_get_slide_grid` - Get the 2D grid layout of the presentation
509
- - `figma_get_slide_transition` - Read transition settings for a slide
510
- - `figma_get_focused_slide` - Get the currently focused slide
511
- - `figma_create_slide` - Create a new blank slide
512
- - `figma_delete_slide` - Delete a slide from the presentation
513
- - `figma_duplicate_slide` - Clone an existing slide
514
- - `figma_reorder_slides` - Reorder slides via new 2D grid layout
515
- - `figma_set_slide_transition` - Set transition effects (22 styles, 8 curves)
516
- - `figma_skip_slide` - Toggle whether a slide is skipped in presentation mode
517
- - `figma_add_text_to_slide` - Add text to a slide with custom fonts, colors, alignment, and wrapping
518
- - `figma_add_shape_to_slide` - Add rectangle or ellipse shapes with color
519
- - `figma_set_slide_background` - Set a slide's background color (creates or updates)
520
- - `figma_get_text_styles` - Get all local text styles with IDs, fonts, and sizes
521
- - `figma_set_slides_view_mode` - Toggle grid vs. single-slide view
522
- - `figma_focus_slide` - Navigate to a specific slide
523
-
524
- **📖 [Detailed Tool Documentation](docs/TOOLS.md)**
96
+ Then point other clients at the URL:
525
97
 
526
- ---
527
-
528
- ## 📖 Example Prompts
529
-
530
- ### Cloud Mode (Web AI Clients)
531
- ```
532
- Connect to my Figma plugin so we can start designing
533
- Pair with my Figma file and create a login form with email, password, and submit button
534
- Set up a brand color token collection with Light and Dark modes
535
- ```
536
-
537
- ### Plugin Debugging
538
- ```
539
- Navigate to my Figma plugin and show me any console errors
540
- Watch the console for 30 seconds while I test my plugin
541
- Get the last 20 console logs
542
- ```
543
-
544
- ### Design System Extraction
545
- ```
546
- Get all design variables from https://figma.com/design/abc123
547
- Extract color styles and show me the CSS exports
548
- Get the Button component with a visual reference image
549
- Get the Badge component in reconstruction format for programmatic creation
550
- ```
551
-
552
- ### Design Creation (Local Mode + Cloud Mode)
553
- ```
554
- Create a success notification card with a checkmark icon and message
555
- Design a button component with hover and disabled states
556
- Build a navigation bar with logo, menu items, and user avatar
557
- Create a modal dialog with header, content area, and action buttons
558
- Arrange these button variants into a component set
559
- Organize my icon variants as a proper component set with the purple border
560
- ```
561
-
562
- ### Variable Management (Local Mode + Cloud Mode)
563
- ```
564
- Create a new color collection called "Brand Colors" with Light and Dark modes
565
- Add a primary color variable with value #3B82F6 for Light and #60A5FA for Dark
566
- Rename the "Default" mode to "Light Theme"
567
- Add a "High Contrast" mode to the existing collection
568
- ```
569
-
570
- ### Design-Code Parity
571
- ```
572
- Compare the Button component in Figma against our React implementation
573
- Check design parity for the Card component before sign-off
574
- Generate component documentation for the Dialog from our design system
575
- ```
576
-
577
- ### FigJam Boards
578
- ```
579
- Create a retrospective board with "Went Well", "To Improve", and "Action Items" columns
580
- Build a user flow diagram for the checkout process with decision points
581
- Read this brainstorming board and summarize the key themes
582
- Generate an affinity map from these meeting notes
583
- Create a comparison table of our three platform options
584
- ```
585
-
586
- ### Slides Presentations
587
- ```
588
- List all slides and tell me which ones are skipped
589
- Add a new slide with the title "Thank You" in 72px text
590
- Set a DISSOLVE transition on the first slide with 0.5 second duration
591
- Duplicate slide 5 for an A/B comparison
592
- Skip slides 8 and 9 — they're not ready for the client presentation
593
- Reorder my slides so the conclusion comes before Q&A
98
+ ```bash
99
+ claude mcp add --transport http figma-console http://localhost:3333/mcp
594
100
  ```
595
101
 
596
- ### Visual Debugging
597
- ```
598
- Take a screenshot of the current Figma canvas
599
- Navigate to this file and capture what's on screen
600
- ```
102
+ - **Both MCP protocol eras on one URL.** 2025-era clients (an `initialize` handshake, then one POST per request; the endpoint is stateless and issues no session id) and 2026-07-28 clients (no `initialize`, a per-request `_meta` envelope) both work at `/mcp`. stdio serves both eras too.
103
+ - **Loopback only.** It binds `127.0.0.1`. Every request must name an exact loopback `Host` (`localhost:<port>`, `127.0.0.1:<port>` or `[::1]:<port>`) and carry either no `Origin` (non-browser clients) or an `http:`/`https:` loopback one, so web pages can't reach it through DNS rebinding. Anything else gets a 403, whichever protocol era the request uses.
104
+ - **Discoverable.** The port is published as `mcpHttpPort` in the instance's port-discovery file and on `GET /`.
105
+ - **Outlives its stdio client.** When the client that spawned the server closes stdin, HTTP keeps serving.
601
106
 
602
- **📖 [More Use Cases & Examples](docs/USE_CASES.md)**
107
+ Upstream later added its own, separate HTTP endpoint under `FIGMA_MCP_HTTP_PORT` (advertised as `mcpHttpUrl`); this fork's `MCP_HTTP_PORT` / `mcpHttpPort` are unchanged.
603
108
 
604
109
  ---
605
110
 
606
- ## 🎨 AI-Assisted Design Creation
607
-
608
- > **Requires Desktop Bridge:** This feature works with Local Mode (NPX or Local Git) and [Cloud Mode](#-cloud-mode-web-ai-clients). Remote SSE without Cloud Mode pairing is read-only and cannot create or modify designs.
609
-
610
- One of the most powerful capabilities of this MCP server is the ability to **design complete UI components and pages directly in Figma through natural language conversation** with any MCP-compatible AI assistant like Claude Desktop or Claude Code.
611
-
612
- ### What's Possible
111
+ ## Working in several files at once
613
112
 
614
- **Create original designs from scratch:**
615
- ```
616
- Design a login card with email and password fields, a "Forgot password?" link,
617
- and a primary Sign In button. Use 32px padding, 16px border radius, and subtle shadow.
618
- ```
619
-
620
- **Leverage existing component libraries:**
621
- ```
622
- Build a dashboard header using the Avatar component for the user profile,
623
- Button components for actions, and Badge components for notifications.
624
- ```
625
-
626
- **Generate complete page layouts:**
627
- ```
628
- Create a settings page with a sidebar navigation, a main content area with form fields,
629
- and a sticky footer with Save and Cancel buttons.
630
- ```
631
-
632
- ### How It Works
633
-
634
- 1. **You describe what you want** in plain English
635
- 2. **The AI searches your component library** using `figma_search_components` to find relevant building blocks
636
- 3. **Components are instantiated** with proper variants and properties via `figma_instantiate_component`
637
- 4. **Custom elements are created** using the full Figma Plugin API via `figma_execute`
638
- 5. **Visual validation** automatically captures screenshots and iterates until the design looks right
639
-
640
- ### Who Benefits
641
-
642
- | Role | Use Case |
643
- |------|----------|
644
- | **Designers** | Rapidly prototype ideas without manual frame-by-frame construction. Explore variations quickly by describing changes. |
645
- | **Developers** | Generate UI mockups during planning discussions. Create visual specs without switching to design tools. |
646
- | **Product Managers** | Sketch out feature concepts during ideation. Communicate visual requirements directly to stakeholders. |
647
- | **Design System Teams** | Test component flexibility by generating compositions. Identify gaps in component coverage. |
648
- | **Agencies** | Speed up initial concept delivery. Iterate on client feedback in real-time during calls. |
649
-
650
- ### Example Workflows
651
-
652
- **Brand New Design:**
653
- > "Create a notification toast with an icon on the left, title and description text, and a dismiss button. Use our brand colors."
654
-
655
- The AI creates custom frames, applies your design tokens, and builds the component from scratch.
656
-
657
- **Component Composition:**
658
- > "Build a user profile card using the Avatar component (large size), two Button components (Edit Profile and Settings), and a Badge for the user's status."
659
-
660
- The AI searches your library, finds the exact components, and assembles them with proper spacing and alignment.
661
-
662
- **Design Iteration:**
663
- > "The spacing feels too tight. Increase the gap between sections to 24px and make the heading larger."
664
-
665
- The AI modifies the existing design, takes a screenshot to verify, and continues iterating until you're satisfied.
666
-
667
- ### Visual Validation
668
-
669
- The AI automatically follows a validation workflow after creating designs:
670
-
671
- 1. **Create** → Execute the design code
672
- 2. **Screenshot** → Capture the result
673
- 3. **Analyze** → Check alignment, spacing, and visual balance
674
- 4. **Iterate** → Fix any issues detected
675
- 5. **Verify** → Final screenshot to confirm
676
-
677
- This ensures designs aren't just technically correct—they *look* right.
113
+ - **`fileKey` on every write tool.** All 31 write tools — `figma_execute`, the variable/collection/mode tools, node manipulation, component creation and instantiation, and the design lint/audit tools — take an optional `fileKey`. With it, the call runs only in that file, whatever file is active, so several agents can work in different files at the same time. If that file isn't connected, the call is refused, naming the file and listing the connected ones, rather than landing in the active file. Without `fileKey`, nothing changes. Details: [`docs/tools.md`](https://github.com/muloka/figma-console-mcp/blob/main/docs/tools.md#targeting-a-file-filekey).
114
+ - **Verifiable targeting.** `figma_execute` results carry `fileContext` (`{ fileName, fileKey }` of the file the code ran in) and `resultAnalysis`. They need the Desktop Bridge plugin re-imported from v0.5.4 or later; a missing `fileContext` means the targeting is unverified.
115
+ - **Target pins.** `figma_navigate` with `lock: true` pins the active file. A pinned file that disconnects keeps its pin, so untargeted commands are refused instead of silently going to another file, while explicit `fileKey` calls still reach the other connected files.
678
116
 
679
117
  ---
680
118
 
681
- ## 🎨 Desktop Bridge Plugin (Recommended Connection)
682
-
683
- The **Figma Desktop Bridge** plugin is the recommended way to connect Figma to the MCP server. It communicates via WebSocket — no special Figma launch flags needed, and it persists across Figma restarts.
684
-
685
- ### Setup
686
-
687
- 1. Open Figma Desktop (normal launch — no debug flags needed)
688
- 2. Go to **Plugins → Development → Import plugin from manifest...**
689
- 3. Select `figma-desktop-bridge/manifest.json` from the figma-console-mcp directory
690
- 4. Run the plugin in your Figma file — it auto-connects via WebSocket (scans ports 9223–9232)
691
- 5. Ask your AI: "Check Figma status" to verify the connection
692
-
693
- > **One-time import.** Once imported, the plugin stays in your Development plugins list. Just run it whenever you want to use the MCP.
694
-
695
- **📖 [Desktop Bridge Documentation](figma-desktop-bridge/README.md)**
696
-
697
- ### Capabilities
698
-
699
- **Read Operations:**
700
- - Variables without Enterprise API
701
- - Reliable component descriptions (bypasses API bugs)
702
- - Multi-mode support (Light/Dark/Brand variants)
703
- - Real-time selection tracking and document change monitoring
704
-
705
- **Write Operations:**
706
- - **Design Creation** - Create frames, shapes, text, components via `figma_execute`
707
- - **Variable Management** - Full CRUD operations on variables and collections
708
- - **Mode Management** - Add and rename modes for multi-theme support
119
+ ## Tools
709
120
 
710
- ### How the Transport Works
121
+ | Area | Tools |
122
+ |---|---|
123
+ | Status, files & navigation | `figma_get_status`, `figma_diagnose`, `figma_list_open_files`, `figma_navigate`, `figma_reconnect`, `figma_get_selection`, `figma_get_design_changes` |
124
+ | Plugin console & screenshots | `figma_get_console_logs`, `figma_watch_console`, `figma_clear_console`, `figma_reload_plugin`, `figma_take_screenshot`, `figma_capture_screenshot` |
125
+ | Run Plugin API code | `figma_execute` |
126
+ | Variables & design tokens | `figma_get_variables`, `figma_get_token_values`, `figma_create_variable(_collection)`, `figma_update_variable`, `figma_rename_variable`, `figma_delete_variable(_collection)`, `figma_add_mode`, `figma_rename_mode`, `figma_batch_create_variables`, `figma_batch_update_variables`, `figma_setup_design_tokens`, `figma_export_tokens`, `figma_import_tokens` |
127
+ | Components | `figma_search_components`, `figma_get_component(_details/_image)`, `figma_get_component_for_development(_deep)`, `figma_analyze_component_set`, `figma_instantiate_component`, `figma_set_instance_properties`, `figma_add/edit/delete_component_property`, `figma_create_component_set`, `figma_arrange_component_set`, `figma_set_description` |
128
+ | Nodes | `figma_create_child`, `figma_clone_node`, `figma_delete_node`, `figma_rename_node`, `figma_move_node`, `figma_resize_node`, `figma_set_fills`, `figma_set_image_fill`, `figma_set_strokes`, `figma_set_text` |
129
+ | Slots | `figma_create_slot`, `figma_get_slots`, `figma_append_to_slot`, `figma_reset_slot`, `figma_add_slot_property` |
130
+ | Design system & libraries | `figma_get_design_system_summary`, `figma_get_design_system_kit`, `figma_get_styles`, `figma_get_file_data`, `figma_get_file_for_plugin`, `figma_get_library_components`, `figma_get_library_component_by_key`, `figma_get_library_variables`, `figma_import_library_variable` |
131
+ | Parity, docs & accessibility | `figma_check_design_parity`, `figma_generate_component_doc`, `figma_lint_design`, `figma_audit_component_accessibility`, `figma_scan_code_accessibility` |
132
+ | Version history | `figma_get_file_versions`, `figma_get_file_at_version`, `figma_diff_versions`, `figma_get_changes_since_version`, `figma_generate_changelog`, `figma_blame_node` |
133
+ | Comments & annotations | `figma_get_comments`, `figma_post_comment`, `figma_delete_comment`, `figma_get_annotations`, `figma_set_annotations`, `figma_get_annotation_categories` |
134
+ | FigJam | `figjam_create_sticky`, `figjam_create_stickies`, `figjam_create_connector`, `figjam_create_shape_with_text`, `figjam_create_section`, `figjam_create_table`, `figjam_create_code_block`, `figjam_auto_arrange`, `figjam_get_board_contents`, `figjam_get_connections` |
135
+ | Slides | `figma_list_slides`, `figma_get_slide_content`, `figma_get_slide_grid`, `figma_create_slide`, `figma_delete_slide`, `figma_duplicate_slide`, `figma_reorder_slides`, `figma_focus_slide`, `figma_get_focused_slide`, `figma_skip_slide`, `figma_add_text_to_slide`, `figma_add_shape_to_slide`, `figma_set_slide_background`, `figma_get/set_slide_transition`, `figma_get_text_styles`, `figma_set_slides_view_mode` |
711
136
 
712
- - The MCP server communicates via **WebSocket** through the Desktop Bridge plugin
713
- - The server tries port 9223 first, then automatically falls back through ports 9224–9232 if needed
714
- - The plugin scans all ports in the range and connects to every active server it finds
715
- - All 112 tools work through the WebSocket transport
137
+ Every tool's input schema is a plain `type: "object"` with no top-level `anyOf`/`oneOf`/`allOf`/`$ref`, and contains no `propertyNames`, tuples or untyped (`z.any()`) nodes, so it is accepted by Claude and by Gemini-based clients alike. JSON replies are tagged with `_mcp: "figma-console-mcp"` and errors a tool throws are prefixed `[figma-console-mcp]`, so an agent running several Figma MCP servers can tell which one answered. (Plain-text replies, and the SDK's own errors for invalid arguments or an unknown tool, carry no tag.)
716
138
 
717
- **Multiple files:** The WebSocket server supports multiple simultaneous plugin connections — one per open Figma file. Each connection is tracked by file key with independent state (selection, document changes, console logs).
139
+ Full reference: [`docs/tools.md`](https://github.com/muloka/figma-console-mcp/blob/main/docs/tools.md).
718
140
 
719
- **Environment variables:**
720
- - `FIGMA_WS_PORT` — Override the preferred WebSocket port (default: 9223). The server will fall back through a 10-port range starting from this value if the preferred port is occupied.
721
- - `FIGMA_WS_HOST` — Override the WebSocket server bind address (default: `localhost`). Set to `0.0.0.0` when running inside Docker so the host machine can reach the MCP server.
141
+ ### MCP Apps (optional)
722
142
 
723
- **Cloud Mode:** The plugin also supports a **Cloud Mode** toggle for pairing with web AI clients (Claude.ai, v0, Replit, Lovable). Toggle "Cloud Mode" in the plugin UI, enter the 6-character pairing code from your AI assistant, and click Connect. See [Cloud Mode](#-cloud-mode-web-ai-clients) for details.
724
-
725
- **Plugin Limitation:** In Local Mode, works with NPX or Local Git. In Cloud Mode, pairs with the remote MCP endpoint. Remote SSE without Cloud Mode pairing is read-only.
726
-
727
- ---
728
-
729
- ## 🔀 Multi-Instance Support (v1.10.0)
730
-
731
- Figma Console MCP now supports **multiple simultaneous instances** — perfect for designers and developers who work across multiple projects or use Claude Desktop's Chat and Code tabs at the same time.
732
-
733
- ### The Problem (Before v1.10.0)
734
-
735
- When two processes tried to start the MCP server (e.g., Claude Desktop's Chat tab and Code tab), the second one would crash with `EADDRINUSE` because both competed for port 9223.
736
-
737
- ### How It Works Now
738
-
739
- - The server tries port **9223** first (the default)
740
- - If that port is already taken, it automatically tries **9224**, then **9225**, and so on up to **9232**
741
- - The Desktop Bridge plugin in Figma connects to **all** active servers simultaneously
742
- - Every server instance receives real-time events (selection changes, document changes, console logs)
743
- - `figma_get_status` shows which port you're on and lists other active instances
744
-
745
- ### What This Means for You
746
-
747
- | Scenario | Before v1.10.0 | Now |
748
- |----------|----------------|-----|
749
- | Two Claude Desktop tabs (Chat + Code) | Second tab crashes | Both work independently |
750
- | Multiple CLI terminals on different projects | Only one can run | All run simultaneously |
751
- | Claude Desktop + Claude Code CLI | Port conflict | Both coexist |
752
-
753
- ### Do I Need to Do Anything?
754
-
755
- **Nothing.** Multi-instance support is fully automatic:
756
- - Each MCP server claims the next available port in the range
757
- - The Desktop Bridge plugin scans all ports and connects to every active server
758
- - Orphaned processes from closed tabs are automatically cleaned up on startup
759
- - No manual port management — the plugin already scans the whole range
760
-
761
- (Re-importing the manifest is only required when the plugin code itself changes — e.g. after a package update. Port-range scanning is already in the shipped plugin.)
143
+ With `ENABLE_MCP_APPS=true`, hosts that support [MCP Apps](https://github.com/modelcontextprotocol/ext-apps) can render two interactive views: a **Token Browser** (`figma_browse_tokens`) and a **Design System Dashboard** (`figma_audit_design_system`).
762
144
 
763
145
  ---
764
146
 
765
- ## 🧩 MCP Apps (Experimental)
766
-
767
- Figma Console MCP includes support for **MCP Apps** — rich interactive UI experiences that render directly inside any MCP client that supports the [MCP Apps protocol extension](https://github.com/anthropics/anthropic-cookbook/tree/main/misc/model_context_protocol/ext-apps). Built with the official [`@modelcontextprotocol/ext-apps`](https://www.npmjs.com/package/@modelcontextprotocol/ext-apps) SDK.
768
-
769
- > **What are MCP Apps?** Traditional MCP tools return text or images to the AI. MCP Apps go further — they render interactive HTML interfaces inline in the chat, allowing users to browse, filter, and interact with data directly without consuming AI context.
770
-
771
- ### Token Browser
772
-
773
- An interactive design token explorer.
774
-
775
- **Usage:** Ask Claude to "browse the design tokens" or "show me the design tokens" while connected to a Figma file.
776
-
777
- **Features:**
778
- - Browse all tokens organized by collection with expandable sections
779
- - Filter by type (Colors, Numbers, Strings) and search by name/description
780
- - Per-collection mode columns (Light, Dark, Custom) matching Figma's Variables panel
781
- - Color swatches, alias resolution, and click-to-copy on any value
782
- - Works without Enterprise plan via Desktop Bridge (local mode)
783
-
784
- ### Design System Dashboard
785
-
786
- A Lighthouse-style health scorecard that audits your design system across six categories.
787
-
788
- **Usage:** Ask Claude to "audit the design system" or "show me design system health" while connected to a Figma file.
789
-
790
- **Features:**
791
- - Overall weighted score (0–100) with six category gauges: Naming, Tokens, Components, Accessibility, Consistency, Coverage
792
- - Expandable category sections with individual findings, severity indicators, and actionable details
793
- - Diagnostic locations linking findings to specific variables, components, or collections
794
- - Tooltips explaining each check's purpose and scoring criteria
795
- - Refresh button to re-run the audit without consuming AI context
796
- - Pure scoring engine with no external dependencies — all analysis runs locally
797
-
798
- **Enabling MCP Apps:**
799
-
800
- MCP Apps are enabled by default in the setup configurations above (via `"ENABLE_MCP_APPS": "true"`). If you set up before v1.10.0 and don't have this in your config, add it to your `env` section:
801
-
802
- ```json
803
- "env": {
804
- "FIGMA_ACCESS_TOKEN": "figd_YOUR_TOKEN_HERE",
805
- "ENABLE_MCP_APPS": "true"
806
- }
807
- ```
808
-
809
- > **Note:** MCP Apps require an MCP client with [ext-apps protocol](https://github.com/anthropics/anthropic-cookbook/tree/main/misc/model_context_protocol/ext-apps) support (e.g. Claude Desktop). This feature is experimental and the protocol may evolve.
810
-
811
- ### Future MCP Apps Roadmap
812
-
813
- Planned MCP Apps:
814
-
815
- - **Component Gallery** — Visual browser for searching and previewing components with variant exploration
816
- - **Style Inspector** — Interactive panel for exploring color, text, and effect styles with live previews
817
- - **Variable Diff Viewer** — Side-by-side comparison of token values across modes and branches
818
-
819
- The architecture supports adding new apps with minimal boilerplate — each app is a self-contained module with its own server-side tool registration and client-side UI.
820
-
821
- ---
822
-
823
- ## 🚀 Advanced Topics
824
-
825
- - **[Setup Guide](docs/SETUP.md)** - Complete setup guide for all MCP clients
826
- - **[Self-Hosting](docs/SELF_HOSTING.md)** - Deploy your own instance on Cloudflare
827
- - **[Architecture](docs/ARCHITECTURE.md)** - How it works under the hood
828
- - **[OAuth Setup](docs/OAUTH_SETUP.md)** - Configure OAuth for self-hosted deployments
829
- - **[Troubleshooting](docs/TROUBLESHOOTING.md)** - Common issues and solutions
830
-
831
- ---
832
-
833
- ## 🤝 vs. Figma Official MCP
834
-
835
- **Figma Console MCP (This Project)** - Debugging, data extraction, and design creation
836
- - ✅ Real-time console logs from Figma plugins
837
- - ✅ Screenshot capture and visual debugging
838
- - ✅ Error stack traces and runtime monitoring
839
- - ✅ Raw design data extraction (JSON)
840
- - ✅ FigJam board creation and reading (stickies, flowcharts, tables)
841
- - ✅ Works remotely or locally
842
-
843
- **Figma Official Dev Mode MCP** - Code generation
844
- - ✅ Generates React/HTML code from designs
845
- - ✅ Tailwind/CSS class generation
846
- - ✅ Component boilerplate scaffolding
847
-
848
- **Use both together** for the complete workflow: generate code with Official MCP, then debug and extract data with Console MCP.
849
-
850
- ---
147
+ ## What this fork changes
851
148
 
852
- ## 🛤️ Roadmap
853
-
854
- **Current Status:** v1.36.0 (Stable) - Production-ready. Latest: Target lock for multi-file parallel work — `figma_navigate` takes a `lock: true` flag that pins the active file so an AI agent can work in one file while you work in another without commands routing to the wrong file (server-only, no plugin re-import). On top of v1.35.0's Figma Slots write support — create, inspect, populate, and reset Slots (GA at Config 2026) via 5 new tools (`figma_create_slot`, `figma_get_slots`, `figma_append_to_slot`, `figma_reset_slot`, `figma_add_slot_property`), live-validated against the GA Plugin API and based on community PR #77. On top of v1.34.0's Bidirectional Token Sync v2 + DTCG 2025.10 — `figma_import_tokens` applies the complete diff plan (creates missing collections/variables, applies renames, writes real `VARIABLE_ALIAS` references, and deletes only under explicit `replace`), `figma_export_tokens` speaks the DTCG 2025.10 dialect on request (legacy default byte-identical), variable scopes/codeSyntax round-trip via `$extensions`, `figma_setup_design_tokens` accepts alias values via DTCG brace references, and `figma_create_component_set` builds a full variant set from an axes matrix in one call. On top of the v1.33.x line: version-handshake fix (re-import banner only fires when plugin files actually changed), security dependency sweep, and the v1.33.0 connection UX overhaul (honest status pill derived from live connection state, `/health` auto-discovery with self-healing reconnect) + a 33-fix full-codebase audit (lossless DTCG multi-mode round-trips, cross-collection alias resolution, branch-URL correctness across REST tools, cache-poisoning and CSWSH fixes, bridge-first screenshots). Built on WCAG-accurate accessibility auditing (line height below 1.5× is no longer mis-flagged as a failure; readability hints decoupled from conformance checks and scoped to multi-line text; code-side WCAG 1.4.12 check), a self-healing Desktop Bridge connection (zombie-process reaper + auto-reconnect watchdog — fixes the recurring "not connected until restart" bug), native variable binding on fills/strokes + typography control in the write tools, shared-library inspection (key-based component resolution + library variable read/import without Enterprise plan), 10-format token export pipeline (DTCG, CSS, Tailwind v4, Tailwind v3, SCSS, TS module, JSON flat/nested, Style Dictionary v3, Tokens Studio), bidirectional Figma↔code token sync, version history & time-series awareness, FigJam + Slides support, Cloud Write Relay, Design System Kit, WebSocket-only connectivity, smart multi-file tracking, **112 tools** (Local) / **101 tools** (Cloud) / **9 tools** (Remote read-only), Comments API, cross-MCP identity disambiguation, and MCP Apps.
855
-
856
- **Recent Releases:**
857
- - [x] **v1.36.0** - Target lock for multi-file parallel work. `figma_navigate` gains a `lock: true` flag that pins the active file — new connections, reconnects, and the user's own selection/page changes in other files no longer move the command target, so an agent can safely write to one file while the user works in another. Auto-releases when the pinned file disconnects or navigates away; `figma_list_open_files` reports a `targetLocked` flag for pre-write guards. Server-only — no plugin re-import needed.
858
- - [x] **v1.35.0** - Figma Slots write support, closing [#29](https://github.com/southleft/figma-console-mcp/issues/29) (the tracker's most-requested feature) via community PR [#77](https://github.com/southleft/figma-console-mcp/pull/77) by @simonesalvucci, updated to the GA API. Five new tools: `figma_create_slot` (slot + auto-linked SLOT property; variants inside component sets supported — the beta restriction was lifted at GA), `figma_get_slots`, `figma_append_to_slot` (clone or create content into instance slots; snaps clones to the slot origin), `figma_reset_slot`, and `figma_add_slot_property` (retrofit an existing frame as a slot). Hardened by live validation: VARIANT `defaultValue` passthrough restored (Figma requires non-empty), destructive-path reorder in the append handler (content validated before `clearExisting` empties anything), relay whitelist fix for `slot` payloads. **Plugin re-import required** (`code.js` + `ui.html` changed).
859
- - [x] **v1.34.0** - Bidirectional Token Sync v2 + DTCG 2025.10. `figma_import_tokens` now applies the *complete* diff plan: missing collections and variables are created (with modes, inferred/recorded types, and values set in dependency order — aliases in a second pass), token-path renames route to the update phase by round-trip variable ID (no more create+delete pairs that would permanently destroy the original under `replace`), reference values write real `{ type: "VARIABLE_ALIAS", id }` payloads via a four-tier resolver, and deletes are strictly gated behind `strategy: "replace"`. `figma_export_tokens` gains `dtcgDialect: "2025"` (object-form colors from full-precision floats, object dimensions) while the legacy default stays byte-identical; import accepts both dialects unconditionally with dialect-insensitive diff normalization. Variable `scopes` + `codeSyntax` round-trip through `$extensions["figma-console-mcp"]`. `figma_setup_design_tokens` accepts DTCG brace references (`"{color.blue.600}"`) that resolve to real aliases, including forward references. New tool `figma_create_component_set` builds a variant set from an axes matrix (or combines existing components) with `Prop=Value` naming, optional auto-arranged grid, and variant keys in the response — with count-scaled timeouts and rollback on failure. **Plugin re-import required** (`code.js` + `ui.html` changed — the component-set handler and relay). 183 tests across the token/write-tools suites.
860
- - [x] **v1.33.2** - Version-handshake false-positive fix. The v1.33.0 handshake compared the plugin's reported version against the server's *package* version, so server-only releases (like the v1.33.1 dependency sweep) flagged every up-to-date plugin as stale and pushed the re-import banner for files that hadn't changed. The server now compares against the `PLUGIN_VERSION` embedded in the `figma-desktop-bridge/code.js` it ships — exactly what a re-import would install — and `PLUGIN_VERSION` itself now means "last release in which plugin files changed" (release tooling bumps it only when `figma-desktop-bridge/` actually changed since the last tag). `figma_get_status` gains `transport.websocket.bundledPluginVersion`; `figma_diagnose` blames the right version. No new tools, **no plugin re-import required** (one-time exception: if you re-imported at v1.33.1, the banner appears once more — clear it with one final re-import). 1245 tests passing (9 new).
861
- - [x] **v1.33.1** - Security dependency sweep. All runtime and critical npm audit alerts resolved via in-range bumps (`ws` 8.21.0, `hono` 4.12.27, `undici` 7.28.0, `handlebars` 4.7.9 — the lone critical, dev-only — plus `lodash`, `path-to-regexp`, `basic-ftp`, `fast-uri`, `vite`). `wrangler` deliberately held at 4.72.0 because newer versions require Node ≥22; the only residual audit findings are inside wrangler/miniflare's dev-time toolchain, which never ships in the npm package or Worker bundle. Supersedes dependabot PRs #81/#82/#84. No code changes, no API changes, no plugin re-import. 1236 tests passing unchanged.
862
- - [x] **v1.33.0** - Connection UX overhaul + full-codebase audit. The plugin's status pill now derives from live connection state instead of Figma's variables loading (it used to glow green with zero MCP servers connected); HTTP `/health` auto-discovery reconnects restarted servers automatically (including one-dead-among-live, previously a permanent dead end); a version handshake banners the plugin UI when a re-import is needed and surfaces the mismatch in `figma_get_status`/`figma_diagnose`; cloud pairing config survives plugin reopen and its status line is derived + labeled (no more orphaned "Disconnected" under a green pill); all plugin copy is designer-language. The audit fixed 33 verified issues: lossless DTCG multi-mode round-trips, set-qualified cross-collection aliases, TIMING/EASING mapped to DTCG `duration`/`cubicBezier`, two cache-poisoning bugs (the "search returns 0 components" reports), a CSWSH origin bypass (`startsWith` → exact match), post-sleep reaper kill-safety (plus a shell-free `/health` probe with `os.devNull` so Windows curl can't false-negative a healthy sibling), branch-URL correctness across REST tools, and bridge-first `figma_take_screenshot`. `figma_arrange_component_set` now rearranges variants in place so placed instances survive. No new tools; **plugin re-import required** (`code.js` + `ui.html` changed — and the new handshake makes this the last one you have to discover on your own). 1236 tests passing (33 new).
863
- - [x] **v1.32.1** - Documentation-generator fix reported by Robin Di Capua: `figma_generate_component_doc` documented **colors** as raw hex (with `—` in the Figma Variable column) even when fills/strokes were bound to variables, while spacing tokens documented correctly. Two root causes — an id→name lookup that read the wrong keys (`.id`/`.name` instead of `variableId`/`variableName`), and variable names only ever being sourced from the Enterprise-only REST `/variables/local` endpoint (403 elsewhere). The generator now resolves names via the Desktop Bridge Plugin API (works on every plan) and threads them through the States, Color Tokens, and Spacing tables, so real token names like `color/content/default` and `spacing/1` appear. No new tools, no arg-shape changes, no plugin re-import required. 1203 tests passing.
864
- - [x] **v1.32.0** - Accessibility-audit correctness fix reported by Isabella (a11y collaborator): `figma_lint_design` was flagging line height below 1.5× as an accessibility failure on hundreds of components. That misreads **WCAG 1.4.12 Text Spacing**, which requires content to *support* user spacing overrides without loss — not that designs *ship* at 1.5× — so a sub-1.5 line height is not a conformance failure. Line/paragraph-spacing checks are now scoped to multi-line text (single-line labels and buttons exempt); readability hints (`text-size`, `line-height`, `letter-spacing`, `paragraph-spacing`) are decoupled from the `wcag` group into an opt-in `best-practice` group, so the default audit (`['wcag','design-system','layout']`) and `rules: ['wcag']` return genuine conformance only; and a new code-side `text-spacing-support` advisory in `figma_scan_code_accessibility` flags fixed-px typography — where 1.4.12/1.4.4 are actually verifiable. No new tools, no arg-shape changes; **plugin re-import required** to pick up the new audit behavior (bridge protocol unchanged, so an un-updated plugin stays compatible). 1196 tests passing.
865
- - [x] **v1.31.0** - Fixes the most-reported reliability bug: the Desktop Bridge connection dropping and staying down until you closed the plugin, restarted your MCP client, or killed ports by hand. Root cause was **zombie MCP server processes** squatting the WebSocket port range (9223–9232) after a bad shutdown. The reaper now escalates `SIGTERM` → `SIGKILL` (a hung server that ignores graceful shutdown can no longer survive), sweeps the range every 5 minutes via an `unref`'d periodic reaper, and a shutdown backstop prevents a server from zombifying in the first place. The redesigned Desktop Bridge plugin adds an auto-reconnect watchdog (re-probes every ~12s while disconnected), a context-aware **Pause / Resume / Reconnect** button, and a live server-count badge. No new tools; **plugin re-import required** (bridge `ui.html` + `code.js` changed). 1190 tests passing, including an integration test that spawns a real `SIGTERM`-ignoring process and asserts the reaper kills it.
866
- - [x] **v1.30.0** - Native variable binding + typography in the structured write tools, closing the Plugin API gaps that used to force raw `figma_execute`. `figma_set_fills` / `figma_set_strokes` accept a `variableId` to bind a fill/stroke to a color variable via `setBoundVariableForPaint` (any plan, via the bridge). `figma_set_text` gains `fontFamily` / `fontStyle` with space-insensitive normalization (`SemiBold` → `Semi Bold`) and graceful `Regular` fallback. `figma_instantiate_component` pre-loads instance text fonts before applying overrides (fixes silently-skipped text overrides on non-Regular weights) and returns a `warnings` array for failed overrides. Also fixes a mixed-font crash in `figma_set_text` and a `ui.html` relay that was dropping new message fields. No new tools; **plugin re-import required** (bridge `ui.html` + `code.js` changed). Validated live; 1185 tests passing.
867
- - [x] **v1.29.2** - Bug fix: `figma_generate_component_doc` now renders Figma component descriptions faithfully and reliably tags atomic-design level. Single-`#` headings in descriptions render as real sections (Usage Guidelines, Implementation Considerations, Accessibility Requirements, Content Configuration) instead of leaking as `- # Heading` list items; frontmatter `description` takes the first sentence instead of truncating on the word "Accessibility"; the generated Figma URL no longer doubles `?node-id=`; and the component's atomic level (atom/molecule/organism/template) is auto-detected via a single `ids=<node>` file request + divider walk-back, with no dependency on library publishing. No new tools; plugin re-import not required.
868
- - [x] **v1.29.1** - Bug fix: `figma_get_design_system_kit` now resolves variables bridge-first (Desktop Bridge / cloud relay → REST fallback) instead of calling the Enterprise-only Variables REST API directly. Non-Enterprise users no longer hit a 403 on the kit's token section when a bridge is connected, and a REST 403 now points the caller back to the bridge instead of dead-ending. 7 new tests, 1185 total passing. No new tools; plugin re-import not required.
869
- - [x] **v1.29.0** - Shared library inspection: three new tools close the gap between "I have a component key" and "I can actually use it." `figma_get_library_component_by_key` resolves any 40-char component key to full `componentPropertyDefinitions` + variants (with their published keys) + per-variant visual specs — without needing the source library file's URL. `figma_get_library_variables` lists library tokens via Plugin API (works on every Figma plan; the REST equivalent is Enterprise-only). `figma_import_library_variable` imports a library token to the current file so it can be bound to nodes. 27 new tests, 1178 total passing. Plugin re-import optional.
870
- - [x] **v1.28.1** - Bug fix patch surfacing from live-fire testing of the v1.28.0 formatters against multi-tier semantic-token design systems. Fixes: Tailwind v3 emitted empty `module.exports` for alias-only sets (now resolves alias chains to literal values); TypeScript module + JSON flat + JSON nested formatters emitted `"{alias.path}"` strings as literal values (now resolves); Tailwind v4 namespace-prefix doubling (`--color-theme-color-X` is now `--color-theme-X`). Adds `resolveAliasChain` public helper. 1151 tests still passing.
871
- - [x] **v1.28.0** - Full formatter coverage for `figma_export_tokens`. Seven new output formats: Tailwind v4 `@theme inline`, Tailwind v3 config, SCSS variables, TypeScript module, JSON flat/nested, Style Dictionary v3, Tokens Studio multi-file. Combined with DTCG + CSS variables, ships **10 fully-implemented output formats** with zero third-party build-tool dependencies. Tool description updated, docs/tools.md table all-green. 22 new Jest tests, 1151 total passing.
872
- - [x] **v1.27.1** - Documentation patch. No code behavior changes. Sweeps stale "Phase 1 ships with DTCG only" claims across tool descriptions, error messages, and internal comments after CSS variables formatter and the apply phase shipped during the v1.27.0 dev cycle. Refreshes README banner + capability bullets + roadmap. Adds `Phase 3.5: Stale-Content Audit` to the release runbook so future releases get a strict pre-publish grep sweep across banners, tool descriptions, error messages, source comments, and tool-count consistency.
873
- - [x] **v1.27.0** - Bidirectional token sync: `figma_export_tokens` + `figma_import_tokens` replace Style Dictionary and Tokens Studio's export pipeline. Canonical DTCG JSON + CSS custom properties. Diff-aware merge with round-trip ID preservation via `$extensions["figma-console-mcp"]`. Apply phase pushes hex-value edits back to Figma via the plugin bridge. Verified end-to-end against 713-token + 280-token design systems.
874
- - [x] **v1.26.0** - Internal cleanup + cross-MCP identity: Local-mode CDP/Puppeteer transport removed entirely (WebSocket-only). `figma_diagnose` tool for designer-readable health checks. Every response tagged `_mcp: "figma-console-mcp"`; errors prefixed `[figma-console-mcp]` so attribution is unambiguous when running multiple Figma MCPs. Plugin status pill now reads `Local · ready` / `Cloud · ready` / `Local + Cloud · ready`. Net diff: −7,299 lines, plugin re-import optional.
875
- - [x] **v1.25.0** - Description + Dev Mode annotation tracking in `figma_diff_versions` via plugin session buffer. Description and annotation edits made during a session now appear in diff output (REST API doesn't return these — bridged through the plugin's `documentchange` listener).
876
- - [x] **v1.24.0** - Honest scope coverage on version diffs. `scope_coverage` object surfaces what `figma_diff_versions` does and doesn't track; always-on coverage warnings prevent silent invisibility on token-value changes and component-instance placements.
877
- - [x] **v1.23.0** - Version History & Time-Series Awareness: 6 new tools (list versions, snapshot any past version, diff two versions for component/binding deltas, generate markdown changelogs, trace property/variant introduction via binary-search blame walker). Author attribution flows from autosaves, not just labeled releases.
878
- - [x] **v1.17.0** - Figma Slides support: 15 tools for managing presentations.
879
- - [x] **v1.16.0** - FigJam support: 9 tools for creating and reading FigJam boards.
880
- - [x] **v1.12.0** - Cloud Write Relay: web AI clients can create and modify Figma designs without Node.js.
881
- - [x] **v1.11.0** - Complete CDP removal, improved multi-file active tracking with focus detection.
882
- - [x] **v1.10.0** - Multi-instance support (dynamic port fallback 9223–9232, multi-connection plugin, instance discovery).
883
- - [x] **v1.9.0** - Figma Comments tools, improved port conflict detection.
884
- - [x] **v1.8.0** - WebSocket Bridge transport (CDP-free connectivity), real-time selection/document tracking.
885
- - [x] **v1.7.0** - MCP Apps (Token Browser, Design System Dashboard), batch variable operations, design-code parity tools.
886
-
887
- **Coming Next:**
888
- - [ ] **Token sync — non-DTCG input parsers** - Parsers for non-DTCG input (Tokens Studio, CSS vars, Tailwind v4, Tailwind v3 config, SCSS, Style Dictionary v3, JSON flat/nested) so `figma_import_tokens` can ingest the same formats it exports. (The import-side apply expansion — creates, replace-gated deletes, alias-target updates — shipped in v1.34.0.)
889
- - [ ] **Cross-library variable resolution** - Resolve cross-library aliases via `getVariableByIdAsync` so they render as real `var(--target)` references in exports instead of comments.
890
- - [ ] **Component template library** - Common UI pattern generation
891
- - [ ] **Visual regression testing** - Screenshot diff capabilities
892
-
893
- **📖 [Full Roadmap](docs/ROADMAP.md)**
149
+ - **MCP SDK v2 and Zod 4 (0.6.0)** — built on `@modelcontextprotocol/server` v2, serving both the 2025-era protocol and 2026-07-28 on stdio and on `MCP_HTTP_PORT`. Tool schemas stay Gemini-clean on Zod 4: the `propertyNames` keyword Zod 4 emits for string-keyed records (which Gemini rejects with a 400) is stripped. Upstream's Cloud Mode was removed along with its Cloudflare dependencies.
150
+ - **Honest error reporting** — the eight single-op variable/collection/mode write tools check the bridge's result envelope, so a plugin-side failure surfaces its real error text instead of a false success or a masking TypeError; batch-create failure rows identify variables that were created before the throw (`created`/`id`/`valueSet: false`).
151
+ - **Mode-limit safety** — `figma_setup_design_tokens` and `figma_create_variable_collection` roll the collection back on a mode-limit failure instead of orphaning it, and the setup tool returns your file's real ceiling as `planModeLimit`; the schema's stale 4-mode cap is now a 40 sanity bound (current Figma plans allow 10/20/unlimited — the runtime limit governs).
152
+ - **No orphaned nodes on failure** — `figma_create_connector` validates endpoints before creating, and create-child / add-text-to-slide / create-table remove their partially-created node on error; batch stickies report the id of any sticky a failed row left behind. `figma_create_child` also gains the POLYGON/STAR/VECTOR types the plugin always supported.
153
+ - **Per-command dispatch budgets** — long-running bridge commands (variable refresh and component scans at 300s, lint/audit at 120s, large component sets) are no longer cut off at 30s: the server's real timeout rides in each WebSocket frame and the plugin's dispatcher honors it ([upstream #94](https://github.com/southleft/figma-console-mcp/issues/94) lineage).
154
+ - **Streamable HTTP transport** (`MCP_HTTP_PORT`, [upstream #48](https://github.com/southleft/figma-console-mcp/issues/48)) and **per-call file targeting** (`fileKey`, held target pins) — see above.
155
+ - **`VariableID:` alias support, hex validation and sandbox-safe JSON escaping** in `figma_batch_create_variables`, `figma_batch_update_variables` and `figma_setup_design_tokens` ([upstream #52](https://github.com/southleft/figma-console-mcp/issues/52)): invalid color strings throw instead of writing `NaN` channels, `#RGB`/`#RGBA`/`#RRGGBB`/`#RRGGBBAA` are all supported, and serialized payloads escape `import`, `(` and `U+2028`/`U+2029` so caller text can't trip Figma's plugin import-expression scanner.
156
+ - **Security** — `figma_scan_code_accessibility` never executes `<script>` tags or inline handlers from the HTML it scans; the plugin's activity log escapes quotes; current MCP SDK and Zod lines.
157
+ - **Daemon and bridge reliability:**
158
+ - ESM-safe startup orphan cleanup with 3-way PID verification (it never kills or removes files for unrelated or inconclusive PIDs) and multi-candidate eviction.
159
+ - Guarded WebSocket heartbeat pings and post-write variable cache invalidation.
160
+ - IPv6 loopback fallback (`::1` → `127.0.0.1`) when the default `localhost` bind isn't accepting connections.
161
+ - Desktop Bridge UI: synchronous-throw handling and socket-identity tracking, with a 10s connect timeout.
162
+ - Partial-failure orphan ids forwarded to callers.
163
+ - **`page`/`pageSize` honored in `figma_get_variables` `format: "full"`** ([upstream #98](https://github.com/southleft/figma-console-mcp/issues/98)).
164
+ - **Plugin and server build versions** surfaced in the Desktop Bridge UI and diagnostics.
165
+ - **CI and plugin-asset guards** — Node 22/24 test matrix, a clean typecheck, a pinned `tools/list` snapshot with schema-invariant checks, and regression tests that parse the plugin files and run Figma's own import-expression scanner against `code.js`, so a comment can never again brick the plugin loader.
894
166
 
895
- ---
167
+ ## Relationship to upstream
896
168
 
897
- ## 💻 Development
169
+ - Frozen at the upstream **v1.36.0** base — this fork does **not** track upstream releases.
170
+ - Upstream fixes are cherry-picked when they matter to this fork's use cases, with original authorship preserved. So far:
171
+ - v1.38.2: orphan-reaper fix
172
+ - v1.39.0: relay fix that lets `figma_execute`'s `fileContext`/`resultAnalysis` reach the server
173
+ - v1.39.1: plugin-update-banner direction fix
174
+ - v1.41.0: accessibility-scan script isolation (the Local Mode part)
175
+ - v2.3.3: held-pin fix
176
+ - v2.5.1: IPv6 loopback fallback
177
+ - v2.x: MCP Apps theming fix
178
+ - **Not in this fork:** upstream's Cloud Mode (Cloudflare Workers deployment, remote SSE, OAuth) and its 2.x feature line. For those, use [southleft/figma-console-mcp](https://github.com/southleft/figma-console-mcp) and its [documentation](https://docs.figma-console-mcp.southleft.com). The Desktop Bridge plugin still shows upstream's cloud pairing option; it connects to upstream's hosted relay and is not supported here.
179
+ - Bugs and requests for this fork go to [this repo's issue tracker](https://github.com/muloka/figma-console-mcp/issues) — please don't file them upstream.
180
+ - All credit for the original server and plugin goes to [Southleft](https://github.com/southleft) and the figma-console-mcp contributors. If it's useful to you, consider [sponsoring them](https://github.com/sponsors/southleft).
181
+
182
+ ## Development
898
183
 
899
184
  ```bash
900
- git clone https://github.com/southleft/figma-console-mcp.git
901
- cd figma-console-mcp
902
- npm install
903
-
904
- # Local mode development
905
- npm run dev:local
906
-
907
- # Cloud mode development
908
- npm run dev
909
-
910
- # Build
911
- npm run build
185
+ npm ci
186
+ npm test # Jest
187
+ npx tsc --noEmit # typecheck (must be clean)
188
+ npm run build # build:local (server) && build:apps (MCP App bundles)
189
+ npm run dev:local # run the server from source with tsx
912
190
  ```
913
191
 
914
- **📖 [Development Guide](docs/ARCHITECTURE.md)**
915
-
916
- ---
917
-
918
- ## 📄 License
919
-
920
- MIT - See [LICENSE](LICENSE) file for details.
921
-
922
- ---
923
-
924
- ## 🔗 Links
192
+ ## License
925
193
 
926
- - 📚 **[Documentation Site](https://docs.figma-console-mcp.southleft.com)** — Complete guides, tutorials, and API reference
927
- - 📖 [Local Docs](docs/) — Documentation source files
928
- - 🐛 [Report Issues](https://github.com/southleft/figma-console-mcp/issues)
929
- - 💬 [Discussions](https://github.com/southleft/figma-console-mcp/discussions)
930
- - 🌐 [Model Context Protocol](https://modelcontextprotocol.io/)
931
- - 🎨 [Figma API](https://www.figma.com/developers/api)
194
+ MIT — see [LICENSE](https://github.com/muloka/figma-console-mcp/blob/main/LICENSE).