@adobe/design-data-mcp 1.8.13 → 1.9.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 +10 -9
- package/package.json +4 -4
- package/src/tools/design-data.js +55 -0
package/README.md
CHANGED
|
@@ -59,15 +59,16 @@ any network failure (offline/air-gapped use is unaffected); set
|
|
|
59
59
|
|
|
60
60
|
## Tools
|
|
61
61
|
|
|
62
|
-
| Tool
|
|
63
|
-
|
|
|
64
|
-
| `design-data-primer`
|
|
65
|
-
| `design-data-query`
|
|
66
|
-
| `design-data-suggest`
|
|
67
|
-
| `design-data-component`
|
|
68
|
-
| `design-data-
|
|
69
|
-
| `design-data-
|
|
70
|
-
| `design-data-guideline`
|
|
62
|
+
| Tool | Description |
|
|
63
|
+
| ------------------------------ | ----------------------------------------------------------------------------------- |
|
|
64
|
+
| `design-data-primer` | Session-start overview: token count, mode-sets, components, guidelines, provenance |
|
|
65
|
+
| `design-data-query` | Filter tokens by query expression (`component=button`, `property=color-*`) |
|
|
66
|
+
| `design-data-suggest` | Natural-language token suggestions with Jaccard similarity confidence scores |
|
|
67
|
+
| `design-data-component` | Full component schema (variants, sizes, states, props) by kebab-case ID |
|
|
68
|
+
| `design-data-component-search` | Search components by name, description, or docs text; returns id, category, snippet |
|
|
69
|
+
| `design-data-resolve` | Resolve a token's concrete value for a mode context (colorScheme, scale, contrast) |
|
|
70
|
+
| `design-data-guideline-list` | List available Spectrum design guideline pages, optionally filtered by category |
|
|
71
|
+
| `design-data-guideline` | Full guideline document by slug ID (purpose, rules, accessibility, examples) |
|
|
71
72
|
|
|
72
73
|
## Testing guideline content
|
|
73
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/design-data-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "MCP server for Spectrum design tokens, component schemas, and design guidelines (embedded, offline)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
32
|
-
"@adobe/design-data": "
|
|
33
|
-
"@adobe/design-data
|
|
34
|
-
"@adobe/
|
|
32
|
+
"@adobe/design-data-wasm": "0.14.0",
|
|
33
|
+
"@adobe/spectrum-design-data": "3.8.0",
|
|
34
|
+
"@adobe/design-data": "3.3.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@anthropic-ai/mcpb": "^2.1.2",
|
package/src/tools/design-data.js
CHANGED
|
@@ -20,6 +20,7 @@ import { createRequire } from "module";
|
|
|
20
20
|
import { readFileSync, existsSync } from "fs";
|
|
21
21
|
import { join, dirname, resolve, sep } from "path";
|
|
22
22
|
|
|
23
|
+
import { searchComponents } from "@adobe/design-data/component";
|
|
23
24
|
import { listGuidelines, loadGuideline } from "@adobe/design-data/guideline";
|
|
24
25
|
|
|
25
26
|
import { checkDatasetFreshness } from "../dataset-freshness.js";
|
|
@@ -286,6 +287,60 @@ export function createDesignDataTools() {
|
|
|
286
287
|
},
|
|
287
288
|
},
|
|
288
289
|
|
|
290
|
+
// ── component search ────────────────────────────────────────────────────
|
|
291
|
+
{
|
|
292
|
+
name: "design-data-component-search",
|
|
293
|
+
annotations: {
|
|
294
|
+
title: "Design Data: Search Components",
|
|
295
|
+
readOnlyHint: true,
|
|
296
|
+
openWorldHint: false,
|
|
297
|
+
},
|
|
298
|
+
description:
|
|
299
|
+
"Search Spectrum components by name, description, or documentation text " +
|
|
300
|
+
'(e.g. "date", "form input", "navigation"). Returns id, displayName, ' +
|
|
301
|
+
"category, and a snippet per match. Use the id with design-data-component " +
|
|
302
|
+
"for the full declaration.",
|
|
303
|
+
inputSchema: {
|
|
304
|
+
type: "object",
|
|
305
|
+
properties: {
|
|
306
|
+
query: {
|
|
307
|
+
type: "string",
|
|
308
|
+
description: "Words to look for, e.g. 'select from a list'",
|
|
309
|
+
},
|
|
310
|
+
category: {
|
|
311
|
+
type: "string",
|
|
312
|
+
description: "Optional component category filter, e.g. actions",
|
|
313
|
+
},
|
|
314
|
+
limit: {
|
|
315
|
+
type: "integer",
|
|
316
|
+
minimum: 1,
|
|
317
|
+
description: "Maximum number of results (default: 10)",
|
|
318
|
+
default: 10,
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
required: ["query"],
|
|
322
|
+
additionalProperties: false,
|
|
323
|
+
},
|
|
324
|
+
async handler({ query, category, limit = 10 }) {
|
|
325
|
+
const pkgRoot = resolveSpectrumDataPackage();
|
|
326
|
+
if (!pkgRoot) {
|
|
327
|
+
throw new Error(
|
|
328
|
+
"@adobe/spectrum-design-data is not installed — cannot search components. " +
|
|
329
|
+
"Install it with: pnpm add @adobe/spectrum-design-data",
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
const results = searchComponents(
|
|
333
|
+
resolve(pkgRoot, "components"),
|
|
334
|
+
query,
|
|
335
|
+
{
|
|
336
|
+
category,
|
|
337
|
+
limit,
|
|
338
|
+
},
|
|
339
|
+
);
|
|
340
|
+
return { results, total: results.length };
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
|
|
289
344
|
// ── resolve ─────────────────────────────────────────────────────────────
|
|
290
345
|
{
|
|
291
346
|
name: "design-data-resolve",
|