@muloka/figma-console-mcp 0.2.0 β†’ 0.4.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 (35) hide show
  1. package/README.md +32 -15
  2. package/dist/apps/design-system-dashboard/mcp-app.html +521 -0
  3. package/dist/apps/token-browser/mcp-app.html +410 -0
  4. package/dist/cloudflare/core/figma-tools.js +64 -13
  5. package/dist/cloudflare/core/tokens-tools.js +1 -1
  6. package/dist/cloudflare/core/websocket-server.js +60 -7
  7. package/dist/cloudflare/index.js +3 -3
  8. package/dist/core/port-discovery.d.ts.map +1 -1
  9. package/dist/core/port-discovery.js +101 -20
  10. package/dist/core/port-discovery.js.map +1 -1
  11. package/dist/core/tokens-tools.js +1 -1
  12. package/dist/core/websocket-server.d.ts +41 -2
  13. package/dist/core/websocket-server.d.ts.map +1 -1
  14. package/dist/core/websocket-server.js +103 -9
  15. package/dist/core/websocket-server.js.map +1 -1
  16. package/dist/core/write-tools.d.ts.map +1 -1
  17. package/dist/core/write-tools.js +34 -0
  18. package/dist/core/write-tools.js.map +1 -1
  19. package/dist/local.d.ts.map +1 -1
  20. package/dist/local.js +30 -10
  21. package/dist/local.js.map +1 -1
  22. package/figma-desktop-bridge/ui.html +66 -5
  23. package/package.json +2 -2
  24. package/dist/browser/base.d.ts +0 -58
  25. package/dist/browser/base.d.ts.map +0 -1
  26. package/dist/browser/base.js +0 -6
  27. package/dist/browser/base.js.map +0 -1
  28. package/dist/browser/local.d.ts +0 -87
  29. package/dist/browser/local.d.ts.map +0 -1
  30. package/dist/browser/local.js +0 -318
  31. package/dist/browser/local.js.map +0 -1
  32. package/dist/core/figma-desktop-connector.d.ts +0 -312
  33. package/dist/core/figma-desktop-connector.d.ts.map +0 -1
  34. package/dist/core/figma-desktop-connector.js +0 -1298
  35. package/dist/core/figma-desktop-connector.js.map +0 -1
package/README.md CHANGED
@@ -1,24 +1,40 @@
1
- # Figma Console MCP Server
1
+ # @muloka/figma-console-mcp
2
2
 
3
- > ### 🍴 This is a fork
4
- >
5
- > **`@muloka/figma-console-mcp`** is a fork of [southleft/figma-console-mcp](https://github.com/southleft/figma-console-mcp) with a few agent-focused adjustments not yet in upstream:
6
- >
7
- > - **Streamable HTTP transport** in local mode β€” connect multiple local clients to one running instance ([upstream #48](https://github.com/southleft/figma-console-mcp/issues/48))
8
- > - **`VariableID:` alias support** in `figma_batch_create_variables` and `figma_setup_design_tokens` ([upstream #52](https://github.com/southleft/figma-console-mcp/issues/52))
9
- > - **Bridge robustness** β€” handler timeout + dropped-response logging in the Desktop Bridge dispatch ([upstream #94](https://github.com/southleft/figma-console-mcp/issues/94))
10
- >
11
- > **Install this fork:** `npx @muloka/figma-console-mcp` β€” the `npx figma-console-mcp` commands below install *upstream* instead. Versioned independently starting at `0.1.0`; currently tracking upstream **v1.35.0**. Everything else in this README is upstream's documentation and applies as written.
3
+ > An independently maintained fork of [southleft/figma-console-mcp](https://github.com/southleft/figma-console-mcp).
12
4
 
13
- [![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io/)
14
5
  [![npm](https://img.shields.io/npm/v/@muloka/figma-console-mcp)](https://www.npmjs.com/package/@muloka/figma-console-mcp)
6
+ [![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io/)
15
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
16
- [![Documentation](https://img.shields.io/badge/docs-docs.figma--console--mcp.southleft.com-0D9488)](https://docs.figma-console-mcp.southleft.com)
17
- [![Sponsor](https://img.shields.io/badge/Sponsor-southleft-ea4aaa?logo=github-sponsors&logoColor=white)](https://github.com/sponsors/southleft)
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.
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
14
+ - **Streamable HTTP transport** in local mode β€” connect multiple local clients to one running instance ([upstream #48](https://github.com/southleft/figma-console-mcp/issues/48))
15
+ - **`VariableID:` alias support** in `figma_batch_create_variables` and `figma_setup_design_tokens` ([upstream #52](https://github.com/southleft/figma-console-mcp/issues/52))
16
+ - **Bridge robustness** β€” handler timeout + dropped-response logging in the Desktop Bridge dispatch ([upstream #94](https://github.com/southleft/figma-console-mcp/issues/94))
17
+ - **`page`/`pageSize` honored in `figma_get_variables` `format: "full"`** ([upstream #98](https://github.com/southleft/figma-console-mcp/issues/98))
18
+ - **Plugin + server build versions surfaced** in the Desktop Bridge UI and diagnostics
19
+ - **CI** β€” Node 22/24 test matrix with a per-file typecheck ratchet
20
+
21
+ ## Relationship to upstream
22
+
23
+ - Frozen at the upstream **v1.36.0** base β€” this fork does **not** track upstream releases.
24
+ - 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 and the v1.39.1 plugin-update-banner direction fix).
25
+ - 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.
26
+ - The hosted `*.southleft.com` endpoints referenced in the documentation below are upstream's service, not this fork's.
27
+ - 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)
28
+
29
+ ---
30
+
31
+ # Figma Console MCP Server
32
+
33
+ *Upstream documentation as of the v1.36.0 base β€” applies as written.*
18
34
 
19
35
  > **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**.
20
36
 
21
- > **πŸ†• Figma Slots Support (v1.35.0):** Create, inspect, populate, and reset Figma Slots (GA at Config 2026) programmatically β€” `figma_create_slot` adds slots to components (variants included), `figma_append_to_slot` populates instance slots with cloned or new content, plus `figma_get_slots`, `figma_reset_slot`, and `figma_add_slot_property`. Live-validated against the GA Plugin API; closes the most-requested issue [#29](https://github.com/southleft/figma-console-mcp/issues/29), based on community PR [#77](https://github.com/southleft/figma-console-mcp/pull/77). **Plugin re-import required** (`code.js` + `ui.html` changed). [See what's new β†’](CHANGELOG.md#1350---2026-07-09)
37
+ > **πŸ†• 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)
22
38
 
23
39
  ## What is this?
24
40
 
@@ -829,9 +845,10 @@ The architecture supports adding new apps with minimal boilerplate β€” each app
829
845
 
830
846
  ## πŸ›€οΈ Roadmap
831
847
 
832
- **Current Status:** v1.35.0 (Stable) - Production-ready. Latest: 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.
848
+ **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.
833
849
 
834
850
  **Recent Releases:**
851
+ - [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.
835
852
  - [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).
836
853
  - [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.
837
854
  - [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).