@atezer/figma-mcp-bridge 1.7.22 → 1.7.24
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/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/dist/core/config.d.ts +1 -5
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +11 -111
- package/dist/core/config.js.map +1 -1
- package/dist/core/instructions.d.ts +7 -0
- package/dist/core/instructions.d.ts.map +1 -0
- package/dist/core/instructions.js +37 -0
- package/dist/core/instructions.js.map +1 -0
- package/dist/core/plugin-bridge-server.js +1 -1
- package/dist/core/types/index.d.ts +2 -98
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/version.d.ts +3 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +3 -0
- package/dist/core/version.js.map +1 -0
- package/dist/local-plugin-only.js +1 -1
- package/f-mcp-plugin/README.md +8 -15
- package/f-mcp-plugin/manifest.json +1 -3
- package/package.json +8 -31
- package/dist/browser/base.d.ts +0 -50
- package/dist/browser/base.d.ts.map +0 -1
- package/dist/browser/base.js +0 -6
- package/dist/browser/base.js.map +0 -1
- package/dist/browser/local.d.ts +0 -81
- package/dist/browser/local.d.ts.map +0 -1
- package/dist/browser/local.js +0 -283
- package/dist/browser/local.js.map +0 -1
- package/dist/core/console-monitor.d.ts +0 -82
- package/dist/core/console-monitor.d.ts.map +0 -1
- package/dist/core/console-monitor.js +0 -428
- package/dist/core/console-monitor.js.map +0 -1
- package/dist/core/design-system-manifest.d.ts +0 -272
- package/dist/core/design-system-manifest.d.ts.map +0 -1
- package/dist/core/design-system-manifest.js +0 -261
- package/dist/core/design-system-manifest.js.map +0 -1
- package/dist/core/enrichment/enrichment-service.d.ts +0 -52
- package/dist/core/enrichment/enrichment-service.d.ts.map +0 -1
- package/dist/core/enrichment/enrichment-service.js +0 -272
- package/dist/core/enrichment/enrichment-service.js.map +0 -1
- package/dist/core/enrichment/index.d.ts +0 -8
- package/dist/core/enrichment/index.d.ts.map +0 -1
- package/dist/core/enrichment/index.js +0 -8
- package/dist/core/enrichment/index.js.map +0 -1
- package/dist/core/enrichment/relationship-mapper.d.ts +0 -106
- package/dist/core/enrichment/relationship-mapper.d.ts.map +0 -1
- package/dist/core/enrichment/relationship-mapper.js +0 -352
- package/dist/core/enrichment/relationship-mapper.js.map +0 -1
- package/dist/core/enrichment/style-resolver.d.ts +0 -80
- package/dist/core/enrichment/style-resolver.d.ts.map +0 -1
- package/dist/core/enrichment/style-resolver.js +0 -327
- package/dist/core/enrichment/style-resolver.js.map +0 -1
- package/dist/core/figma-api.d.ts +0 -137
- package/dist/core/figma-api.d.ts.map +0 -1
- package/dist/core/figma-api.js +0 -274
- package/dist/core/figma-api.js.map +0 -1
- package/dist/core/figma-desktop-connector.d.ts +0 -242
- package/dist/core/figma-desktop-connector.d.ts.map +0 -1
- package/dist/core/figma-desktop-connector.js +0 -1042
- package/dist/core/figma-desktop-connector.js.map +0 -1
- package/dist/core/figma-reconstruction-spec.d.ts +0 -162
- package/dist/core/figma-reconstruction-spec.d.ts.map +0 -1
- package/dist/core/figma-reconstruction-spec.js +0 -387
- package/dist/core/figma-reconstruction-spec.js.map +0 -1
- package/dist/core/figma-tools.d.ts +0 -21
- package/dist/core/figma-tools.d.ts.map +0 -1
- package/dist/core/figma-tools.js +0 -2920
- package/dist/core/figma-tools.js.map +0 -1
- package/dist/core/snippet-injector.d.ts +0 -24
- package/dist/core/snippet-injector.d.ts.map +0 -1
- package/dist/core/snippet-injector.js +0 -97
- package/dist/core/snippet-injector.js.map +0 -1
- package/dist/core/types/enriched.d.ts +0 -213
- package/dist/core/types/enriched.d.ts.map +0 -1
- package/dist/core/types/enriched.js +0 -6
- package/dist/core/types/enriched.js.map +0 -1
- package/dist/local.d.ts +0 -73
- package/dist/local.d.ts.map +0 -1
- package/dist/local.js +0 -2606
- package/dist/local.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,36 @@ Bu dosya [Keep a Changelog](https://keepachangelog.com/tr/1.1.0/) biçimine uygu
|
|
|
12
12
|
|
|
13
13
|
Bu changelog'a ekleme öncesi sürümlerin tam ayrıntıları için `git log` kullanılabilir.
|
|
14
14
|
|
|
15
|
+
## [1.7.23] - 2026-04-11
|
|
16
|
+
|
|
17
|
+
### Refactor: Local Full + Cloudflare Modları Kaldırıldı
|
|
18
|
+
|
|
19
|
+
Proje artık yalnızca **plugin-only** modunu destekliyor. CDP debug port (9222), Figma REST API ve Cloudflare Workers modları kaldırıldı. ~15.000+ satır kod temizlendi.
|
|
20
|
+
|
|
21
|
+
**Kaldırılan:**
|
|
22
|
+
- `src/local.ts` — Full local server (CDP + REST + Puppeteer)
|
|
23
|
+
- `src/index.ts` — Cloudflare Workers entry point
|
|
24
|
+
- `src/browser/` — Tüm browser modülleri (Puppeteer, Cloudflare Browser Rendering)
|
|
25
|
+
- `src/cloud-*.ts` — Cloudflare cloud-specific modüller
|
|
26
|
+
- `src/core/figma-tools.ts` — REST API araç kaydı (3,564 satır)
|
|
27
|
+
- `src/core/figma-desktop-connector.ts` — CDP connector (1,391 satır)
|
|
28
|
+
- `src/core/figma-api.ts`, `console-monitor.ts`, `snippet-injector.ts`, `design-system-manifest.ts`, `figma-reconstruction-spec.ts`
|
|
29
|
+
- `src/core/enrichment/` — Tüm enrichment modülleri
|
|
30
|
+
- `tsconfig.cloudflare.json`, `wrangler.jsonc`, `worker-configuration.d.ts`
|
|
31
|
+
- Bağımlılıklar: `@cloudflare/puppeteer`, `agents`, `puppeteer-core`, `wrangler`
|
|
32
|
+
|
|
33
|
+
**Güncellenen:**
|
|
34
|
+
- `package.json` — main/types → local-plugin-only, bin sadeleştirildi, 3 runtime + 1 dev bağımlılık kaldırıldı
|
|
35
|
+
- `tsconfig.local.json` — Sadece plugin-only + core
|
|
36
|
+
- `scripts/validate-fmcp-skills-tools.mjs` — Kaynak: sadece local-plugin-only.ts
|
|
37
|
+
- `.github/workflows/ci.yml` — local.ts version check kaldırıldı
|
|
38
|
+
- `KURULUM.md`, `CONTRIBUTING.md`, `f-mcp-plugin/README.md`, `f-mcp-plugin/manifest.json`
|
|
39
|
+
- `.cursor/skills/f-mcp/TOOL_MAPPING.md` — 19 kaldırılan araç temizlendi
|
|
40
|
+
- `src/core/types/index.ts` — Kullanılmayan tipler kaldırıldı
|
|
41
|
+
- `src/core/config.ts` — Browser/console/screenshot config kaldırıldı
|
|
42
|
+
|
|
43
|
+
**Korunan:** 46 MCP aracı, 19 skill, plugin bridge (WebSocket 5454), audit log
|
|
44
|
+
|
|
15
45
|
## [1.7.19] - 2026-04-10
|
|
16
46
|
|
|
17
47
|
### Fix: `figma_create_frame` Otomatik Pozisyonlama
|
package/README.md
CHANGED
|
@@ -138,7 +138,7 @@ Daha fazla: [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md)
|
|
|
138
138
|
|
|
139
139
|
| | |
|
|
140
140
|
|---|---|
|
|
141
|
-
| Güncel sürüm | **1.7.
|
|
141
|
+
| Güncel sürüm | **1.7.23** ([CHANGELOG](CHANGELOG.md) · [Releases](https://github.com/atezer/FMCP/releases)) |
|
|
142
142
|
| npm | [@atezer/figma-mcp-bridge](https://www.npmjs.com/package/@atezer/figma-mcp-bridge) |
|
|
143
143
|
| Lisans | MIT — kişisel ve ticari kullanıma açık |
|
|
144
144
|
|
package/dist/core/config.d.ts
CHANGED
|
@@ -7,11 +7,7 @@ import type { ServerConfig } from './types/index.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function loadConfig(): ServerConfig;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export declare function validateConfig(config: ServerConfig): void;
|
|
13
|
-
/**
|
|
14
|
-
* Get configuration with validation
|
|
10
|
+
* Get configuration
|
|
15
11
|
*/
|
|
16
12
|
export declare function getConfig(): ServerConfig;
|
|
17
13
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA2BrD;;GAEG;AACH,wBAAgB,UAAU,IAAI,YAAY,CAyBzC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,YAAY,CAExC"}
|
package/dist/core/config.js
CHANGED
|
@@ -4,53 +4,12 @@
|
|
|
4
4
|
import { readFileSync, existsSync } from 'fs';
|
|
5
5
|
import { homedir } from 'os';
|
|
6
6
|
import { join } from 'path';
|
|
7
|
-
/**
|
|
8
|
-
* Auto-detect server mode based on environment
|
|
9
|
-
*/
|
|
10
|
-
function detectMode() {
|
|
11
|
-
// If running in Workers environment, return cloudflare
|
|
12
|
-
if (typeof globalThis !== 'undefined' && 'caches' in globalThis) {
|
|
13
|
-
return 'cloudflare';
|
|
14
|
-
}
|
|
15
|
-
// Explicit env var override
|
|
16
|
-
const modeEnv = process.env.FIGMA_MCP_MODE?.toLowerCase();
|
|
17
|
-
if (modeEnv === 'local' || modeEnv === 'cloudflare') {
|
|
18
|
-
return modeEnv;
|
|
19
|
-
}
|
|
20
|
-
// Default to local for Node.js environments
|
|
21
|
-
return 'local';
|
|
22
|
-
}
|
|
23
7
|
/**
|
|
24
8
|
* Default configuration values
|
|
25
9
|
*/
|
|
26
10
|
const DEFAULT_CONFIG = {
|
|
27
|
-
mode:
|
|
28
|
-
browser: {
|
|
29
|
-
headless: false,
|
|
30
|
-
args: [
|
|
31
|
-
'--disable-blink-features=AutomationControlled',
|
|
32
|
-
'--disable-dev-shm-usage',
|
|
33
|
-
'--no-sandbox', // Note: Only use in trusted environments
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
console: {
|
|
37
|
-
bufferSize: 1000,
|
|
38
|
-
filterLevels: ['log', 'info', 'warn', 'error', 'debug'],
|
|
39
|
-
truncation: {
|
|
40
|
-
maxStringLength: 500,
|
|
41
|
-
maxArrayLength: 10,
|
|
42
|
-
maxObjectDepth: 3,
|
|
43
|
-
removeDuplicates: true,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
screenshots: {
|
|
47
|
-
defaultFormat: 'png',
|
|
48
|
-
quality: 90,
|
|
49
|
-
storePath: join(process.env.TMPDIR || '/tmp', 'figma-mcp-bridge', 'screenshots'),
|
|
50
|
-
},
|
|
11
|
+
mode: 'local',
|
|
51
12
|
local: {
|
|
52
|
-
debugHost: process.env.FIGMA_DEBUG_HOST || 'localhost',
|
|
53
|
-
debugPort: parseInt(process.env.FIGMA_DEBUG_PORT || '9222', 10),
|
|
54
13
|
pluginBridgePort: parseInt(process.env.FIGMA_MCP_BRIDGE_PORT || process.env.FIGMA_PLUGIN_BRIDGE_PORT || '5454', 10),
|
|
55
14
|
auditLogPath: process.env.FIGMA_MCP_AUDIT_LOG_PATH || undefined,
|
|
56
15
|
},
|
|
@@ -78,9 +37,14 @@ export function loadConfig() {
|
|
|
78
37
|
try {
|
|
79
38
|
const fileContent = readFileSync(configPath, 'utf-8');
|
|
80
39
|
const userConfig = JSON.parse(fileContent);
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
|
|
40
|
+
// Merge with defaults
|
|
41
|
+
return {
|
|
42
|
+
mode: 'local',
|
|
43
|
+
local: {
|
|
44
|
+
...DEFAULT_CONFIG.local,
|
|
45
|
+
...(userConfig.local || {}),
|
|
46
|
+
},
|
|
47
|
+
};
|
|
84
48
|
}
|
|
85
49
|
catch (error) {
|
|
86
50
|
console.error(`Failed to load config from ${configPath}:`, error);
|
|
@@ -92,73 +56,9 @@ export function loadConfig() {
|
|
|
92
56
|
return DEFAULT_CONFIG;
|
|
93
57
|
}
|
|
94
58
|
/**
|
|
95
|
-
*
|
|
96
|
-
*/
|
|
97
|
-
function mergeConfig(defaults, overrides) {
|
|
98
|
-
return {
|
|
99
|
-
mode: overrides.mode || defaults.mode,
|
|
100
|
-
browser: {
|
|
101
|
-
...defaults.browser,
|
|
102
|
-
...(overrides.browser || {}),
|
|
103
|
-
},
|
|
104
|
-
console: {
|
|
105
|
-
...defaults.console,
|
|
106
|
-
...(overrides.console || {}),
|
|
107
|
-
truncation: {
|
|
108
|
-
...defaults.console.truncation,
|
|
109
|
-
...(overrides.console?.truncation || {}),
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
screenshots: {
|
|
113
|
-
...defaults.screenshots,
|
|
114
|
-
...(overrides.screenshots || {}),
|
|
115
|
-
},
|
|
116
|
-
local: {
|
|
117
|
-
...defaults.local,
|
|
118
|
-
...(overrides.local || {}),
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Validate configuration
|
|
124
|
-
*/
|
|
125
|
-
export function validateConfig(config) {
|
|
126
|
-
// Validate browser config
|
|
127
|
-
if (!Array.isArray(config.browser.args)) {
|
|
128
|
-
throw new Error('browser.args must be an array');
|
|
129
|
-
}
|
|
130
|
-
// Validate console config
|
|
131
|
-
if (config.console.bufferSize <= 0) {
|
|
132
|
-
throw new Error('console.bufferSize must be positive');
|
|
133
|
-
}
|
|
134
|
-
if (!Array.isArray(config.console.filterLevels)) {
|
|
135
|
-
throw new Error('console.filterLevels must be an array');
|
|
136
|
-
}
|
|
137
|
-
// Validate truncation config
|
|
138
|
-
const { truncation } = config.console;
|
|
139
|
-
if (truncation.maxStringLength <= 0) {
|
|
140
|
-
throw new Error('console.truncation.maxStringLength must be positive');
|
|
141
|
-
}
|
|
142
|
-
if (truncation.maxArrayLength <= 0) {
|
|
143
|
-
throw new Error('console.truncation.maxArrayLength must be positive');
|
|
144
|
-
}
|
|
145
|
-
if (truncation.maxObjectDepth <= 0) {
|
|
146
|
-
throw new Error('console.truncation.maxObjectDepth must be positive');
|
|
147
|
-
}
|
|
148
|
-
// Validate screenshot config
|
|
149
|
-
if (!['png', 'jpeg'].includes(config.screenshots.defaultFormat)) {
|
|
150
|
-
throw new Error('screenshots.defaultFormat must be "png" or "jpeg"');
|
|
151
|
-
}
|
|
152
|
-
if (config.screenshots.quality < 0 || config.screenshots.quality > 100) {
|
|
153
|
-
throw new Error('screenshots.quality must be between 0 and 100');
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Get configuration with validation
|
|
59
|
+
* Get configuration
|
|
158
60
|
*/
|
|
159
61
|
export function getConfig() {
|
|
160
|
-
|
|
161
|
-
validateConfig(config);
|
|
162
|
-
return config;
|
|
62
|
+
return loadConfig();
|
|
163
63
|
}
|
|
164
64
|
//# sourceMappingURL=config.js.map
|
package/dist/core/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B;;GAEG;AACH,MAAM,cAAc,GAAiB;IACnC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACL,gBAAgB,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,MAAM,EAAE,EAAE,CAAC;QACnH,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,SAAS;KAChE;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,YAAY,GAAG;IACnB,gCAAgC;IAChC,OAAO,CAAC,GAAG,CAAC,oBAAoB;IAChC,uBAAuB;IACvB,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,wBAAwB,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,uBAAuB,CAAC;IAC5C,mBAAmB;IACnB,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,aAAa,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE,EAAE,wBAAwB,CAAC;CAC1C,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,+BAA+B;IAC/B,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;QACtC,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;gBACtD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;gBAE3C,sBAAsB;gBACtB,OAAO;oBACL,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE;wBACL,GAAG,cAAc,CAAC,KAAM;wBACxB,GAAG,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE,CAAC;qBAC5B;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,8BAA8B,UAAU,GAAG,EAAE,KAAK,CAAC,CAAC;gBAClE,+BAA+B;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAED,qCAAqC;IACrC,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,UAAU,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server Instructions — sent to AI clients during initialization.
|
|
3
|
+
* Helps Claude/Cursor distinguish F-MCP Bridge from the official Figma MCP.
|
|
4
|
+
* No Node.js dependencies — safe for Cloudflare Workers.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FMCP_INSTRUCTIONS = "F-MCP ATezer Bridge \u2014 Plugin-based Figma MCP server.\n\nWHAT IT IS:\nF-MCP connects directly to the Figma Plugin API via WebSocket bridge (ports 5454-5470).\nIt reads real-time state from open Figma files without needing a REST API token.\nAll F-MCP tool names start with \"figma_\" and belong to the \"figma-mcp-bridge\" MCP server.\n\nWHEN TO PREFER F-MCP BRIDGE (figma-mcp-bridge tools):\n- Reading live plugin state: variables, styles, components, document structure\n- Running Plugin API code (figma_execute) for custom queries or mutations\n- Capturing screenshots without a REST token (figma_capture_screenshot)\n- Creating/modifying nodes directly: frames, text, rectangles, groups\n- Variable CRUD (create, update, delete variables and collections)\n- Design token browsing and design-code parity checks\n- Multi-file targeting via fileKey or figmaUrl params\n- Batch export (SVG/PNG/JPG/PDF) via plugin exportAsync\n- When no Figma REST API token is available\n\nWHEN TO PREFER OFFICIAL FIGMA MCP:\n- Code Connect mappings and suggestions\n- Design system search across team libraries (search_design_system)\n- Creating new Figma files (create_new_file)\n- Running Plugin API code through official channel (use_figma)\n- Generating diagrams in FigJam (generate_diagram)\n- When official Figma Cloud API OAuth integration is needed\n\nCOEXISTENCE:\nBoth servers run simultaneously on different ports with different namespaces.\nF-MCP tools are prefixed \"figma_\" in the figma-mcp-bridge server.\nOfficial tools use their own names in separate MCP server namespaces.\nChoose based on the capability needed.";
|
|
7
|
+
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/core/instructions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,ylDA8BS,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server Instructions — sent to AI clients during initialization.
|
|
3
|
+
* Helps Claude/Cursor distinguish F-MCP Bridge from the official Figma MCP.
|
|
4
|
+
* No Node.js dependencies — safe for Cloudflare Workers.
|
|
5
|
+
*/
|
|
6
|
+
export const FMCP_INSTRUCTIONS = `F-MCP ATezer Bridge — Plugin-based Figma MCP server.
|
|
7
|
+
|
|
8
|
+
WHAT IT IS:
|
|
9
|
+
F-MCP connects directly to the Figma Plugin API via WebSocket bridge (ports 5454-5470).
|
|
10
|
+
It reads real-time state from open Figma files without needing a REST API token.
|
|
11
|
+
All F-MCP tool names start with "figma_" and belong to the "figma-mcp-bridge" MCP server.
|
|
12
|
+
|
|
13
|
+
WHEN TO PREFER F-MCP BRIDGE (figma-mcp-bridge tools):
|
|
14
|
+
- Reading live plugin state: variables, styles, components, document structure
|
|
15
|
+
- Running Plugin API code (figma_execute) for custom queries or mutations
|
|
16
|
+
- Capturing screenshots without a REST token (figma_capture_screenshot)
|
|
17
|
+
- Creating/modifying nodes directly: frames, text, rectangles, groups
|
|
18
|
+
- Variable CRUD (create, update, delete variables and collections)
|
|
19
|
+
- Design token browsing and design-code parity checks
|
|
20
|
+
- Multi-file targeting via fileKey or figmaUrl params
|
|
21
|
+
- Batch export (SVG/PNG/JPG/PDF) via plugin exportAsync
|
|
22
|
+
- When no Figma REST API token is available
|
|
23
|
+
|
|
24
|
+
WHEN TO PREFER OFFICIAL FIGMA MCP:
|
|
25
|
+
- Code Connect mappings and suggestions
|
|
26
|
+
- Design system search across team libraries (search_design_system)
|
|
27
|
+
- Creating new Figma files (create_new_file)
|
|
28
|
+
- Running Plugin API code through official channel (use_figma)
|
|
29
|
+
- Generating diagrams in FigJam (generate_diagram)
|
|
30
|
+
- When official Figma Cloud API OAuth integration is needed
|
|
31
|
+
|
|
32
|
+
COEXISTENCE:
|
|
33
|
+
Both servers run simultaneously on different ports with different namespaces.
|
|
34
|
+
F-MCP tools are prefixed "figma_" in the figma-mcp-bridge server.
|
|
35
|
+
Official tools use their own names in separate MCP server namespaces.
|
|
36
|
+
Choose based on the capability needed.`;
|
|
37
|
+
//# sourceMappingURL=instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/core/instructions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA8BM,CAAC"}
|
|
@@ -326,7 +326,7 @@ export class PluginBridgeServer {
|
|
|
326
326
|
logger.info({ clientId, fileKey: incomingFileKey, fileName: incomingFileName }, "Plugin bridge: client registered (fileKey=%s, fileName=%s)", incomingFileKey, incomingFileName);
|
|
327
327
|
ws.send(JSON.stringify({
|
|
328
328
|
type: "welcome",
|
|
329
|
-
bridgeVersion: "1.7.
|
|
329
|
+
bridgeVersion: "1.7.24",
|
|
330
330
|
port: this.port,
|
|
331
331
|
clientId,
|
|
332
332
|
multiClient: true,
|
|
@@ -1,116 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for F-MCP ATezer (Figma MCP Bridge)
|
|
3
3
|
*/
|
|
4
|
-
/**
|
|
5
|
-
* Console log entry captured from Figma plugin
|
|
6
|
-
*/
|
|
7
|
-
export interface ConsoleLogEntry {
|
|
8
|
-
timestamp: number;
|
|
9
|
-
level: 'log' | 'info' | 'warn' | 'error' | 'debug';
|
|
10
|
-
message: string;
|
|
11
|
-
args: any[];
|
|
12
|
-
stackTrace?: StackTrace;
|
|
13
|
-
source: 'plugin' | 'figma' | 'page' | 'unknown';
|
|
14
|
-
workerUrl?: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Stack trace information
|
|
18
|
-
*/
|
|
19
|
-
export interface StackTrace {
|
|
20
|
-
callFrames: CallFrame[];
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Individual stack frame
|
|
24
|
-
*/
|
|
25
|
-
export interface CallFrame {
|
|
26
|
-
functionName: string;
|
|
27
|
-
url: string;
|
|
28
|
-
lineNumber: number;
|
|
29
|
-
columnNumber: number;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Screenshot metadata
|
|
33
|
-
*/
|
|
34
|
-
export interface Screenshot {
|
|
35
|
-
id: string;
|
|
36
|
-
timestamp: number;
|
|
37
|
-
path: string;
|
|
38
|
-
format: 'png' | 'jpeg';
|
|
39
|
-
width: number;
|
|
40
|
-
height: number;
|
|
41
|
-
selector?: string;
|
|
42
|
-
base64?: string;
|
|
43
|
-
metadata?: ScreenshotMetadata;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Additional screenshot metadata
|
|
47
|
-
*/
|
|
48
|
-
export interface ScreenshotMetadata {
|
|
49
|
-
pluginName?: string;
|
|
50
|
-
pluginId?: string;
|
|
51
|
-
figmaFileKey?: string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Plugin context information
|
|
55
|
-
*/
|
|
56
|
-
export interface PluginContext {
|
|
57
|
-
pluginId?: string;
|
|
58
|
-
pluginName?: string;
|
|
59
|
-
isRunning: boolean;
|
|
60
|
-
lastReloadTime?: number;
|
|
61
|
-
}
|
|
62
4
|
/**
|
|
63
5
|
* Server configuration
|
|
64
6
|
*/
|
|
65
7
|
export interface ServerConfig {
|
|
66
|
-
mode: 'local'
|
|
67
|
-
browser: BrowserConfig;
|
|
68
|
-
console: ConsoleConfig;
|
|
69
|
-
screenshots: ScreenshotConfig;
|
|
8
|
+
mode: 'local';
|
|
70
9
|
local?: LocalModeConfig;
|
|
71
10
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Browser configuration
|
|
74
|
-
*/
|
|
75
|
-
export interface BrowserConfig {
|
|
76
|
-
headless: boolean;
|
|
77
|
-
args: string[];
|
|
78
|
-
executablePath?: string;
|
|
79
|
-
}
|
|
80
11
|
/**
|
|
81
12
|
* Local mode configuration
|
|
82
13
|
*/
|
|
83
14
|
export interface LocalModeConfig {
|
|
84
|
-
|
|
85
|
-
debugPort: number;
|
|
86
|
-
/** Plugin bridge WebSocket server port (no CDP needed when plugin connects) */
|
|
15
|
+
/** Plugin bridge WebSocket server port (default: 5454) */
|
|
87
16
|
pluginBridgePort?: number;
|
|
88
17
|
/** Optional audit log file path (enterprise); one JSON object per line (NDJSON) */
|
|
89
18
|
auditLogPath?: string;
|
|
90
19
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Console monitoring configuration
|
|
93
|
-
*/
|
|
94
|
-
export interface ConsoleConfig {
|
|
95
|
-
bufferSize: number;
|
|
96
|
-
filterLevels: ConsoleLogEntry['level'][];
|
|
97
|
-
truncation: TruncationConfig;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Screenshot configuration
|
|
101
|
-
*/
|
|
102
|
-
export interface ScreenshotConfig {
|
|
103
|
-
defaultFormat: 'png' | 'jpeg';
|
|
104
|
-
quality: number;
|
|
105
|
-
storePath: string;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Log truncation configuration
|
|
109
|
-
*/
|
|
110
|
-
export interface TruncationConfig {
|
|
111
|
-
maxStringLength: number;
|
|
112
|
-
maxArrayLength: number;
|
|
113
|
-
maxObjectDepth: number;
|
|
114
|
-
removeDuplicates: boolean;
|
|
115
|
-
}
|
|
116
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/core/version.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAO,MAAM,YAAY,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/core/version.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC"}
|
|
@@ -89,7 +89,7 @@ export async function main() {
|
|
|
89
89
|
bridge.start();
|
|
90
90
|
const server = new McpServer({
|
|
91
91
|
name: "F-MCP ATezer Bridge (Plugin-only)",
|
|
92
|
-
version: "1.7.
|
|
92
|
+
version: "1.7.24",
|
|
93
93
|
});
|
|
94
94
|
// ---- figma_list_connected_files (multi-client discovery) ----
|
|
95
95
|
server.registerTool("figma_list_connected_files", {
|
package/f-mcp-plugin/README.md
CHANGED
|
@@ -10,12 +10,12 @@ This plugin enables AI assistants like Claude Code and Claude Desktop to access
|
|
|
10
10
|
|
|
11
11
|
**For Variables (pre-loaded):**
|
|
12
12
|
```
|
|
13
|
-
Figma Plugin Worker → postMessage → Plugin UI Iframe →
|
|
13
|
+
Figma Plugin Worker → postMessage → Plugin UI Iframe → WebSocket → MCP Server
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
**For Components (on-demand):**
|
|
17
17
|
```
|
|
18
|
-
MCP Request → Plugin UI → postMessage → Plugin Worker → figma.getNodeByIdAsync() → Returns with description
|
|
18
|
+
MCP Request → WebSocket → Plugin UI → postMessage → Plugin Worker → figma.getNodeByIdAsync() → Returns with description
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
**Key Features:**
|
|
@@ -40,9 +40,9 @@ The plugin runs in **both** Figma Design and Dev Mode (`"editorType": ["figma",
|
|
|
40
40
|
|
|
41
41
|
So: Design vs Dev mode does **not** block MCP. Users with only Dev Mode access can run the plugin and use all read-only MCP tools.
|
|
42
42
|
|
|
43
|
-
### Plugin Bridge (
|
|
43
|
+
### Plugin Bridge (WebSocket)
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
When the plugin runs, it connects to the MCP server over WebSocket (`ws://127.0.0.1:5454`).
|
|
46
46
|
|
|
47
47
|
1. Start Claude (or your MCP client) so the MCP server is running (it starts the bridge server on port 5454).
|
|
48
48
|
2. Open Figma **normally** (no special launch args).
|
|
@@ -61,7 +61,7 @@ The bridge is **one** WebSocket server on **one** port (default **5454**). It su
|
|
|
61
61
|
|
|
62
62
|
### Plugin-only mode (recommended: no REST API, no token)
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Run **without** any Figma REST API token:
|
|
65
65
|
|
|
66
66
|
1. Use the **plugin-only MCP relay**: `node dist/local-plugin-only.js` (or add it to Claude as the only MCP server).
|
|
67
67
|
2. All data comes from the plugin: variables, file structure, components, styles, execute, screenshot. No `FIGMA_ACCESS_TOKEN` needed.
|
|
@@ -124,7 +124,7 @@ The plugin will:
|
|
|
124
124
|
```
|
|
125
125
|
3. **Restart Claude.** Then open Figma, run **Plugins → Development → F-MCP ATezer Bridge**. When the plugin shows "ready", ask Claude e.g. "Figma'daki variable'ları listele" or "design system özetini ver".
|
|
126
126
|
|
|
127
|
-
No Figma REST API token
|
|
127
|
+
No Figma REST API token required.
|
|
128
128
|
|
|
129
129
|
### Accessing Data via MCP
|
|
130
130
|
|
|
@@ -179,18 +179,12 @@ figma_get_component({
|
|
|
179
179
|
4. Resolves promise when `COMPONENT_DATA` message received
|
|
180
180
|
5. Includes 10-second timeout and error handling
|
|
181
181
|
|
|
182
|
-
### MCP connection: WebSocket
|
|
182
|
+
### MCP connection: WebSocket
|
|
183
183
|
|
|
184
|
-
**WebSocket (plugin-only, no debug port):**
|
|
185
184
|
1. Plugin UI connects to MCP server at `ws://127.0.0.1:5454`
|
|
186
185
|
2. MCP sends RPCs (getVariables, getComponent, execute, etc.) over the WebSocket
|
|
187
186
|
3. No Figma debug port or token required
|
|
188
187
|
|
|
189
|
-
**CDP (optional, for console logs):**
|
|
190
|
-
1. When using `local.js` and Figma started with `--remote-debugging-port=9222`, MCP can connect via Puppeteer
|
|
191
|
-
2. Enumerates plugin UI iframes and reads `window.__figmaVariablesData` / calls `window.requestComponentData(nodeId)`
|
|
192
|
-
3. Returns variables and component data to MCP tools
|
|
193
|
-
|
|
194
188
|
## Troubleshooting
|
|
195
189
|
|
|
196
190
|
### Plugin doesn't appear in menu
|
|
@@ -201,8 +195,7 @@ figma_get_component({
|
|
|
201
195
|
### "No plugin UI found with variables data" or "No plugin UI found with requestComponentData"
|
|
202
196
|
- Ensure plugin is running (check for open plugin window showing "✓ F-MCP ATezer Bridge active" or "ready")
|
|
203
197
|
- Try closing and reopening the plugin
|
|
204
|
-
-
|
|
205
|
-
- **CDP mode:** If using debug port, verify Figma was launched with `--remote-debugging-port=9222`
|
|
198
|
+
- Ensure MCP server is running and nothing else is using port 5454; open Figma normally
|
|
206
199
|
|
|
207
200
|
### Variables not updating
|
|
208
201
|
- Close and reopen the plugin to refresh data
|
|
@@ -29,9 +29,7 @@
|
|
|
29
29
|
"http://localhost:5468", "ws://localhost:5468",
|
|
30
30
|
"http://localhost:5469", "ws://localhost:5469",
|
|
31
31
|
"http://localhost:5470", "ws://localhost:5470",
|
|
32
|
-
"https://figma-mcp-bridge.workers.dev",
|
|
33
|
-
"wss://figma-mcp-bridge.workers.dev"
|
|
34
32
|
],
|
|
35
|
-
"reasoning": "Local MCP WebSocket (5454–5470)
|
|
33
|
+
"reasoning": "Local MCP WebSocket (5454–5470); add your custom host here if different."
|
|
36
34
|
}
|
|
37
35
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atezer/figma-mcp-bridge",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.24",
|
|
4
4
|
"description": "F-MCP ATezer: MCP server and Figma plugin bridge for Claude/Cursor. No REST token required.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/local.js",
|
|
7
|
-
"types": "dist/local.d.ts",
|
|
6
|
+
"main": "dist/local-plugin-only.js",
|
|
7
|
+
"types": "dist/local-plugin-only.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"figma-mcp-bridge": "./dist/local.js",
|
|
10
9
|
"figma-mcp-bridge-plugin": "./dist/local-plugin-only.js"
|
|
11
10
|
},
|
|
12
11
|
"files": [
|
|
@@ -14,11 +13,6 @@
|
|
|
14
13
|
"dist/local-plugin-only.js.map",
|
|
15
14
|
"dist/local-plugin-only.d.ts",
|
|
16
15
|
"dist/local-plugin-only.d.ts.map",
|
|
17
|
-
"dist/local.js",
|
|
18
|
-
"dist/local.js.map",
|
|
19
|
-
"dist/local.d.ts",
|
|
20
|
-
"dist/local.d.ts.map",
|
|
21
|
-
"dist/browser",
|
|
22
16
|
"dist/core",
|
|
23
17
|
"f-mcp-plugin",
|
|
24
18
|
"README.md",
|
|
@@ -26,23 +20,15 @@
|
|
|
26
20
|
"LICENSE"
|
|
27
21
|
],
|
|
28
22
|
"scripts": {
|
|
29
|
-
"prepublishOnly": "npm run build
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"dev:plugin-only": "node dist/local-plugin-only.js",
|
|
34
|
-
"build:run": "npm run build:local && node dist/local-plugin-only.js",
|
|
35
|
-
"figma:debug": "./scripts/auto-launch-figma-plugin.sh",
|
|
36
|
-
"build": "npm run build:local && npm run build:cloudflare",
|
|
37
|
-
"build:local": "tsc -p tsconfig.local.json",
|
|
38
|
-
"build:cloudflare": "tsc -p tsconfig.cloudflare.json",
|
|
39
|
-
"start": "wrangler dev",
|
|
23
|
+
"prepublishOnly": "npm run build && npm run validate:fmcp-skills",
|
|
24
|
+
"dev": "node dist/local-plugin-only.js",
|
|
25
|
+
"build:run": "npm run build && node dist/local-plugin-only.js",
|
|
26
|
+
"build": "tsc -p tsconfig.local.json",
|
|
40
27
|
"test": "jest",
|
|
41
28
|
"test:watch": "jest --watch",
|
|
42
29
|
"test:coverage": "jest --coverage",
|
|
43
30
|
"format": "biome format --write",
|
|
44
31
|
"lint:fix": "biome lint --fix",
|
|
45
|
-
"cf-typegen": "wrangler types",
|
|
46
32
|
"type-check": "tsc --noEmit",
|
|
47
33
|
"validate:fmcp-skills": "node scripts/validate-fmcp-skills-tools.mjs",
|
|
48
34
|
"check-ports": "bash scripts/check-ports.sh"
|
|
@@ -71,18 +57,10 @@
|
|
|
71
57
|
"engines": {
|
|
72
58
|
"node": ">=18.0.0"
|
|
73
59
|
},
|
|
74
|
-
"overrides": {
|
|
75
|
-
"agents": {
|
|
76
|
-
"@modelcontextprotocol/sdk": "1.25.3"
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
60
|
"dependencies": {
|
|
80
|
-
"@cloudflare/puppeteer": "^1.0.4",
|
|
81
61
|
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
82
|
-
"agents": "^0.2.8",
|
|
83
62
|
"pino": "^9.5.0",
|
|
84
63
|
"pino-pretty": "^13.0.0",
|
|
85
|
-
"puppeteer-core": "^23.11.1",
|
|
86
64
|
"ws": "^8.19.0",
|
|
87
65
|
"zod": "^3.25.76"
|
|
88
66
|
},
|
|
@@ -94,7 +72,6 @@
|
|
|
94
72
|
"jest": "^29.7.0",
|
|
95
73
|
"ts-jest": "^29.2.5",
|
|
96
74
|
"tsx": "^4.19.2",
|
|
97
|
-
"typescript": "5.9.3"
|
|
98
|
-
"wrangler": "^4.42.0"
|
|
75
|
+
"typescript": "5.9.3"
|
|
99
76
|
}
|
|
100
77
|
}
|