@muloka/figma-console-mcp 0.6.4 → 0.6.6

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 (108) hide show
  1. package/README.md +18 -6
  2. package/dist/apps/design-system-dashboard/mcp-app.html +20 -20
  3. package/dist/apps/design-system-dashboard/scoring/accessibility.d.ts.map +1 -1
  4. package/dist/apps/design-system-dashboard/scoring/accessibility.js +2 -1
  5. package/dist/apps/design-system-dashboard/scoring/accessibility.js.map +1 -1
  6. package/dist/apps/design-system-dashboard/scoring/coverage.d.ts.map +1 -1
  7. package/dist/apps/design-system-dashboard/scoring/coverage.js +2 -1
  8. package/dist/apps/design-system-dashboard/scoring/coverage.js.map +1 -1
  9. package/dist/apps/design-system-dashboard/scoring/token-architecture.d.ts.map +1 -1
  10. package/dist/apps/design-system-dashboard/scoring/token-architecture.js +2 -1
  11. package/dist/apps/design-system-dashboard/scoring/token-architecture.js.map +1 -1
  12. package/dist/apps/design-system-dashboard/server.d.ts.map +1 -1
  13. package/dist/apps/design-system-dashboard/server.js +2 -1
  14. package/dist/apps/design-system-dashboard/server.js.map +1 -1
  15. package/dist/core/annotation-tools.d.ts.map +1 -1
  16. package/dist/core/annotation-tools.js +7 -6
  17. package/dist/core/annotation-tools.js.map +1 -1
  18. package/dist/core/cache-invalidation.d.ts +18 -2
  19. package/dist/core/cache-invalidation.d.ts.map +1 -1
  20. package/dist/core/cache-invalidation.js +51 -0
  21. package/dist/core/cache-invalidation.js.map +1 -1
  22. package/dist/core/call-context.d.ts +13 -0
  23. package/dist/core/call-context.d.ts.map +1 -0
  24. package/dist/core/call-context.js +20 -0
  25. package/dist/core/call-context.js.map +1 -0
  26. package/dist/core/comment-tools.d.ts.map +1 -1
  27. package/dist/core/comment-tools.js +4 -3
  28. package/dist/core/comment-tools.js.map +1 -1
  29. package/dist/core/deep-component-tools.d.ts.map +1 -1
  30. package/dist/core/deep-component-tools.js +5 -4
  31. package/dist/core/deep-component-tools.js.map +1 -1
  32. package/dist/core/design-code-tools.d.ts.map +1 -1
  33. package/dist/core/design-code-tools.js +4 -3
  34. package/dist/core/design-code-tools.js.map +1 -1
  35. package/dist/core/design-system-manifest.d.ts +7 -3
  36. package/dist/core/design-system-manifest.d.ts.map +1 -1
  37. package/dist/core/design-system-manifest.js +14 -5
  38. package/dist/core/design-system-manifest.js.map +1 -1
  39. package/dist/core/design-system-tools.d.ts.map +1 -1
  40. package/dist/core/design-system-tools.js +2 -1
  41. package/dist/core/design-system-tools.js.map +1 -1
  42. package/dist/core/diagnose-tool.d.ts +2 -0
  43. package/dist/core/diagnose-tool.d.ts.map +1 -1
  44. package/dist/core/diagnose-tool.js +6 -5
  45. package/dist/core/diagnose-tool.js.map +1 -1
  46. package/dist/core/figjam-tools.d.ts.map +1 -1
  47. package/dist/core/figjam-tools.js +5 -4
  48. package/dist/core/figjam-tools.js.map +1 -1
  49. package/dist/core/figma-api.d.ts +12 -0
  50. package/dist/core/figma-api.d.ts.map +1 -1
  51. package/dist/core/figma-api.js +17 -1
  52. package/dist/core/figma-api.js.map +1 -1
  53. package/dist/core/figma-tools.d.ts.map +1 -1
  54. package/dist/core/figma-tools.js +42 -53
  55. package/dist/core/figma-tools.js.map +1 -1
  56. package/dist/core/library-tools.d.ts.map +1 -1
  57. package/dist/core/library-tools.js +7 -6
  58. package/dist/core/library-tools.js.map +1 -1
  59. package/dist/core/logger.d.ts +11 -0
  60. package/dist/core/logger.d.ts.map +1 -1
  61. package/dist/core/logger.js +13 -1
  62. package/dist/core/logger.js.map +1 -1
  63. package/dist/core/plugin-import-dir.d.ts +9 -0
  64. package/dist/core/plugin-import-dir.d.ts.map +1 -0
  65. package/dist/core/plugin-import-dir.js +47 -0
  66. package/dist/core/plugin-import-dir.js.map +1 -0
  67. package/dist/core/plugin-name.d.ts +26 -0
  68. package/dist/core/plugin-name.d.ts.map +1 -0
  69. package/dist/core/plugin-name.js +35 -0
  70. package/dist/core/plugin-name.js.map +1 -0
  71. package/dist/core/port-discovery.d.ts +2 -2
  72. package/dist/core/port-discovery.d.ts.map +1 -1
  73. package/dist/core/port-discovery.js +8 -6
  74. package/dist/core/port-discovery.js.map +1 -1
  75. package/dist/core/slides-tools.d.ts.map +1 -1
  76. package/dist/core/slides-tools.js +2 -1
  77. package/dist/core/slides-tools.js.map +1 -1
  78. package/dist/core/slot-tools.d.ts.map +1 -1
  79. package/dist/core/slot-tools.js +3 -2
  80. package/dist/core/slot-tools.js.map +1 -1
  81. package/dist/core/tokens/schemas.d.ts +1 -1
  82. package/dist/core/tokens-tools.d.ts.map +1 -1
  83. package/dist/core/tokens-tools.js +2 -1
  84. package/dist/core/tokens-tools.js.map +1 -1
  85. package/dist/core/variable-resolver.d.ts.map +1 -1
  86. package/dist/core/variable-resolver.js +3 -2
  87. package/dist/core/variable-resolver.js.map +1 -1
  88. package/dist/core/version-tools.d.ts.map +1 -1
  89. package/dist/core/version-tools.js +9 -8
  90. package/dist/core/version-tools.js.map +1 -1
  91. package/dist/core/websocket-connector.d.ts.map +1 -1
  92. package/dist/core/websocket-connector.js +3 -2
  93. package/dist/core/websocket-connector.js.map +1 -1
  94. package/dist/core/websocket-server.d.ts.map +1 -1
  95. package/dist/core/websocket-server.js +8 -5
  96. package/dist/core/websocket-server.js.map +1 -1
  97. package/dist/core/write-tools.d.ts.map +1 -1
  98. package/dist/core/write-tools.js +283 -232
  99. package/dist/core/write-tools.js.map +1 -1
  100. package/dist/local.d.ts +1 -1
  101. package/dist/local.d.ts.map +1 -1
  102. package/dist/local.js +114 -190
  103. package/dist/local.js.map +1 -1
  104. package/figma-desktop-bridge/README.md +15 -63
  105. package/figma-desktop-bridge/code.js +31 -29
  106. package/figma-desktop-bridge/manifest.json +5 -9
  107. package/figma-desktop-bridge/ui.html +768 -924
  108. package/package.json +1 -1
package/README.md CHANGED
@@ -52,9 +52,9 @@ claude mcp add figma-console -s user -e FIGMA_ACCESS_TOKEN=figd_YOUR_TOKEN -- np
52
52
 
53
53
  Restart the client afterwards.
54
54
 
55
- ### 3. Import the Desktop Bridge plugin
55
+ ### 3. Import the plugin
56
56
 
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:
57
+ The plugin is called **Toko Relay** in Figma's menus. The server keeps it in its own folder, `~/.figma-console-mcp/toko-relay/`, and refreshes the files on every start. To print the exact path of its `manifest.json`:
58
58
 
59
59
  ```bash
60
60
  npx @muloka/figma-console-mcp --print-path
@@ -62,7 +62,9 @@ npx @muloka/figma-console-mcp --print-path
62
62
 
63
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.
64
64
 
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.
65
+ Run it from **Plugins → Development → Toko Relay** 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.
66
+
67
+ **Already using Figma Desktop Bridge?** From 0.6.6 the plugin has its own name and plugin ID, so Figma treats it as a new plugin rather than an update. Import the new folder's `manifest.json` as above, not the old `~/.figma-console-mcp/plugin/` one, then remove the old entry: **Plugins → Development → Manage plugins in development**. Until you switch, the old plugin keeps working and shows an update notice.
66
68
 
67
69
  ### When to re-import the plugin
68
70
 
@@ -71,9 +73,9 @@ Figma caches plugin files (`code.js`, `ui.html`) and keeps using its cached copy
71
73
  - **Re-import when a release says `figma-desktop-bridge/` changed.** Otherwise the new server stays compatible with the plugin you have.
72
74
  - **The server tells you when a re-import is needed (from 0.6.1).**
73
75
  - The plugin's `PLUGIN_VERSION` tracks the upstream lineage it was vendored from (currently 1.35.0), so it never changes for this fork's own plugin edits.
74
- - The plugin therefore also reports a fork revision. When yours is older than the one the server ships, `figma_get_status` and `figma_diagnose` report `pluginUpdateAvailable`, and the plugin shows its update banner.
76
+ - The plugin therefore also reports a fork revision. When yours is older than the one the server ships, `figma_get_status` and `figma_diagnose` report `pluginUpdateAvailable`, and the plugin window shows **Plugin update available**.
75
77
  - Plugins imported before 0.6.1 don't report a revision, so they're flagged once; re-importing clears it.
76
- - To re-import: **Plugins → Manage plugins**, then import the same `manifest.json` again.
78
+ - To re-import: **Plugins → Development → Import plugin from manifest…**, then choose the same `manifest.json` again.
77
79
 
78
80
  ---
79
81
 
@@ -166,13 +168,23 @@ With `ENABLE_MCP_APPS=true`, hosts that support [MCP Apps](https://github.com/mo
166
168
  - **Safe concurrent reads (0.6.3)** — clients such as Claude Code run read-only tools in parallel. Concurrent variable reads of one file now share a single plugin read, and a read that a write overtakes is returned but never cached, so a later read can't pick up pre-write data. `figma_import_tokens` and `figma_import_library_variable` now clear the variable cache after writing, like the other variable writes. `figma_execute` clears it after every run, failed or not, because a script can change variables without Figma reporting it. The next design-system summary or component search then rebuilds too.
167
169
  - **Exit when stdin closes (0.6.3)** — a server without `MCP_HTTP_PORT` shuts down when its client closes stdin: it stops the bridge, removes its port file and exits 0, instead of running on and holding its port. With `MCP_HTTP_PORT` serving, it keeps running, as before.
168
170
  - **Library variable tools (0.6.3)** — `figma_get_library_variables` lists the file's subscribed library collections; it used to return none. `figma_import_library_variable` reports a failed import as an error, and on success returns the imported variable with its id.
169
- - **Per-file caching (0.6.4)** — an edit or a plugin disconnect in one file clears only that file's cached variables and design-system data, and ends only that file's shared plugin reads. Before, an edit in any open file also stopped in-flight reads of every other open file from being cached. A variable write, or any `figma_execute` run, still clears everything.
171
+ - **Per-file caching (0.6.4)** — an edit or a plugin disconnect in one file clears only that file's cached variables and design-system data, and ends only that file's shared plugin reads. Before, an edit in any open file also stopped in-flight reads of every other open file from being cached.
170
172
  - **One design-system build per file (0.6.4)** — `figma_get_design_system_summary`, `figma_search_components`, `figma_get_component_details` and `figma_get_token_values` share one build of the file's design-system data. The build reads components and variables from the file it started for, even if the active file changes while it runs, and a build that an edit overtakes is returned but not cached. Concurrent builds of one file share a single component scan.
171
173
  - **Arranging a component set touches only that set (0.6.4)** — `figma_arrange_component_set`, and `figma_create_component_set` with `autoArrange`, no longer delete other component sets' containers on the same page.
172
174
  - A re-run replaces the container a previous run built around this set, and only when that container holds nothing but the previous arrangement. If it holds anything else (another component, an instance, a note), it is kept and the new container goes beside it.
173
175
  - The new container is built before the old one is removed, so a font that fails to load changes nothing.
174
176
  - A set on another page is arranged on its own page, and your current page, selection and view stay put.
175
177
  - The result reports `removedContainerId`, `keptContainer`, and `setPage` for a set that isn't on the current page. `figma_create_component_set` never removes a container.
178
+ - **Writes clear their own file's caches right away (0.6.5)** — every tool that can change a file (creates, updates, deletes, `figma_execute`, token imports) clears that file's cached variables and design-system data as soon as the call finishes, whether it succeeded, failed or threw. Before, a node write such as creating a component left `figma_get_design_system_summary` and `figma_search_components` answering from pre-write data until Figma's edit event arrived, which can take about a minute when Figma is in the background.
179
+ - Only the files the call sent commands to are cleared. A write to one file, whether by `fileKey` or to the active file, leaves every other open file's caches warm. Variable writes and `figma_execute` used to clear every file; they now clear only their own as well.
180
+ - Read-only tools clear nothing, and neither does a write rejected before it reaches Figma.
181
+ - Edits you make by hand in Figma still wait for the edit event, as before.
182
+ - **Fetch warnings in every design-system tool (0.6.5)** — when the plugin's component scan or variable read fails, `figma_get_component_details` and `figma_get_token_values` now say so in a `warnings` list, as `figma_get_design_system_summary` and `figma_search_components` already did. Before, they answered from the partial data without a word, so a failed component scan read as "component not found".
183
+ - **The plugin's own name and folder (0.6.6)** — the plugin is **Toko Relay**, with its own plugin ID, so Figma lists it apart from upstream's Figma Desktop Bridge. The server copies it to `~/.figma-console-mcp/toko-relay/` and no longer writes `~/.figma-console-mcp/plugin/`. While people switch, messages that send you to the plugin give both names, and an older plugin gets the steps: import the new folder, then remove the old entry (see [step 3](#3-import-the-plugin)).
184
+ - **No cloud pairing (0.6.6)** — the plugin no longer carries upstream's cloud pairing, and its manifest allows network access to localhost only.
185
+ - **A quieter plugin window (0.6.6)** — two short status lines, with Pause or Resume, Activity and Minimize on one row underneath. It reads "Ready" until your AI acts, then the time and the last action; a failed action turns that line red. Minimize shrinks the window to one row at the same width, and the plugin remembers that across files and restarts. The plugin and server versions are at the top of the open activity log.
186
+ - **Logged errors keep their details (0.6.6)** — an error the server logs keeps its message and stack trace. Before, many came out as `{}`.
187
+ - **The arranger cleans up after a failure (0.6.6)** — when `figma_arrange_component_set` fails before the set moves into its new container, it removes the layers it created in that run. Once the set has moved it removes nothing, and a layer it couldn't remove is reported.
176
188
  - **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`).
177
189
  - **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).
178
190
  - **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.