@muloka/figma-console-mcp 0.5.4 → 0.5.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 (109) hide show
  1. package/README.md +5 -4
  2. package/dist/apps/design-system-dashboard/mcp-app.html +26 -26
  3. package/dist/apps/token-browser/mcp-app.html +34 -34
  4. package/dist/core/http-request-guard.d.ts.map +1 -1
  5. package/dist/core/http-request-guard.js +12 -14
  6. package/dist/core/http-request-guard.js.map +1 -1
  7. package/dist/core/port-discovery.d.ts.map +1 -1
  8. package/dist/core/port-discovery.js +151 -52
  9. package/dist/core/port-discovery.js.map +1 -1
  10. package/dist/core/websocket-server.d.ts.map +1 -1
  11. package/dist/core/websocket-server.js +9 -1
  12. package/dist/core/websocket-server.js.map +1 -1
  13. package/dist/core/write-tools.d.ts +5 -1
  14. package/dist/core/write-tools.d.ts.map +1 -1
  15. package/dist/core/write-tools.js +113 -83
  16. package/dist/core/write-tools.js.map +1 -1
  17. package/dist/local.d.ts.map +1 -1
  18. package/dist/local.js +9 -2
  19. package/dist/local.js.map +1 -1
  20. package/figma-desktop-bridge/code.js +10 -2
  21. package/figma-desktop-bridge/ui.html +82 -8
  22. package/package.json +1 -1
  23. package/dist/cloudflare/apps/design-system-dashboard/scoring/accessibility.js +0 -277
  24. package/dist/cloudflare/apps/design-system-dashboard/scoring/component-metadata.js +0 -357
  25. package/dist/cloudflare/apps/design-system-dashboard/scoring/consistency.js +0 -341
  26. package/dist/cloudflare/apps/design-system-dashboard/scoring/coverage.js +0 -230
  27. package/dist/cloudflare/apps/design-system-dashboard/scoring/engine.js +0 -92
  28. package/dist/cloudflare/apps/design-system-dashboard/scoring/naming-semantics.js +0 -308
  29. package/dist/cloudflare/apps/design-system-dashboard/scoring/token-architecture.js +0 -349
  30. package/dist/cloudflare/apps/design-system-dashboard/scoring/types.js +0 -40
  31. package/dist/cloudflare/apps/design-system-dashboard/server.js +0 -159
  32. package/dist/cloudflare/apps/token-browser/server.js +0 -136
  33. package/dist/cloudflare/browser-manager.js +0 -157
  34. package/dist/cloudflare/core/accessibility-tools.js +0 -361
  35. package/dist/cloudflare/core/annotation-tools.js +0 -230
  36. package/dist/cloudflare/core/cloud-websocket-connector.js +0 -419
  37. package/dist/cloudflare/core/cloud-websocket-relay.js +0 -198
  38. package/dist/cloudflare/core/comment-tools.js +0 -292
  39. package/dist/cloudflare/core/config.js +0 -153
  40. package/dist/cloudflare/core/console-monitor.js +0 -427
  41. package/dist/cloudflare/core/deep-component-tools.js +0 -128
  42. package/dist/cloudflare/core/design-code-tools.js +0 -2793
  43. package/dist/cloudflare/core/design-system-manifest.js +0 -265
  44. package/dist/cloudflare/core/design-system-tools.js +0 -882
  45. package/dist/cloudflare/core/diagnose-tool.js +0 -100
  46. package/dist/cloudflare/core/diff/changelog-formatter.js +0 -275
  47. package/dist/cloudflare/core/diff/diff-engine.js +0 -334
  48. package/dist/cloudflare/core/diff/property-compare.js +0 -36
  49. package/dist/cloudflare/core/diff/version-cache.js +0 -74
  50. package/dist/cloudflare/core/enrichment/enrichment-service.js +0 -374
  51. package/dist/cloudflare/core/enrichment/index.js +0 -7
  52. package/dist/cloudflare/core/enrichment/relationship-mapper.js +0 -351
  53. package/dist/cloudflare/core/enrichment/style-resolver.js +0 -346
  54. package/dist/cloudflare/core/figjam-tools.js +0 -547
  55. package/dist/cloudflare/core/figma-api.js +0 -509
  56. package/dist/cloudflare/core/figma-connector.js +0 -7
  57. package/dist/cloudflare/core/figma-reconstruction-spec.js +0 -402
  58. package/dist/cloudflare/core/figma-style-extractor.js +0 -311
  59. package/dist/cloudflare/core/figma-tools.js +0 -3353
  60. package/dist/cloudflare/core/identity.js +0 -96
  61. package/dist/cloudflare/core/library-tools.js +0 -580
  62. package/dist/cloudflare/core/logger.js +0 -53
  63. package/dist/cloudflare/core/port-discovery.js +0 -935
  64. package/dist/cloudflare/core/resolve-package-root.js +0 -11
  65. package/dist/cloudflare/core/slides-tools.js +0 -714
  66. package/dist/cloudflare/core/slot-tools.js +0 -334
  67. package/dist/cloudflare/core/snippet-injector.js +0 -96
  68. package/dist/cloudflare/core/tokens/alias-resolver.js +0 -205
  69. package/dist/cloudflare/core/tokens/config.js +0 -294
  70. package/dist/cloudflare/core/tokens/dialect.js +0 -232
  71. package/dist/cloudflare/core/tokens/figma-converter.js +0 -323
  72. package/dist/cloudflare/core/tokens/formatters/css-vars.js +0 -338
  73. package/dist/cloudflare/core/tokens/formatters/dtcg.js +0 -376
  74. package/dist/cloudflare/core/tokens/formatters/index.js +0 -45
  75. package/dist/cloudflare/core/tokens/formatters/json.js +0 -205
  76. package/dist/cloudflare/core/tokens/formatters/less.js +0 -4
  77. package/dist/cloudflare/core/tokens/formatters/scss.js +0 -258
  78. package/dist/cloudflare/core/tokens/formatters/stubs.js +0 -13
  79. package/dist/cloudflare/core/tokens/formatters/style-dictionary-v3.js +0 -213
  80. package/dist/cloudflare/core/tokens/formatters/tailwind-v3.js +0 -237
  81. package/dist/cloudflare/core/tokens/formatters/tailwind-v4.js +0 -335
  82. package/dist/cloudflare/core/tokens/formatters/tokens-studio.js +0 -256
  83. package/dist/cloudflare/core/tokens/formatters/ts-module.js +0 -198
  84. package/dist/cloudflare/core/tokens/index.js +0 -16
  85. package/dist/cloudflare/core/tokens/parsers/css-vars.js +0 -4
  86. package/dist/cloudflare/core/tokens/parsers/dtcg.js +0 -280
  87. package/dist/cloudflare/core/tokens/parsers/index.js +0 -138
  88. package/dist/cloudflare/core/tokens/parsers/json.js +0 -7
  89. package/dist/cloudflare/core/tokens/parsers/scss.js +0 -4
  90. package/dist/cloudflare/core/tokens/parsers/stubs.js +0 -20
  91. package/dist/cloudflare/core/tokens/parsers/style-dictionary-v3.js +0 -4
  92. package/dist/cloudflare/core/tokens/parsers/tailwind-v3.js +0 -4
  93. package/dist/cloudflare/core/tokens/parsers/tailwind-v4.js +0 -4
  94. package/dist/cloudflare/core/tokens/parsers/tokens-studio.js +0 -4
  95. package/dist/cloudflare/core/tokens/schemas.js +0 -152
  96. package/dist/cloudflare/core/tokens/transforms/color.js +0 -12
  97. package/dist/cloudflare/core/tokens/transforms/index.js +0 -29
  98. package/dist/cloudflare/core/tokens/transforms/size.js +0 -7
  99. package/dist/cloudflare/core/tokens/types.js +0 -18
  100. package/dist/cloudflare/core/tokens-tools.js +0 -1788
  101. package/dist/cloudflare/core/types/design-code.js +0 -4
  102. package/dist/cloudflare/core/types/enriched.js +0 -5
  103. package/dist/cloudflare/core/types/index.js +0 -4
  104. package/dist/cloudflare/core/variable-resolver.js +0 -85
  105. package/dist/cloudflare/core/version-tools.js +0 -1199
  106. package/dist/cloudflare/core/websocket-connector.js +0 -436
  107. package/dist/cloudflare/core/websocket-server.js +0 -1009
  108. package/dist/cloudflare/core/write-tools.js +0 -2506
  109. package/dist/cloudflare/index.js +0 -3010
package/README.md CHANGED
@@ -14,10 +14,11 @@
14
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
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
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 name a loopback `Host` on that port and carry either no `Origin` (non-browser clients) or a loopback one, so web pages can't reach it through DNS rebinding — anything else gets a 403. 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** — `figma_execute` and the token-sync write tools (`figma_setup_design_tokens`, `figma_batch_create_variables`, `figma_batch_update_variables`, `figma_delete_variable`, `figma_rename_variable`, `figma_rename_node`) 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. 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 only once the Desktop Bridge plugin has been re-imported from v0.5.4 or later; 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)
20
- - **`VariableID:` alias support** in `figma_batch_create_variables` and `figma_setup_design_tokens` ([upstream #52](https://github.com/southleft/figma-console-mcp/issues/52))
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
21
22
  - **`page`/`pageSize` honored in `figma_get_variables` `format: "full"`** ([upstream #98](https://github.com/southleft/figma-console-mcp/issues/98))
22
23
  - **Plugin + server build versions surfaced** in the Desktop Bridge UI and diagnostics
23
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