@mp3wizard/figma-console-mcp 1.23.1 → 1.27.2
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.
- package/README.md +49 -33
- package/dist/cloudflare/core/config.js +0 -8
- package/dist/cloudflare/core/console-monitor.js +3 -3
- package/dist/cloudflare/core/diagnose-tool.js +96 -0
- package/dist/cloudflare/core/figma-tools.js +69 -229
- package/dist/cloudflare/core/identity.js +96 -0
- package/dist/cloudflare/core/tokens/alias-resolver.js +98 -0
- package/dist/cloudflare/core/tokens/config.js +284 -0
- package/dist/cloudflare/core/tokens/figma-converter.js +195 -0
- package/dist/cloudflare/core/tokens/formatters/css-vars.js +329 -0
- package/dist/cloudflare/core/tokens/formatters/dtcg.js +300 -0
- package/dist/cloudflare/core/tokens/formatters/index.js +45 -0
- package/dist/cloudflare/core/tokens/formatters/json.js +7 -0
- package/dist/cloudflare/core/tokens/formatters/less.js +4 -0
- package/dist/cloudflare/core/tokens/formatters/scss.js +4 -0
- package/dist/cloudflare/core/tokens/formatters/stubs.js +11 -0
- package/dist/cloudflare/core/tokens/formatters/style-dictionary-v3.js +4 -0
- package/dist/cloudflare/core/tokens/formatters/tailwind-v3.js +4 -0
- package/dist/cloudflare/core/tokens/formatters/tailwind-v4.js +4 -0
- package/dist/cloudflare/core/tokens/formatters/tokens-studio.js +4 -0
- package/dist/cloudflare/core/tokens/formatters/ts-module.js +4 -0
- package/dist/cloudflare/core/tokens/index.js +15 -0
- package/dist/cloudflare/core/tokens/parsers/css-vars.js +4 -0
- package/dist/cloudflare/core/tokens/parsers/dtcg.js +253 -0
- package/dist/cloudflare/core/tokens/parsers/index.js +138 -0
- package/dist/cloudflare/core/tokens/parsers/json.js +7 -0
- package/dist/cloudflare/core/tokens/parsers/scss.js +4 -0
- package/dist/cloudflare/core/tokens/parsers/stubs.js +13 -0
- package/dist/cloudflare/core/tokens/parsers/style-dictionary-v3.js +4 -0
- package/dist/cloudflare/core/tokens/parsers/tailwind-v3.js +4 -0
- package/dist/cloudflare/core/tokens/parsers/tailwind-v4.js +4 -0
- package/dist/cloudflare/core/tokens/parsers/tokens-studio.js +4 -0
- package/dist/cloudflare/core/tokens/schemas.js +148 -0
- package/dist/cloudflare/core/tokens/transforms/color.js +12 -0
- package/dist/cloudflare/core/tokens/transforms/index.js +29 -0
- package/dist/cloudflare/core/tokens/transforms/size.js +7 -0
- package/dist/cloudflare/core/tokens/types.js +18 -0
- package/dist/cloudflare/core/tokens-tools.js +849 -0
- package/dist/cloudflare/core/version-tools.js +151 -7
- package/dist/cloudflare/core/websocket-server.js +77 -55
- package/dist/cloudflare/index.js +37 -26
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +0 -8
- package/dist/core/config.js.map +1 -1
- package/dist/core/console-monitor.d.ts +2 -2
- package/dist/core/console-monitor.d.ts.map +1 -1
- package/dist/core/console-monitor.js +3 -3
- package/dist/core/console-monitor.js.map +1 -1
- package/dist/core/diagnose-tool.d.ts +33 -0
- package/dist/core/diagnose-tool.d.ts.map +1 -0
- package/dist/core/diagnose-tool.js +97 -0
- package/dist/core/diagnose-tool.js.map +1 -0
- package/dist/core/diff/diff-engine.d.ts +14 -0
- package/dist/core/diff/diff-engine.d.ts.map +1 -1
- package/dist/core/diff/diff-engine.js.map +1 -1
- package/dist/core/figma-connector.d.ts +1 -1
- package/dist/core/figma-connector.d.ts.map +1 -1
- package/dist/core/figma-tools.d.ts +1 -2
- package/dist/core/figma-tools.d.ts.map +1 -1
- package/dist/core/figma-tools.js +69 -229
- package/dist/core/figma-tools.js.map +1 -1
- package/dist/core/identity.d.ts +41 -0
- package/dist/core/identity.d.ts.map +1 -0
- package/dist/core/identity.js +97 -0
- package/dist/core/identity.js.map +1 -0
- package/dist/core/tokens/alias-resolver.d.ts +40 -0
- package/dist/core/tokens/alias-resolver.d.ts.map +1 -0
- package/dist/core/tokens/alias-resolver.js +99 -0
- package/dist/core/tokens/alias-resolver.js.map +1 -0
- package/dist/core/tokens/config.d.ts +352 -0
- package/dist/core/tokens/config.d.ts.map +1 -0
- package/dist/core/tokens/config.js +285 -0
- package/dist/core/tokens/config.js.map +1 -0
- package/dist/core/tokens/figma-converter.d.ts +81 -0
- package/dist/core/tokens/figma-converter.d.ts.map +1 -0
- package/dist/core/tokens/figma-converter.js +196 -0
- package/dist/core/tokens/figma-converter.js.map +1 -0
- package/dist/core/tokens/formatters/css-vars.d.ts +24 -0
- package/dist/core/tokens/formatters/css-vars.d.ts.map +1 -0
- package/dist/core/tokens/formatters/css-vars.js +330 -0
- package/dist/core/tokens/formatters/css-vars.js.map +1 -0
- package/dist/core/tokens/formatters/dtcg.d.ts +28 -0
- package/dist/core/tokens/formatters/dtcg.d.ts.map +1 -0
- package/dist/core/tokens/formatters/dtcg.js +301 -0
- package/dist/core/tokens/formatters/dtcg.js.map +1 -0
- package/dist/core/tokens/formatters/index.d.ts +30 -0
- package/dist/core/tokens/formatters/index.d.ts.map +1 -0
- package/dist/core/tokens/formatters/index.js +46 -0
- package/dist/core/tokens/formatters/index.js.map +1 -0
- package/dist/core/tokens/formatters/json.d.ts +5 -0
- package/dist/core/tokens/formatters/json.d.ts.map +1 -0
- package/dist/core/tokens/formatters/json.js +8 -0
- package/dist/core/tokens/formatters/json.js.map +1 -0
- package/dist/core/tokens/formatters/less.d.ts +4 -0
- package/dist/core/tokens/formatters/less.d.ts.map +1 -0
- package/dist/core/tokens/formatters/less.js +5 -0
- package/dist/core/tokens/formatters/less.js.map +1 -0
- package/dist/core/tokens/formatters/scss.d.ts +4 -0
- package/dist/core/tokens/formatters/scss.d.ts.map +1 -0
- package/dist/core/tokens/formatters/scss.js +5 -0
- package/dist/core/tokens/formatters/scss.js.map +1 -0
- package/dist/core/tokens/formatters/stubs.d.ts +9 -0
- package/dist/core/tokens/formatters/stubs.d.ts.map +1 -0
- package/dist/core/tokens/formatters/stubs.js +12 -0
- package/dist/core/tokens/formatters/stubs.js.map +1 -0
- package/dist/core/tokens/formatters/style-dictionary-v3.d.ts +4 -0
- package/dist/core/tokens/formatters/style-dictionary-v3.d.ts.map +1 -0
- package/dist/core/tokens/formatters/style-dictionary-v3.js +5 -0
- package/dist/core/tokens/formatters/style-dictionary-v3.js.map +1 -0
- package/dist/core/tokens/formatters/tailwind-v3.d.ts +4 -0
- package/dist/core/tokens/formatters/tailwind-v3.d.ts.map +1 -0
- package/dist/core/tokens/formatters/tailwind-v3.js +5 -0
- package/dist/core/tokens/formatters/tailwind-v3.js.map +1 -0
- package/dist/core/tokens/formatters/tailwind-v4.d.ts +4 -0
- package/dist/core/tokens/formatters/tailwind-v4.d.ts.map +1 -0
- package/dist/core/tokens/formatters/tailwind-v4.js +5 -0
- package/dist/core/tokens/formatters/tailwind-v4.js.map +1 -0
- package/dist/core/tokens/formatters/tokens-studio.d.ts +4 -0
- package/dist/core/tokens/formatters/tokens-studio.d.ts.map +1 -0
- package/dist/core/tokens/formatters/tokens-studio.js +5 -0
- package/dist/core/tokens/formatters/tokens-studio.js.map +1 -0
- package/dist/core/tokens/formatters/ts-module.d.ts +4 -0
- package/dist/core/tokens/formatters/ts-module.d.ts.map +1 -0
- package/dist/core/tokens/formatters/ts-module.js +5 -0
- package/dist/core/tokens/formatters/ts-module.js.map +1 -0
- package/dist/core/tokens/index.d.ts +17 -0
- package/dist/core/tokens/index.d.ts.map +1 -0
- package/dist/core/tokens/index.js +16 -0
- package/dist/core/tokens/index.js.map +1 -0
- package/dist/core/tokens/parsers/css-vars.d.ts +3 -0
- package/dist/core/tokens/parsers/css-vars.d.ts.map +1 -0
- package/dist/core/tokens/parsers/css-vars.js +5 -0
- package/dist/core/tokens/parsers/css-vars.js.map +1 -0
- package/dist/core/tokens/parsers/dtcg.d.ts +21 -0
- package/dist/core/tokens/parsers/dtcg.d.ts.map +1 -0
- package/dist/core/tokens/parsers/dtcg.js +254 -0
- package/dist/core/tokens/parsers/dtcg.js.map +1 -0
- package/dist/core/tokens/parsers/index.d.ts +37 -0
- package/dist/core/tokens/parsers/index.d.ts.map +1 -0
- package/dist/core/tokens/parsers/index.js +139 -0
- package/dist/core/tokens/parsers/index.js.map +1 -0
- package/dist/core/tokens/parsers/json.d.ts +4 -0
- package/dist/core/tokens/parsers/json.d.ts.map +1 -0
- package/dist/core/tokens/parsers/json.js +8 -0
- package/dist/core/tokens/parsers/json.js.map +1 -0
- package/dist/core/tokens/parsers/scss.d.ts +3 -0
- package/dist/core/tokens/parsers/scss.d.ts.map +1 -0
- package/dist/core/tokens/parsers/scss.js +5 -0
- package/dist/core/tokens/parsers/scss.js.map +1 -0
- package/dist/core/tokens/parsers/stubs.d.ts +11 -0
- package/dist/core/tokens/parsers/stubs.d.ts.map +1 -0
- package/dist/core/tokens/parsers/stubs.js +14 -0
- package/dist/core/tokens/parsers/stubs.js.map +1 -0
- package/dist/core/tokens/parsers/style-dictionary-v3.d.ts +3 -0
- package/dist/core/tokens/parsers/style-dictionary-v3.d.ts.map +1 -0
- package/dist/core/tokens/parsers/style-dictionary-v3.js +5 -0
- package/dist/core/tokens/parsers/style-dictionary-v3.js.map +1 -0
- package/dist/core/tokens/parsers/tailwind-v3.d.ts +3 -0
- package/dist/core/tokens/parsers/tailwind-v3.d.ts.map +1 -0
- package/dist/core/tokens/parsers/tailwind-v3.js +5 -0
- package/dist/core/tokens/parsers/tailwind-v3.js.map +1 -0
- package/dist/core/tokens/parsers/tailwind-v4.d.ts +3 -0
- package/dist/core/tokens/parsers/tailwind-v4.d.ts.map +1 -0
- package/dist/core/tokens/parsers/tailwind-v4.js +5 -0
- package/dist/core/tokens/parsers/tailwind-v4.js.map +1 -0
- package/dist/core/tokens/parsers/tokens-studio.d.ts +3 -0
- package/dist/core/tokens/parsers/tokens-studio.d.ts.map +1 -0
- package/dist/core/tokens/parsers/tokens-studio.js +5 -0
- package/dist/core/tokens/parsers/tokens-studio.js.map +1 -0
- package/dist/core/tokens/schemas.d.ts +152 -0
- package/dist/core/tokens/schemas.d.ts.map +1 -0
- package/dist/core/tokens/schemas.js +149 -0
- package/dist/core/tokens/schemas.js.map +1 -0
- package/dist/core/tokens/transforms/color.d.ts +9 -0
- package/dist/core/tokens/transforms/color.d.ts.map +1 -0
- package/dist/core/tokens/transforms/color.js +13 -0
- package/dist/core/tokens/transforms/color.js.map +1 -0
- package/dist/core/tokens/transforms/index.d.ts +36 -0
- package/dist/core/tokens/transforms/index.d.ts.map +1 -0
- package/dist/core/tokens/transforms/index.js +30 -0
- package/dist/core/tokens/transforms/index.js.map +1 -0
- package/dist/core/tokens/transforms/size.d.ts +7 -0
- package/dist/core/tokens/transforms/size.d.ts.map +1 -0
- package/dist/core/tokens/transforms/size.js +8 -0
- package/dist/core/tokens/transforms/size.js.map +1 -0
- package/dist/core/tokens/types.d.ts +228 -0
- package/dist/core/tokens/types.d.ts.map +1 -0
- package/dist/core/tokens/types.js +19 -0
- package/dist/core/tokens/types.js.map +1 -0
- package/dist/core/tokens-tools.d.ts +42 -0
- package/dist/core/tokens-tools.d.ts.map +1 -0
- package/dist/core/tokens-tools.js +850 -0
- package/dist/core/tokens-tools.js.map +1 -0
- package/dist/core/types/index.d.ts +0 -8
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/version-tools.d.ts +30 -1
- package/dist/core/version-tools.d.ts.map +1 -1
- package/dist/core/version-tools.js +151 -7
- package/dist/core/version-tools.js.map +1 -1
- package/dist/core/websocket-connector.d.ts +1 -1
- package/dist/core/websocket-connector.d.ts.map +1 -1
- package/dist/core/websocket-server.d.ts +47 -3
- package/dist/core/websocket-server.d.ts.map +1 -1
- package/dist/core/websocket-server.js +77 -55
- package/dist/core/websocket-server.js.map +1 -1
- package/dist/local.d.ts +0 -12
- package/dist/local.d.ts.map +1 -1
- package/dist/local.js +967 -3406
- package/dist/local.js.map +1 -1
- package/figma-desktop-bridge/code.js +59 -63
- package/figma-desktop-bridge/ui.html +85 -11
- package/package.json +12 -30
- package/figma-desktop-bridge/ui-full.html +0 -1353
package/README.md
CHANGED
|
@@ -6,21 +6,25 @@
|
|
|
6
6
|
[](https://docs.figma-console-mcp.southleft.com)
|
|
7
7
|
[](https://github.com/sponsors/southleft)
|
|
8
8
|
|
|
9
|
-
> **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**, and **
|
|
9
|
+
> **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**.
|
|
10
10
|
|
|
11
|
-
> **🆕
|
|
11
|
+
> **🆕 Bidirectional Token Sync (v1.27.0, patched v1.27.1):** Two new tools — `figma_export_tokens` and `figma_import_tokens` — replace Style Dictionary and Tokens Studio's export pipeline for popular styling methods. Pull every variable across every collection and mode as canonical DTCG JSON + CSS custom properties; edit a hex value in code; push the delta back to Figma. Diff-aware merge produces exactly one API call per changed value, not a full collection rewrite. 103 tools total. [See what's new →](CHANGELOG.md#1271---2026-05-16)
|
|
12
12
|
|
|
13
13
|
## What is this?
|
|
14
14
|
|
|
15
15
|
Figma Console MCP connects AI assistants (like Claude) to Figma, enabling:
|
|
16
16
|
|
|
17
17
|
- **🎨 Design system extraction** - Pull variables, components, and styles
|
|
18
|
+
- **🔁 Bidirectional token sync** - Export Figma variables to DTCG JSON + CSS custom properties; push code-side edits back to Figma. Replaces Style Dictionary and Tokens Studio's export pipeline.
|
|
18
19
|
- **📸 Visual debugging** - Take screenshots for context
|
|
19
20
|
- **✏️ Design creation** - Create UI components, frames, and layouts directly in Figma
|
|
20
21
|
- **🔧 Variable management** - Create, update, rename, and delete design tokens
|
|
22
|
+
- **🕰 Version history & time-series awareness** - List versions, diff snapshots, generate markdown changelogs, trace property/variant introduction via binary-search blame
|
|
21
23
|
- **⚡ Real-time monitoring** - Watch console logs from the Desktop Bridge plugin
|
|
22
24
|
- **📌 FigJam boards** - Create stickies, flowcharts, tables, and code blocks on collaborative boards
|
|
25
|
+
- **🎞️ Slides presentations** - Build and manage Figma Slides decks programmatically
|
|
23
26
|
- **♿ Accessibility scanning** - 14 WCAG design checks with conformance level tagging, component scorecards, axe-core code scanning, design-to-code parity
|
|
27
|
+
- **🛡 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
|
|
24
28
|
- **☁️ Cloud Write Relay** - Web AI clients (Claude.ai, v0, Replit) can design in Figma via cloud pairing
|
|
25
29
|
- **🔄 Four ways to connect** - Remote SSE, Cloud Mode, NPX, or Local Git
|
|
26
30
|
|
|
@@ -51,9 +55,9 @@ Figma Console MCP connects AI assistants (like Claude) to Figma, enabling:
|
|
|
51
55
|
| Real-time monitoring (console, selection) | ✅ | ❌ | ❌ |
|
|
52
56
|
| Desktop Bridge plugin | ✅ | ✅ | ❌ |
|
|
53
57
|
| Requires Node.js | Yes | **No** | No |
|
|
54
|
-
| **Total tools available** | **
|
|
58
|
+
| **Total tools available** | **103** | **93** | **9** |
|
|
55
59
|
|
|
56
|
-
> **Bottom line:** Remote SSE is **read-only** with ~38% of the tools. **Cloud Mode** unlocks write access from web AI clients without Node.js. NPX/Local Git gives the full
|
|
60
|
+
> **Bottom line:** Remote SSE is **read-only** with ~38% of the tools. **Cloud Mode** unlocks write access from web AI clients without Node.js. NPX/Local Git gives the full 103 tools with real-time monitoring.
|
|
57
61
|
|
|
58
62
|
---
|
|
59
63
|
|
|
@@ -61,7 +65,7 @@ Figma Console MCP connects AI assistants (like Claude) to Figma, enabling:
|
|
|
61
65
|
|
|
62
66
|
**Best for:** Designers who want full AI-assisted design capabilities.
|
|
63
67
|
|
|
64
|
-
**What you get:** All
|
|
68
|
+
**What you get:** All 103 tools including design creation, variable management, and component instantiation.
|
|
65
69
|
|
|
66
70
|
#### Prerequisites
|
|
67
71
|
|
|
@@ -126,11 +130,13 @@ If you're not sure where to put the JSON configuration above, here's where each
|
|
|
126
130
|
1. Open Figma Desktop normally (no special flags needed) and open a file
|
|
127
131
|
2. Go to **Plugins → Development → Import plugin from manifest...**
|
|
128
132
|
3. Select `~/.figma-console-mcp/plugin/manifest.json` (stable path, auto-created by the MCP server)
|
|
129
|
-
4. Run the plugin in your Figma file —
|
|
133
|
+
4. Run the plugin in your Figma file — it scans ports 9223–9232 and connects automatically to your running MCP server
|
|
130
134
|
|
|
131
|
-
>
|
|
132
|
-
|
|
133
|
-
> **
|
|
135
|
+
> **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.
|
|
136
|
+
>
|
|
137
|
+
> **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).
|
|
138
|
+
>
|
|
139
|
+
> 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.
|
|
134
140
|
|
|
135
141
|
#### Step 4: Restart Your MCP Client
|
|
136
142
|
|
|
@@ -156,7 +162,7 @@ Create a simple frame with a blue background
|
|
|
156
162
|
|
|
157
163
|
**Best for:** Developers who want to modify source code or contribute to the project.
|
|
158
164
|
|
|
159
|
-
**What you get:** Same
|
|
165
|
+
**What you get:** Same 103 tools as NPX, plus full source code access.
|
|
160
166
|
|
|
161
167
|
#### Quick Setup
|
|
162
168
|
|
|
@@ -245,7 +251,7 @@ Ready for design creation? Follow the [NPX Setup](#-npx-setup-recommended) guide
|
|
|
245
251
|
|
|
246
252
|
**Best for:** Using Claude.ai, v0, Replit, or Lovable to create and modify Figma designs — no Node.js required.
|
|
247
253
|
|
|
248
|
-
**What you get:**
|
|
254
|
+
**What you get:** 95 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.
|
|
249
255
|
|
|
250
256
|
#### Prerequisites
|
|
251
257
|
|
|
@@ -302,7 +308,7 @@ AI Client → Cloud MCP Server → Durable Object Relay → Desktop Bridge Plugi
|
|
|
302
308
|
| Feature | NPX (Recommended) | Cloud Mode | Local Git | Remote SSE |
|
|
303
309
|
|---------|-------------------|------------|-----------|------------|
|
|
304
310
|
| **Setup time** | ~10 minutes | ~5 minutes | ~15 minutes | ~2 minutes |
|
|
305
|
-
| **Total tools** | **
|
|
311
|
+
| **Total tools** | **103** | **93** | **103** | **9** (read-only) |
|
|
306
312
|
| **Design creation** | ✅ | ✅ | ✅ | ❌ |
|
|
307
313
|
| **Variable management** | ✅ | ✅ | ✅ | ❌ |
|
|
308
314
|
| **Component instantiation** | ✅ | ✅ | ✅ | ❌ |
|
|
@@ -317,7 +323,7 @@ AI Client → Cloud MCP Server → Durable Object Relay → Desktop Bridge Plugi
|
|
|
317
323
|
| **Automatic updates** | ✅ (`@latest`) | ✅ | Manual (`git pull`) | ✅ |
|
|
318
324
|
| **Source code access** | ❌ | ❌ | ✅ | ❌ |
|
|
319
325
|
|
|
320
|
-
> **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
|
|
326
|
+
> **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 103 tools.
|
|
321
327
|
|
|
322
328
|
**📖 [Complete Feature Comparison](docs/mode-comparison.md)**
|
|
323
329
|
|
|
@@ -370,9 +376,11 @@ When you first use design system tools:
|
|
|
370
376
|
|
|
371
377
|
## 🛠️ Available Tools
|
|
372
378
|
|
|
373
|
-
###
|
|
374
|
-
- `
|
|
375
|
-
- `
|
|
379
|
+
### Status & Diagnostics
|
|
380
|
+
- `figma_get_status` - Check WebSocket bridge connection and file context
|
|
381
|
+
- `figma_diagnose` - Designer-readable health check + setup guidance
|
|
382
|
+
- `figma_reconnect` - Force reconnect to the Desktop Bridge plugin
|
|
383
|
+
- `figma_navigate` - Switch the active file target among connected plugins (Local), or navigate the cloud headless browser (Remote/Cloud)
|
|
376
384
|
|
|
377
385
|
### Console Debugging
|
|
378
386
|
- `figma_get_console_logs` - Retrieve console logs
|
|
@@ -417,6 +425,10 @@ When you first use design system tools:
|
|
|
417
425
|
- `figma_check_design_parity` - Compare Figma component specs against code implementation, producing a scored diff report with actionable fix items
|
|
418
426
|
- `figma_generate_component_doc` - Generate platform-agnostic markdown documentation by merging Figma design data with code-side info
|
|
419
427
|
|
|
428
|
+
### 🔁 Token Sync (Local Mode + Cloud Mode)
|
|
429
|
+
- `figma_export_tokens` - **Export Figma variables to design token files in your codebase.** Canonical DTCG JSON + CSS custom properties out of the box. Diff-aware merge against existing source files (only writes what changed). `tokens.config.json` autodiscovery means zero-arg calls after first setup. Replaces Style Dictionary and Tokens Studio's export pipeline for popular styling methods.
|
|
430
|
+
- `figma_import_tokens` - **Push code-side token edits back to Figma.** Diff against current Figma state, apply only the deltas. Round-trip safe — Figma variable IDs preserved in DTCG `$extensions["figma-console-mcp"]` so renames on either side don't create duplicates. Dry-run default for safety. In Cloud Mode, pass tokens inline via `payload` or `files` (no local filesystem access).
|
|
431
|
+
|
|
420
432
|
### 🔧 Variable Management (Local Mode + Cloud Mode)
|
|
421
433
|
- `figma_create_variable_collection` - Create new variable collections with modes
|
|
422
434
|
- `figma_create_variable` - Create COLOR, FLOAT, STRING, or BOOLEAN variables
|
|
@@ -651,7 +663,7 @@ The **Figma Desktop Bridge** plugin is the recommended way to connect Figma to t
|
|
|
651
663
|
- The MCP server communicates via **WebSocket** through the Desktop Bridge plugin
|
|
652
664
|
- The server tries port 9223 first, then automatically falls back through ports 9224–9232 if needed
|
|
653
665
|
- The plugin scans all ports in the range and connects to every active server it finds
|
|
654
|
-
- All
|
|
666
|
+
- All 103 tools work through the WebSocket transport
|
|
655
667
|
|
|
656
668
|
**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).
|
|
657
669
|
|
|
@@ -693,9 +705,11 @@ When two processes tried to start the MCP server (e.g., Claude Desktop's Chat ta
|
|
|
693
705
|
|
|
694
706
|
**Nothing.** Multi-instance support is fully automatic:
|
|
695
707
|
- Each MCP server claims the next available port in the range
|
|
696
|
-
- The
|
|
708
|
+
- The Desktop Bridge plugin scans all ports and connects to every active server
|
|
697
709
|
- Orphaned processes from closed tabs are automatically cleaned up on startup
|
|
698
|
-
- No
|
|
710
|
+
- No manual port management — the plugin already scans the whole range
|
|
711
|
+
|
|
712
|
+
(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.)
|
|
699
713
|
|
|
700
714
|
---
|
|
701
715
|
|
|
@@ -788,27 +802,29 @@ The architecture supports adding new apps with minimal boilerplate — each app
|
|
|
788
802
|
|
|
789
803
|
## 🛤️ Roadmap
|
|
790
804
|
|
|
791
|
-
**Current Status:** v1.
|
|
805
|
+
**Current Status:** v1.27.1 (Stable) - Production-ready with 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, **103 tools** (Local) / **95 tools** (Cloud) / **9 tools** (Remote read-only), Comments API, cross-MCP identity disambiguation, and MCP Apps.
|
|
792
806
|
|
|
793
807
|
**Recent Releases:**
|
|
794
|
-
- [x] **v1.
|
|
795
|
-
- [x] **v1.
|
|
796
|
-
- [x] **v1.
|
|
797
|
-
- [x] **v1.
|
|
798
|
-
- [x] **v1.
|
|
799
|
-
- [x] **v1.
|
|
800
|
-
- [x] **v1.
|
|
801
|
-
- [x] **v1.
|
|
802
|
-
- [x] **v1.
|
|
803
|
-
- [x] **v1.
|
|
804
|
-
- [x] **v1.
|
|
805
|
-
- [x] **v1.
|
|
808
|
+
- [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.
|
|
809
|
+
- [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.
|
|
810
|
+
- [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.
|
|
811
|
+
- [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).
|
|
812
|
+
- [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.
|
|
813
|
+
- [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.
|
|
814
|
+
- [x] **v1.17.0** - Figma Slides support: 15 tools for managing presentations.
|
|
815
|
+
- [x] **v1.16.0** - FigJam support: 9 tools for creating and reading FigJam boards.
|
|
816
|
+
- [x] **v1.12.0** - Cloud Write Relay: web AI clients can create and modify Figma designs without Node.js.
|
|
817
|
+
- [x] **v1.11.0** - Complete CDP removal, improved multi-file active tracking with focus detection.
|
|
818
|
+
- [x] **v1.10.0** - Multi-instance support (dynamic port fallback 9223–9232, multi-connection plugin, instance discovery).
|
|
819
|
+
- [x] **v1.9.0** - Figma Comments tools, improved port conflict detection.
|
|
820
|
+
- [x] **v1.8.0** - WebSocket Bridge transport (CDP-free connectivity), real-time selection/document tracking.
|
|
821
|
+
- [x] **v1.7.0** - MCP Apps (Token Browser, Design System Dashboard), batch variable operations, design-code parity tools.
|
|
806
822
|
|
|
807
823
|
**Coming Next:**
|
|
824
|
+
- [ ] **Token sync Phase 2** - Tailwind v4 `@theme`, SCSS, TypeScript module, Style Dictionary v3 source format, `toCreate` apply orchestration, `toDelete` for `replace` strategy, cross-library variable resolution via `getVariableByIdAsync`.
|
|
808
825
|
- [ ] **Component template library** - Common UI pattern generation
|
|
809
826
|
- [ ] **Visual regression testing** - Screenshot diff capabilities
|
|
810
827
|
- [ ] **Design linting** - Automated compliance and accessibility checks
|
|
811
|
-
- [ ] **AI enhancements** - Intelligent component suggestions and auto-layout optimization
|
|
812
828
|
|
|
813
829
|
**📖 [Full Roadmap](docs/ROADMAP.md)**
|
|
814
830
|
|
|
@@ -48,10 +48,6 @@ const DEFAULT_CONFIG = {
|
|
|
48
48
|
quality: 90,
|
|
49
49
|
storePath: join(process.env.TMPDIR || '/tmp', 'figma-console-mcp', 'screenshots'),
|
|
50
50
|
},
|
|
51
|
-
local: {
|
|
52
|
-
debugHost: process.env.FIGMA_DEBUG_HOST || 'localhost',
|
|
53
|
-
debugPort: parseInt(process.env.FIGMA_DEBUG_PORT || '9222', 10),
|
|
54
|
-
},
|
|
55
51
|
};
|
|
56
52
|
/**
|
|
57
53
|
* Possible config file locations (checked in order)
|
|
@@ -111,10 +107,6 @@ function mergeConfig(defaults, overrides) {
|
|
|
111
107
|
...defaults.screenshots,
|
|
112
108
|
...(overrides.screenshots || {}),
|
|
113
109
|
},
|
|
114
|
-
local: {
|
|
115
|
-
...defaults.local,
|
|
116
|
-
...(overrides.local || {}),
|
|
117
|
-
},
|
|
118
110
|
};
|
|
119
111
|
}
|
|
120
112
|
/**
|
|
@@ -14,14 +14,14 @@ export class ConsoleMonitor {
|
|
|
14
14
|
constructor(config) {
|
|
15
15
|
this.logs = [];
|
|
16
16
|
this.isMonitoring = false;
|
|
17
|
-
this.page = null; //
|
|
17
|
+
this.page = null; // @cloudflare/puppeteer Page (this class is cloud-mode-only after Phase 3).
|
|
18
18
|
this.workers = new Set();
|
|
19
19
|
this.lastUrl = ''; // Track the last URL to detect real navigations vs hash changes
|
|
20
20
|
this.config = config;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Start monitoring console logs on a page
|
|
24
|
-
* Accepts
|
|
23
|
+
* Start monitoring console logs on a page.
|
|
24
|
+
* Accepts the @cloudflare/puppeteer Page type (cloud mode only).
|
|
25
25
|
*/
|
|
26
26
|
async startMonitoring(page) {
|
|
27
27
|
if (this.isMonitoring && this.page === page) {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* figma_diagnose — a designer-readable health check for figma-console-mcp.
|
|
3
|
+
*
|
|
4
|
+
* This is the one tool to point a confused user at. It self-identifies the
|
|
5
|
+
* server, reports the transport / plugin / token state in plain language,
|
|
6
|
+
* and explicitly disclaims any token or OAuth error a user might be seeing
|
|
7
|
+
* in chat (those typically come from a different MCP). The response is
|
|
8
|
+
* structured so an LLM is likely to surface the `report` field verbatim.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { MCP_NAME, withIdentity } from "./identity.js";
|
|
12
|
+
function buildReport(opts) {
|
|
13
|
+
const lines = [];
|
|
14
|
+
lines.push(`# ${MCP_NAME} diagnostic`);
|
|
15
|
+
lines.push("");
|
|
16
|
+
lines.push(`Server version: ${opts.getServerVersion()}`);
|
|
17
|
+
lines.push(`Mode: ${opts.mode === "local" ? "Local (stdio + WebSocket plugin bridge)" : "Cloud (Cloudflare Workers)"}`);
|
|
18
|
+
lines.push("");
|
|
19
|
+
const plugin = opts.getPluginState?.();
|
|
20
|
+
lines.push("## Plugin connection");
|
|
21
|
+
if (!plugin) {
|
|
22
|
+
lines.push("- No WebSocket server (cloud mode runs without a local plugin bridge unless paired).");
|
|
23
|
+
}
|
|
24
|
+
else if (plugin.connected) {
|
|
25
|
+
const portInfo = plugin.portFallbackFrom && plugin.port && plugin.port !== plugin.portFallbackFrom
|
|
26
|
+
? `port ${plugin.port} (fallback from ${plugin.portFallbackFrom})`
|
|
27
|
+
: plugin.port
|
|
28
|
+
? `port ${plugin.port}`
|
|
29
|
+
: "connected";
|
|
30
|
+
lines.push(`- ✅ Desktop Bridge plugin connected on ${portInfo}.`);
|
|
31
|
+
if (plugin.fileName) {
|
|
32
|
+
lines.push(`- Active file: **${plugin.fileName}**${plugin.currentPage ? ` (page: ${plugin.currentPage})` : ""}.`);
|
|
33
|
+
}
|
|
34
|
+
if (plugin.editorType && plugin.editorType !== "figma") {
|
|
35
|
+
lines.push(`- Editor type: ${plugin.editorType}.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
lines.push(`- ⚠️ Desktop Bridge plugin not connected${plugin.port ? ` (server is listening on port ${plugin.port})` : ""}.`);
|
|
40
|
+
lines.push("- To fix: open the Figma Desktop Bridge plugin in Figma Desktop. If it was already running, close and reopen it once.");
|
|
41
|
+
}
|
|
42
|
+
lines.push("");
|
|
43
|
+
const token = opts.getTokenState?.();
|
|
44
|
+
lines.push("## REST API token");
|
|
45
|
+
if (!token) {
|
|
46
|
+
lines.push("- Token state not available in this mode.");
|
|
47
|
+
}
|
|
48
|
+
else if (token.hasToken) {
|
|
49
|
+
lines.push(`- ✅ Figma access token detected (source: ${token.source ?? "unknown"}). REST-based tools should work.`);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
lines.push("- ⚠️ No Figma access token detected. Plugin-based tools still work; REST-only tools (file data, version history, image rendering) will return an auth error.");
|
|
53
|
+
if (opts.mode === "local") {
|
|
54
|
+
lines.push("- To enable REST tools: set FIGMA_ACCESS_TOKEN in your MCP client config. Generate a token at https://www.figma.com/developers/api#access-tokens.");
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
lines.push("- To enable REST tools: authenticate via your MCP client's OAuth flow or pass a Figma personal access token (figd_...) as a Bearer token.");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
lines.push("");
|
|
61
|
+
lines.push("## If you're seeing token / OAuth errors in chat");
|
|
62
|
+
lines.push(`If you see messages like "API token has expired" or "Bearer token has expired" and the response above does NOT show a token problem, the error is most likely coming from a **different MCP server**, not from ${MCP_NAME}.`);
|
|
63
|
+
lines.push("");
|
|
64
|
+
lines.push("Common cause: Figma's native MCP (often listed as just `Figma` in your MCP client) is also installed and its OAuth session expired. Check your MCP client's server list. Errors from those servers are not produced by figma-console-mcp.");
|
|
65
|
+
lines.push("");
|
|
66
|
+
return lines.join("\n");
|
|
67
|
+
}
|
|
68
|
+
export function registerDiagnoseTool(server, options) {
|
|
69
|
+
server.tool("figma_diagnose", `Designer-readable health check for ${MCP_NAME}. Use this when something seems wrong — it self-identifies the server, reports plugin connection / file / token status in plain language, and disambiguates errors that may be coming from a different Figma-related MCP server. Recommended as the first step when a user reports a "token expired" or "plugin disconnected" issue.`, {
|
|
70
|
+
verbose: z
|
|
71
|
+
.boolean()
|
|
72
|
+
.optional()
|
|
73
|
+
.default(false)
|
|
74
|
+
.describe("Include the raw structured state alongside the human-readable report."),
|
|
75
|
+
}, async ({ verbose }) => {
|
|
76
|
+
const report = buildReport(options);
|
|
77
|
+
const details = verbose
|
|
78
|
+
? {
|
|
79
|
+
plugin: options.getPluginState?.() ?? null,
|
|
80
|
+
token: options.getTokenState?.() ?? null,
|
|
81
|
+
}
|
|
82
|
+
: undefined;
|
|
83
|
+
const payload = withIdentity({
|
|
84
|
+
report,
|
|
85
|
+
...(details ? { details } : {}),
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
content: [
|
|
89
|
+
{
|
|
90
|
+
type: "text",
|
|
91
|
+
text: JSON.stringify(payload),
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
}
|