@dsgraph/mcp 0.0.0-stage → 0.2.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 +21 -0
- package/README.md +62 -2
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +36 -0
- package/dist/cli.js.map +1 -0
- package/dist/nearest.d.ts +23 -0
- package/dist/nearest.d.ts.map +1 -0
- package/dist/nearest.js +67 -0
- package/dist/nearest.js.map +1 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +259 -0
- package/dist/server.js.map +1 -0
- package/package.json +46 -4
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,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @dsgraph/mcp
|
|
2
2
|
|
|
3
|
-
|
|
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.app/tools/mcp](https://specsure.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
|
+
| `compare_versions` | What changed between two versions, what breaks and which semver bump the release needs |
|
|
38
|
+
| `check_tokens` | Broken references, cycles, legacy syntax, naming collisions, ramps out of order, colors out of gamut |
|
|
39
|
+
|
|
40
|
+
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`".
|
|
41
|
+
|
|
42
|
+
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.
|
|
43
|
+
|
|
44
|
+
## Example
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
find_token { "value": "#3366ff" }
|
|
48
|
+
|
|
49
|
+
color #3366ff in theme: default:
|
|
50
|
+
- #3366ff — exact: `color-accent` → color-blue-500, `color-blue-500`
|
|
51
|
+
|
|
52
|
+
Use `color-accent` instead of the literal value, or another token with the same value whose name fits the use.
|
|
53
|
+
|
|
54
|
+
find_token { "value": "0.875rem" }
|
|
55
|
+
|
|
56
|
+
dimension 0.875rem in theme: default:
|
|
57
|
+
- 16px — off by 2: `space-md`
|
|
58
|
+
- 8px — off by 6: `space-small`
|
|
59
|
+
|
|
60
|
+
No token matches exactly; the closest is `space-md`. Using a literal value here would bypass the design system.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Part of [dsgraph](https://github.com/specsure/specsure). MIT license.
|
package/dist/cli.d.ts
ADDED
|
@@ -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
|
package/dist/cli.js.map
ADDED
|
@@ -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,23 @@
|
|
|
1
|
+
import { type DsGraph, type Input, type Token } 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
|
+
export interface Match {
|
|
8
|
+
token: Token;
|
|
9
|
+
value: unknown;
|
|
10
|
+
distance: number;
|
|
11
|
+
/** Within the threshold people cannot tell apart (ΔE < 1, < 0.5px). */
|
|
12
|
+
exact: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Tokens nearest to a value in one context. Deprecated ones go last; among equally close tokens,
|
|
16
|
+
* the ones that reference another token (semantic tokens, which follow themes) come before the
|
|
17
|
+
* primitives that hold the value.
|
|
18
|
+
*/
|
|
19
|
+
export declare function nearest(graph: DsGraph, parsed: {
|
|
20
|
+
type: string;
|
|
21
|
+
value: unknown;
|
|
22
|
+
}, input: Input, limit: number): Match[];
|
|
23
|
+
//# sourceMappingURL=nearest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nearest.d.ts","sourceRoot":"","sources":["../src/nearest.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,OAAO,EAEZ,KAAK,KAAK,EACV,KAAK,KAAK,EAEX,MAAM,eAAe,CAAA;AAEtB,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;AA0BD,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,KAAK,CAAA;IACZ,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,uEAAuE;IACvE,KAAK,EAAE,OAAO,CAAA;CACf;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,EACxC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,GACZ,KAAK,EAAE,CAoBT"}
|
package/dist/nearest.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { cssValueToToken } from '@dsgraph/adapters';
|
|
2
|
+
import { canonicalize, canonicalValue, DiagnosticBag, deltaEOK, toPx, } 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
|
+
const REM = 16;
|
|
19
|
+
/** How far two values of a type are apart, in the unit people think in; undefined when not comparable. */
|
|
20
|
+
function distance(type, a, b) {
|
|
21
|
+
if (type === 'color')
|
|
22
|
+
return deltaEOK(a, b);
|
|
23
|
+
if (type === 'dimension') {
|
|
24
|
+
const pa = toPx(a, REM);
|
|
25
|
+
const pb = toPx(b, REM);
|
|
26
|
+
if (pa !== undefined && pb !== undefined)
|
|
27
|
+
return Math.abs(pa - pb);
|
|
28
|
+
}
|
|
29
|
+
if (type === 'duration') {
|
|
30
|
+
const ms = (d) => (d.unit === 's' ? d.value * 1000 : d.value);
|
|
31
|
+
return Math.abs(ms(a) - ms(b));
|
|
32
|
+
}
|
|
33
|
+
if (typeof a === 'number' && typeof b === 'number')
|
|
34
|
+
return Math.abs(a - b);
|
|
35
|
+
return canonicalize(a) === canonicalize(b) ? 0 : undefined;
|
|
36
|
+
}
|
|
37
|
+
/** Types an agent's value can stand for: a bare number may be a font weight. */
|
|
38
|
+
const COMPATIBLE = {
|
|
39
|
+
number: ['number', 'fontWeight'],
|
|
40
|
+
fontWeight: ['fontWeight', 'number'],
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Tokens nearest to a value in one context. Deprecated ones go last; among equally close tokens,
|
|
44
|
+
* the ones that reference another token (semantic tokens, which follow themes) come before the
|
|
45
|
+
* primitives that hold the value.
|
|
46
|
+
*/
|
|
47
|
+
export function nearest(graph, parsed, input, limit) {
|
|
48
|
+
const types = COMPATIBLE[parsed.type] ?? [parsed.type];
|
|
49
|
+
const out = [];
|
|
50
|
+
for (const token of graph.tokens({ type: types })) {
|
|
51
|
+
const value = graph.value(token.id, input);
|
|
52
|
+
if (value === undefined || value === null)
|
|
53
|
+
continue;
|
|
54
|
+
const d = distance(token.type === parsed.type ? parsed.type : token.type, parsed.value, value);
|
|
55
|
+
if (d === undefined)
|
|
56
|
+
continue;
|
|
57
|
+
const exact = parsed.type === 'color' ? d < 1 : parsed.type === 'dimension' ? d < 0.5 : d === 0;
|
|
58
|
+
out.push({ token, value, distance: Math.round(d * 100) / 100, exact });
|
|
59
|
+
}
|
|
60
|
+
return out
|
|
61
|
+
.sort((a, b) => Number(a.token.deprecated !== null) - Number(b.token.deprecated !== null) ||
|
|
62
|
+
a.distance - b.distance ||
|
|
63
|
+
graph.chain(b.token.id, input).length - graph.chain(a.token.id, input).length ||
|
|
64
|
+
a.token.id.localeCompare(b.token.id))
|
|
65
|
+
.slice(0, limit);
|
|
66
|
+
}
|
|
67
|
+
//# 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,EAEL,YAAY,EACZ,cAAc,EACd,aAAa,EAEb,QAAQ,EAGR,IAAI,GACL,MAAM,eAAe,CAAA;AAEtB,kHAAkH;AAClH,MAAM,UAAU,UAAU,CAAC,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AA;AACpB,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -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":"AACA,OAAO,EAAE,KAAK,MAAM,EAA8C,MAAM,eAAe,CAAA;AAIvF,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;AA+BD,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,CAkR3D"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { diffOptions, loadGraph } from '@dsgraph/cli';
|
|
2
|
+
import { diff } from '@dsgraph/core';
|
|
3
|
+
import { formatChangeset, formatFindings, formatValue, formatWhen } from '@dsgraph/report';
|
|
4
|
+
import { check } from '@dsgraph/rules';
|
|
5
|
+
import { parseRemoteSpec } from '@dsgraph/sources';
|
|
6
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { nearest, parseValue } from './nearest.js';
|
|
9
|
+
const SOURCE = z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.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.');
|
|
13
|
+
const CONTEXT = z
|
|
14
|
+
.record(z.string(), z.string())
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('Theme or other mode to read values in, e.g. {"theme": "dark"}. Leave out for the default.');
|
|
17
|
+
/** Remote sources pinned to an exact version never change; everything else is read again after a while. */
|
|
18
|
+
const pinned = (spec) => {
|
|
19
|
+
const r = parseRemoteSpec(spec);
|
|
20
|
+
if (!r)
|
|
21
|
+
return false;
|
|
22
|
+
return r.kind === 'npm' ? /^\d+\.\d+\.\d+/.test(r.version) : /^[0-9a-f]{40}$/.test(r.ref);
|
|
23
|
+
};
|
|
24
|
+
const REMOTE_TTL = 5 * 60_000;
|
|
25
|
+
const text = (t) => ({ content: [{ type: 'text', text: t }] });
|
|
26
|
+
const failure = (t) => ({ content: [{ type: 'text', text: t }], isError: true });
|
|
27
|
+
function describeValue(graph, t, input) {
|
|
28
|
+
const v = graph.value(t.id, input);
|
|
29
|
+
const chain = graph.chain(t.id, input);
|
|
30
|
+
const alias = chain.length > 1 ? ` (alias of ${chain.slice(1).join(' → ')})` : '';
|
|
31
|
+
return `${formatValue(t.type, v)}${alias}`;
|
|
32
|
+
}
|
|
33
|
+
/** The MCP server: read-only tools over a design system's tokens, built on dsgraph. */
|
|
34
|
+
export function createServer(opts) {
|
|
35
|
+
const server = new McpServer({ name: 'dsgraph', version: opts.version ?? '0.2.0' });
|
|
36
|
+
const config = opts.config ?? {};
|
|
37
|
+
const cache = new Map();
|
|
38
|
+
const graphOf = (source) => {
|
|
39
|
+
const spec = source?.trim() || opts.source;
|
|
40
|
+
const remote = !!parseRemoteSpec(spec);
|
|
41
|
+
const hit = cache.get(spec);
|
|
42
|
+
// Local files change while the agent works: read them on every call.
|
|
43
|
+
if (hit && remote && (pinned(spec) || Date.now() - hit.at < REMOTE_TTL))
|
|
44
|
+
return hit.graph;
|
|
45
|
+
const graph = loadGraph(spec, config, opts.cwd);
|
|
46
|
+
if (remote) {
|
|
47
|
+
cache.set(spec, { graph, at: Date.now() });
|
|
48
|
+
graph.catch(() => cache.delete(spec));
|
|
49
|
+
}
|
|
50
|
+
return graph;
|
|
51
|
+
};
|
|
52
|
+
const inputOf = (graph, context) => graph.defaultInput(context ?? {});
|
|
53
|
+
const contextLine = (graph, input) => graph.modifiers.length
|
|
54
|
+
? ` in ${Object.entries(input)
|
|
55
|
+
.map(([k, v]) => `${k}: ${v}`)
|
|
56
|
+
.join(', ')}`
|
|
57
|
+
: '';
|
|
58
|
+
server.registerTool('find_token', {
|
|
59
|
+
title: 'Find the token for a value',
|
|
60
|
+
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.',
|
|
61
|
+
inputSchema: {
|
|
62
|
+
value: z
|
|
63
|
+
.string()
|
|
64
|
+
.describe('The value, e.g. "#3366ff", "rgb(51 102 255)", "12px", "0.75rem", "600", "200ms"'),
|
|
65
|
+
type: z
|
|
66
|
+
.enum(['color', 'dimension', 'duration', 'number', 'fontWeight', 'fontFamily', 'cubicBezier'])
|
|
67
|
+
.optional()
|
|
68
|
+
.describe('Token type, when the value alone is ambiguous'),
|
|
69
|
+
context: CONTEXT,
|
|
70
|
+
limit: z.number().int().min(1).max(25).optional().describe('How many tokens to return (default 5)'),
|
|
71
|
+
source: SOURCE,
|
|
72
|
+
},
|
|
73
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
74
|
+
}, async ({ value, type, context, limit, source }) => {
|
|
75
|
+
const parsed = parseValue(value, type);
|
|
76
|
+
if (!parsed)
|
|
77
|
+
return failure(`"${value}" is not a value dsgraph can read as a token value. Pass \`type\` if it is ambiguous.`);
|
|
78
|
+
const graph = await graphOf(source);
|
|
79
|
+
const input = inputOf(graph, context);
|
|
80
|
+
// Tokens with the same value are one choice: grouped, so the list shows different values.
|
|
81
|
+
const groups = [];
|
|
82
|
+
for (const m of nearest(graph, parsed, input, 500)) {
|
|
83
|
+
const key = formatValue(m.token.type, m.value);
|
|
84
|
+
const g = groups.find((x) => x.value === key);
|
|
85
|
+
if (g)
|
|
86
|
+
g.matches.push(m);
|
|
87
|
+
else if (groups.length < (limit ?? 5))
|
|
88
|
+
groups.push({ value: key, matches: [m] });
|
|
89
|
+
}
|
|
90
|
+
if (!groups.length)
|
|
91
|
+
return text(`No ${parsed.type} tokens${contextLine(graph, input)}.`);
|
|
92
|
+
const lines = groups.map(({ value: v, matches }) => {
|
|
93
|
+
const first = matches[0];
|
|
94
|
+
const how = first.exact
|
|
95
|
+
? 'exact'
|
|
96
|
+
: parsed.type === 'color'
|
|
97
|
+
? `ΔE ${first.distance}`
|
|
98
|
+
: `off by ${first.distance}`;
|
|
99
|
+
const shown = matches.slice(0, 4).map((m) => {
|
|
100
|
+
const chain = graph.chain(m.token.id, input);
|
|
101
|
+
const alias = chain.length > 1 ? ` → ${chain.at(-1)}` : '';
|
|
102
|
+
return `\`${m.token.id}\`${alias}${m.token.deprecated ? ' (deprecated)' : ''}`;
|
|
103
|
+
});
|
|
104
|
+
const more = matches.length > 4 ? `, and ${matches.length - 4} more` : '';
|
|
105
|
+
return `- ${v} — ${how}: ${shown.join(', ')}${more}`;
|
|
106
|
+
});
|
|
107
|
+
const best = groups[0].matches[0];
|
|
108
|
+
const advice = best.exact
|
|
109
|
+
? `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' : ''}.`
|
|
110
|
+
: `No token matches exactly; the closest is \`${best.token.id}\`. Using a literal value here would bypass the design system.`;
|
|
111
|
+
return text(`${parsed.type} ${formatValue(parsed.type, parsed.value)}${contextLine(graph, input)}:\n${lines.join('\n')}\n\n${advice}`);
|
|
112
|
+
});
|
|
113
|
+
server.registerTool('get_token', {
|
|
114
|
+
title: 'Read a token',
|
|
115
|
+
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.',
|
|
116
|
+
inputSchema: {
|
|
117
|
+
id: z
|
|
118
|
+
.string()
|
|
119
|
+
.describe('Token id as dsgraph writes it, e.g. "color.text.primary" or "space-4" for CSS'),
|
|
120
|
+
source: SOURCE,
|
|
121
|
+
},
|
|
122
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
123
|
+
}, async ({ id, source }) => {
|
|
124
|
+
const graph = await graphOf(source);
|
|
125
|
+
const t = graph.token(id);
|
|
126
|
+
if (!t) {
|
|
127
|
+
const near = graph
|
|
128
|
+
.tokens()
|
|
129
|
+
.map((x) => x.id)
|
|
130
|
+
.filter((x) => x.includes(id) || id.includes(x))
|
|
131
|
+
.slice(0, 8);
|
|
132
|
+
return failure(`No token "${id}".${near.length ? ` Similar: ${near.map((n) => `\`${n}\``).join(', ')}` : ''}`);
|
|
133
|
+
}
|
|
134
|
+
const lines = [`\`${t.id}\` — ${t.type ?? 'untyped'}`];
|
|
135
|
+
if (t.description)
|
|
136
|
+
lines.push(t.description);
|
|
137
|
+
if (t.deprecated)
|
|
138
|
+
lines.push(`Deprecated${t.deprecated.replacement ? `: use \`${t.deprecated.replacement}\`` : t.deprecated.reason ? `: ${t.deprecated.reason}` : ''}.`);
|
|
139
|
+
lines.push('', 'Values:');
|
|
140
|
+
for (const v of t.values) {
|
|
141
|
+
const chain = graph.chain(t.id, v.when);
|
|
142
|
+
const via = chain.length > 1 ? ` ← ${chain.slice(1).join(' ← ')}` : '';
|
|
143
|
+
lines.push(`- ${formatWhen(v.when).replace(/^ \(|\)$/g, '') || 'everywhere'}: ${formatValue(t.type, v.value)}${via}`);
|
|
144
|
+
}
|
|
145
|
+
const users = graph.dependents(t.id);
|
|
146
|
+
const all = graph.dependents(t.id, { transitive: true });
|
|
147
|
+
lines.push('', users.length
|
|
148
|
+
? `Used by ${users.length} token${users.length === 1 ? '' : 's'}${all.length > users.length ? ` (${all.length} counting their users)` : ''}: ${users
|
|
149
|
+
.slice(0, 30)
|
|
150
|
+
.map((u) => `\`${u}\``)
|
|
151
|
+
.join(', ')}${users.length > 30 ? ', …' : ''}`
|
|
152
|
+
: 'No other token uses it.', `File: ${t.origin.file}`);
|
|
153
|
+
return text(lines.join('\n'));
|
|
154
|
+
});
|
|
155
|
+
server.registerTool('search_tokens', {
|
|
156
|
+
title: 'Search tokens',
|
|
157
|
+
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.',
|
|
158
|
+
inputSchema: {
|
|
159
|
+
query: z
|
|
160
|
+
.string()
|
|
161
|
+
.optional()
|
|
162
|
+
.describe('Part of the name, or a glob such as "color.text.*". Leave out to list everything (up to the limit).'),
|
|
163
|
+
type: z
|
|
164
|
+
.string()
|
|
165
|
+
.optional()
|
|
166
|
+
.describe('Only this type: color, dimension, fontFamily, typography, shadow…'),
|
|
167
|
+
context: CONTEXT,
|
|
168
|
+
limit: z.number().int().min(1).max(500).optional().describe('Most tokens to return (default 100)'),
|
|
169
|
+
source: SOURCE,
|
|
170
|
+
},
|
|
171
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
172
|
+
}, async ({ query, type, context, limit, source }) => {
|
|
173
|
+
const graph = await graphOf(source);
|
|
174
|
+
const input = inputOf(graph, context);
|
|
175
|
+
const q = query?.trim() ?? '';
|
|
176
|
+
const glob = /[*?]/.test(q);
|
|
177
|
+
const all = graph.tokens(type ? { type } : {}).filter((t) => {
|
|
178
|
+
if (!q)
|
|
179
|
+
return true;
|
|
180
|
+
if (glob)
|
|
181
|
+
return graph.tokens({ path: q }).some((x) => x.id === t.id);
|
|
182
|
+
return t.id.toLowerCase().includes(q.toLowerCase());
|
|
183
|
+
});
|
|
184
|
+
const max = limit ?? 100;
|
|
185
|
+
if (!all.length)
|
|
186
|
+
return text('No tokens match.');
|
|
187
|
+
const lines = all
|
|
188
|
+
.slice(0, max)
|
|
189
|
+
.map((t) => `- \`${t.id}\` (${t.type ?? '?'}): ${describeValue(graph, t, input)}${t.deprecated ? ' — deprecated' : ''}`);
|
|
190
|
+
if (all.length > max)
|
|
191
|
+
lines.push(`… ${all.length - max} more; narrow the query or raise the limit.`);
|
|
192
|
+
return text(`${all.length} token${all.length === 1 ? '' : 's'}${contextLine(graph, input)}:\n${lines.join('\n')}`);
|
|
193
|
+
});
|
|
194
|
+
server.registerTool('describe_tokens', {
|
|
195
|
+
title: 'Describe the design system',
|
|
196
|
+
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.',
|
|
197
|
+
inputSchema: { source: SOURCE },
|
|
198
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
199
|
+
}, async ({ source }) => {
|
|
200
|
+
const graph = await graphOf(source);
|
|
201
|
+
const tokens = graph.tokens();
|
|
202
|
+
const byType = new Map();
|
|
203
|
+
for (const t of tokens)
|
|
204
|
+
byType.set(t.type ?? 'untyped', (byType.get(t.type ?? 'untyped') ?? 0) + 1);
|
|
205
|
+
const roots = new Map();
|
|
206
|
+
for (const t of tokens) {
|
|
207
|
+
const root = t.id.includes('.') ? t.id.split('.')[0] : t.id.split('-')[0];
|
|
208
|
+
roots.set(root, (roots.get(root) ?? 0) + 1);
|
|
209
|
+
}
|
|
210
|
+
const files = new Set(tokens.map((t) => t.origin.file));
|
|
211
|
+
const errors = graph.snapshot.diagnostics.filter((d) => d.severity === 'error').length;
|
|
212
|
+
const lines = [
|
|
213
|
+
`${tokens.length} tokens from ${files.size} file${files.size === 1 ? '' : 's'} (${source?.trim() || opts.source}).`,
|
|
214
|
+
`Types: ${[...byType]
|
|
215
|
+
.sort((a, b) => b[1] - a[1])
|
|
216
|
+
.map(([k, n]) => `${k} ${n}`)
|
|
217
|
+
.join(', ')}.`,
|
|
218
|
+
graph.modifiers.length
|
|
219
|
+
? `Modes: ${graph.modifiers.map((m) => `${m.name} (${m.contexts.join(', ')}; default ${m.default ?? m.contexts[0]})`).join('; ')}.`
|
|
220
|
+
: 'No themes or other modes.',
|
|
221
|
+
`Top-level groups: ${[...roots]
|
|
222
|
+
.sort((a, b) => b[1] - a[1])
|
|
223
|
+
.slice(0, 20)
|
|
224
|
+
.map(([k, n]) => `${k} ${n}`)
|
|
225
|
+
.join(', ')}.`,
|
|
226
|
+
];
|
|
227
|
+
if (errors)
|
|
228
|
+
lines.push(`${errors} parse errors; run check_tokens for details.`);
|
|
229
|
+
return text(lines.join('\n'));
|
|
230
|
+
});
|
|
231
|
+
server.registerTool('compare_versions', {
|
|
232
|
+
title: 'Compare two versions',
|
|
233
|
+
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.',
|
|
234
|
+
inputSchema: {
|
|
235
|
+
base: z
|
|
236
|
+
.string()
|
|
237
|
+
.describe('The old version: a path, npm:package@version or github:owner/repo/path@ref'),
|
|
238
|
+
head: SOURCE.describe('The new version; leave out for the project default'),
|
|
239
|
+
},
|
|
240
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
241
|
+
}, async ({ base, head }) => {
|
|
242
|
+
const [b, h] = await Promise.all([graphOf(base), graphOf(head)]);
|
|
243
|
+
const cs = await diff(b, h, diffOptions(config));
|
|
244
|
+
const types = new Map([...b.tokens(), ...h.tokens()].map((t) => [t.id, t.type]));
|
|
245
|
+
return text(formatChangeset(cs, { format: 'markdown', types }));
|
|
246
|
+
});
|
|
247
|
+
server.registerTool('check_tokens', {
|
|
248
|
+
title: 'Check tokens',
|
|
249
|
+
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.',
|
|
250
|
+
inputSchema: { source: SOURCE },
|
|
251
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
252
|
+
}, async ({ source }) => {
|
|
253
|
+
const graph = await graphOf(source);
|
|
254
|
+
const findings = await check(graph, config);
|
|
255
|
+
return text(findings.length ? formatFindings(findings, { format: 'markdown' }) : 'No problems found.');
|
|
256
|
+
});
|
|
257
|
+
return server;
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAA6B,IAAI,EAA0B,MAAM,eAAe,CAAA;AACvF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAWlD,MAAM,MAAM,GAAG,CAAC;KACb,MAAM,EAAE;KACR,QAAQ,EAAE;KACV,QAAQ,CACP,oIAAoI,CACrI,CAAA;AACH,MAAM,OAAO,GAAG,CAAC;KACd,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;KAC9B,QAAQ,EAAE;KACV,QAAQ,CAAC,2FAA2F,CAAC,CAAA;AAExG,2GAA2G;AAC3G,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE;IAC9B,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAA;IAC/B,IAAI,CAAC,CAAC;QAAE,OAA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AAM,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.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.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.2.0",
|
|
40
|
+
"@dsgraph/cli": "0.2.0",
|
|
41
|
+
"@dsgraph/core": "0.2.0",
|
|
42
|
+
"@dsgraph/report": "0.2.0",
|
|
43
|
+
"@dsgraph/rules": "0.2.0",
|
|
44
|
+
"@dsgraph/sources": "0.2.0",
|
|
45
|
+
"@modelcontextprotocol/sdk": "1.31.0",
|
|
46
|
+
"zod": "4.6.5"
|
|
47
|
+
}
|
|
48
|
+
}
|