figma-console-mcp 1.10.1 β 1.11.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.
- package/README.md +15 -23
- package/dist/browser/local.d.ts +3 -2
- package/dist/browser/local.d.ts.map +1 -1
- package/dist/browser/local.js +6 -9
- package/dist/browser/local.js.map +1 -1
- package/dist/cloudflare/core/comment-tools.js +3 -3
- package/dist/cloudflare/core/console-monitor.js +1 -1
- package/dist/cloudflare/core/design-code-tools.js +2 -2
- package/dist/cloudflare/core/figma-connector.js +2 -3
- package/dist/cloudflare/core/figma-desktop-connector.js +3 -2
- package/dist/cloudflare/core/figma-tools.js +22 -22
- package/dist/cloudflare/core/websocket-connector.js +1 -1
- package/dist/cloudflare/core/websocket-server.js +4 -5
- package/dist/core/comment-tools.js +3 -3
- package/dist/core/comment-tools.js.map +1 -1
- package/dist/core/console-monitor.d.ts +1 -1
- package/dist/core/console-monitor.js +1 -1
- package/dist/core/design-code-tools.js +2 -2
- package/dist/core/design-code-tools.js.map +1 -1
- package/dist/core/figma-connector.d.ts +2 -3
- package/dist/core/figma-connector.d.ts.map +1 -1
- package/dist/core/figma-connector.js +2 -3
- package/dist/core/figma-connector.js.map +1 -1
- package/dist/core/figma-desktop-connector.d.ts +3 -2
- package/dist/core/figma-desktop-connector.d.ts.map +1 -1
- package/dist/core/figma-desktop-connector.js +3 -2
- package/dist/core/figma-desktop-connector.js.map +1 -1
- package/dist/core/figma-tools.js +22 -22
- package/dist/core/figma-tools.js.map +1 -1
- package/dist/core/websocket-connector.d.ts +1 -1
- package/dist/core/websocket-connector.js +1 -1
- package/dist/core/websocket-server.d.ts.map +1 -1
- package/dist/core/websocket-server.js +4 -5
- package/dist/core/websocket-server.js.map +1 -1
- package/dist/local.d.ts +5 -9
- package/dist/local.d.ts.map +1 -1
- package/dist/local.js +73 -175
- package/dist/local.js.map +1 -1
- package/figma-desktop-bridge/README.md +36 -21
- package/figma-desktop-bridge/code.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
> **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 **debugging**.
|
|
9
9
|
|
|
10
|
-
> **π v1.
|
|
10
|
+
> **π v1.11.0 β CDP Removed, Smarter Multi-File:** All CDP references removed (Figma blocked it). Active file now tracks your focused tab across multiple open projects. [See changelog β](CHANGELOG.md)
|
|
11
11
|
|
|
12
12
|
## What is this?
|
|
13
13
|
|
|
@@ -64,8 +64,8 @@ Figma Console MCP connects AI assistants (like Claude) to Figma, enabling:
|
|
|
64
64
|
|
|
65
65
|
#### Step 1: Get Your Figma Token
|
|
66
66
|
|
|
67
|
-
1. Go to [
|
|
68
|
-
2.
|
|
67
|
+
1. Go to [Manage personal access tokens](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) in Figma Help
|
|
68
|
+
2. Follow the steps to **create a new personal access token**
|
|
69
69
|
3. Enter description: `Figma Console MCP`
|
|
70
70
|
4. **Copy the token** β you won't see it again! (starts with `figd_`)
|
|
71
71
|
|
|
@@ -114,21 +114,14 @@ If you're not sure where to put the JSON configuration above, here's where each
|
|
|
114
114
|
|
|
115
115
|
#### Step 3: Connect to Figma Desktop
|
|
116
116
|
|
|
117
|
-
**
|
|
117
|
+
**Desktop Bridge Plugin:**
|
|
118
118
|
1. Open Figma Desktop normally (no special flags needed)
|
|
119
119
|
2. Go to **Plugins β Development β Import plugin from manifest...**
|
|
120
120
|
3. Select `figma-desktop-bridge/manifest.json` from the figma-console-mcp directory
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
> One-time setup. No need to restart Figma with special flags.
|
|
124
|
-
|
|
125
|
-
**Option B β CDP Debug Mode (Alternative):**
|
|
126
|
-
|
|
127
|
-
Quit Figma completely, then restart with:
|
|
128
|
-
- **macOS:** `open -a "Figma" --args --remote-debugging-port=9222`
|
|
129
|
-
- **Windows:** `cmd /c "%LOCALAPPDATA%\Figma\Figma.exe" --remote-debugging-port=9222`
|
|
121
|
+
- **NPX users:** Run `npx figma-console-mcp@latest --print-path` to find the directory
|
|
122
|
+
4. Run the plugin in your Figma file β it auto-connects via WebSocket (scans ports 9223β9232)
|
|
130
123
|
|
|
131
|
-
|
|
124
|
+
> One-time setup. The plugin persists in your Development plugins list across sessions.
|
|
132
125
|
|
|
133
126
|
#### Step 4: Restart Your MCP Client
|
|
134
127
|
|
|
@@ -139,7 +132,7 @@ Restart your MCP client to load the new configuration.
|
|
|
139
132
|
```
|
|
140
133
|
Check Figma status
|
|
141
134
|
```
|
|
142
|
-
β Should show connection status with active
|
|
135
|
+
β Should show connection status with active WebSocket transport
|
|
143
136
|
|
|
144
137
|
```
|
|
145
138
|
Create a simple frame with a blue background
|
|
@@ -295,7 +288,7 @@ When you first use design system tools:
|
|
|
295
288
|
|
|
296
289
|
### Local Mode - Personal Access Token (Manual)
|
|
297
290
|
|
|
298
|
-
1. Visit https://
|
|
291
|
+
1. Visit https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens
|
|
299
292
|
2. Generate token
|
|
300
293
|
3. Add to MCP config as `FIGMA_ACCESS_TOKEN` environment variable
|
|
301
294
|
|
|
@@ -521,12 +514,10 @@ The **Figma Desktop Bridge** plugin is the recommended way to connect Figma to t
|
|
|
521
514
|
|
|
522
515
|
### How the Transport Works
|
|
523
516
|
|
|
524
|
-
- The MCP server
|
|
525
|
-
-
|
|
526
|
-
- The
|
|
527
|
-
- All 56+ tools work
|
|
528
|
-
|
|
529
|
-
**CDP as fallback:** If you also launch Figma with `--remote-debugging-port=9222`, CDP serves as a fallback transport. CDP captures all page-level console logs while WebSocket captures plugin-context logs. `figma_navigate` requires CDP for browser-level navigation; in WebSocket mode it returns the connected file info with guidance instead.
|
|
517
|
+
- The MCP server communicates via **WebSocket** through the Desktop Bridge plugin
|
|
518
|
+
- The server tries port 9223 first, then automatically falls back through ports 9224β9232 if needed
|
|
519
|
+
- The plugin scans all ports in the range and connects to every active server it finds
|
|
520
|
+
- All 56+ tools work through the WebSocket transport
|
|
530
521
|
|
|
531
522
|
**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).
|
|
532
523
|
|
|
@@ -660,9 +651,10 @@ The architecture supports adding new apps with minimal boilerplate β each app
|
|
|
660
651
|
|
|
661
652
|
## π€οΈ Roadmap
|
|
662
653
|
|
|
663
|
-
**Current Status:** v1.
|
|
654
|
+
**Current Status:** v1.11.0 (Stable) - Production-ready with WebSocket-only connectivity, smart multi-file tracking, 56+ tools, Comments API, and MCP Apps
|
|
664
655
|
|
|
665
656
|
**Recent Releases:**
|
|
657
|
+
- [x] **v1.11.0** - Complete CDP removal, improved multi-file active tracking with focus detection
|
|
666
658
|
- [x] **v1.10.0** - Multi-instance support (dynamic port fallback 9223β9232, multi-connection plugin, instance discovery)
|
|
667
659
|
- [x] **v1.9.0** - Figma Comments tools, improved port conflict detection
|
|
668
660
|
- [x] **v1.8.0** - WebSocket Bridge transport (CDP-free connectivity), real-time selection/document tracking, `figma_get_selection` + `figma_get_design_changes` tools
|
package/dist/browser/local.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Local Browser Manager
|
|
3
|
-
*
|
|
2
|
+
* Local Browser Manager (Legacy)
|
|
3
|
+
* Note: This module is maintained for backwards compatibility but is no longer
|
|
4
|
+
* the primary connection method. Use the WebSocket Desktop Bridge plugin instead.
|
|
4
5
|
*/
|
|
5
6
|
import { type Page } from 'puppeteer-core';
|
|
6
7
|
import type { IBrowserManager, NavigationResult } from './base.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/browser/local.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/browser/local.ts"],"names":[],"mappings":"AAA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CAAC,IAAI,CAAC;CAUvD"}
|
package/dist/browser/local.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Local Browser Manager
|
|
3
|
-
*
|
|
2
|
+
* Local Browser Manager (Legacy)
|
|
3
|
+
* Note: This module is maintained for backwards compatibility but is no longer
|
|
4
|
+
* the primary connection method. Use the WebSocket Desktop Bridge plugin instead.
|
|
4
5
|
*/
|
|
5
6
|
import puppeteer from 'puppeteer-core';
|
|
6
7
|
import { createChildLogger } from '../core/logger.js';
|
|
@@ -43,13 +44,9 @@ export class LocalBrowserManager {
|
|
|
43
44
|
}
|
|
44
45
|
catch (error) {
|
|
45
46
|
logger.error({ error, browserURL }, 'Failed to connect to Figma Desktop');
|
|
46
|
-
throw new Error(`Failed to connect to Figma Desktop
|
|
47
|
-
`
|
|
48
|
-
`
|
|
49
|
-
`2. Figma was launched with: --remote-debugging-port=${debugPort}\n` +
|
|
50
|
-
`3. "Use Developer VM" is enabled in: Plugins β Development β Use Developer VM\n\n` +
|
|
51
|
-
`macOS launch command:\n` +
|
|
52
|
-
` open -a "Figma" --args --remote-debugging-port=${debugPort}\n\n` +
|
|
47
|
+
throw new Error(`Failed to connect to Figma Desktop.\n\n` +
|
|
48
|
+
`Please open the Desktop Bridge plugin in Figma:\n` +
|
|
49
|
+
` Plugins β Development β Figma Desktop Bridge\n\n` +
|
|
53
50
|
`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
54
51
|
}
|
|
55
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/browser/local.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/browser/local.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,SAAsC,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,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IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;YACjC,SAAS,EAAE,cAAc;YACzB,OAAO;SACP,CAAC,CAAC;IACJ,CAAC;CACD"}
|
|
@@ -40,7 +40,7 @@ export function registerCommentTools(server, getFigmaAPI, getCurrentUrl, options
|
|
|
40
40
|
type: "text",
|
|
41
41
|
text: JSON.stringify({
|
|
42
42
|
error: "no_file_url",
|
|
43
|
-
message: "No Figma file URL available. Pass the fileUrl parameter
|
|
43
|
+
message: "No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.",
|
|
44
44
|
}),
|
|
45
45
|
},
|
|
46
46
|
],
|
|
@@ -143,7 +143,7 @@ export function registerCommentTools(server, getFigmaAPI, getCurrentUrl, options
|
|
|
143
143
|
type: "text",
|
|
144
144
|
text: JSON.stringify({
|
|
145
145
|
error: "no_file_url",
|
|
146
|
-
message: "No Figma file URL available. Pass the fileUrl parameter
|
|
146
|
+
message: "No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.",
|
|
147
147
|
}),
|
|
148
148
|
},
|
|
149
149
|
],
|
|
@@ -235,7 +235,7 @@ export function registerCommentTools(server, getFigmaAPI, getCurrentUrl, options
|
|
|
235
235
|
type: "text",
|
|
236
236
|
text: JSON.stringify({
|
|
237
237
|
error: "no_file_url",
|
|
238
|
-
message: "No Figma file URL available. Pass the fileUrl parameter
|
|
238
|
+
message: "No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.",
|
|
239
239
|
}),
|
|
240
240
|
},
|
|
241
241
|
],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Console Monitor
|
|
3
|
-
* Captures and manages console logs from Figma plugins
|
|
3
|
+
* Captures and manages console logs from Figma plugins
|
|
4
4
|
* Monitors both main page console AND Web Worker consoles (where Figma plugins run)
|
|
5
5
|
*/
|
|
6
6
|
import { createChildLogger } from './logger.js';
|
|
@@ -1287,7 +1287,7 @@ export function registerDesignCodeTools(server, getFigmaAPI, getCurrentUrl, vari
|
|
|
1287
1287
|
try {
|
|
1288
1288
|
const url = fileUrl || getCurrentUrl();
|
|
1289
1289
|
if (!url) {
|
|
1290
|
-
throw new Error("No Figma file URL available. Pass the fileUrl parameter
|
|
1290
|
+
throw new Error("No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.");
|
|
1291
1291
|
}
|
|
1292
1292
|
const fileKey = extractFileKey(url);
|
|
1293
1293
|
if (!fileKey) {
|
|
@@ -1474,7 +1474,7 @@ export function registerDesignCodeTools(server, getFigmaAPI, getCurrentUrl, vari
|
|
|
1474
1474
|
try {
|
|
1475
1475
|
const url = fileUrl || getCurrentUrl();
|
|
1476
1476
|
if (!url) {
|
|
1477
|
-
throw new Error("No Figma file URL available. Pass the fileUrl parameter
|
|
1477
|
+
throw new Error("No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.");
|
|
1478
1478
|
}
|
|
1479
1479
|
const fileKey = extractFileKey(url);
|
|
1480
1480
|
if (!fileKey) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Figma Connector Interface
|
|
3
3
|
*
|
|
4
|
-
* Transport abstraction
|
|
5
|
-
*
|
|
6
|
-
* whichever transport is available β WebSocket preferred, CDP fallback.
|
|
4
|
+
* Transport abstraction for the WebSocket Desktop Bridge plugin.
|
|
5
|
+
* Allows getDesktopConnector() to return the active WebSocket transport.
|
|
7
6
|
*/
|
|
8
7
|
export {};
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* to execute code with access to the full Figma Plugin API,
|
|
6
6
|
* including variables without Enterprise access.
|
|
7
7
|
*
|
|
8
|
-
* Uses Puppeteer's Worker API to directly access plugin workers
|
|
9
|
-
*
|
|
8
|
+
* Uses Puppeteer's Worker API to directly access plugin workers.
|
|
9
|
+
* Note: This is a legacy connector maintained for backwards compatibility.
|
|
10
|
+
* The WebSocket Desktop Bridge plugin is the primary connection method.
|
|
10
11
|
*/
|
|
11
12
|
import { logger } from './logger.js';
|
|
12
13
|
export class FigmaDesktopConnector {
|
|
@@ -585,7 +585,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
585
585
|
.string()
|
|
586
586
|
.url()
|
|
587
587
|
.optional()
|
|
588
|
-
.describe("Figma file URL (e.g., https://figma.com/design/abc123). Auto-detected from
|
|
588
|
+
.describe("Figma file URL (e.g., https://figma.com/design/abc123). Auto-detected from WebSocket Desktop Bridge connection. Only required if not connected."),
|
|
589
589
|
depth: z
|
|
590
590
|
.number()
|
|
591
591
|
.min(0)
|
|
@@ -626,7 +626,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
626
626
|
// Use provided URL or current URL from browser
|
|
627
627
|
const url = fileUrl || getCurrentUrl();
|
|
628
628
|
if (!url) {
|
|
629
|
-
throw new Error("No Figma file URL available. Pass the fileUrl parameter
|
|
629
|
+
throw new Error("No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.");
|
|
630
630
|
}
|
|
631
631
|
const fileKey = extractFileKey(url);
|
|
632
632
|
if (!fileKey) {
|
|
@@ -786,7 +786,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
786
786
|
.string()
|
|
787
787
|
.url()
|
|
788
788
|
.optional()
|
|
789
|
-
.describe("Figma file URL (e.g., https://figma.com/design/abc123). Auto-detected from
|
|
789
|
+
.describe("Figma file URL (e.g., https://figma.com/design/abc123). Auto-detected from WebSocket Desktop Bridge connection. Only required if not connected."),
|
|
790
790
|
includePublished: z
|
|
791
791
|
.boolean()
|
|
792
792
|
.optional()
|
|
@@ -896,7 +896,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
896
896
|
type: "text",
|
|
897
897
|
text: JSON.stringify({
|
|
898
898
|
error: "No Figma file URL available",
|
|
899
|
-
message: "Pass the fileUrl parameter
|
|
899
|
+
message: "Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma."
|
|
900
900
|
}),
|
|
901
901
|
},
|
|
902
902
|
],
|
|
@@ -1447,9 +1447,9 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
1447
1447
|
}
|
|
1448
1448
|
}
|
|
1449
1449
|
// FALLBACK: Try Desktop connection (when no token available OR as secondary fallback)
|
|
1450
|
-
// Only call ensureInitialized for
|
|
1450
|
+
// Only call ensureInitialized for legacy path β skip when transport-agnostic connector exists
|
|
1451
1451
|
if (ensureInitialized && !getDesktopConnector && !parseFromConsole && (!hasToken || !restApiSucceeded)) {
|
|
1452
|
-
logger.info("Calling ensureInitialized to initialize browser manager (
|
|
1452
|
+
logger.info("Calling ensureInitialized to initialize browser manager (legacy path)");
|
|
1453
1453
|
await ensureInitialized();
|
|
1454
1454
|
}
|
|
1455
1455
|
const browserManager = getBrowserManager?.();
|
|
@@ -1473,7 +1473,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
1473
1473
|
connector = await getDesktopConnector();
|
|
1474
1474
|
}
|
|
1475
1475
|
else {
|
|
1476
|
-
// Fallback: direct
|
|
1476
|
+
// Fallback: direct connector (legacy path)
|
|
1477
1477
|
const { FigmaDesktopConnector } = await import('./figma-desktop-connector.js');
|
|
1478
1478
|
const page = await browserManager.getPage();
|
|
1479
1479
|
connector = new FigmaDesktopConnector(page);
|
|
@@ -1837,7 +1837,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
1837
1837
|
.string()
|
|
1838
1838
|
.url()
|
|
1839
1839
|
.optional()
|
|
1840
|
-
.describe("Figma file URL (e.g., https://figma.com/design/abc123). Auto-detected from
|
|
1840
|
+
.describe("Figma file URL (e.g., https://figma.com/design/abc123). Auto-detected from WebSocket Desktop Bridge connection. Only required if not connected."),
|
|
1841
1841
|
nodeId: z
|
|
1842
1842
|
.string()
|
|
1843
1843
|
.describe("Component node ID (e.g., '123:456')"),
|
|
@@ -1854,7 +1854,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
1854
1854
|
try {
|
|
1855
1855
|
const url = fileUrl || getCurrentUrl();
|
|
1856
1856
|
if (!url) {
|
|
1857
|
-
throw new Error("No Figma file URL available. Pass the fileUrl parameter
|
|
1857
|
+
throw new Error("No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.");
|
|
1858
1858
|
}
|
|
1859
1859
|
const fileKey = extractFileKey(url);
|
|
1860
1860
|
if (!fileKey) {
|
|
@@ -1870,7 +1870,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
1870
1870
|
connector = await getDesktopConnector();
|
|
1871
1871
|
}
|
|
1872
1872
|
else {
|
|
1873
|
-
// Fallback: direct
|
|
1873
|
+
// Fallback: direct connector (legacy path)
|
|
1874
1874
|
if (ensureInitialized)
|
|
1875
1875
|
await ensureInitialized();
|
|
1876
1876
|
const browserManager = getBrowserManager?.();
|
|
@@ -1978,7 +1978,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
1978
1978
|
`To fix:\n` +
|
|
1979
1979
|
`1. Local mode: Set FIGMA_ACCESS_TOKEN environment variable, OR ensure Figma Desktop Bridge plugin is running\n` +
|
|
1980
1980
|
`2. Cloud mode: Authenticate via OAuth\n` +
|
|
1981
|
-
`3.
|
|
1981
|
+
`3. Ensure the Desktop Bridge plugin is running in Figma Desktop`);
|
|
1982
1982
|
}
|
|
1983
1983
|
const componentData = await api.getComponentData(fileKey, nodeId);
|
|
1984
1984
|
if (!componentData) {
|
|
@@ -2077,7 +2077,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
2077
2077
|
.string()
|
|
2078
2078
|
.url()
|
|
2079
2079
|
.optional()
|
|
2080
|
-
.describe("Figma file URL (e.g., https://figma.com/design/abc123). Auto-detected from
|
|
2080
|
+
.describe("Figma file URL (e.g., https://figma.com/design/abc123). Auto-detected from WebSocket Desktop Bridge connection. Only required if not connected."),
|
|
2081
2081
|
verbosity: z
|
|
2082
2082
|
.enum(["summary", "standard", "full"])
|
|
2083
2083
|
.optional()
|
|
@@ -2115,7 +2115,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
2115
2115
|
}
|
|
2116
2116
|
const url = fileUrl || getCurrentUrl();
|
|
2117
2117
|
if (!url) {
|
|
2118
|
-
throw new Error("No Figma file URL available. Pass the fileUrl parameter
|
|
2118
|
+
throw new Error("No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.");
|
|
2119
2119
|
}
|
|
2120
2120
|
const fileKey = extractFileKey(url);
|
|
2121
2121
|
if (!fileKey) {
|
|
@@ -2222,7 +2222,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
2222
2222
|
.string()
|
|
2223
2223
|
.url()
|
|
2224
2224
|
.optional()
|
|
2225
|
-
.describe("Figma file URL (e.g., https://figma.com/design/abc123). Auto-detected from
|
|
2225
|
+
.describe("Figma file URL (e.g., https://figma.com/design/abc123). Auto-detected from WebSocket Desktop Bridge connection. Only required if not connected."),
|
|
2226
2226
|
nodeId: z
|
|
2227
2227
|
.string()
|
|
2228
2228
|
.describe("Component node ID to render as image (e.g., '695:313')"),
|
|
@@ -2251,12 +2251,12 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
2251
2251
|
`To fix:\n` +
|
|
2252
2252
|
`1. Local mode: Set FIGMA_ACCESS_TOKEN environment variable\n` +
|
|
2253
2253
|
`2. Cloud mode: Authenticate via OAuth\n\n` +
|
|
2254
|
-
`Note: For component screenshots,
|
|
2255
|
-
`if
|
|
2254
|
+
`Note: For component screenshots, figma_capture_screenshot may work as an alternative ` +
|
|
2255
|
+
`if the Desktop Bridge plugin is connected.`);
|
|
2256
2256
|
}
|
|
2257
2257
|
const url = fileUrl || getCurrentUrl();
|
|
2258
2258
|
if (!url) {
|
|
2259
|
-
throw new Error("No Figma file URL available. Pass the fileUrl parameter
|
|
2259
|
+
throw new Error("No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.");
|
|
2260
2260
|
}
|
|
2261
2261
|
const fileKey = extractFileKey(url);
|
|
2262
2262
|
if (!fileKey) {
|
|
@@ -2367,11 +2367,11 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
2367
2367
|
`1. Local mode: Set FIGMA_ACCESS_TOKEN environment variable\n` +
|
|
2368
2368
|
`2. Cloud mode: Authenticate via OAuth\n\n` +
|
|
2369
2369
|
`Note: For component metadata, figma_get_component has Desktop Bridge fallback ` +
|
|
2370
|
-
`that works without token (requires
|
|
2370
|
+
`that works without token (requires the Desktop Bridge plugin to be connected).`);
|
|
2371
2371
|
}
|
|
2372
2372
|
const url = fileUrl || getCurrentUrl();
|
|
2373
2373
|
if (!url) {
|
|
2374
|
-
throw new Error("No Figma file URL available. Pass the fileUrl parameter
|
|
2374
|
+
throw new Error("No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.");
|
|
2375
2375
|
}
|
|
2376
2376
|
const fileKey = extractFileKey(url);
|
|
2377
2377
|
if (!fileKey) {
|
|
@@ -2581,7 +2581,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
2581
2581
|
}
|
|
2582
2582
|
const url = fileUrl || getCurrentUrl();
|
|
2583
2583
|
if (!url) {
|
|
2584
|
-
throw new Error("No Figma file URL available. Pass the fileUrl parameter
|
|
2584
|
+
throw new Error("No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.");
|
|
2585
2585
|
}
|
|
2586
2586
|
const fileKey = extractFileKey(url);
|
|
2587
2587
|
if (!fileKey) {
|
|
@@ -2758,7 +2758,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
2758
2758
|
try {
|
|
2759
2759
|
logger.info({ nodeId, format, scale }, "Capturing screenshot via Desktop Bridge");
|
|
2760
2760
|
let result = null;
|
|
2761
|
-
// Use the connector abstraction (
|
|
2761
|
+
// Use the connector abstraction (WebSocket transport)
|
|
2762
2762
|
if (getDesktopConnector) {
|
|
2763
2763
|
const connector = await getDesktopConnector();
|
|
2764
2764
|
logger.info({ transport: connector.getTransportType?.() || 'unknown' }, "Screenshot via connector");
|
|
@@ -2866,7 +2866,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, getCon
|
|
|
2866
2866
|
try {
|
|
2867
2867
|
logger.info({ nodeId, properties: Object.keys(properties) }, "Setting instance properties via Desktop Bridge");
|
|
2868
2868
|
let result = null;
|
|
2869
|
-
// Use the connector abstraction (
|
|
2869
|
+
// Use the connector abstraction (WebSocket transport)
|
|
2870
2870
|
if (getDesktopConnector) {
|
|
2871
2871
|
const connector = await getDesktopConnector();
|
|
2872
2872
|
logger.info({ transport: connector.getTransportType?.() || 'unknown' }, "Instance properties via connector");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WebSocket Figma Connector
|
|
3
3
|
*
|
|
4
|
-
* Implements IFigmaConnector using WebSocket
|
|
4
|
+
* Implements IFigmaConnector using the WebSocket Desktop Bridge transport.
|
|
5
5
|
* Each method sends a command to the plugin UI via WebSocket and waits
|
|
6
6
|
* for the response β same window.* functions, different transport.
|
|
7
7
|
*
|
|
@@ -275,11 +275,10 @@ export class FigmaWebSocketServer extends EventEmitter {
|
|
|
275
275
|
lastActivity: Date.now(),
|
|
276
276
|
gracePeriodTimer: null,
|
|
277
277
|
});
|
|
278
|
-
//
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
278
|
+
// Most recently connected file becomes active (user just opened the plugin there).
|
|
279
|
+
// On bulk reconnect the order is non-deterministic, but the first user interaction
|
|
280
|
+
// (SELECTION_CHANGE or PAGE_CHANGE) will correct the active file immediately.
|
|
281
|
+
this._activeFileKey = fileKey;
|
|
283
282
|
logger.info({
|
|
284
283
|
fileName: data.fileName,
|
|
285
284
|
fileKey,
|
|
@@ -40,7 +40,7 @@ export function registerCommentTools(server, getFigmaAPI, getCurrentUrl, options
|
|
|
40
40
|
type: "text",
|
|
41
41
|
text: JSON.stringify({
|
|
42
42
|
error: "no_file_url",
|
|
43
|
-
message: "No Figma file URL available. Pass the fileUrl parameter
|
|
43
|
+
message: "No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.",
|
|
44
44
|
}),
|
|
45
45
|
},
|
|
46
46
|
],
|
|
@@ -143,7 +143,7 @@ export function registerCommentTools(server, getFigmaAPI, getCurrentUrl, options
|
|
|
143
143
|
type: "text",
|
|
144
144
|
text: JSON.stringify({
|
|
145
145
|
error: "no_file_url",
|
|
146
|
-
message: "No Figma file URL available. Pass the fileUrl parameter
|
|
146
|
+
message: "No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.",
|
|
147
147
|
}),
|
|
148
148
|
},
|
|
149
149
|
],
|
|
@@ -235,7 +235,7 @@ export function registerCommentTools(server, getFigmaAPI, getCurrentUrl, options
|
|
|
235
235
|
type: "text",
|
|
236
236
|
text: JSON.stringify({
|
|
237
237
|
error: "no_file_url",
|
|
238
|
-
message: "No Figma file URL available. Pass the fileUrl parameter
|
|
238
|
+
message: "No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.",
|
|
239
239
|
}),
|
|
240
240
|
},
|
|
241
241
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment-tools.js","sourceRoot":"","sources":["../../src/core/comment-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG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AAC;qBACF;iBACD;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,0BAA0B,CAAC,CAAC;YAEpD,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACpB,KAAK,EAAE,uBAAuB;4BAC9B,OAAO,EAAE,0BAA0B,OAAO,EAAE;yBAC5C,CAAC;qBACF;iBACD;gBACD,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Console Monitor
|
|
3
|
-
* Captures and manages console logs from Figma plugins
|
|
3
|
+
* Captures and manages console logs from Figma plugins
|
|
4
4
|
* Monitors both main page console AND Web Worker consoles (where Figma plugins run)
|
|
5
5
|
*/
|
|
6
6
|
import type { ConsoleLogEntry, ConsoleConfig } from './types/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Console Monitor
|
|
3
|
-
* Captures and manages console logs from Figma plugins
|
|
3
|
+
* Captures and manages console logs from Figma plugins
|
|
4
4
|
* Monitors both main page console AND Web Worker consoles (where Figma plugins run)
|
|
5
5
|
*/
|
|
6
6
|
import { createChildLogger } from './logger.js';
|
|
@@ -1287,7 +1287,7 @@ export function registerDesignCodeTools(server, getFigmaAPI, getCurrentUrl, vari
|
|
|
1287
1287
|
try {
|
|
1288
1288
|
const url = fileUrl || getCurrentUrl();
|
|
1289
1289
|
if (!url) {
|
|
1290
|
-
throw new Error("No Figma file URL available. Pass the fileUrl parameter
|
|
1290
|
+
throw new Error("No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.");
|
|
1291
1291
|
}
|
|
1292
1292
|
const fileKey = extractFileKey(url);
|
|
1293
1293
|
if (!fileKey) {
|
|
@@ -1474,7 +1474,7 @@ export function registerDesignCodeTools(server, getFigmaAPI, getCurrentUrl, vari
|
|
|
1474
1474
|
try {
|
|
1475
1475
|
const url = fileUrl || getCurrentUrl();
|
|
1476
1476
|
if (!url) {
|
|
1477
|
-
throw new Error("No Figma file URL available. Pass the fileUrl parameter
|
|
1477
|
+
throw new Error("No Figma file URL available. Pass the fileUrl parameter or ensure the Desktop Bridge plugin is open in Figma.");
|
|
1478
1478
|
}
|
|
1479
1479
|
const fileKey = extractFileKey(url);
|
|
1480
1480
|
if (!fileKey) {
|