@mp3wizard/figma-console-mcp 1.31.1 → 1.32.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.
- package/README.md +3 -2
- package/dist/cloudflare/core/accessibility-tools.js +55 -0
- package/dist/cloudflare/core/deep-component-tools.js +1 -1
- package/dist/cloudflare/core/figma-tools.js +1 -1
- package/dist/cloudflare/core/tokens-tools.js +1 -1
- package/dist/cloudflare/core/write-tools.js +40 -12
- package/dist/cloudflare/index.js +3 -3
- package/dist/core/accessibility-tools.d.ts.map +1 -1
- package/dist/core/accessibility-tools.js +55 -0
- package/dist/core/accessibility-tools.js.map +1 -1
- package/dist/core/deep-component-tools.js +1 -1
- package/dist/core/deep-component-tools.js.map +1 -1
- package/dist/core/figma-tools.js +1 -1
- package/dist/core/figma-tools.js.map +1 -1
- package/dist/core/tokens-tools.js +1 -1
- package/dist/core/write-tools.d.ts.map +1 -1
- package/dist/core/write-tools.js +40 -12
- package/dist/core/write-tools.js.map +1 -1
- package/figma-desktop-bridge/code.js +126 -12
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **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**, **debugging**, and **bidirectional token sync**.
|
|
10
10
|
|
|
11
|
-
> **🆕
|
|
11
|
+
> **🆕 Accessibility auditing now matches WCAG, not folklore (v1.32.0):** `figma_lint_design` no longer red-flags line height below 1.5× as an accessibility failure. **WCAG 1.4.12 Text Spacing** only requires that content *support* a user overriding text spacing without loss — not that designs *ship* at 1.5× — so a sub-1.5 line height is not a conformance failure. Line and paragraph spacing checks are now scoped to multi-line text (single-line labels, buttons, and headings are exempt), the readability hints are split into an opt-in `best-practice` group so `rules: ['wcag']` stays pure conformance, and the real 1.4.12 check now lives on the code side in `figma_scan_code_accessibility`. **Re-import the plugin once** to pick up the new audit behavior. [See what's new →](CHANGELOG.md#1320---2026-06-20)
|
|
12
12
|
|
|
13
13
|
## What is this?
|
|
14
14
|
|
|
@@ -808,9 +808,10 @@ The architecture supports adding new apps with minimal boilerplate — each app
|
|
|
808
808
|
|
|
809
809
|
## 🛤️ Roadmap
|
|
810
810
|
|
|
811
|
-
**Current Status:** v1.
|
|
811
|
+
**Current Status:** v1.32.0 (Stable) - Production-ready with WCAG-accurate accessibility auditing (line height below 1.5× is no longer mis-flagged as a failure; readability hints decoupled from conformance checks and scoped to multi-line text; code-side WCAG 1.4.12 check), a self-healing Desktop Bridge connection (zombie-process reaper + auto-reconnect watchdog — fixes the recurring "not connected until restart" bug), native variable binding on fills/strokes + typography control in the write tools, shared-library inspection (key-based component resolution + library variable read/import without Enterprise plan), 10-format token export pipeline (DTCG, CSS, Tailwind v4, Tailwind v3, SCSS, TS module, JSON flat/nested, Style Dictionary v3, Tokens Studio), bidirectional Figma↔code token sync, version history & time-series awareness, FigJam + Slides support, Cloud Write Relay, Design System Kit, WebSocket-only connectivity, smart multi-file tracking, **106 tools** (Local) / **95 tools** (Cloud) / **9 tools** (Remote read-only), Comments API, cross-MCP identity disambiguation, and MCP Apps.
|
|
812
812
|
|
|
813
813
|
**Recent Releases:**
|
|
814
|
+
- [x] **v1.32.0** - Accessibility-audit correctness fix reported by Isabella (a11y collaborator): `figma_lint_design` was flagging line height below 1.5× as an accessibility failure on hundreds of components. That misreads **WCAG 1.4.12 Text Spacing**, which requires content to *support* user spacing overrides without loss — not that designs *ship* at 1.5× — so a sub-1.5 line height is not a conformance failure. Line/paragraph-spacing checks are now scoped to multi-line text (single-line labels and buttons exempt); readability hints (`text-size`, `line-height`, `letter-spacing`, `paragraph-spacing`) are decoupled from the `wcag` group into an opt-in `best-practice` group, so the default audit (`['wcag','design-system','layout']`) and `rules: ['wcag']` return genuine conformance only; and a new code-side `text-spacing-support` advisory in `figma_scan_code_accessibility` flags fixed-px typography — where 1.4.12/1.4.4 are actually verifiable. No new tools, no arg-shape changes; **plugin re-import required** to pick up the new audit behavior (bridge protocol unchanged, so an un-updated plugin stays compatible). 1196 tests passing.
|
|
814
815
|
- [x] **v1.31.0** - Fixes the most-reported reliability bug: the Desktop Bridge connection dropping and staying down until you closed the plugin, restarted your MCP client, or killed ports by hand. Root cause was **zombie MCP server processes** squatting the WebSocket port range (9223–9232) after a bad shutdown. The reaper now escalates `SIGTERM` → `SIGKILL` (a hung server that ignores graceful shutdown can no longer survive), sweeps the range every 5 minutes via an `unref`'d periodic reaper, and a shutdown backstop prevents a server from zombifying in the first place. The redesigned Desktop Bridge plugin adds an auto-reconnect watchdog (re-probes every ~12s while disconnected), a context-aware **Pause / Resume / Reconnect** button, and a live server-count badge. No new tools; **plugin re-import required** (bridge `ui.html` + `code.js` changed). 1190 tests passing, including an integration test that spawns a real `SIGTERM`-ignoring process and asserts the reaper kills it.
|
|
815
816
|
- [x] **v1.30.0** - Native variable binding + typography in the structured write tools, closing the Plugin API gaps that used to force raw `figma_execute`. `figma_set_fills` / `figma_set_strokes` accept a `variableId` to bind a fill/stroke to a color variable via `setBoundVariableForPaint` (any plan, via the bridge). `figma_set_text` gains `fontFamily` / `fontStyle` with space-insensitive normalization (`SemiBold` → `Semi Bold`) and graceful `Regular` fallback. `figma_instantiate_component` pre-loads instance text fonts before applying overrides (fixes silently-skipped text overrides on non-Regular weights) and returns a `warnings` array for failed overrides. Also fixes a mixed-font crash in `figma_set_text` and a `ui.html` relay that was dropping new message fields. No new tools; **plugin re-import required** (bridge `ui.html` + `code.js` changed). Validated live; 1185 tests passing.
|
|
816
817
|
- [x] **v1.29.2** - Bug fix: `figma_generate_component_doc` now renders Figma component descriptions faithfully and reliably tags atomic-design level. Single-`#` headings in descriptions render as real sections (Usage Guidelines, Implementation Considerations, Accessibility Requirements, Content Configuration) instead of leaking as `- # Heading` list items; frontmatter `description` takes the first sentence instead of truncating on the word "Accessibility"; the generated Figma URL no longer doubles `?node-id=`; and the component's atomic level (atom/molecule/organism/template) is auto-detected via a single `ids=<node>` file request + divider walk-back, with no dependency on library publishing. No new tools; plugin re-import not required.
|
|
@@ -242,11 +242,58 @@ function formatAxeResults(axeResults) {
|
|
|
242
242
|
inapplicable: axeResults.inapplicable?.length || 0,
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* Heuristic WCAG 1.4.12 (Text Spacing) / 1.4.4 (Resize Text) signal for CODE.
|
|
247
|
+
*
|
|
248
|
+
* This is where text-spacing override support actually belongs: 1.4.12 is about whether
|
|
249
|
+
* content survives a USER overriding line/letter/word/paragraph spacing — it cannot be
|
|
250
|
+
* proven from a design's spacing value, only from the code. axe-core can't evaluate it
|
|
251
|
+
* (it needs layout), but the common, checkable risk indicator is fixed-px typography:
|
|
252
|
+
* line-height/font-size locked in px don't respond to spacing overrides or text-only zoom,
|
|
253
|
+
* whereas unitless line-height and rem/em sizing do. Surfaces fixed-px usage as an advisory
|
|
254
|
+
* (info) finding so teams verify reflow — without red-flagging sub-1.5 line heights, which
|
|
255
|
+
* are not failures.
|
|
256
|
+
*/
|
|
257
|
+
function scanTextSpacingSupport(html) {
|
|
258
|
+
// Collect CSS from <style> blocks and inline style="" attributes
|
|
259
|
+
let css = "";
|
|
260
|
+
const styleBlocks = html.match(/<style[^>]*>([\s\S]*?)<\/style>/gi) || [];
|
|
261
|
+
for (const block of styleBlocks)
|
|
262
|
+
css += block.replace(/<\/?style[^>]*>/gi, "") + "\n";
|
|
263
|
+
const inlineStyles = html.match(/style=["']([^"']*)["']/gi) || [];
|
|
264
|
+
for (const s of inlineStyles)
|
|
265
|
+
css += s.replace(/^style=["']|["']$/gi, "") + ";\n";
|
|
266
|
+
if (!css.trim())
|
|
267
|
+
return null;
|
|
268
|
+
// line-height: <n>px → won't grow when a user overrides text spacing (1.4.12 risk)
|
|
269
|
+
const pxLineHeights = css.match(/line-height\s*:\s*[\d.]+px/gi) || [];
|
|
270
|
+
// font-size: <n>px → won't scale on text-only zoom / 200% resize (1.4.4 risk)
|
|
271
|
+
const pxFontSizes = css.match(/font-size\s*:\s*[\d.]+px/gi) || [];
|
|
272
|
+
if (pxLineHeights.length === 0 && pxFontSizes.length === 0)
|
|
273
|
+
return null;
|
|
274
|
+
const samples = [
|
|
275
|
+
...pxLineHeights.slice(0, 5).map((m) => m.trim()),
|
|
276
|
+
...pxFontSizes.slice(0, 5).map((m) => m.trim()),
|
|
277
|
+
];
|
|
278
|
+
return {
|
|
279
|
+
rule: "text-spacing-support",
|
|
280
|
+
severity: "info",
|
|
281
|
+
count: pxLineHeights.length + pxFontSizes.length,
|
|
282
|
+
description: `Typography uses fixed px units (${pxLineHeights.length} px line-height, ${pxFontSizes.length} px font-size). ` +
|
|
283
|
+
"This is where WCAG 1.4.12 (Text Spacing) and 1.4.4 (Resize Text) are actually verified — not on the design side. " +
|
|
284
|
+
"Prefer unitless line-height (e.g. line-height: 1.4) and rem/em font sizes so user spacing overrides and text-only zoom do not clip or overlap content. " +
|
|
285
|
+
"Advisory only: a sub-1.5 line height is NOT a failure — confirm content still reflows when the 1.4.12 text-spacing overrides are applied.",
|
|
286
|
+
wcagTags: ["wcag22aa", "wcag1412", "wcag144"],
|
|
287
|
+
helpUrl: "https://www.w3.org/WAI/WCAG22/Understanding/text-spacing.html",
|
|
288
|
+
samples,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
245
291
|
export function registerAccessibilityTools(server) {
|
|
246
292
|
server.tool("figma_scan_code_accessibility", "Scan HTML code for accessibility violations using axe-core (Deque). " +
|
|
247
293
|
"Runs structural/semantic checks via JSDOM: ARIA attributes, roles, labels, alt text, " +
|
|
248
294
|
"form labels, heading order, landmarks, semantic HTML, tabindex, duplicate IDs, lang attribute, and ~50 more rules. " +
|
|
249
295
|
"Visual checks (color contrast, focus visibility) are disabled in this mode — use figma_lint_design for visual a11y on the design side. " +
|
|
296
|
+
"Also surfaces a WCAG 1.4.12 (Text Spacing) / 1.4.4 (Resize Text) advisory when typography is locked to fixed px units — the code side is where text-spacing override support is actually verified (a sub-1.5 line height in a design is not itself a failure). " +
|
|
250
297
|
"Together, these two tools provide full-spectrum accessibility coverage across design and code. " +
|
|
251
298
|
"Pass component HTML directly or use with figma_check_design_parity for design-to-code a11y comparison. " +
|
|
252
299
|
"No Figma connection required — this is a standalone code analysis tool.", {
|
|
@@ -264,6 +311,14 @@ export function registerAccessibilityTools(server) {
|
|
|
264
311
|
context: context || undefined,
|
|
265
312
|
});
|
|
266
313
|
const formatted = formatAxeResults(axeResults);
|
|
314
|
+
// Supplementary WCAG 1.4.12 / 1.4.4 advisory — axe can't see layout/overrides,
|
|
315
|
+
// and this (not the design side) is where text-spacing support is verifiable.
|
|
316
|
+
const textSpacing = scanTextSpacingSupport(html);
|
|
317
|
+
if (textSpacing) {
|
|
318
|
+
formatted.categories.push(textSpacing);
|
|
319
|
+
formatted.summary.info += textSpacing.count;
|
|
320
|
+
formatted.summary.total += textSpacing.count;
|
|
321
|
+
}
|
|
267
322
|
// Optionally strip pass/incomplete counts to save tokens
|
|
268
323
|
if (!includePassingRules) {
|
|
269
324
|
delete formatted.passes;
|
|
@@ -78,7 +78,7 @@ export function registerDeepComponentTools(server, getDesktopConnector) {
|
|
|
78
78
|
// -----------------------------------------------------------------------
|
|
79
79
|
// Tool: figma_analyze_component_set
|
|
80
80
|
// -----------------------------------------------------------------------
|
|
81
|
-
server.tool("figma_analyze_component_set", "Analyze a Figma COMPONENT_SET to extract variant state machine and cross-variant diffs for code generation. Returns: (1) variant axes (size, state) with all values, (2) CSS pseudo-class mappings for interaction states (hover→:hover, focus→:focus-visible, disabled→:disabled, error→[aria-invalid]), (3) visual diff from default state per variant (only changed properties — fill token, stroke token, stroke weight, text color, opacity, effects, visibility), (4) component property definitions mapped to code props (BOOLEAN→boolean, TEXT→string, INSTANCE_SWAP→slot/ReactNode). Use this on the parent COMPONENT_SET node, not individual variants. Requires Desktop Bridge plugin.", {
|
|
81
|
+
server.tool("figma_analyze_component_set", "Analyze a Figma COMPONENT_SET to extract variant state machine and cross-variant diffs for code generation. Returns: (1) variant axes (size, state) with all values, (2) CSS pseudo-class mappings for interaction states (hover→:hover, focus→:focus-visible, disabled→:disabled, error→[aria-invalid]), (3) visual diff from default state per variant (only changed properties — fill token, stroke token, stroke weight, text color, opacity, effects, visibility), (4) component property definitions mapped to code props (BOOLEAN→boolean, TEXT→string, INSTANCE_SWAP→slot/ReactNode), and (5) slots — Figma SLOT properties (name, preferredValues = the components a slot accepts, and limitViolations) to implement as named slots / children props (React {children} or named ReactNode; Web Components <slot name>). Use this on the parent COMPONENT_SET node, not individual variants. Requires Desktop Bridge plugin.", {
|
|
82
82
|
nodeId: z
|
|
83
83
|
.string()
|
|
84
84
|
.describe("COMPONENT_SET node ID (the parent of all variants, e.g., '214:274')"),
|
|
@@ -2403,7 +2403,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, variab
|
|
|
2403
2403
|
}
|
|
2404
2404
|
});
|
|
2405
2405
|
// Tool 13: Get Component for Development (UI Implementation)
|
|
2406
|
-
server.tool("figma_get_component_for_development", "Get component data optimized for high-fidelity UI implementation. Returns a deep component tree (depth 4) with design tokens (boundVariables), interaction states (reactions), sizing constraints (min/max/layoutSizing), text behavior (autoResize, truncation), and design annotations. Automatically includes 2x rendered image. Use when user asks to: 'build this component', 'implement this in React/Vue', 'generate code for', or needs both visual reference and technical specs for production-quality, accessible, token-aware code. For just metadata/descriptions, use figma_get_component. For just image, use figma_get_component_image. For full annotation details, use figma_get_annotations. To resolve variable IDs to names/values, use figma_get_variables.", {
|
|
2406
|
+
server.tool("figma_get_component_for_development", "Get component data optimized for high-fidelity UI implementation. Returns a deep component tree (depth 4) with design tokens (boundVariables), interaction states (reactions), sizing constraints (min/max/layoutSizing), text behavior (autoResize, truncation), Figma slots (named freeform-content regions on a component, with the components each accepts and any min/max limit violations), and design annotations. Automatically includes 2x rendered image. Use when user asks to: 'build this component', 'implement this in React/Vue', 'generate code for', or needs both visual reference and technical specs for production-quality, accessible, token-aware code. For just metadata/descriptions, use figma_get_component. For just image, use figma_get_component_image. For full annotation details, use figma_get_annotations. To resolve variable IDs to names/values, use figma_get_variables.", {
|
|
2407
2407
|
fileUrl: z
|
|
2408
2408
|
.string()
|
|
2409
2409
|
.url()
|
|
@@ -30,7 +30,7 @@ const logger = createChildLogger({ component: "tokens-tools" });
|
|
|
30
30
|
* on every exported token document. Kept in sync with package.json by
|
|
31
31
|
* scripts/release.sh — see step 3 of the release flow.
|
|
32
32
|
*/
|
|
33
|
-
const MCP_VERSION = "1.
|
|
33
|
+
const MCP_VERSION = "1.32.0";
|
|
34
34
|
const EXPORT_TOOL_DESCRIPTION = `Export Figma variables to design token files in your codebase. Bidirectional with figma_import_tokens — together they replace Style Dictionary and Tokens Studio's export pipeline for the popular styling methods.
|
|
35
35
|
|
|
36
36
|
FULLY-IMPLEMENTED OUTPUT FORMATS:
|
|
@@ -76,28 +76,53 @@ Layers: If your code creates helper frames, placeholder nodes, or intermediate l
|
|
|
76
76
|
// VARIABLE MANAGEMENT TOOLS
|
|
77
77
|
// ============================================================================
|
|
78
78
|
// Tool: Update a variable's value
|
|
79
|
-
server.tool("figma_update_variable", "Update a single variable's value. For
|
|
79
|
+
server.tool("figma_update_variable", "Update a single variable's value and/or its description. Pass modeId+value to change the value in a mode; pass description to set the 'How to use this variable' text shown in the Variables panel (and exported as DTCG $description). At least one of {modeId+value} or {description} is required. For many value updates at once, use figma_batch_update_variables (10-50x faster). Use figma_get_variables first for IDs. COLOR: hex '#FF0000', FLOAT: number, STRING: text, BOOLEAN: true/false. Requires Desktop Bridge plugin.", {
|
|
80
80
|
variableId: z
|
|
81
81
|
.string()
|
|
82
82
|
.describe("The variable ID to update (e.g., 'VariableID:123:456'). Get this from figma_get_variables."),
|
|
83
83
|
modeId: z
|
|
84
84
|
.string()
|
|
85
|
-
.
|
|
85
|
+
.optional()
|
|
86
|
+
.describe("The mode ID to update the value in (e.g., '1:0'). Required when updating a value. Get this from the variable's collection modes."),
|
|
86
87
|
value: z
|
|
87
88
|
.union([z.string(), z.number(), z.boolean()])
|
|
88
|
-
.
|
|
89
|
-
|
|
89
|
+
.optional()
|
|
90
|
+
.describe("The new value (requires modeId). For COLOR: hex string like '#FF0000'. For FLOAT: number. For STRING: text. For BOOLEAN: true/false."),
|
|
91
|
+
description: z
|
|
92
|
+
.string()
|
|
93
|
+
.optional()
|
|
94
|
+
.describe("Set the variable's description (the 'How to use this variable' field; exported as DTCG $description). Pass an empty string to clear it."),
|
|
95
|
+
}, async ({ variableId, modeId, value, description }) => {
|
|
90
96
|
try {
|
|
91
97
|
const connector = await getDesktopConnector();
|
|
92
|
-
const
|
|
98
|
+
const hasValueUpdate = modeId !== undefined && value !== undefined;
|
|
99
|
+
const hasDescriptionUpdate = description !== undefined;
|
|
100
|
+
if ((modeId !== undefined) !== (value !== undefined)) {
|
|
101
|
+
throw new Error("Both modeId and value are required together to update a value.");
|
|
102
|
+
}
|
|
103
|
+
if (!hasValueUpdate && !hasDescriptionUpdate) {
|
|
104
|
+
throw new Error("Nothing to update: provide modeId+value to change the value, and/or description to set the description.");
|
|
105
|
+
}
|
|
106
|
+
let variable;
|
|
107
|
+
const updated = [];
|
|
108
|
+
if (hasValueUpdate) {
|
|
109
|
+
const result = await connector.updateVariable(variableId, modeId, value);
|
|
110
|
+
variable = result.variable;
|
|
111
|
+
updated.push("value");
|
|
112
|
+
}
|
|
113
|
+
if (hasDescriptionUpdate) {
|
|
114
|
+
const result = await connector.setVariableDescription(variableId, description);
|
|
115
|
+
variable = result.variable || variable;
|
|
116
|
+
updated.push("description");
|
|
117
|
+
}
|
|
93
118
|
return {
|
|
94
119
|
content: [
|
|
95
120
|
{
|
|
96
121
|
type: "text",
|
|
97
122
|
text: JSON.stringify({
|
|
98
123
|
success: true,
|
|
99
|
-
message: `Variable "${
|
|
100
|
-
variable
|
|
124
|
+
message: `Variable "${variable?.name ?? variableId}" updated successfully (${updated.join(" + ")})`,
|
|
125
|
+
variable,
|
|
101
126
|
timestamp: Date.now(),
|
|
102
127
|
}),
|
|
103
128
|
},
|
|
@@ -2083,22 +2108,25 @@ return {
|
|
|
2083
2108
|
});
|
|
2084
2109
|
// Tool: Lint Design for accessibility and quality issues
|
|
2085
2110
|
server.tool("figma_lint_design", "Run comprehensive accessibility (WCAG 2.2) and design quality checks on the current page or a specific node tree. " +
|
|
2086
|
-
"WCAG checks (
|
|
2087
|
-
"focus indicators (2.4.7),
|
|
2088
|
-
"
|
|
2111
|
+
"WCAG conformance checks (10 rules): color contrast (AA), non-text contrast (1.4.11), color-only differentiation (1.4.1), " +
|
|
2112
|
+
"focus indicators (2.4.7), touch targets (2.5.8), image alt text (1.1.1), heading hierarchy (1.3.1), " +
|
|
2113
|
+
"reflow/responsive (1.4.10), reading order (1.3.2), and disabled context (4.1.2). " +
|
|
2114
|
+
"Best-practice readability hints (opt-in via rules: ['best-practice'] or ['all']): text sizing, line height, letter spacing, paragraph spacing. " +
|
|
2115
|
+
"Note: line/paragraph spacing below 1.5x/2x is NOT a WCAG 1.4.12 failure — 1.4.12 requires supporting user spacing overrides without breaking (a code concern, see figma_scan_code_accessibility), not specific design values — so these are non-normative hints scoped to multi-line text only. " +
|
|
2089
2116
|
"Design system checks: hardcoded colors, missing text styles, default names, detached components. " +
|
|
2090
2117
|
"Layout checks: missing auto-layout, empty containers. " +
|
|
2118
|
+
"Default audit runs WCAG + design-system + layout (best-practice hints excluded). " +
|
|
2091
2119
|
"Returns categorized findings with severity levels (critical/warning/info) and WCAG conformance level (a/aa/aaa/best-practice) so teams can filter by target level. " +
|
|
2092
2120
|
"Use natural language like 'check my design for accessibility issues' or 'lint this page'. " +
|
|
2093
2121
|
"Requires Desktop Bridge plugin.", {
|
|
2094
2122
|
nodeId: z.string().optional().describe("Node ID to lint (defaults to current page)"),
|
|
2095
|
-
rules: z.array(z.string()).optional().describe("Rule filter: ['
|
|
2123
|
+
rules: z.array(z.string()).optional().describe("Rule filter. Default (omitted) = ['wcag','design-system','layout'] — real WCAG conformance plus quality checks, with best-practice hints excluded. Groups: ['wcag'] (10 conformance rules), ['best-practice'] (text-size, line-height, letter-spacing, paragraph-spacing), ['all'] (everything incl. best-practice), ['design-system'], ['layout']. Or specific rule IDs like ['wcag-contrast', 'wcag-focus-indicator', 'wcag-disabled-no-context']."),
|
|
2096
2124
|
maxDepth: z.number().optional().describe("Maximum tree depth to traverse (default: 10)"),
|
|
2097
2125
|
maxFindings: z.number().optional().describe("Maximum findings before stopping (default: 100)"),
|
|
2098
2126
|
}, async ({ nodeId, rules, maxDepth, maxFindings }) => {
|
|
2099
2127
|
try {
|
|
2100
2128
|
const connector = await getDesktopConnector();
|
|
2101
|
-
const result = await connector.lintDesign(nodeId, rules || ['
|
|
2129
|
+
const result = await connector.lintDesign(nodeId, rules || ['wcag', 'design-system', 'layout'], maxDepth || 10, maxFindings || 100);
|
|
2102
2130
|
if (!result.success) {
|
|
2103
2131
|
throw new Error(result.error || "Lint failed");
|
|
2104
2132
|
}
|
package/dist/cloudflare/index.js
CHANGED
|
@@ -74,7 +74,7 @@ export class FigmaConsoleMCPv3 extends McpAgent {
|
|
|
74
74
|
this.server = (() => {
|
|
75
75
|
const s = new McpServer({
|
|
76
76
|
name: "Figma Console MCP",
|
|
77
|
-
version: "1.
|
|
77
|
+
version: "1.32.0",
|
|
78
78
|
});
|
|
79
79
|
// Identity wrap — every tool's response and thrown error gets stamped
|
|
80
80
|
// with our MCP name so cross-MCP attribution is unambiguous.
|
|
@@ -1083,7 +1083,7 @@ export default {
|
|
|
1083
1083
|
});
|
|
1084
1084
|
const statelessServer = new McpServer({
|
|
1085
1085
|
name: "Figma Console MCP",
|
|
1086
|
-
version: "1.
|
|
1086
|
+
version: "1.32.0",
|
|
1087
1087
|
});
|
|
1088
1088
|
wrapServerForIdentity(statelessServer);
|
|
1089
1089
|
// ================================================================
|
|
@@ -1720,7 +1720,7 @@ export default {
|
|
|
1720
1720
|
return new Response(JSON.stringify({
|
|
1721
1721
|
status: "healthy",
|
|
1722
1722
|
service: "Figma Console MCP",
|
|
1723
|
-
version: "1.
|
|
1723
|
+
version: "1.32.0",
|
|
1724
1724
|
endpoints: {
|
|
1725
1725
|
mcp: ["/sse", "/mcp"],
|
|
1726
1726
|
oauth_mcp_spec: ["/.well-known/oauth-authorization-server", "/authorize", "/token", "/oauth/register"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessibility-tools.d.ts","sourceRoot":"","sources":["../../src/core/accessibility-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA6FpE;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAoGvF;
|
|
1
|
+
{"version":3,"file":"accessibility-tools.d.ts","sourceRoot":"","sources":["../../src/core/accessibility-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA6FpE;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAoGvF;AAgHD,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,SAAS,GACf,IAAI,CAmFN"}
|
|
@@ -242,11 +242,58 @@ function formatAxeResults(axeResults) {
|
|
|
242
242
|
inapplicable: axeResults.inapplicable?.length || 0,
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* Heuristic WCAG 1.4.12 (Text Spacing) / 1.4.4 (Resize Text) signal for CODE.
|
|
247
|
+
*
|
|
248
|
+
* This is where text-spacing override support actually belongs: 1.4.12 is about whether
|
|
249
|
+
* content survives a USER overriding line/letter/word/paragraph spacing — it cannot be
|
|
250
|
+
* proven from a design's spacing value, only from the code. axe-core can't evaluate it
|
|
251
|
+
* (it needs layout), but the common, checkable risk indicator is fixed-px typography:
|
|
252
|
+
* line-height/font-size locked in px don't respond to spacing overrides or text-only zoom,
|
|
253
|
+
* whereas unitless line-height and rem/em sizing do. Surfaces fixed-px usage as an advisory
|
|
254
|
+
* (info) finding so teams verify reflow — without red-flagging sub-1.5 line heights, which
|
|
255
|
+
* are not failures.
|
|
256
|
+
*/
|
|
257
|
+
function scanTextSpacingSupport(html) {
|
|
258
|
+
// Collect CSS from <style> blocks and inline style="" attributes
|
|
259
|
+
let css = "";
|
|
260
|
+
const styleBlocks = html.match(/<style[^>]*>([\s\S]*?)<\/style>/gi) || [];
|
|
261
|
+
for (const block of styleBlocks)
|
|
262
|
+
css += block.replace(/<\/?style[^>]*>/gi, "") + "\n";
|
|
263
|
+
const inlineStyles = html.match(/style=["']([^"']*)["']/gi) || [];
|
|
264
|
+
for (const s of inlineStyles)
|
|
265
|
+
css += s.replace(/^style=["']|["']$/gi, "") + ";\n";
|
|
266
|
+
if (!css.trim())
|
|
267
|
+
return null;
|
|
268
|
+
// line-height: <n>px → won't grow when a user overrides text spacing (1.4.12 risk)
|
|
269
|
+
const pxLineHeights = css.match(/line-height\s*:\s*[\d.]+px/gi) || [];
|
|
270
|
+
// font-size: <n>px → won't scale on text-only zoom / 200% resize (1.4.4 risk)
|
|
271
|
+
const pxFontSizes = css.match(/font-size\s*:\s*[\d.]+px/gi) || [];
|
|
272
|
+
if (pxLineHeights.length === 0 && pxFontSizes.length === 0)
|
|
273
|
+
return null;
|
|
274
|
+
const samples = [
|
|
275
|
+
...pxLineHeights.slice(0, 5).map((m) => m.trim()),
|
|
276
|
+
...pxFontSizes.slice(0, 5).map((m) => m.trim()),
|
|
277
|
+
];
|
|
278
|
+
return {
|
|
279
|
+
rule: "text-spacing-support",
|
|
280
|
+
severity: "info",
|
|
281
|
+
count: pxLineHeights.length + pxFontSizes.length,
|
|
282
|
+
description: `Typography uses fixed px units (${pxLineHeights.length} px line-height, ${pxFontSizes.length} px font-size). ` +
|
|
283
|
+
"This is where WCAG 1.4.12 (Text Spacing) and 1.4.4 (Resize Text) are actually verified — not on the design side. " +
|
|
284
|
+
"Prefer unitless line-height (e.g. line-height: 1.4) and rem/em font sizes so user spacing overrides and text-only zoom do not clip or overlap content. " +
|
|
285
|
+
"Advisory only: a sub-1.5 line height is NOT a failure — confirm content still reflows when the 1.4.12 text-spacing overrides are applied.",
|
|
286
|
+
wcagTags: ["wcag22aa", "wcag1412", "wcag144"],
|
|
287
|
+
helpUrl: "https://www.w3.org/WAI/WCAG22/Understanding/text-spacing.html",
|
|
288
|
+
samples,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
245
291
|
export function registerAccessibilityTools(server) {
|
|
246
292
|
server.tool("figma_scan_code_accessibility", "Scan HTML code for accessibility violations using axe-core (Deque). " +
|
|
247
293
|
"Runs structural/semantic checks via JSDOM: ARIA attributes, roles, labels, alt text, " +
|
|
248
294
|
"form labels, heading order, landmarks, semantic HTML, tabindex, duplicate IDs, lang attribute, and ~50 more rules. " +
|
|
249
295
|
"Visual checks (color contrast, focus visibility) are disabled in this mode — use figma_lint_design for visual a11y on the design side. " +
|
|
296
|
+
"Also surfaces a WCAG 1.4.12 (Text Spacing) / 1.4.4 (Resize Text) advisory when typography is locked to fixed px units — the code side is where text-spacing override support is actually verified (a sub-1.5 line height in a design is not itself a failure). " +
|
|
250
297
|
"Together, these two tools provide full-spectrum accessibility coverage across design and code. " +
|
|
251
298
|
"Pass component HTML directly or use with figma_check_design_parity for design-to-code a11y comparison. " +
|
|
252
299
|
"No Figma connection required — this is a standalone code analysis tool.", {
|
|
@@ -264,6 +311,14 @@ export function registerAccessibilityTools(server) {
|
|
|
264
311
|
context: context || undefined,
|
|
265
312
|
});
|
|
266
313
|
const formatted = formatAxeResults(axeResults);
|
|
314
|
+
// Supplementary WCAG 1.4.12 / 1.4.4 advisory — axe can't see layout/overrides,
|
|
315
|
+
// and this (not the design side) is where text-spacing support is verifiable.
|
|
316
|
+
const textSpacing = scanTextSpacingSupport(html);
|
|
317
|
+
if (textSpacing) {
|
|
318
|
+
formatted.categories.push(textSpacing);
|
|
319
|
+
formatted.summary.info += textSpacing.count;
|
|
320
|
+
formatted.summary.total += textSpacing.count;
|
|
321
|
+
}
|
|
267
322
|
// Optionally strip pass/incomplete counts to save tokens
|
|
268
323
|
if (!includePassingRules) {
|
|
269
324
|
delete formatted.passes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessibility-tools.js","sourceRoot":"","sources":["../../src/core/accessibility-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qDAAqD;AACrD,IAAI,OAAO,GAAQ,IAAI,CAAC;AACxB,IAAI,KAAK,GAAQ,IAAI,CAAC;AACtB,IAAI,UAAU,GAAG,KAAK,CAAC;AACvB,IAAI,SAAS,GAAkB,IAAI,CAAC;AAEpC,KAAK,UAAU,QAAQ;IACtB,IAAI,UAAU;QAAE,OAAO;IACvB,IAAI,CAAC;QACJ,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;QACnC,sCAAsC;QACtC,IAAI,OAAO,CAAC,OAAO;YAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/C,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1C,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QAC1B,UAAU,GAAG,IAAI,CAAC;IACnB,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QACjB,SAAS,GAAG,qEAAqE,CAAC,CAAC,OAAO,EAAE,CAAC;QAC7F,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACH,KAAK,UAAU,eAAe,CAC7B,IAAY,EACZ,UAII,EAAE;IAEN,MAAM,QAAQ,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gBACnB,SAAS,CAAC,qBAAqB,GAAG,oBAAoB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBACzE,SAAS,CAAC,qBAAqB,CAAC,MAAM,GAAG,6GAA6G,CAAC;YACxJ,CAAC;YAED,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;qBACxC;iBACD;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;YAC7D,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,mCAAmC,CAAC,CAAC;YAC7D,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACpB,KAAK,EAAE,KAAK,CAAC,OAAO;4BACpB,IAAI,EAAE,WAAW;gCAChB,CAAC,CAAC,kDAAkD;gCACpD,CAAC,CAAC,+FAA+F;yBAClG,CAAC;qBACF;iBACD;gBACD,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -78,7 +78,7 @@ export function registerDeepComponentTools(server, getDesktopConnector) {
|
|
|
78
78
|
// -----------------------------------------------------------------------
|
|
79
79
|
// Tool: figma_analyze_component_set
|
|
80
80
|
// -----------------------------------------------------------------------
|
|
81
|
-
server.tool("figma_analyze_component_set", "Analyze a Figma COMPONENT_SET to extract variant state machine and cross-variant diffs for code generation. Returns: (1) variant axes (size, state) with all values, (2) CSS pseudo-class mappings for interaction states (hover→:hover, focus→:focus-visible, disabled→:disabled, error→[aria-invalid]), (3) visual diff from default state per variant (only changed properties — fill token, stroke token, stroke weight, text color, opacity, effects, visibility), (4) component property definitions mapped to code props (BOOLEAN→boolean, TEXT→string, INSTANCE_SWAP→slot/ReactNode). Use this on the parent COMPONENT_SET node, not individual variants. Requires Desktop Bridge plugin.", {
|
|
81
|
+
server.tool("figma_analyze_component_set", "Analyze a Figma COMPONENT_SET to extract variant state machine and cross-variant diffs for code generation. Returns: (1) variant axes (size, state) with all values, (2) CSS pseudo-class mappings for interaction states (hover→:hover, focus→:focus-visible, disabled→:disabled, error→[aria-invalid]), (3) visual diff from default state per variant (only changed properties — fill token, stroke token, stroke weight, text color, opacity, effects, visibility), (4) component property definitions mapped to code props (BOOLEAN→boolean, TEXT→string, INSTANCE_SWAP→slot/ReactNode), and (5) slots — Figma SLOT properties (name, preferredValues = the components a slot accepts, and limitViolations) to implement as named slots / children props (React {children} or named ReactNode; Web Components <slot name>). Use this on the parent COMPONENT_SET node, not individual variants. Requires Desktop Bridge plugin.", {
|
|
82
82
|
nodeId: z
|
|
83
83
|
.string()
|
|
84
84
|
.describe("COMPONENT_SET node ID (the parent of all variants, e.g., '214:274')"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep-component-tools.js","sourceRoot":"","sources":["../../src/core/deep-component-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,GAAG,iBAAiB,CAAC,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAAC,CAAC;AAExE,MAAM,UAAU,0BAA0B,CACzC,MAAiB,EACjB,mBAAuC;IAEvC,MAAM,CAAC,IAAI,CACV,0CAA0C,EAC1C,sqBAAsqB,EACtqB;QACC,MAAM,EAAE,CAAC;aACP,MAAM,EAAE;aACR,QAAQ,CAAC,gDAAgD,CAAC;QAC5D,KAAK,EAAE,CAAC,CAAC,UAAU,CAClB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,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K,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,+BAA+B,CAAC,CAAC;YAEzD,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACpB,KAAK,EAAE,8BAA8B;4BACrC,OAAO,EAAE,iCAAiC,OAAO,EAAE;4BACnD,IAAI,EAAE,2JAA2J;yBACjK,CAAC;qBACF;iBACD;gBACD,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
package/dist/core/figma-tools.js
CHANGED
|
@@ -2403,7 +2403,7 @@ export function registerFigmaAPITools(server, getFigmaAPI, getCurrentUrl, variab
|
|
|
2403
2403
|
}
|
|
2404
2404
|
});
|
|
2405
2405
|
// Tool 13: Get Component for Development (UI Implementation)
|
|
2406
|
-
server.tool("figma_get_component_for_development", "Get component data optimized for high-fidelity UI implementation. Returns a deep component tree (depth 4) with design tokens (boundVariables), interaction states (reactions), sizing constraints (min/max/layoutSizing), text behavior (autoResize, truncation), and design annotations. Automatically includes 2x rendered image. Use when user asks to: 'build this component', 'implement this in React/Vue', 'generate code for', or needs both visual reference and technical specs for production-quality, accessible, token-aware code. For just metadata/descriptions, use figma_get_component. For just image, use figma_get_component_image. For full annotation details, use figma_get_annotations. To resolve variable IDs to names/values, use figma_get_variables.", {
|
|
2406
|
+
server.tool("figma_get_component_for_development", "Get component data optimized for high-fidelity UI implementation. Returns a deep component tree (depth 4) with design tokens (boundVariables), interaction states (reactions), sizing constraints (min/max/layoutSizing), text behavior (autoResize, truncation), Figma slots (named freeform-content regions on a component, with the components each accepts and any min/max limit violations), and design annotations. Automatically includes 2x rendered image. Use when user asks to: 'build this component', 'implement this in React/Vue', 'generate code for', or needs both visual reference and technical specs for production-quality, accessible, token-aware code. For just metadata/descriptions, use figma_get_component. For just image, use figma_get_component_image. For full annotation details, use figma_get_annotations. To resolve variable IDs to names/values, use figma_get_variables.", {
|
|
2407
2407
|
fileUrl: z
|
|
2408
2408
|
.string()
|
|
2409
2409
|
.url()
|