@adobe/design-data-mcp 1.6.0 → 1.7.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,8 +1,18 @@
1
- # [**@adobe/design-data-mcp**](https://github.com/adobe/design-data-mcp)
1
+ # [**@adobe/design-data-mcp**](https://github.com/adobe/spectrum-design-data/tree/main/tools/design-data-mcp)
2
2
 
3
- MCP server for [Adobe Spectrum](https://spectrum.adobe.com) design tokens and component schemas, powered by the [`@adobe/design-data`](https://www.npmjs.com/package/@adobe/design-data) CLI.
3
+ MCP server for [Adobe Spectrum](https://spectrum.adobe.com) design tokens, component schemas,
4
+ and design guidelines. Runs fully in-process via an embedded Spectrum snapshot — no network
5
+ access, no CLI binary, and no configuration required.
4
6
 
5
- ## Setup
7
+ ## Install in Claude Desktop (Extension)
8
+
9
+ Download the latest `design-data.mcpb` from the
10
+ [releases page](https://github.com/adobe/spectrum-design-data/releases) and drag it into
11
+ **Claude Desktop → Settings → Extensions**.
12
+
13
+ No API keys or configuration needed. The extension installs and runs offline.
14
+
15
+ ## Setup via npx (Cursor / Claude Desktop manual config)
6
16
 
7
17
  ### Cursor
8
18
 
@@ -19,7 +29,7 @@ Add to `.cursor/mcp-servers.json` in your project root:
19
29
  }
20
30
  ```
21
31
 
22
- ### Claude Desktop
32
+ ### Claude Desktop (manual config)
23
33
 
24
34
  Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
25
35
 
@@ -36,26 +46,15 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
36
46
 
37
47
  ## Tools
38
48
 
39
- | Tool | Description |
40
- | ----------------------- | -------------------------------------------------------------------------- |
41
- | `design-data-primer` | Session-start overview: token count, mode-sets, components, provenance |
42
- | `design-data-query` | Filter tokens by query expression (`component=button`, `property=color-*`) |
43
- | `design-data-suggest` | Natural-language token suggestions with confidence scores |
44
- | `design-data-component` | Full component schema (variants, sizes, states, props) |
45
- | `design-data-resolve` | Resolve a token's concrete value for a mode context |
46
-
47
- ## Custom dataset
48
-
49
- Add a `.design-data.toml` to your project root to use a specific Spectrum version or a custom fork:
50
-
51
- ```toml
52
- [source]
53
- type = "github"
54
- repo = "adobe/spectrum-design-data"
55
- tag = "@adobe/spectrum-tokens@14.11.0"
56
- ```
57
-
58
- Without a config file the embedded Spectrum snapshot is used automatically (offline, zero-setup).
49
+ | Tool | Description |
50
+ | ---------------------------- | ---------------------------------------------------------------------------------- |
51
+ | `design-data-primer` | Session-start overview: token count, mode-sets, components, guidelines, provenance |
52
+ | `design-data-query` | Filter tokens by query expression (`component=button`, `property=color-*`) |
53
+ | `design-data-suggest` | Natural-language token suggestions with Jaccard similarity confidence scores |
54
+ | `design-data-component` | Full component schema (variants, sizes, states, props) by kebab-case ID |
55
+ | `design-data-resolve` | Resolve a token's concrete value for a mode context (colorScheme, scale, contrast) |
56
+ | `design-data-guideline-list` | List available Spectrum design guideline pages, optionally filtered by category |
57
+ | `design-data-guideline` | Full guideline document by slug ID (purpose, rules, accessibility, examples) |
59
58
 
60
59
  ## License
61
60
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adobe/design-data-mcp",
3
- "version": "1.6.0",
4
- "description": "MCP server for Spectrum design tokens and component schemas via the design-data CLI",
3
+ "version": "1.7.0",
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",
7
7
  "bin": {
@@ -28,11 +28,13 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@modelcontextprotocol/sdk": "^1.27.1",
31
- "@adobe/design-data-wasm": "0.4.0",
32
- "@adobe/spectrum-design-data": "0.7.0"
31
+ "@adobe/spectrum-design-data": "0.7.0",
32
+ "@adobe/design-data-wasm": "0.4.0"
33
33
  },
34
34
  "devDependencies": {
35
- "ava": "^6.0.1"
35
+ "@anthropic-ai/mcpb": "^2.1.2",
36
+ "ava": "^6.0.1",
37
+ "sharp": "^0.35.1"
36
38
  },
37
39
  "engines": {
38
40
  "node": ">=20.12.0"
@@ -40,9 +42,10 @@
40
42
  "keywords": [
41
43
  "mcp",
42
44
  "spectrum",
45
+ "adobe",
43
46
  "design-system",
44
47
  "design-tokens",
45
- "cli"
48
+ "design-data"
46
49
  ],
47
50
  "author": "Adobe",
48
51
  "license": "Apache-2.0",
package/src/index.js CHANGED
@@ -11,12 +11,10 @@
11
11
  /**
12
12
  * @adobe/design-data-mcp — MCP server for Spectrum design tokens and components.
13
13
  *
14
- * Wraps the @adobe/design-data CLI as five MCP tools, making Spectrum design
15
- * data available to any MCP-compatible agent (Cursor, Claude Desktop, etc.)
16
- * without requiring a Rust toolchain or monorepo checkout.
17
- *
18
- * The CLI resolves data automatically: it uses the embedded Spectrum snapshot
19
- * for zero-config offline use, or a `.design-data.toml` config for custom sources.
14
+ * Exposes seven read-only MCP tools backed by @adobe/design-data-wasm running
15
+ * in-process (no CLI binary or npx required). The embedded Spectrum snapshot
16
+ * powers zero-config offline use across Claude Desktop, Cursor, and any
17
+ * MCP-compatible agent.
20
18
  */
21
19
 
22
20
  import { readFileSync } from "fs";
@@ -45,10 +43,11 @@ export function createMCPServer() {
45
43
  const tools = createDesignDataTools();
46
44
 
47
45
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
48
- tools: tools.map(({ name, description, inputSchema }) => ({
46
+ tools: tools.map(({ name, description, inputSchema, annotations }) => ({
49
47
  name,
50
48
  description,
51
49
  inputSchema,
50
+ annotations,
52
51
  })),
53
52
  }));
54
53
 
@@ -96,6 +96,11 @@ export function createDesignDataTools() {
96
96
  // ── primer ─────────────────────────────────────────────────────────────
97
97
  {
98
98
  name: "design-data-primer",
99
+ annotations: {
100
+ title: "Design Data: Primer",
101
+ readOnlyHint: true,
102
+ openWorldHint: false,
103
+ },
99
104
  description:
100
105
  "Get a structural overview of the Spectrum design dataset: token count, " +
101
106
  "available mode-sets (color-scheme, scale, contrast), component list, " +
@@ -119,7 +124,14 @@ export function createDesignDataTools() {
119
124
  }
120
125
  : null;
121
126
 
127
+ // Provenance carries source + designDataVersion (the @adobe/spectrum-design-data
128
+ // package version baked into the wasm at build time via EMBEDDED_DATA_VERSION).
129
+ const { provenance } = ds.primer();
130
+
122
131
  return {
132
+ // top-level source is the legacy skill-contract field; provenance.source
133
+ // duplicates it intentionally — provenance is the richer metrics object
134
+ // and consumers should prefer it going forward.
123
135
  source: "embedded",
124
136
  tokenCount: ds.tokenCount(),
125
137
  modeSets: {
@@ -134,6 +146,7 @@ export function createDesignDataTools() {
134
146
  components: wasm.getFieldValues("component") ?? [],
135
147
  properties: wasm.getFieldValues("property") ?? [],
136
148
  guidelines: guidelinesSummary,
149
+ provenance,
137
150
  };
138
151
  },
139
152
  },
@@ -141,6 +154,11 @@ export function createDesignDataTools() {
141
154
  // ── query ───────────────────────────────────────────────────────────────
142
155
  {
143
156
  name: "design-data-query",
157
+ annotations: {
158
+ title: "Design Data: Query Tokens",
159
+ readOnlyHint: true,
160
+ openWorldHint: false,
161
+ },
144
162
  description:
145
163
  "Filter Spectrum tokens by a query expression. " +
146
164
  "Expression syntax: `component=button`, `component=button,state=hover`, " +
@@ -167,6 +185,11 @@ export function createDesignDataTools() {
167
185
  // ── suggest ─────────────────────────────────────────────────────────────
168
186
  {
169
187
  name: "design-data-suggest",
188
+ annotations: {
189
+ title: "Design Data: Suggest Tokens",
190
+ readOnlyHint: true,
191
+ openWorldHint: false,
192
+ },
170
193
  description:
171
194
  "Suggest Spectrum tokens matching a natural-language intent using Jaccard similarity " +
172
195
  "scoring over token name segments, name-object fields, and description text. " +
@@ -198,6 +221,11 @@ export function createDesignDataTools() {
198
221
  // ── component ───────────────────────────────────────────────────────────
199
222
  {
200
223
  name: "design-data-component",
224
+ annotations: {
225
+ title: "Design Data: Get Component",
226
+ readOnlyHint: true,
227
+ openWorldHint: false,
228
+ },
201
229
  description:
202
230
  "Get the full component declaration for a Spectrum component by ID. " +
203
231
  "Returns the component's displayName, description, and all available options " +
@@ -223,6 +251,11 @@ export function createDesignDataTools() {
223
251
  // ── resolve ─────────────────────────────────────────────────────────────
224
252
  {
225
253
  name: "design-data-resolve",
254
+ annotations: {
255
+ title: "Design Data: Resolve Token",
256
+ readOnlyHint: true,
257
+ openWorldHint: false,
258
+ },
226
259
  description:
227
260
  "Resolve the concrete value of a Spectrum token property for a given " +
228
261
  "mode-set context (color-scheme, scale, contrast). " +
@@ -270,6 +303,11 @@ export function createDesignDataTools() {
270
303
  // ── guideline-list ──────────────────────────────────────────────────────
271
304
  {
272
305
  name: "design-data-guideline-list",
306
+ annotations: {
307
+ title: "Design Data: List Guidelines",
308
+ readOnlyHint: true,
309
+ openWorldHint: false,
310
+ },
273
311
  description:
274
312
  "List available Spectrum design guideline pages. " +
275
313
  "Returns catalog entries with slug, title, category, status, and sourceUrl. " +
@@ -306,6 +344,11 @@ export function createDesignDataTools() {
306
344
  // ── guideline ───────────────────────────────────────────────────────────
307
345
  {
308
346
  name: "design-data-guideline",
347
+ annotations: {
348
+ title: "Design Data: Get Guideline",
349
+ readOnlyHint: true,
350
+ openWorldHint: false,
351
+ },
309
352
  description:
310
353
  "Get the full guideline document for a Spectrum design page by ID. " +
311
354
  "Returns the guideline's title, category, metadata, and documentBlocks body " +