@dsgraph/mcp 0.0.0-stage → 0.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Adam Reznik
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,64 @@
1
- # Temporary Holding Version
1
+ # @dsgraph/mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An MCP server that gives coding agents (Claude Code, Cursor and other MCP clients) the design tokens of your project. Its main job: when an agent is about to write `#3366ff` or `12px` in code, it asks which token holds that value and uses the token instead.
4
+
5
+ It reads DTCG 2025.10 (with resolver documents and themes), token JSON with `value` and `type` (including token sets and themes), and CSS custom properties, from a folder, an npm package or a GitHub repository. Every tool only reads.
6
+
7
+ ## Install
8
+
9
+ Step-by-step setup for Claude Code, Claude Desktop, Cursor, VS Code, Windsurf and Codex, with the exact snippet for your tokens: [specsure.vercel.app/tools/mcp](https://specsure.vercel.app/tools/mcp).
10
+
11
+ Claude Code, with the project's tokens in `./tokens`:
12
+
13
+ ```bash
14
+ claude mcp add dsgraph -- npx -y @dsgraph/mcp ./tokens
15
+ ```
16
+
17
+ Any other MCP client, in its JSON config:
18
+
19
+ ```json
20
+ {
21
+ "mcpServers": {
22
+ "dsgraph": { "command": "npx", "args": ["-y", "@dsgraph/mcp", "./tokens"] }
23
+ }
24
+ }
25
+ ```
26
+
27
+ The argument is the default source: a folder or file, `npm:@scope/tokens@2` or `github:owner/repo/tokens@main`. Without it the server reads the current folder. A `dsgraph.config.json` in the folder the server starts in is used too (`--config` points elsewhere).
28
+
29
+ ## Tools
30
+
31
+ | Tool | What it answers |
32
+ |---|---|
33
+ | `find_token` | Which token holds this color, size, duration or font weight? Exact matches first, semantic tokens before the primitives they point to; otherwise the closest values (colors by ΔE, sizes in px across px and rem) |
34
+ | `get_token` | One token: its value in every theme, the references it takes the value from, the tokens that use it, description, deprecation, file |
35
+ | `search_tokens` | Tokens by part of the name or a glob (`color.text.*`) and by type, with their values |
36
+ | `describe_tokens` | An overview: tokens per type, themes and other modes, top-level groups, files |
37
+ | `check_styles` | CSS or SCSS the agent just wrote, or a style file or folder of the project: colors and spacing, radii and font sizes written by hand (with the token to use), deprecated and unknown design-system variables |
38
+ | `compare_versions` | What changed between two versions, what breaks and which semver bump the release needs; with `code`, the places in the project's styles that break or look different |
39
+ | `check_tokens` | Broken references, cycles, legacy syntax, naming collisions, ramps out of order, colors out of gamut |
40
+
41
+ Each tool takes an optional `source`, so an agent can also look at a package before upgrading it: "compare `npm:@scope/tokens@2` with `npm:@scope/tokens@3`".
42
+
43
+ Local files are read again on every call, so the answers follow your edits. Remote sources pinned to an exact version are cached for the session; others for five minutes.
44
+
45
+ ## Example
46
+
47
+ ```
48
+ find_token { "value": "#3366ff" }
49
+
50
+ color #3366ff in theme: default:
51
+ - #3366ff — exact: `color-accent` → color-blue-500, `color-blue-500`
52
+
53
+ Use `color-accent` instead of the literal value, or another token with the same value whose name fits the use.
54
+
55
+ find_token { "value": "0.875rem" }
56
+
57
+ dimension 0.875rem in theme: default:
58
+ - 16px — off by 2: `space-md`
59
+ - 8px — off by 6: `space-small`
60
+
61
+ No token matches exactly; the closest is `space-md`. Using a literal value here would bypass the design system.
62
+ ```
63
+
64
+ Part of [dsgraph](https://github.com/specsure/specsure). MIT license.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from 'node:util';
3
+ import { loadConfig } from '@dsgraph/cli';
4
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
5
+ import { createServer } from './server.js';
6
+ const HELP = `dsgraph-mcp — MCP server for design tokens
7
+
8
+ Usage
9
+ dsgraph-mcp [source]
10
+
11
+ source the project's tokens: a folder or file (default .), npm:pkg@version
12
+ or github:owner/repo/path@ref. Tools accept another source per call.
13
+
14
+ Options
15
+ -c, --config <file> dsgraph.config.json (default: ./dsgraph.config.json if present)
16
+ -h, --help
17
+
18
+ Claude Code
19
+ claude mcp add dsgraph -- npx -y @dsgraph/mcp ./tokens
20
+ `;
21
+ const { values, positionals } = parseArgs({
22
+ allowPositionals: true,
23
+ options: { config: { type: 'string', short: 'c' }, help: { type: 'boolean', short: 'h' } },
24
+ });
25
+ if (values.help) {
26
+ process.stdout.write(HELP);
27
+ process.exit(0);
28
+ }
29
+ const cwd = process.cwd();
30
+ const server = createServer({
31
+ source: positionals[0] ?? process.env.DSGRAPH_SOURCE ?? '.',
32
+ cwd,
33
+ config: await loadConfig(values.config, cwd),
34
+ });
35
+ await server.connect(new StdioServerTransport());
36
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,IAAI,GAAG;;;;;;;;;;;;;;CAcZ,CAAA;AAED,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;IACxC,gBAAgB,EAAE,IAAI;IACtB,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;CAC3F,CAAC,CAAA;AACF,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;IAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC1B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AACD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;AACzB,MAAM,MAAM,GAAG,YAAY,CAAC;IAC1B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,GAAG;IAC3D,GAAG;IACH,MAAM,EAAE,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAC7C,CAAC,CAAA;AACF,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { type NearestToken, nearestTokens } from '@dsgraph/core';
2
+ /** A value typed by an agent (`#3366ff`, `12px`, `0.5rem`, `600`, `200ms`) as a DTCG type and canonical value. */
3
+ export declare function parseValue(text: string, type?: string): {
4
+ type: string;
5
+ value: unknown;
6
+ } | undefined;
7
+ /** Tokens nearest to a value in one context; see `nearestTokens` in `@dsgraph/core`. */
8
+ export declare const nearest: typeof nearestTokens;
9
+ export type Match = NearestToken;
10
+ //# sourceMappingURL=nearest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nearest.d.ts","sourceRoot":"","sources":["../src/nearest.ts"],"names":[],"mappings":"AACA,OAAO,EAAiC,KAAK,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE/F,kHAAkH;AAClH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAYpG;AAED,wFAAwF;AACxF,eAAO,MAAM,OAAO,sBAAgB,CAAA;AACpC,MAAM,MAAM,KAAK,GAAG,YAAY,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { cssValueToToken } from '@dsgraph/adapters';
2
+ import { canonicalValue, DiagnosticBag, nearestTokens } from '@dsgraph/core';
3
+ /** A value typed by an agent (`#3366ff`, `12px`, `0.5rem`, `600`, `200ms`) as a DTCG type and canonical value. */
4
+ export function parseValue(text, type) {
5
+ const entry = cssValueToToken(type ? `--${type}` : '--value', text);
6
+ const t = type ?? entry.$type;
7
+ if (!t || t === 'css-expression')
8
+ return undefined;
9
+ const ctx = {
10
+ strict: false,
11
+ allowNonstandardUnits: true,
12
+ diag: new DiagnosticBag(),
13
+ flags: new Set(),
14
+ };
15
+ const value = canonicalValue(t, t === entry.$type ? entry.$value : text, ctx);
16
+ return value === undefined ? undefined : { type: t, value };
17
+ }
18
+ /** Tokens nearest to a value in one context; see `nearestTokens` in `@dsgraph/core`. */
19
+ export const nearest = nearestTokens;
20
+ //# sourceMappingURL=nearest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nearest.js","sourceRoot":"","sources":["../src/nearest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAqB,aAAa,EAAE,MAAM,eAAe,CAAA;AAE/F,kHAAkH;AAClH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,IAAa;IACpD,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;IACnE,MAAM,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,KAAK,CAAA;IAC7B,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,gBAAgB;QAAE,OAAO,SAAS,CAAA;IAClD,MAAM,GAAG,GAAG;QACV,MAAM,EAAE,KAAK;QACb,qBAAqB,EAAE,IAAI;QAC3B,IAAI,EAAE,IAAI,aAAa,EAAE;QACzB,KAAK,EAAE,IAAI,GAAG,EAAU;KACzB,CAAA;IACD,MAAM,KAAK,GAAG,cAAc,CAAC,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC7E,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAA;AAC7D,CAAC;AAED,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { type Config } from '@dsgraph/core';
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ export interface ServerOptions {
4
+ /** The design system the tools read when a call names no source: a folder, a file, `npm:…` or `github:…`. */
5
+ source: string;
6
+ /** Folder that relative sources and `dsgraph.config.json` are resolved against. */
7
+ cwd: string;
8
+ config?: Config;
9
+ version?: string;
10
+ }
11
+ /** The MCP server: read-only tools over a design system's tokens, built on dsgraph. */
12
+ export declare function createServer(opts: ServerOptions): McpServer;
13
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,MAAM,EAMZ,MAAM,eAAe,CAAA;AAKtB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAInE,MAAM,WAAW,aAAa;IAC5B,6GAA6G;IAC7G,MAAM,EAAE,MAAM,CAAA;IACd,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAsCD,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,CAuU3D"}
package/dist/server.js ADDED
@@ -0,0 +1,312 @@
1
+ import { stat } from 'node:fs/promises';
2
+ import { basename, dirname, resolve } from 'node:path';
3
+ import { scanStyles } from '@dsgraph/adapters';
4
+ import { diffOptions, loadGraph } from '@dsgraph/cli';
5
+ import { diff, impactOf, } from '@dsgraph/core';
6
+ import { formatChangeset, formatFindings, formatValue, formatWhen } from '@dsgraph/report';
7
+ import { check } from '@dsgraph/rules';
8
+ import { MemorySource, parseRemoteSpec } from '@dsgraph/sources';
9
+ import { NodeFsSource } from '@dsgraph/sources/node';
10
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
11
+ import { z } from 'zod';
12
+ import { nearest, parseValue } from './nearest.js';
13
+ const SOURCE = z
14
+ .string()
15
+ .optional()
16
+ .describe('Where the tokens are: a folder or file path, npm:package@version or github:owner/repo/path@ref. Leave out for the project default.');
17
+ const CONTEXT = z
18
+ .record(z.string(), z.string())
19
+ .optional()
20
+ .describe('Theme or other mode to read values in, e.g. {"theme": "dark"}. Leave out for the default.');
21
+ /** Remote sources pinned to an exact version never change; everything else is read again after a while. */
22
+ const pinned = (spec) => {
23
+ const r = parseRemoteSpec(spec);
24
+ if (!r)
25
+ return false;
26
+ return r.kind === 'npm' ? /^\d+\.\d+\.\d+/.test(r.version) : /^[0-9a-f]{40}$/.test(r.ref);
27
+ };
28
+ const REMOTE_TTL = 5 * 60_000;
29
+ const CODE = z
30
+ .string()
31
+ .optional()
32
+ .describe('The project code that uses the tokens: a folder or a style file (CSS, SCSS, CSS modules), relative to the project. Leave out to skip the code.');
33
+ const text = (t) => ({ content: [{ type: 'text', text: t }] });
34
+ const failure = (t) => ({ content: [{ type: 'text', text: t }], isError: true });
35
+ function describeValue(graph, t, input) {
36
+ const v = graph.value(t.id, input);
37
+ const chain = graph.chain(t.id, input);
38
+ const alias = chain.length > 1 ? ` (alias of ${chain.slice(1).join(' → ')})` : '';
39
+ return `${formatValue(t.type, v)}${alias}`;
40
+ }
41
+ /** The MCP server: read-only tools over a design system's tokens, built on dsgraph. */
42
+ export function createServer(opts) {
43
+ const server = new McpServer({ name: 'dsgraph', version: opts.version ?? '0.3.0' });
44
+ const config = opts.config ?? {};
45
+ const cache = new Map();
46
+ const graphOf = (source) => {
47
+ const spec = source?.trim() || opts.source;
48
+ const remote = !!parseRemoteSpec(spec);
49
+ const hit = cache.get(spec);
50
+ // Local files change while the agent works: read them on every call.
51
+ if (hit && remote && (pinned(spec) || Date.now() - hit.at < REMOTE_TTL))
52
+ return hit.graph;
53
+ const graph = loadGraph(spec, config, opts.cwd);
54
+ if (remote) {
55
+ cache.set(spec, { graph, at: Date.now() });
56
+ graph.catch(() => cache.delete(spec));
57
+ }
58
+ return graph;
59
+ };
60
+ /** Styles of the project: a folder, or one file in it. Read on every call; the agent edits them. */
61
+ const codeOf = async (path) => {
62
+ const full = resolve(opts.cwd, path);
63
+ const info = await stat(full).catch(() => undefined);
64
+ if (!info)
65
+ throw new Error(`Not found: ${path}`);
66
+ const scanOpts = {};
67
+ if (config.code?.exclude)
68
+ scanOpts.exclude = config.code.exclude;
69
+ if (info.isFile())
70
+ return scanStyles(new NodeFsSource(dirname(full)), { ...scanOpts, include: [basename(full)] });
71
+ if (config.code?.include)
72
+ scanOpts.include = config.code.include;
73
+ return scanStyles(new NodeFsSource(full), scanOpts);
74
+ };
75
+ const inputOf = (graph, context) => graph.defaultInput(context ?? {});
76
+ const contextLine = (graph, input) => graph.modifiers.length
77
+ ? ` in ${Object.entries(input)
78
+ .map(([k, v]) => `${k}: ${v}`)
79
+ .join(', ')}`
80
+ : '';
81
+ server.registerTool('find_token', {
82
+ title: 'Find the token for a value',
83
+ description: 'Use before writing a hard-coded color, size, duration or font weight in code: returns the design tokens whose value matches it or comes closest (colors by visual difference ΔE, sizes in px). Prefer an exact match; among exact matches, semantic tokens (aliases) are listed before the primitives they point to.',
84
+ inputSchema: {
85
+ value: z
86
+ .string()
87
+ .describe('The value, e.g. "#3366ff", "rgb(51 102 255)", "12px", "0.75rem", "600", "200ms"'),
88
+ type: z
89
+ .enum(['color', 'dimension', 'duration', 'number', 'fontWeight', 'fontFamily', 'cubicBezier'])
90
+ .optional()
91
+ .describe('Token type, when the value alone is ambiguous'),
92
+ context: CONTEXT,
93
+ limit: z.number().int().min(1).max(25).optional().describe('How many tokens to return (default 5)'),
94
+ source: SOURCE,
95
+ },
96
+ annotations: { readOnlyHint: true, openWorldHint: true },
97
+ }, async ({ value, type, context, limit, source }) => {
98
+ const parsed = parseValue(value, type);
99
+ if (!parsed)
100
+ return failure(`"${value}" is not a value dsgraph can read as a token value. Pass \`type\` if it is ambiguous.`);
101
+ const graph = await graphOf(source);
102
+ const input = inputOf(graph, context);
103
+ // Tokens with the same value are one choice: grouped, so the list shows different values.
104
+ const groups = [];
105
+ for (const m of nearest(graph, parsed, input, 500)) {
106
+ const key = formatValue(m.token.type, m.value);
107
+ const g = groups.find((x) => x.value === key);
108
+ if (g)
109
+ g.matches.push(m);
110
+ else if (groups.length < (limit ?? 5))
111
+ groups.push({ value: key, matches: [m] });
112
+ }
113
+ if (!groups.length)
114
+ return text(`No ${parsed.type} tokens${contextLine(graph, input)}.`);
115
+ const lines = groups.map(({ value: v, matches }) => {
116
+ const first = matches[0];
117
+ const how = first.exact
118
+ ? 'exact'
119
+ : parsed.type === 'color'
120
+ ? `ΔE ${first.distance}`
121
+ : `off by ${first.distance}`;
122
+ const shown = matches.slice(0, 4).map((m) => {
123
+ const chain = graph.chain(m.token.id, input);
124
+ const alias = chain.length > 1 ? ` → ${chain.at(-1)}` : '';
125
+ return `\`${m.token.id}\`${alias}${m.token.deprecated ? ' (deprecated)' : ''}`;
126
+ });
127
+ const more = matches.length > 4 ? `, and ${matches.length - 4} more` : '';
128
+ return `- ${v} — ${how}: ${shown.join(', ')}${more}`;
129
+ });
130
+ const best = groups[0].matches[0];
131
+ const advice = best.exact
132
+ ? `Use \`${best.token.id}\` instead of the literal value${groups[0].matches.length > 1 ? ', or another token with the same value whose name fits the use' : ''}.`
133
+ : `No token matches exactly; the closest is \`${best.token.id}\`. Using a literal value here would bypass the design system.`;
134
+ return text(`${parsed.type} ${formatValue(parsed.type, parsed.value)}${contextLine(graph, input)}:\n${lines.join('\n')}\n\n${advice}`);
135
+ });
136
+ server.registerTool('get_token', {
137
+ title: 'Read a token',
138
+ description: 'One token in full: its value in every theme, the chain of references it takes the value from, the tokens that use it, its description, deprecation and file.',
139
+ inputSchema: {
140
+ id: z
141
+ .string()
142
+ .describe('Token id as dsgraph writes it, e.g. "color.text.primary" or "space-4" for CSS'),
143
+ source: SOURCE,
144
+ },
145
+ annotations: { readOnlyHint: true, openWorldHint: true },
146
+ }, async ({ id, source }) => {
147
+ const graph = await graphOf(source);
148
+ const t = graph.token(id);
149
+ if (!t) {
150
+ const near = graph
151
+ .tokens()
152
+ .map((x) => x.id)
153
+ .filter((x) => x.includes(id) || id.includes(x))
154
+ .slice(0, 8);
155
+ return failure(`No token "${id}".${near.length ? ` Similar: ${near.map((n) => `\`${n}\``).join(', ')}` : ''}`);
156
+ }
157
+ const lines = [`\`${t.id}\` — ${t.type ?? 'untyped'}`];
158
+ if (t.description)
159
+ lines.push(t.description);
160
+ if (t.deprecated)
161
+ lines.push(`Deprecated${t.deprecated.replacement ? `: use \`${t.deprecated.replacement}\`` : t.deprecated.reason ? `: ${t.deprecated.reason}` : ''}.`);
162
+ lines.push('', 'Values:');
163
+ for (const v of t.values) {
164
+ const chain = graph.chain(t.id, v.when);
165
+ const via = chain.length > 1 ? ` ← ${chain.slice(1).join(' ← ')}` : '';
166
+ lines.push(`- ${formatWhen(v.when).replace(/^ \(|\)$/g, '') || 'everywhere'}: ${formatValue(t.type, v.value)}${via}`);
167
+ }
168
+ const users = graph.dependents(t.id);
169
+ const all = graph.dependents(t.id, { transitive: true });
170
+ lines.push('', users.length
171
+ ? `Used by ${users.length} token${users.length === 1 ? '' : 's'}${all.length > users.length ? ` (${all.length} counting their users)` : ''}: ${users
172
+ .slice(0, 30)
173
+ .map((u) => `\`${u}\``)
174
+ .join(', ')}${users.length > 30 ? ', …' : ''}`
175
+ : 'No other token uses it.', `File: ${t.origin.file}`);
176
+ return text(lines.join('\n'));
177
+ });
178
+ server.registerTool('search_tokens', {
179
+ title: 'Search tokens',
180
+ description: 'Lists tokens by name and type with their values, e.g. every color, or everything under "color.text". Use to learn which tokens exist before choosing one.',
181
+ inputSchema: {
182
+ query: z
183
+ .string()
184
+ .optional()
185
+ .describe('Part of the name, or a glob such as "color.text.*". Leave out to list everything (up to the limit).'),
186
+ type: z
187
+ .string()
188
+ .optional()
189
+ .describe('Only this type: color, dimension, fontFamily, typography, shadow…'),
190
+ context: CONTEXT,
191
+ limit: z.number().int().min(1).max(500).optional().describe('Most tokens to return (default 100)'),
192
+ source: SOURCE,
193
+ },
194
+ annotations: { readOnlyHint: true, openWorldHint: true },
195
+ }, async ({ query, type, context, limit, source }) => {
196
+ const graph = await graphOf(source);
197
+ const input = inputOf(graph, context);
198
+ const q = query?.trim() ?? '';
199
+ const glob = /[*?]/.test(q);
200
+ const all = graph.tokens(type ? { type } : {}).filter((t) => {
201
+ if (!q)
202
+ return true;
203
+ if (glob)
204
+ return graph.tokens({ path: q }).some((x) => x.id === t.id);
205
+ return t.id.toLowerCase().includes(q.toLowerCase());
206
+ });
207
+ const max = limit ?? 100;
208
+ if (!all.length)
209
+ return text('No tokens match.');
210
+ const lines = all
211
+ .slice(0, max)
212
+ .map((t) => `- \`${t.id}\` (${t.type ?? '?'}): ${describeValue(graph, t, input)}${t.deprecated ? ' — deprecated' : ''}`);
213
+ if (all.length > max)
214
+ lines.push(`… ${all.length - max} more; narrow the query or raise the limit.`);
215
+ return text(`${all.length} token${all.length === 1 ? '' : 's'}${contextLine(graph, input)}:\n${lines.join('\n')}`);
216
+ });
217
+ server.registerTool('describe_tokens', {
218
+ title: 'Describe the design system',
219
+ description: 'An overview of a token source: how many tokens of each type, the themes and other modes, the top-level groups and files. Start here with an unfamiliar design system.',
220
+ inputSchema: { source: SOURCE },
221
+ annotations: { readOnlyHint: true, openWorldHint: true },
222
+ }, async ({ source }) => {
223
+ const graph = await graphOf(source);
224
+ const tokens = graph.tokens();
225
+ const byType = new Map();
226
+ for (const t of tokens)
227
+ byType.set(t.type ?? 'untyped', (byType.get(t.type ?? 'untyped') ?? 0) + 1);
228
+ const roots = new Map();
229
+ for (const t of tokens) {
230
+ const root = t.id.includes('.') ? t.id.split('.')[0] : t.id.split('-')[0];
231
+ roots.set(root, (roots.get(root) ?? 0) + 1);
232
+ }
233
+ const files = new Set(tokens.map((t) => t.origin.file));
234
+ const errors = graph.snapshot.diagnostics.filter((d) => d.severity === 'error').length;
235
+ const lines = [
236
+ `${tokens.length} tokens from ${files.size} file${files.size === 1 ? '' : 's'} (${source?.trim() || opts.source}).`,
237
+ `Types: ${[...byType]
238
+ .sort((a, b) => b[1] - a[1])
239
+ .map(([k, n]) => `${k} ${n}`)
240
+ .join(', ')}.`,
241
+ graph.modifiers.length
242
+ ? `Modes: ${graph.modifiers.map((m) => `${m.name} (${m.contexts.join(', ')}; default ${m.default ?? m.contexts[0]})`).join('; ')}.`
243
+ : 'No themes or other modes.',
244
+ `Top-level groups: ${[...roots]
245
+ .sort((a, b) => b[1] - a[1])
246
+ .slice(0, 20)
247
+ .map(([k, n]) => `${k} ${n}`)
248
+ .join(', ')}.`,
249
+ ];
250
+ if (errors)
251
+ lines.push(`${errors} parse errors; run check_tokens for details.`);
252
+ return text(lines.join('\n'));
253
+ });
254
+ server.registerTool('compare_versions', {
255
+ title: 'Compare two versions',
256
+ description: 'What changed between two versions of the tokens, what breaks and which semver bump the release needs: removed and renamed tokens first, value changes per theme, and tokens that changed through references. Use before upgrading a token package or releasing one.',
257
+ inputSchema: {
258
+ base: z
259
+ .string()
260
+ .describe('The old version: a path, npm:package@version or github:owner/repo/path@ref'),
261
+ head: SOURCE.describe('The new version; leave out for the project default'),
262
+ code: CODE.describe('The project that uses the tokens (a folder or style file): adds, under each change, the places in its styles that break or look different.'),
263
+ },
264
+ annotations: { readOnlyHint: true, openWorldHint: true },
265
+ }, async ({ base, head, code }) => {
266
+ const [b, h, index] = await Promise.all([graphOf(base), graphOf(head), code ? codeOf(code) : undefined]);
267
+ const cs = await diff(b, h, diffOptions(config));
268
+ const types = new Map([...b.tokens(), ...h.tokens()].map((t) => [t.id, t.type]));
269
+ const impact = index
270
+ ? impactOf(cs, b, h, index, config.code?.prefix ? { prefix: config.code.prefix } : {})
271
+ : undefined;
272
+ return text(formatChangeset(cs, { format: 'markdown', types, ...(impact ? { impact } : {}) }));
273
+ });
274
+ server.registerTool('check_styles', {
275
+ title: 'Check styles against the tokens',
276
+ description: 'Use after writing or editing CSS or SCSS: finds colors written by hand, spacing, radii and font sizes off the scale, deprecated and unknown design-system variables, each with the token to use instead. Pass the style text you just wrote, or a file or folder of the project.',
277
+ inputSchema: {
278
+ css: z
279
+ .string()
280
+ .optional()
281
+ .describe('Style text to check, e.g. the rule you are about to write. SCSS is fine.'),
282
+ path: CODE.describe('A style file or folder of the project to check instead of `css`.'),
283
+ source: SOURCE,
284
+ },
285
+ annotations: { readOnlyHint: true, openWorldHint: true },
286
+ }, async ({ css, path, source }) => {
287
+ if (!css && !path)
288
+ return failure('Pass `css` (style text) or `path` (a style file or folder).');
289
+ const [graph, code] = await Promise.all([
290
+ graphOf(source),
291
+ css ? scanStyles(new MemorySource({ 'snippet.scss': css })) : codeOf(path),
292
+ ]);
293
+ if (code.skipped.length && !code.files.length)
294
+ return failure(`Could not parse the styles: ${code.skipped[0].message}`);
295
+ const findings = (await check(graph, config, [], { code })).filter((f) => /^(style|usage)\//.test(f.rule));
296
+ if (!findings.length)
297
+ return text(`No problems: ${code.uses.length} token use${code.uses.length === 1 ? '' : 's'}, no values written by hand that should be tokens.`);
298
+ return text(formatFindings(findings, { format: 'markdown', group: false }));
299
+ });
300
+ server.registerTool('check_tokens', {
301
+ title: 'Check tokens',
302
+ description: 'Problems in a token source: broken references, reference cycles, legacy syntax, naming collisions, color ramps out of order, colors out of gamut. Repeated problems are grouped.',
303
+ inputSchema: { source: SOURCE },
304
+ annotations: { readOnlyHint: true, openWorldHint: true },
305
+ }, async ({ source }) => {
306
+ const graph = await graphOf(source);
307
+ const findings = await check(graph, config);
308
+ return text(findings.length ? formatFindings(findings, { format: 'markdown' }) : 'No problems found.');
309
+ });
310
+ return server;
311
+ }
312
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM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C,CAAA;IAC7E,CAAC,CACF,CAAA;IAED,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,kLAAkL;QACpL,WAAW,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;QAC/B,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;KACzD,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACnB,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;QACnC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAA;IACxG,CAAC,CACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,48 @@
1
1
  {
2
2
  "name": "@dsgraph/mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.3.0",
4
+ "description": "MCP server for design tokens: find the token for a value, read a token with its references, compare versions, run checks. DTCG, token JSON and CSS; folders, npm and GitHub.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "dsgraph-mcp": "dist/cli.js"
9
+ },
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/server.d.ts",
13
+ "default": "./dist/server.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/specsure/specsure.git",
22
+ "directory": "packages/dsgraph-mcp"
23
+ },
24
+ "homepage": "https://github.com/specsure/specsure/tree/main/packages/dsgraph-mcp#readme",
25
+ "bugs": {
26
+ "url": "https://github.com/specsure/specsure/issues"
27
+ },
28
+ "keywords": [
29
+ "design-tokens",
30
+ "dtcg",
31
+ "design-system",
32
+ "mcp",
33
+ "model-context-protocol"
34
+ ],
35
+ "engines": {
36
+ "node": ">=20.19"
37
+ },
38
+ "dependencies": {
39
+ "@dsgraph/adapters": "0.3.0",
40
+ "@dsgraph/cli": "0.3.0",
41
+ "@dsgraph/core": "0.3.0",
42
+ "@dsgraph/report": "0.3.0",
43
+ "@dsgraph/rules": "0.3.0",
44
+ "@dsgraph/sources": "0.3.0",
45
+ "@modelcontextprotocol/sdk": "1.31.0",
46
+ "zod": "4.6.5"
47
+ }
48
+ }