@adobe/design-data-agent-mcp 0.0.0-size-token-taxonomy-20260929225107
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/.claude-plugin/plugin.json +10 -0
- package/LICENSE +201 -0
- package/README.md +168 -0
- package/package.json +57 -0
- package/skills/design-data/SKILL.md +184 -0
- package/src/cascade-bootstrap.js +176 -0
- package/src/cli.js +50 -0
- package/src/config.js +103 -0
- package/src/dataset-freshness.js +95 -0
- package/src/index.js +126 -0
- package/src/tools/authoring.js +867 -0
- package/src/tools/data.js +162 -0
- package/src/tools/diff.js +74 -0
- package/src/tools/read.js +438 -0
- package/src/tools/validate.js +53 -0
- package/src/tools/write.js +48 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "design-data-agent",
|
|
3
|
+
"description": "Spec-conformant design token lookup, validation, diff, and authoring for any dataset via the design-data CLI.",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Adobe"
|
|
6
|
+
},
|
|
7
|
+
"homepage": "https://github.com/adobe/spectrum-design-data/tree/main/tools/design-data-agent-mcp",
|
|
8
|
+
"repository": "https://github.com/adobe/spectrum-design-data",
|
|
9
|
+
"license": "Apache-2.0"
|
|
10
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Adobe
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# `@adobe/design-data-agent-mcp`
|
|
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`, `describe_component`, `describe_guideline`, `list_guidelines`) run fully in-process via `@adobe/design-data-wasm` — no CLI binary required for those. Only `authoring_session_step_intent` still invokes the native binary (for NLP suggest ranking, not yet on the wasm surface).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
### Claude Code (skill + optional MCP)
|
|
8
|
+
|
|
9
|
+
Add the Spectrum Design Data marketplace, then install the spec-generic skill:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
/plugin marketplace add adobe/spectrum-design-data
|
|
13
|
+
/plugin install design-data-agent@spectrum-design-data
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
For Spectrum tokens with zero setup (embedded snapshot), install `design-data@spectrum-design-data` instead — see [`tools/design-data-skill/`](../design-data-skill/).
|
|
17
|
+
|
|
18
|
+
### Cursor (skill)
|
|
19
|
+
|
|
20
|
+
Cursor Settings → Rules → **Add Rule** → **Remote Rule (GitHub)** → paste:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
https://github.com/adobe/spectrum-design-data/tree/main/tools/design-data-agent-mcp/skills/design-data
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### npm (MCP server)
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npx @adobe/design-data-agent-mcp@latest
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The `@adobe/design-data` CLI binary is **only** needed for `authoring_session_step_intent`. All other tools run in-process. Set `DESIGN_DATA_BIN` if the binary is not on `PATH`.
|
|
33
|
+
|
|
34
|
+
### Staying current
|
|
35
|
+
|
|
36
|
+
The embedded Spectrum snapshot is baked into the wasm at build time and travels with the
|
|
37
|
+
package version — there's no separate data update to run. Pin `@latest` (as above) so `npx`
|
|
38
|
+
fetches the newest published version rather than reusing whatever it last cached; `-y` alone
|
|
39
|
+
only skips the install confirmation, it doesn't force a re-fetch. Already on `/plugin`? Run
|
|
40
|
+
`/plugin update design-data-agent@spectrum-design-data`. Call the primer tool and check
|
|
41
|
+
`provenance.designDataVersion` to see which dataset version is embedded. The primer tool
|
|
42
|
+
also does a best-effort check against the latest published `@adobe/spectrum-design-data`
|
|
43
|
+
version — if the embedded dataset is behind, it adds a `provenance.datasetStatus` field and
|
|
44
|
+
logs a one-line warning to stderr. This is silent on any network failure (offline/air-gapped
|
|
45
|
+
use is unaffected); set `DESIGN_DATA_SKIP_VERSION_CHECK=1` to disable the check entirely.
|
|
46
|
+
|
|
47
|
+
## MCP server
|
|
48
|
+
|
|
49
|
+
Configure your MCP client to run:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
npx -y @adobe/design-data-agent-mcp@latest
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or from a repo clone:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
node tools/design-data-agent-mcp/src/index.js
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Environment variables
|
|
62
|
+
|
|
63
|
+
| Variable | Default | Description |
|
|
64
|
+
| ------------------------ | ------------- | ------------------------------------------------------------------------------ |
|
|
65
|
+
| `DESIGN_DATA_BIN` | `design-data` | Path to the `design-data` binary (authoring only) |
|
|
66
|
+
| `DESIGN_DATA_ROOT` | — | Absolute root that relative paths are anchored to |
|
|
67
|
+
| `DESIGN_DATA_PATH` | `.` | Dataset root path |
|
|
68
|
+
| `DESIGN_DATA_COMPONENTS` | — | Override components directory |
|
|
69
|
+
| `DESIGN_DATA_GUIDELINES` | — | Override guidelines directory |
|
|
70
|
+
| `DESIGN_DATA_FIELDS` | — | Override fields directory |
|
|
71
|
+
| `DESIGN_DATA_SCHEMAS` | — | Override schema path (for `validate`) |
|
|
72
|
+
| `DESIGN_DATA_EXCEPTIONS` | — | Override exceptions path (for `validate`) |
|
|
73
|
+
| `DESIGN_DATA_CONFIG` | — | Path to a `.design-data.toml` (or its directory) to resolve a platform cascade |
|
|
74
|
+
|
|
75
|
+
> **Platform cascade.** If `DESIGN_DATA_CONFIG` is set, the server shells out to
|
|
76
|
+
> the `design-data` CLI once at startup (`design-data query --filter "" --format
|
|
77
|
+
> json`, run from the config's directory) to resolve its `.design-data.toml`
|
|
78
|
+
> source (path/npm/github/git) and any top-level `manifest` cascade, then
|
|
79
|
+
> materializes the result to a temp dir and points `primer` / `resolve_token` /
|
|
80
|
+
> `query_tokens` / `validate_usage` / `describe_component` /
|
|
81
|
+
> `describe_guideline` / `list_guidelines` at it instead of the embedded
|
|
82
|
+
> Spectrum snapshot. Component, relationship, and guideline catalogs are copied
|
|
83
|
+
> from the fallback dataset and overlaid with platform manifest extensions. If
|
|
84
|
+
> resolution fails
|
|
85
|
+
> (e.g. no network for a github source), the server logs a warning and falls
|
|
86
|
+
> back to the embedded/local dataset rather than crashing.
|
|
87
|
+
|
|
88
|
+
> **Path resolution.** The MCP client launches this server with the working
|
|
89
|
+
> directory inherited from wherever the editor was opened — which may be a
|
|
90
|
+
> subdirectory of your repo (e.g. `sdk/`), not the repo root. To stay independent
|
|
91
|
+
> of that working directory, each data path is resolved in this order:
|
|
92
|
+
>
|
|
93
|
+
> 1. **Explicit env override.** If `DESIGN_DATA_PATH` / `DESIGN_DATA_COMPONENTS` /
|
|
94
|
+
> `DESIGN_DATA_FIELDS` is set, it is used. Relative values are anchored to
|
|
95
|
+
> `DESIGN_DATA_ROOT` (absolute, recommended when launching via `npx`) or, if
|
|
96
|
+
> that is unset, to the server package's own location in the monorepo. Absolute
|
|
97
|
+
> values are used as-is.
|
|
98
|
+
> 2. **Resolved `@adobe/spectrum-design-data` package** (zero config). When no env
|
|
99
|
+
> override is set, the server resolves the installed `@adobe/spectrum-design-data`
|
|
100
|
+
> package via Node module resolution and reads its `tokens/`, `components/`, and
|
|
101
|
+
> `fields/` directories. In a pnpm workspace this follows the symlink to
|
|
102
|
+
> `packages/design-data`; when published it uses the installed dependency. This
|
|
103
|
+
> is independent of the working directory.
|
|
104
|
+
> 3. **Fallback.** `dataPath` falls back to the (anchored) current directory; the
|
|
105
|
+
> component/field overrides fall back to `null` (not supplied), which means
|
|
106
|
+
> `describe_component` / `describe_guideline` will throw an error if
|
|
107
|
+
> `@adobe/spectrum-design-data` is not resolvable.
|
|
108
|
+
>
|
|
109
|
+
> In a monorepo checkout you typically need no `DESIGN_DATA_*` env vars at all —
|
|
110
|
+
> resolution via the workspace package handles it.
|
|
111
|
+
|
|
112
|
+
### Example (Cursor `.cursor/mcp.json`)
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"design-data-agent": {
|
|
118
|
+
"command": "npx",
|
|
119
|
+
"args": ["-y", "@adobe/design-data-agent-mcp@latest"],
|
|
120
|
+
"env": {
|
|
121
|
+
"DESIGN_DATA_ROOT": "/abs/path/to/your/repo",
|
|
122
|
+
"DESIGN_DATA_PATH": "packages/design-data/tokens",
|
|
123
|
+
"DESIGN_DATA_COMPONENTS": "packages/design-data/components",
|
|
124
|
+
"DESIGN_DATA_FIELDS": "packages/design-data/fields"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Example (Claude Desktop `claude_desktop_config.json`)
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"mcpServers": {
|
|
136
|
+
"design-data-agent": {
|
|
137
|
+
"command": "npx",
|
|
138
|
+
"args": ["-y", "@adobe/design-data-agent-mcp@latest"],
|
|
139
|
+
"env": {
|
|
140
|
+
"DESIGN_DATA_BIN": "design-data",
|
|
141
|
+
"DESIGN_DATA_PATH": "/path/to/your/dataset"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Tools exposed
|
|
149
|
+
|
|
150
|
+
| Tool | Description |
|
|
151
|
+
| -------------------- | --------------------------------------------------------------- |
|
|
152
|
+
| `primer` | Load full token taxonomy, component list, and field definitions |
|
|
153
|
+
| `resolve_token` | Resolve a token property to its literal value |
|
|
154
|
+
| `query_tokens` | Filter tokens by expression |
|
|
155
|
+
| `describe_component` | Fetch component schema and token bindings |
|
|
156
|
+
| `describe_guideline` | Fetch guideline documentBlocks content and metadata |
|
|
157
|
+
| `list_guidelines` | List guideline slugs and metadata, optionally by category |
|
|
158
|
+
| `validate_usage` | Validate token usage and return a diagnostic report |
|
|
159
|
+
| `diff_datasets` | Compare two datasets and return a semantic diff |
|
|
160
|
+
| `write` | Write agent-generated product context to the dataset |
|
|
161
|
+
|
|
162
|
+
## Skill
|
|
163
|
+
|
|
164
|
+
The Claude Code skill lives at [`skills/design-data/SKILL.md`](skills/design-data/SKILL.md). It shells out to `npx @adobe/design-data` for validate, query, resolve, diff, and write operations against local datasets.
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
Apache-2.0
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adobe/design-data-agent-mcp",
|
|
3
|
+
"version": "0.0.0-size-token-taxonomy-20260929225107",
|
|
4
|
+
"description": "MCP server and Claude Code skill for the design-data agent surface — read tools run in-process via wasm",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"design-data-agent-mcp": "./src/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"src/",
|
|
12
|
+
".claude-plugin/",
|
|
13
|
+
"skills/",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/adobe/spectrum-design-data.git",
|
|
20
|
+
"directory": "tools/design-data-agent-mcp"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/adobe/spectrum-design-data/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/adobe/spectrum-design-data/tree/main/tools/design-data-agent-mcp#readme",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"registry": "https://registry.npmjs.org/",
|
|
29
|
+
"provenance": true
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
33
|
+
"@adobe/design-data": "0.0.0-size-token-taxonomy-20260929225107",
|
|
34
|
+
"@adobe/design-data-wasm": "0.0.0-size-token-taxonomy-20260929225107",
|
|
35
|
+
"@adobe/spectrum-design-data": "0.0.0-size-token-taxonomy-20260929225107"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"ava": "^6.0.1"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=20.12.0"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"mcp",
|
|
45
|
+
"design-system",
|
|
46
|
+
"design-tokens",
|
|
47
|
+
"design-data",
|
|
48
|
+
"agent-surface",
|
|
49
|
+
"cli"
|
|
50
|
+
],
|
|
51
|
+
"author": "Adobe",
|
|
52
|
+
"license": "Apache-2.0",
|
|
53
|
+
"scripts": {
|
|
54
|
+
"start": "node src/index.js",
|
|
55
|
+
"test": "ava"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-data-agent
|
|
3
|
+
description: >
|
|
4
|
+
Validate, query, resolve, diff, and author spec-conformant design tokens and components using the
|
|
5
|
+
design-data MCP tools against a local dataset. Use when the user asks about design tokens, a design
|
|
6
|
+
system, token lookup, spec-conformance, drift detection, or token authoring on custom data.
|
|
7
|
+
metadata:
|
|
8
|
+
author: adobe
|
|
9
|
+
version: "1.11.0"
|
|
10
|
+
when_to_use: >
|
|
11
|
+
Trigger on: design system, design tokens, spec-conformant, drift, validate tokens, token
|
|
12
|
+
authoring, custom dataset, DESIGN_DATA_PATH, design-data validate, design-data diff,
|
|
13
|
+
design-data write, product-context.json.
|
|
14
|
+
allowed-tools: mcp__design-data-agent__primer, mcp__design-data-agent__query_tokens, mcp__design-data-agent__resolve_token, mcp__design-data-agent__describe_component, mcp__design-data-agent__validate_usage, mcp__design-data-agent__diff_datasets, mcp__design-data-agent__write, mcp__design-data-agent__start_authoring_session, mcp__design-data-agent__authoring_session_step_intent, mcp__design-data-agent__authoring_session_step_classification, mcp__design-data-agent__authoring_session_step_values, mcp__design-data-agent__authoring_session_commit, mcp__design-data-agent__authoring_session_cancel, mcp__design-data-agent__authoring_session_get, mcp__design-data-agent__authoring_session_list
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# design-data agent skill
|
|
18
|
+
|
|
19
|
+
`@adobe/design-data-agent-mcp` provides in-process wasm tools for validating, querying,
|
|
20
|
+
resolving, diffing, and authoring spec-conformant tokens and components from any dataset
|
|
21
|
+
on the local filesystem.
|
|
22
|
+
|
|
23
|
+
Set two path variables once and reference them throughout:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
export DESIGN_DATA_PATH=./packages/design-data/tokens
|
|
27
|
+
export DESIGN_DATA_SPEC_PATH=./packages/design-data
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
For Spectrum tokens with zero setup (embedded snapshot), use the `design-data` skill instead — this skill targets custom or repo-local datasets.
|
|
31
|
+
|
|
32
|
+
## Bootstrap
|
|
33
|
+
|
|
34
|
+
Add `@adobe/design-data-agent-mcp` to your `.cursor/mcp.json`:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"design-data-agent": {
|
|
40
|
+
"command": "npx",
|
|
41
|
+
"args": ["-y", "@adobe/design-data-agent-mcp@latest"],
|
|
42
|
+
"env": {
|
|
43
|
+
"DESIGN_DATA_PATH": "./packages/tokens/src",
|
|
44
|
+
"DESIGN_DATA_COMPONENTS": "./packages/design-data/components",
|
|
45
|
+
"DESIGN_DATA_FIELDS": "./packages/design-data/fields"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Adjust paths to match your dataset layout. Pin `@latest` — the embedded Spectrum snapshot is
|
|
53
|
+
baked into the wasm at build time and travels with the package version, so there's no separate
|
|
54
|
+
data update to run, but plain `npx -y <pkg>` (no tag) can reuse a cached older build.
|
|
55
|
+
|
|
56
|
+
***
|
|
57
|
+
|
|
58
|
+
## Session start — call `primer` first
|
|
59
|
+
|
|
60
|
+
Call `primer` at the start of every session that touches design data. It returns the active
|
|
61
|
+
dimensions, component list, taxonomy fields, and token count — structural context that scopes
|
|
62
|
+
all subsequent lookups. No inputs required.
|
|
63
|
+
|
|
64
|
+
***
|
|
65
|
+
|
|
66
|
+
## Token lookup
|
|
67
|
+
|
|
68
|
+
### Resolve a token to its literal value — `resolve_token`
|
|
69
|
+
|
|
70
|
+
Required: `property` (string) — the bare `name.property` segment, e.g. `"background-color"`
|
|
71
|
+
or `"corner-radius"` (see `primer().properties` for the full list). **Not** a flattened
|
|
72
|
+
legacyKey like `"accent-background-color-default"` — that form never resolves.
|
|
73
|
+
Optional context: `colorScheme` (`"light"` or `"dark"`), `scale` (`"desktop"` or `"mobile"`),
|
|
74
|
+
`contrast` (`"regular"` or `"high"`). Optional narrowing: `component`, `variant`, `state`, and
|
|
75
|
+
`colorRole`. Set `excludeDeprecated` to omit tokens with `lifecycle.deprecatedIn`.
|
|
76
|
+
|
|
77
|
+
> **Gotcha:** when several tokens share a property, use `variant`, `state`, or `colorRole` to
|
|
78
|
+
> narrow the match, then check `ambiguous` and `deprecated` on the result. `component` is
|
|
79
|
+
> sparsely populated in the current dataset, so prefer the other fields when available.
|
|
80
|
+
> `resolve_token` still uses cascade ranking when multiple candidates remain; use `query_tokens`
|
|
81
|
+
> to inspect the full candidate set.
|
|
82
|
+
|
|
83
|
+
### Query tokens by filter expression — `query_tokens`
|
|
84
|
+
|
|
85
|
+
Required: `filter` (string)
|
|
86
|
+
|
|
87
|
+
Valid filter keys: `property`, `component`, `variant`, `state`, `colorScheme`, `scale`,
|
|
88
|
+
`contrast`, `uuid`, `$schema`.
|
|
89
|
+
|
|
90
|
+
Filter syntax examples:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
property=background-color
|
|
94
|
+
property=*background*
|
|
95
|
+
property=background-color|property=border-color
|
|
96
|
+
$schema=https://spectrum.adobe.com/page/design-token/
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
> **Gotcha:** `component=<id>` currently always returns `[]` — tokens aren't
|
|
100
|
+
> component-indexed in this dataset. Use `describe_component` to see a component's known
|
|
101
|
+
> token bindings instead.
|
|
102
|
+
|
|
103
|
+
> **Exit codes:** `0` = matches found; empty array = no matches (not an error).
|
|
104
|
+
|
|
105
|
+
***
|
|
106
|
+
|
|
107
|
+
## Component info — `describe_component`
|
|
108
|
+
|
|
109
|
+
Required: `id` (string) — kebab-case component ID, e.g. `button`, `action-button`
|
|
110
|
+
|
|
111
|
+
Returns the component contract: `name`, `displayName`, `options`, `anatomy`, `states`,
|
|
112
|
+
and `tokenBindings`.
|
|
113
|
+
|
|
114
|
+
***
|
|
115
|
+
|
|
116
|
+
## Validation — `validate_usage`
|
|
117
|
+
|
|
118
|
+
Optional inputs:
|
|
119
|
+
|
|
120
|
+
* `path` — dataset path (defaults to `DESIGN_DATA_PATH`)
|
|
121
|
+
* `strict` (boolean) — treat warnings as errors
|
|
122
|
+
* `schema_path` — override schemas directory (defaults to `@adobe/spectrum-tokens` schemas)
|
|
123
|
+
|
|
124
|
+
Runs Layer-1 JSON-Schema structural validation and Layer-2 relational rules.
|
|
125
|
+
Returns `{ valid, errors, warnings }`.
|
|
126
|
+
|
|
127
|
+
> **Note:** `--exceptions-path` (SPEC-007 naming allowlist) is not supported in the
|
|
128
|
+
> in-process path. Use the `design-data` CLI directly if you need exceptions support.
|
|
129
|
+
|
|
130
|
+
***
|
|
131
|
+
|
|
132
|
+
## Dataset diff — `diff_datasets`
|
|
133
|
+
|
|
134
|
+
Required: `oldPath`, `newPath`
|
|
135
|
+
Optional: `filter` (substring to narrow results by token name)
|
|
136
|
+
|
|
137
|
+
Returns `{ renamed, deprecated, reverted, added, deleted, updated }`.
|
|
138
|
+
|
|
139
|
+
***
|
|
140
|
+
|
|
141
|
+
## Product-layer authoring — `write`
|
|
142
|
+
|
|
143
|
+
Write or update the product context document in the dataset.
|
|
144
|
+
|
|
145
|
+
Optional inputs: `output` (defaults to `$DESIGN_DATA_PATH/product-context.json`),
|
|
146
|
+
`rationale` (string)
|
|
147
|
+
|
|
148
|
+
***
|
|
149
|
+
|
|
150
|
+
## Token authoring session
|
|
151
|
+
|
|
152
|
+
Use the following tools in sequence to create a new token through the wizard:
|
|
153
|
+
|
|
154
|
+
1. **`start_authoring_session`** — start a session (returns `session_id`)
|
|
155
|
+
2. **`authoring_session_step_intent`** — provide natural-language intent; get token suggestions
|
|
156
|
+
3. **`authoring_session_step_classification`** — set layer, property, name fields
|
|
157
|
+
4. **`authoring_session_step_values`** — set mode-specific value rows
|
|
158
|
+
5. **`authoring_session_commit`** — validate and write the token to disk
|
|
159
|
+
6. **`authoring_session_cancel`** — cancel without writing
|
|
160
|
+
|
|
161
|
+
Helper tools: `authoring_session_get` (inspect state), `authoring_session_list` (all active sessions).
|
|
162
|
+
|
|
163
|
+
`authoring_session_commit` accepts an optional `schema_path` to override the schemas directory
|
|
164
|
+
for Layer-1 JSON-Schema validation before writing.
|
|
165
|
+
|
|
166
|
+
> **Note:** `authoring_session_step_intent` (NLP suggestion ranking) still delegates to the
|
|
167
|
+
> `design-data` CLI because the NLP `suggest` API is not yet on the wasm surface.
|
|
168
|
+
|
|
169
|
+
***
|
|
170
|
+
|
|
171
|
+
## Gotchas
|
|
172
|
+
|
|
173
|
+
* **Scale values:** `desktop` and `mobile` — not `medium`/`large`.
|
|
174
|
+
* **Contrast values:** `regular` and `high` — not `standard`/`high`.
|
|
175
|
+
* **`query_tokens` returns `[]`** when no tokens match — not an error.
|
|
176
|
+
* **`diff_datasets` filter** matches by token name substring (case-insensitive).
|
|
177
|
+
|
|
178
|
+
## When working in Cursor
|
|
179
|
+
|
|
180
|
+
Cursor Settings → Rules → **Add Rule** → **Remote Rule (GitHub)** → paste this URL:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
https://github.com/adobe/spectrum-design-data/tree/main/tools/design-data-agent-mcp/skills/design-data
|
|
184
|
+
```
|