@mp3wizard/figma-console-mcp 1.21.2 → 1.22.2

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 (39) hide show
  1. package/README.md +10 -9
  2. package/dist/apps/design-system-dashboard/mcp-app.html +59 -59
  3. package/dist/apps/token-browser/mcp-app.html +53 -53
  4. package/dist/cloudflare/core/accessibility-tools.js +306 -0
  5. package/dist/cloudflare/core/cloud-websocket-connector.js +11 -0
  6. package/dist/cloudflare/core/design-code-tools.js +160 -2
  7. package/dist/cloudflare/core/figma-desktop-connector.js +2 -0
  8. package/dist/cloudflare/core/websocket-connector.js +11 -0
  9. package/dist/cloudflare/core/write-tools.js +49 -4
  10. package/dist/cloudflare/index.js +16 -7
  11. package/dist/core/accessibility-tools.d.ts +21 -0
  12. package/dist/core/accessibility-tools.d.ts.map +1 -0
  13. package/dist/core/accessibility-tools.js +307 -0
  14. package/dist/core/accessibility-tools.js.map +1 -0
  15. package/dist/core/design-code-tools.d.ts.map +1 -1
  16. package/dist/core/design-code-tools.js +160 -2
  17. package/dist/core/design-code-tools.js.map +1 -1
  18. package/dist/core/figma-connector.d.ts +1 -0
  19. package/dist/core/figma-connector.d.ts.map +1 -1
  20. package/dist/core/figma-desktop-connector.d.ts +1 -0
  21. package/dist/core/figma-desktop-connector.d.ts.map +1 -1
  22. package/dist/core/figma-desktop-connector.js +2 -0
  23. package/dist/core/figma-desktop-connector.js.map +1 -1
  24. package/dist/core/types/design-code.d.ts +8 -0
  25. package/dist/core/types/design-code.d.ts.map +1 -1
  26. package/dist/core/websocket-connector.d.ts +1 -0
  27. package/dist/core/websocket-connector.d.ts.map +1 -1
  28. package/dist/core/websocket-connector.js +11 -0
  29. package/dist/core/websocket-connector.js.map +1 -1
  30. package/dist/core/write-tools.d.ts.map +1 -1
  31. package/dist/core/write-tools.js +49 -4
  32. package/dist/core/write-tools.js.map +1 -1
  33. package/dist/local.d.ts.map +1 -1
  34. package/dist/local.js +52 -4
  35. package/dist/local.js.map +1 -1
  36. package/figma-desktop-bridge/code.js +1134 -1
  37. package/figma-desktop-bridge/ui-full.html +13 -0
  38. package/figma-desktop-bridge/ui.html +13 -0
  39. package/package.json +5 -101
@@ -552,6 +552,15 @@
552
552
  .catch(function(err) { return { success: false, error: err.message || String(err) }; });
553
553
  };
554
554
 
555
+ // Audit component accessibility (deep a11y scorecard with color-blind simulation)
556
+ window.auditComponentAccessibility = function(nodeId, targetSize) {
557
+ var params = {};
558
+ if (nodeId) params.nodeId = nodeId;
559
+ if (targetSize !== undefined) params.targetSize = targetSize;
560
+ return window.sendPluginCommand('AUDIT_COMPONENT_ACCESSIBILITY', params, 120000)
561
+ .catch(function(err) { return { success: false, error: err.message || String(err) }; });
562
+ };
563
+
555
564
  // Analyze component set (variant state machine + cross-variant diff)
556
565
  window.analyzeComponentSet = (nodeId) => {
557
566
  return window.sendPluginCommand('ANALYZE_COMPONENT_SET', {
@@ -652,6 +661,7 @@
652
661
  'SET_IMAGE_FILL': function(params) { return window.setImageFill(params.nodeIds || params.nodeId, params.imageData, params.scaleMode); },
653
662
  'SET_INSTANCE_PROPERTIES': function(params) { return window.setInstanceProperties(params.nodeId, params.properties); },
654
663
  'LINT_DESIGN': function(params) { return window.lintDesign(params.nodeId, params.rules, params.maxDepth, params.maxFindings); },
664
+ 'AUDIT_COMPONENT_ACCESSIBILITY': function(params) { return window.auditComponentAccessibility(params.nodeId, params.targetSize); },
655
665
  'GET_VARIABLES_DATA': function() {
656
666
  // Return the cached variables data directly
657
667
  if (window.__figmaVariablesReady && window.__figmaVariablesData) {
@@ -1282,6 +1292,9 @@
1282
1292
  case 'LINT_DESIGN_RESULT':
1283
1293
  handleResult('LINT_DESIGN', 'data');
1284
1294
  break;
1295
+ case 'AUDIT_COMPONENT_ACCESSIBILITY_RESULT':
1296
+ handleResult('AUDIT_COMPONENT_ACCESSIBILITY', 'data');
1297
+ break;
1285
1298
 
1286
1299
  // File info
1287
1300
  case 'GET_FILE_INFO_RESULT':
@@ -552,6 +552,15 @@
552
552
  .catch(function(err) { return { success: false, error: err.message || String(err) }; });
553
553
  };
554
554
 
555
+ // Audit component accessibility (deep a11y scorecard with color-blind simulation)
556
+ window.auditComponentAccessibility = function(nodeId, targetSize) {
557
+ var params = {};
558
+ if (nodeId) params.nodeId = nodeId;
559
+ if (targetSize !== undefined) params.targetSize = targetSize;
560
+ return window.sendPluginCommand('AUDIT_COMPONENT_ACCESSIBILITY', params, 120000)
561
+ .catch(function(err) { return { success: false, error: err.message || String(err) }; });
562
+ };
563
+
555
564
  // Analyze component set (variant state machine + cross-variant diff)
556
565
  window.analyzeComponentSet = (nodeId) => {
557
566
  return window.sendPluginCommand('ANALYZE_COMPONENT_SET', {
@@ -652,6 +661,7 @@
652
661
  'SET_IMAGE_FILL': function(params) { return window.setImageFill(params.nodeIds || params.nodeId, params.imageData, params.scaleMode); },
653
662
  'SET_INSTANCE_PROPERTIES': function(params) { return window.setInstanceProperties(params.nodeId, params.properties); },
654
663
  'LINT_DESIGN': function(params) { return window.lintDesign(params.nodeId, params.rules, params.maxDepth, params.maxFindings); },
664
+ 'AUDIT_COMPONENT_ACCESSIBILITY': function(params) { return window.auditComponentAccessibility(params.nodeId, params.targetSize); },
655
665
  'GET_VARIABLES_DATA': function() {
656
666
  // Return the cached variables data directly
657
667
  if (window.__figmaVariablesReady && window.__figmaVariablesData) {
@@ -1340,6 +1350,9 @@
1340
1350
  case 'LINT_DESIGN_RESULT':
1341
1351
  handleResult('LINT_DESIGN', 'data');
1342
1352
  break;
1353
+ case 'AUDIT_COMPONENT_ACCESSIBILITY_RESULT':
1354
+ handleResult('AUDIT_COMPONENT_ACCESSIBILITY', 'data');
1355
+ break;
1343
1356
 
1344
1357
  // FigJam tools
1345
1358
  case 'CREATE_STICKY_RESULT':
package/package.json CHANGED
@@ -1,198 +1,102 @@
1
1
  {
2
-
3
2
  "name": "@mp3wizard/figma-console-mcp",
4
-
5
- "version": "1.21.2",
6
-
3
+ "version": "1.22.2",
7
4
  "description": "MCP server for accessing Figma plugin console logs and screenshots via Cloudflare Workers or local mode",
8
-
9
5
  "type": "module",
10
-
11
6
  "main": "dist/local.js",
12
-
13
7
  "types": "dist/local.d.ts",
14
-
15
8
  "bin": {
16
-
17
9
  "figma-console-mcp": "./dist/local.js"
18
-
19
10
  },
20
-
21
11
  "files": [
22
-
23
12
  "dist",
24
-
25
13
  "figma-desktop-bridge",
26
-
27
14
  "README.md",
28
-
29
15
  "LICENSE"
30
-
31
16
  ],
32
-
33
17
  "scripts": {
34
-
35
18
  "prepublishOnly": "npm run build",
36
-
37
19
  "deploy": "wrangler deploy",
38
-
39
20
  "dev": "wrangler dev",
40
-
41
21
  "dev:local": "tsx src/local.ts",
42
-
43
22
  "build": "npm run build:local && npm run build:cloudflare && npm run build:apps",
44
-
45
23
  "build:apps": "cross-env APP_NAME=token-browser vite build && cross-env APP_NAME=design-system-dashboard vite build",
46
-
47
24
  "dev:apps": "vite build --watch",
48
-
49
25
  "build:local": "tsc -p tsconfig.local.json",
50
-
51
26
  "build:cloudflare": "tsc -p tsconfig.cloudflare.json",
52
-
53
27
  "start": "wrangler dev",
54
-
55
28
  "test": "jest",
56
-
57
29
  "test:watch": "jest --watch",
58
-
59
30
  "test:coverage": "jest --coverage",
60
-
61
31
  "format": "biome format --write",
62
-
63
32
  "lint:fix": "biome lint --fix",
64
-
65
33
  "cf-typegen": "wrangler types",
66
-
67
34
  "type-check": "tsc --noEmit"
68
-
69
35
  },
70
-
71
36
  "keywords": [
72
-
73
37
  "mcp",
74
-
75
38
  "figma",
76
-
77
39
  "plugin",
78
-
79
40
  "console",
80
-
81
41
  "debugging",
82
-
83
42
  "ai",
84
-
85
43
  "anthropic",
86
-
87
44
  "claude",
88
-
89
45
  "cloudflare",
90
-
91
46
  "workers"
92
-
93
47
  ],
94
-
95
48
  "author": "Your Name",
96
-
97
49
  "license": "MIT",
98
-
99
50
  "repository": {
100
-
101
51
  "type": "git",
102
-
103
52
  "url": "https://github.com/mp3wizard/figma-console-mcp.git"
104
-
105
53
  },
106
-
107
54
  "engines": {
108
-
109
55
  "node": ">=18.0.0"
110
-
111
56
  },
112
-
113
57
  "overrides": {
114
-
115
58
  "path-to-regexp": ">=8.4.1",
116
-
117
59
  "vite": {
118
-
119
60
  "picomatch": ">=4.0.4"
120
-
121
61
  },
122
-
123
62
  "miniflare": {
124
-
125
63
  "undici": ">=7.24.0"
126
-
127
64
  },
128
-
129
65
  "handlebars": ">=4.7.9",
130
-
131
66
  "brace-expansion": ">=1.1.13",
132
-
133
67
  "lodash": ">=4.18.0",
134
-
135
68
  "picomatch": ">=4.0.4"
136
-
137
69
  },
138
-
139
70
  "dependencies": {
140
-
141
71
  "@cloudflare/puppeteer": "^1.0.4",
142
-
143
72
  "@modelcontextprotocol/ext-apps": "^1.0.1",
144
-
145
73
  "@modelcontextprotocol/sdk": "^1.26.0",
146
-
147
74
  "agents": "^0.7.1",
148
-
75
+ "axe-core": "^4.11.2",
149
76
  "chrome-remote-interface": "^0.33.2",
150
-
77
+ "jsdom": "^29.0.1",
151
78
  "pino": "^9.5.0",
152
-
153
79
  "pino-pretty": "^13.0.0",
154
-
155
80
  "puppeteer-core": "^23.11.1",
156
-
157
81
  "uuid": "^11.0.3",
158
-
159
82
  "ws": "^8.19.0",
160
-
161
83
  "zod": "^3.25.76"
162
-
163
84
  },
164
-
165
85
  "devDependencies": {
166
-
167
86
  "@biomejs/biome": "^2.2.5",
168
-
169
87
  "@types/jest": "^29.5.14",
170
-
88
+ "@types/jsdom": "^28.0.1",
171
89
  "@types/node": "^22.10.2",
172
-
173
90
  "@types/uuid": "^10.0.0",
174
-
175
91
  "@types/ws": "^8.18.1",
176
-
177
92
  "cross-env": "^7.0.3",
178
-
179
93
  "jest": "^29.7.0",
180
-
181
94
  "ts-jest": "^29.2.5",
182
-
183
95
  "tsx": "^4.19.2",
184
-
185
96
  "typescript": "5.9.3",
186
-
187
- "vite": "^6.0.0",
188
-
97
+ "vite": ">=6.4.2",
189
98
  "vite-plugin-singlefile": "^2.0.0",
190
-
191
99
  "wrangler": "^4.42.0",
192
-
193
100
  "zod-to-json-schema": "^3.25.1"
194
-
195
101
  }
196
-
197
102
  }
198
-