@adobe/design-data-agent-mcp 1.15.35 → 1.16.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@adobe/design-data-agent-mcp`
2
2
 
3
- MCP server and Claude Code skill for the [Spectrum Design Data](../../packages/design-data/) agent surface. Read tools (`primer`, `resolve_token`, `query_tokens`, `suggest_token`, `describe_component`, `describe_guideline`, `list_guidelines`) run fully in-process via `@adobe/design-data-wasm` — no CLI binary required for those. `suggest_token` uses the wasm `suggest` API directly; `authoring_session_step_intent` still invokes the native binary for session-state-aware ranking within an authoring flow.
3
+ MCP server and Claude Code skill for the [Spectrum Design Data](../../packages/design-data/) agent surface. Read tools (`primer`, `resolve_token`, `query_tokens`, `suggest_token`, `token_refinements`, `describe_component`, `describe_guideline`, `list_guidelines`) run fully in-process via `@adobe/design-data-wasm` — no CLI binary required for those. `suggest_token` uses the wasm `suggest` API directly; `authoring_session_step_intent` still invokes the native binary for session-state-aware ranking within an authoring flow.
4
4
 
5
5
  ## Testing guideline content
6
6
 
@@ -187,6 +187,7 @@ node tools/design-data-agent-mcp/src/index.js
187
187
  | `resolve_token` | Resolve a token property to its literal value |
188
188
  | `query_tokens` | Filter tokens by expression |
189
189
  | `suggest_token` | Suggest tokens matching a natural-language intent |
190
+ | `token_refinements` | A token's specificity and its narrower and broader neighbors |
190
191
  | `describe_component` | Fetch component schema and token bindings |
191
192
  | `describe_guideline` | Fetch guideline documentBlocks content and metadata |
192
193
  | `list_guidelines` | List guideline slugs and metadata, optionally by category |
package/llms.txt CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > MCP server and Claude Code skill for the design-data agent surface — read tools run in-process via wasm
4
4
 
5
- MCP server and Claude Code skill for the [Spectrum Design Data](../../packages/design-data/) agent surface. Read tools (`primer`, `resolve_token`, `query_tokens`, `suggest_token`, `describe_component`, `describe_guideline`, `list_guidelines`) run fully in-process via `@adobe/design-data-wasm` — no CLI binary required for those. `suggest_token` uses the wasm `suggest` API directly; `authoring_session_step_intent` still invokes the native binary for session-state-aware ranking within an authoring flow.
5
+ MCP server and Claude Code skill for the [Spectrum Design Data](../../packages/design-data/) agent surface. Read tools (`primer`, `resolve_token`, `query_tokens`, `suggest_token`, `token_refinements`, `describe_component`, `describe_guideline`, `list_guidelines`) run fully in-process via `@adobe/design-data-wasm` — no CLI binary required for those. `suggest_token` uses the wasm `suggest` API directly; `authoring_session_step_intent` still invokes the native binary for session-state-aware ranking within an authoring flow.
6
6
 
7
7
  ## Install
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/design-data-agent-mcp",
3
- "version": "1.15.35",
3
+ "version": "1.16.0",
4
4
  "description": "MCP server and Claude Code skill for the design-data agent surface — read tools run in-process via wasm",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -31,9 +31,9 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@modelcontextprotocol/sdk": "^1.27.1",
34
- "@adobe/design-data": "3.3.26",
35
- "@adobe/design-data-wasm": "0.29.0",
36
- "@adobe/spectrum-design-data": "3.21.0"
34
+ "@adobe/design-data": "3.3.28",
35
+ "@adobe/design-data-wasm": "0.31.0",
36
+ "@adobe/spectrum-design-data": "3.23.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "ava": "^6.0.1"
@@ -6,7 +6,7 @@ description: >
6
6
  system, token lookup, spec-conformance, drift detection, or token authoring on custom data.
7
7
  metadata:
8
8
  author: adobe
9
- version: "1.15.35"
9
+ version: "1.16.0"
10
10
  when_to_use: >
11
11
  Trigger on: design system, design tokens, spec-conformant, drift, validate tokens, token
12
12
  authoring, custom dataset, DESIGN_DATA_PATH, design-data validate, design-data diff,
@@ -118,7 +118,7 @@ text. Use this when the user describes what they need rather than knowing a toke
118
118
  Required: `id` (string) — kebab-case component ID, e.g. `button`, `action-button`
119
119
 
120
120
  Returns the component contract: `name`, `displayName`, `options`, `anatomy`, `states`,
121
- and `tokenBindings`.
121
+ and `relationships` (the component's token bindings).
122
122
 
123
123
  ***
124
124
 
package/src/tools/read.js CHANGED
@@ -273,7 +273,7 @@ export function createReadTools() {
273
273
  description:
274
274
  'Filter expression, e.g. "property=background-color". Valid keys: ' +
275
275
  "property, component, variant, state, colorScheme, scale, contrast, " +
276
- 'uuid, $schema. Note: "component" is not currently populated on ' +
276
+ 'uuid, $schema, tier (primitive, semantic or component), object, anatomy, colorRole. Results include purposeFields. Note: "component" is not currently populated on ' +
277
277
  "tokens — component=<id> always returns []; use describe_component instead.",
278
278
  },
279
279
  },
@@ -317,6 +317,43 @@ export function createReadTools() {
317
317
  },
318
318
  },
319
319
 
320
+ {
321
+ name: "token_refinements",
322
+ description:
323
+ "Show a token's semantic specificity (tier, then purpose-field count, derived from its " +
324
+ "name) and the same-property tokens that are narrower (add purpose fields) or broader " +
325
+ "(drop them). Each neighbor lists `fields` it adds or lacks and a `valueMatch`: " +
326
+ '"drop-in" (same value in every mode) or "consider" (differs; see `differingModes`). ' +
327
+ "Specificity only orders tokens; check the added fields fit the use before swapping.",
328
+ inputSchema: {
329
+ type: "object",
330
+ required: ["token"],
331
+ properties: {
332
+ token: {
333
+ type: "string",
334
+ description:
335
+ "Token name (e.g. neutral-content-color-hover), uuid or conceptId. A token without a name shown by query as `property=corner-radius scaleIndex=500` can be passed as that text.",
336
+ },
337
+ limit: {
338
+ type: "number",
339
+ description:
340
+ "Maximum narrower and broader tokens, each (default: 10)",
341
+ default: 10,
342
+ },
343
+ },
344
+ additionalProperties: false,
345
+ },
346
+ async handler({ token, limit = 10 }) {
347
+ const ds = await getDataset();
348
+ const result = ds.refinements(token, limit);
349
+ if (!result)
350
+ throw new Error(
351
+ `No token found for "${token}". Use a token name, uuid or conceptId, or the name shown by query_tokens.`,
352
+ );
353
+ return result;
354
+ },
355
+ },
356
+
320
357
  {
321
358
  name: "describe_component",
322
359
  description:
@@ -360,10 +397,8 @@ export function createReadTools() {
360
397
  }
361
398
  const component = JSON.parse(readFileSync(componentFile, "utf-8"));
362
399
 
363
- // Component/Token Relationships (CTRs) migrated most tokenBindings out
364
- // of the component file into relationships/<id>.json — merge them back
365
- // in so callers relying on this tool for a component's token bindings
366
- // still see them (see spectrum-design-data-x29.4).
400
+ // A component's token bindings live in relationships/<id>.json
401
+ // (Component/Token Relationships), not in the component file.
367
402
  const relationshipsDir = getCascadeAwareDir(
368
403
  config.relationshipsDir,
369
404
  "relationships",