@nysds/mcp-server 1.0.0 → 1.14.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.
Files changed (43) hide show
  1. package/dist/index.d.ts +9 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +16 -0
  4. package/dist/lib/cem-parser.d.ts +96 -0
  5. package/dist/lib/cem-parser.d.ts.map +1 -0
  6. package/dist/lib/cem-parser.js +82 -0
  7. package/dist/lib/search.d.ts +20 -0
  8. package/dist/lib/search.d.ts.map +1 -0
  9. package/dist/lib/search.js +87 -0
  10. package/dist/lib/token-parser.d.ts +140 -0
  11. package/dist/lib/token-parser.d.ts.map +1 -0
  12. package/dist/lib/token-parser.js +458 -0
  13. package/dist/prompts/nysds-mode.d.ts +8 -0
  14. package/dist/prompts/nysds-mode.d.ts.map +1 -0
  15. package/dist/prompts/nysds-mode.js +51 -0
  16. package/dist/resources/components.d.ts +12 -0
  17. package/dist/resources/components.d.ts.map +1 -0
  18. package/dist/resources/components.js +62 -0
  19. package/dist/resources/guides.d.ts +11 -0
  20. package/dist/resources/guides.d.ts.map +1 -0
  21. package/dist/resources/guides.js +80 -0
  22. package/dist/resources/index.d.ts +8 -0
  23. package/dist/resources/index.d.ts.map +1 -0
  24. package/dist/resources/index.js +13 -0
  25. package/dist/resources/tokens.d.ts +17 -0
  26. package/dist/resources/tokens.d.ts.map +1 -0
  27. package/dist/resources/tokens.js +312 -0
  28. package/dist/server.d.ts +11 -0
  29. package/dist/server.d.ts.map +1 -0
  30. package/dist/server.js +30 -0
  31. package/dist/tools/component-tools.d.ts +14 -0
  32. package/dist/tools/component-tools.d.ts.map +1 -0
  33. package/dist/tools/component-tools.js +127 -0
  34. package/dist/tools/index.d.ts +8 -0
  35. package/dist/tools/index.d.ts.map +1 -0
  36. package/dist/tools/index.js +13 -0
  37. package/dist/tools/token-tools.d.ts +17 -0
  38. package/dist/tools/token-tools.d.ts.map +1 -0
  39. package/dist/tools/token-tools.js +504 -0
  40. package/dist/tools/validation-tools.d.ts +12 -0
  41. package/dist/tools/validation-tools.d.ts.map +1 -0
  42. package/dist/tools/validation-tools.js +222 -0
  43. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ /**
2
+ * MCP Resources Registration
3
+ *
4
+ * Registers all NYSDS resources with the MCP server.
5
+ */
6
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
+ export declare function registerResources(server: McpServer): void;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAIzD"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * MCP Resources Registration
3
+ *
4
+ * Registers all NYSDS resources with the MCP server.
5
+ */
6
+ import { registerComponentResources } from "./components.js";
7
+ import { registerTokenResources } from "./tokens.js";
8
+ import { registerGuideResources } from "./guides.js";
9
+ export function registerResources(server) {
10
+ registerComponentResources(server);
11
+ registerTokenResources(server);
12
+ registerGuideResources(server);
13
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Token Resources
3
+ *
4
+ * MCP resources for NYSDS design tokens.
5
+ *
6
+ * Resources:
7
+ * - nysds://tokens - All tokens in CSS-centric format
8
+ * - nysds://tokens/css - Raw tokens.css file content
9
+ * - nysds://tokens/graph - Token dependency graph with stats
10
+ * - nysds://tokens/color - Color tokens only
11
+ * - nysds://tokens/font - Typography tokens
12
+ * - nysds://tokens/space - Spacing tokens
13
+ * - nysds://tokens/size - Size tokens
14
+ */
15
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
16
+ export declare function registerTokenResources(server: McpServer): void;
17
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/resources/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASzE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiZ9D"}
@@ -0,0 +1,312 @@
1
+ /**
2
+ * Token Resources
3
+ *
4
+ * MCP resources for NYSDS design tokens.
5
+ *
6
+ * Resources:
7
+ * - nysds://tokens - All tokens in CSS-centric format
8
+ * - nysds://tokens/css - Raw tokens.css file content
9
+ * - nysds://tokens/graph - Token dependency graph with stats
10
+ * - nysds://tokens/color - Color tokens only
11
+ * - nysds://tokens/font - Typography tokens
12
+ * - nysds://tokens/space - Spacing tokens
13
+ * - nysds://tokens/size - Size tokens
14
+ */
15
+ import { getCSSTokens, getCSSTokensByCategory, getCSSTokenCategories, buildTokenGraph, getTokensCSS, } from "../lib/token-parser.js";
16
+ export function registerTokenResources(server) {
17
+ // ---------------------------------------------------------------------------
18
+ // nysds://tokens - All design tokens in CSS-centric format
19
+ // ---------------------------------------------------------------------------
20
+ server.resource("tokens", "nysds://tokens", {
21
+ description: "All NYSDS design tokens with CSS variable names, values, and descriptions",
22
+ mimeType: "application/json",
23
+ }, async () => {
24
+ const tokens = getCSSTokens();
25
+ const categories = getCSSTokenCategories();
26
+ const formatted = tokens.map((t) => ({
27
+ cssVariable: t.cssVariable,
28
+ cssValue: t.cssValue,
29
+ referencesVariable: t.referencesVariable,
30
+ resolvedValue: t.resolvedValue,
31
+ description: t.description,
32
+ category: t.category,
33
+ layer: t.layer,
34
+ }));
35
+ return {
36
+ contents: [
37
+ {
38
+ uri: "nysds://tokens",
39
+ mimeType: "application/json",
40
+ text: JSON.stringify({
41
+ totalTokens: tokens.length,
42
+ categories: categories.map((c) => c.category),
43
+ tokens: formatted,
44
+ }, null, 2),
45
+ },
46
+ ],
47
+ };
48
+ });
49
+ // ---------------------------------------------------------------------------
50
+ // nysds://tokens/css - Raw tokens.css file content
51
+ // ---------------------------------------------------------------------------
52
+ server.resource("tokens-css", "nysds://tokens/css", {
53
+ description: "Raw tokens.css file content for direct CSS usage",
54
+ mimeType: "text/css",
55
+ }, async () => {
56
+ const css = getTokensCSS();
57
+ if (!css) {
58
+ return {
59
+ contents: [
60
+ {
61
+ uri: "nysds://tokens/css",
62
+ mimeType: "text/plain",
63
+ text: "/* tokens.css not found. Run 'npm run build -w packages/tokens' to generate. */",
64
+ },
65
+ ],
66
+ };
67
+ }
68
+ return {
69
+ contents: [
70
+ {
71
+ uri: "nysds://tokens/css",
72
+ mimeType: "text/css",
73
+ text: css,
74
+ },
75
+ ],
76
+ };
77
+ });
78
+ // ---------------------------------------------------------------------------
79
+ // nysds://tokens/graph - Token dependency graph with stats
80
+ // ---------------------------------------------------------------------------
81
+ server.resource("tokens-graph", "nysds://tokens/graph", {
82
+ description: "Token dependency graph showing which tokens reference which and usage statistics",
83
+ mimeType: "application/json",
84
+ }, async () => {
85
+ const graph = buildTokenGraph();
86
+ const nodes = Array.from(graph.values());
87
+ // Calculate statistics
88
+ const aliasTokens = nodes.filter((n) => n.referencesVariable);
89
+ const primitiveTokens = nodes.filter((n) => !n.referencesVariable);
90
+ const usedTokens = nodes.filter((n) => n.usedBy.length > 0);
91
+ // Find most referenced tokens
92
+ const mostReferenced = [...usedTokens]
93
+ .sort((a, b) => b.usedBy.length - a.usedBy.length)
94
+ .slice(0, 10)
95
+ .map((n) => ({
96
+ cssVariable: n.cssVariable,
97
+ usedByCount: n.usedBy.length,
98
+ usedBy: n.usedBy.slice(0, 5),
99
+ }));
100
+ // Build a simplified graph representation
101
+ const graphData = nodes
102
+ .filter((n) => n.referencesVariable || n.usedBy.length > 0)
103
+ .map((n) => ({
104
+ cssVariable: n.cssVariable,
105
+ referencesVariable: n.referencesVariable,
106
+ usedBy: n.usedBy.length > 0 ? n.usedBy : undefined,
107
+ }));
108
+ return {
109
+ contents: [
110
+ {
111
+ uri: "nysds://tokens/graph",
112
+ mimeType: "application/json",
113
+ text: JSON.stringify({
114
+ stats: {
115
+ totalTokens: nodes.length,
116
+ aliasTokens: aliasTokens.length,
117
+ primitiveTokens: primitiveTokens.length,
118
+ tokensWithDependents: usedTokens.length,
119
+ },
120
+ mostReferenced,
121
+ graph: graphData,
122
+ }, null, 2),
123
+ },
124
+ ],
125
+ };
126
+ });
127
+ // ---------------------------------------------------------------------------
128
+ // nysds://tokens/color - Color tokens only
129
+ // ---------------------------------------------------------------------------
130
+ server.resource("tokens-color", "nysds://tokens/color", {
131
+ description: "All NYSDS color tokens including primitives, semantic colors, and theme colors",
132
+ mimeType: "application/json",
133
+ }, async () => {
134
+ const tokens = getCSSTokensByCategory("color");
135
+ // Group by layer for better organization
136
+ const primitive = tokens.filter((t) => t.layer === "primitive");
137
+ const applied = tokens.filter((t) => t.layer === "applied");
138
+ const base = tokens.filter((t) => t.layer === "base" || t.layer === "color");
139
+ const formatToken = (t) => ({
140
+ cssVariable: t.cssVariable,
141
+ cssValue: t.cssValue,
142
+ referencesVariable: t.referencesVariable,
143
+ resolvedValue: t.resolvedValue,
144
+ description: t.description,
145
+ });
146
+ return {
147
+ contents: [
148
+ {
149
+ uri: "nysds://tokens/color",
150
+ mimeType: "application/json",
151
+ text: JSON.stringify({
152
+ totalColors: tokens.length,
153
+ layers: {
154
+ primitive: {
155
+ count: primitive.length,
156
+ description: "Raw color values - reference these via applied tokens",
157
+ tokens: primitive.map(formatToken),
158
+ },
159
+ applied: {
160
+ count: applied.length,
161
+ description: "Semantic color tokens - use these in code",
162
+ tokens: applied.map(formatToken),
163
+ },
164
+ theme: {
165
+ count: base.length,
166
+ description: "Theme-aware colors that change per agency",
167
+ tokens: base.map(formatToken),
168
+ },
169
+ },
170
+ }, null, 2),
171
+ },
172
+ ],
173
+ };
174
+ });
175
+ // ---------------------------------------------------------------------------
176
+ // nysds://tokens/font - Typography tokens
177
+ // ---------------------------------------------------------------------------
178
+ server.resource("tokens-font", "nysds://tokens/font", {
179
+ description: "All NYSDS typography tokens including font families, sizes, weights, and line heights",
180
+ mimeType: "application/json",
181
+ }, async () => {
182
+ const tokens = getCSSTokensByCategory("font");
183
+ // Group by subcategory based on CSS variable name
184
+ const families = tokens.filter((t) => t.cssVariable.includes("-font-family-"));
185
+ const sizes = tokens.filter((t) => t.cssVariable.includes("-font-size-"));
186
+ const weights = tokens.filter((t) => t.cssVariable.includes("-font-weight-"));
187
+ const lineHeights = tokens.filter((t) => t.cssVariable.includes("-font-lineheight-"));
188
+ const letterSpacing = tokens.filter((t) => t.cssVariable.includes("-font-letterspacing-"));
189
+ const formatToken = (t) => ({
190
+ cssVariable: t.cssVariable,
191
+ cssValue: t.cssValue,
192
+ resolvedValue: t.resolvedValue,
193
+ description: t.description,
194
+ });
195
+ return {
196
+ contents: [
197
+ {
198
+ uri: "nysds://tokens/font",
199
+ mimeType: "application/json",
200
+ text: JSON.stringify({
201
+ totalTypography: tokens.length,
202
+ groups: {
203
+ families: {
204
+ count: families.length,
205
+ description: "Font family stacks",
206
+ tokens: families.map(formatToken),
207
+ },
208
+ sizes: {
209
+ count: sizes.length,
210
+ description: "Font sizes for different contexts",
211
+ tokens: sizes.map(formatToken),
212
+ },
213
+ weights: {
214
+ count: weights.length,
215
+ description: "Font weight values",
216
+ tokens: weights.map(formatToken),
217
+ },
218
+ lineHeights: {
219
+ count: lineHeights.length,
220
+ description: "Line height values",
221
+ tokens: lineHeights.map(formatToken),
222
+ },
223
+ letterSpacing: {
224
+ count: letterSpacing.length,
225
+ description: "Letter spacing adjustments",
226
+ tokens: letterSpacing.map(formatToken),
227
+ },
228
+ },
229
+ }, null, 2),
230
+ },
231
+ ],
232
+ };
233
+ });
234
+ // ---------------------------------------------------------------------------
235
+ // nysds://tokens/space - Spacing tokens
236
+ // ---------------------------------------------------------------------------
237
+ server.resource("tokens-space", "nysds://tokens/space", {
238
+ description: "All NYSDS spacing tokens for margins, padding, and gaps. Based on an 8px grid.",
239
+ mimeType: "application/json",
240
+ }, async () => {
241
+ const tokens = getCSSTokensByCategory("space");
242
+ const formatToken = (t) => ({
243
+ cssVariable: t.cssVariable,
244
+ cssValue: t.cssValue,
245
+ resolvedValue: t.resolvedValue,
246
+ description: t.description,
247
+ });
248
+ // Sort by numeric value if possible
249
+ const sorted = [...tokens].sort((a, b) => {
250
+ const aNum = parseFloat(a.resolvedValue || "0");
251
+ const bNum = parseFloat(b.resolvedValue || "0");
252
+ return aNum - bNum;
253
+ });
254
+ return {
255
+ contents: [
256
+ {
257
+ uri: "nysds://tokens/space",
258
+ mimeType: "application/json",
259
+ text: JSON.stringify({
260
+ totalSpacing: tokens.length,
261
+ description: "Spacing scale based on 8px base unit. Use for margins, padding, and gaps.",
262
+ tokens: sorted.map(formatToken),
263
+ usage: {
264
+ padding: "padding: var(--nys-space-200);",
265
+ margin: "margin-block: var(--nys-space-400);",
266
+ gap: "gap: var(--nys-space-100);",
267
+ },
268
+ }, null, 2),
269
+ },
270
+ ],
271
+ };
272
+ });
273
+ // ---------------------------------------------------------------------------
274
+ // nysds://tokens/size - Size tokens
275
+ // ---------------------------------------------------------------------------
276
+ server.resource("tokens-size", "nysds://tokens/size", {
277
+ description: "All NYSDS size tokens for widths, heights, and component dimensions",
278
+ mimeType: "application/json",
279
+ }, async () => {
280
+ const tokens = getCSSTokensByCategory("size");
281
+ const formatToken = (t) => ({
282
+ cssVariable: t.cssVariable,
283
+ cssValue: t.cssValue,
284
+ resolvedValue: t.resolvedValue,
285
+ description: t.description,
286
+ });
287
+ // Sort by numeric value if possible
288
+ const sorted = [...tokens].sort((a, b) => {
289
+ const aNum = parseFloat(a.resolvedValue || "0");
290
+ const bNum = parseFloat(b.resolvedValue || "0");
291
+ return aNum - bNum;
292
+ });
293
+ return {
294
+ contents: [
295
+ {
296
+ uri: "nysds://tokens/size",
297
+ mimeType: "application/json",
298
+ text: JSON.stringify({
299
+ totalSizes: tokens.length,
300
+ description: "Size tokens for component dimensions, icon sizes, and fixed widths/heights.",
301
+ tokens: sorted.map(formatToken),
302
+ usage: {
303
+ iconSize: "width: var(--nys-size-200); height: var(--nys-size-200);",
304
+ minHeight: "min-height: var(--nys-size-400);",
305
+ componentSize: "inline-size: var(--nys-size-600);",
306
+ },
307
+ }, null, 2),
308
+ },
309
+ ],
310
+ };
311
+ });
312
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * NYSDS MCP Server Setup
3
+ *
4
+ * Configures the MCP server with tools, resources, and prompts
5
+ * for the New York State Design System.
6
+ */
7
+ export interface NysdsMcpServer {
8
+ start(): Promise<void>;
9
+ }
10
+ export declare function createServer(): Promise<NysdsMcpServer>;
11
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,MAAM,WAAW,cAAc;IAC7B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,cAAc,CAAC,CAkB5D"}
package/dist/server.js ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * NYSDS MCP Server Setup
3
+ *
4
+ * Configures the MCP server with tools, resources, and prompts
5
+ * for the New York State Design System.
6
+ */
7
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
9
+ import { registerTools } from "./tools/index.js";
10
+ import { registerResources } from "./resources/index.js";
11
+ import { registerPrompts } from "./prompts/nysds-mode.js";
12
+ const SERVER_NAME = "nysds-mcp";
13
+ const SERVER_VERSION = "1.0.0";
14
+ export async function createServer() {
15
+ const server = new McpServer({
16
+ name: SERVER_NAME,
17
+ version: SERVER_VERSION,
18
+ });
19
+ // Register all capabilities
20
+ registerTools(server);
21
+ registerResources(server);
22
+ registerPrompts(server);
23
+ return {
24
+ async start() {
25
+ const transport = new StdioServerTransport();
26
+ await server.connect(transport);
27
+ console.error(`${SERVER_NAME} v${SERVER_VERSION} started`);
28
+ },
29
+ };
30
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Component Tools
3
+ *
4
+ * MCP tools for working with NYSDS components.
5
+ *
6
+ * P0 Tools:
7
+ * - list_components: List all NYSDS components with summaries
8
+ * - get_component_docs: Full documentation for a specific component
9
+ * - find_components: Search by name/description (fuzzy)
10
+ * - get_usage_guide: Installation and usage patterns
11
+ */
12
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
13
+ export declare function registerComponentTools(server: McpServer): void;
14
+ //# sourceMappingURL=component-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-tools.d.ts","sourceRoot":"","sources":["../../src/tools/component-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8I9D"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Component Tools
3
+ *
4
+ * MCP tools for working with NYSDS components.
5
+ *
6
+ * P0 Tools:
7
+ * - list_components: List all NYSDS components with summaries
8
+ * - get_component_docs: Full documentation for a specific component
9
+ * - find_components: Search by name/description (fuzzy)
10
+ * - get_usage_guide: Installation and usage patterns
11
+ */
12
+ import { z } from "zod";
13
+ import { getComponent, getAllComponents } from "../lib/cem-parser.js";
14
+ import { searchComponents } from "../lib/search.js";
15
+ export function registerComponentTools(server) {
16
+ // list_components - List all NYSDS components with summaries
17
+ server.tool("list_components", "List all NYSDS web components with their tag names and brief descriptions", {}, async () => {
18
+ const components = getAllComponents();
19
+ const list = components.map((c) => ({
20
+ tagName: c.tagName,
21
+ name: c.name,
22
+ summary: c.summary || c.description?.split("\n")[0] || "No description",
23
+ }));
24
+ return {
25
+ content: [
26
+ {
27
+ type: "text",
28
+ text: JSON.stringify(list, null, 2),
29
+ },
30
+ ],
31
+ };
32
+ });
33
+ // get_component_docs - Full documentation for a specific component
34
+ server.tool("get_component_docs", "Get full documentation for a specific NYSDS component including properties, events, slots, and CSS custom properties", {
35
+ tagName: z
36
+ .string()
37
+ .describe("The tag name of the component (e.g., 'nys-button')"),
38
+ }, async ({ tagName }) => {
39
+ const component = getComponent(tagName);
40
+ if (!component) {
41
+ return {
42
+ content: [
43
+ {
44
+ type: "text",
45
+ text: `Component "${tagName}" not found. Use list_components to see available components.`,
46
+ },
47
+ ],
48
+ isError: true,
49
+ };
50
+ }
51
+ return {
52
+ content: [
53
+ {
54
+ type: "text",
55
+ text: JSON.stringify(component, null, 2),
56
+ },
57
+ ],
58
+ };
59
+ });
60
+ // find_components - Search by name/description
61
+ server.tool("find_components", "Search for NYSDS components by name or description", {
62
+ query: z
63
+ .string()
64
+ .describe("Search query to match against component names and descriptions"),
65
+ }, async ({ query }) => {
66
+ const results = searchComponents(query);
67
+ return {
68
+ content: [
69
+ {
70
+ type: "text",
71
+ text: JSON.stringify(results, null, 2),
72
+ },
73
+ ],
74
+ };
75
+ });
76
+ // get_usage_guide - Installation and usage patterns
77
+ server.tool("get_usage_guide", "Get installation and usage guide for NYSDS components", {}, async () => {
78
+ const guide = `# NYSDS Component Usage Guide
79
+
80
+ ## Installation
81
+
82
+ \`\`\`bash
83
+ npm install @nysds/components
84
+ \`\`\`
85
+
86
+ ## Basic Usage
87
+
88
+ Import components individually:
89
+
90
+ \`\`\`javascript
91
+ import '@nysds/components/nys-button';
92
+ import '@nysds/components/nys-alert';
93
+ \`\`\`
94
+
95
+ Or import all components:
96
+
97
+ \`\`\`javascript
98
+ import '@nysds/components';
99
+ \`\`\`
100
+
101
+ ## Using Components in HTML
102
+
103
+ \`\`\`html
104
+ <nys-button label="Click me" variant="primary"></nys-button>
105
+ <nys-alert type="info">This is an informational message.</nys-alert>
106
+ \`\`\`
107
+
108
+ ## CSS Custom Properties
109
+
110
+ NYSDS components use CSS custom properties for theming. Import the base styles:
111
+
112
+ \`\`\`css
113
+ @import '@nysds/components/dist/styles.css';
114
+ \`\`\`
115
+
116
+ Use the get_design_tokens tool to explore available tokens.
117
+ `;
118
+ return {
119
+ content: [
120
+ {
121
+ type: "text",
122
+ text: guide,
123
+ },
124
+ ],
125
+ };
126
+ });
127
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * MCP Tools Registration
3
+ *
4
+ * Registers all NYSDS tools with the MCP server.
5
+ */
6
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
+ export declare function registerTools(server: McpServer): void;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAIrD"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * MCP Tools Registration
3
+ *
4
+ * Registers all NYSDS tools with the MCP server.
5
+ */
6
+ import { registerComponentTools } from "./component-tools.js";
7
+ import { registerTokenTools } from "./token-tools.js";
8
+ import { registerValidationTools } from "./validation-tools.js";
9
+ export function registerTools(server) {
10
+ registerComponentTools(server);
11
+ registerTokenTools(server);
12
+ registerValidationTools(server);
13
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Token Tools
3
+ *
4
+ * MCP tools for working with NYSDS design tokens.
5
+ *
6
+ * Tools:
7
+ * - get_design_tokens: Get tokens with filtering and options
8
+ * - find_tokens: Search tokens by CSS variable, value, or description
9
+ * - list_themes: List all 8 agency themes
10
+ * - get_token_value: Get detailed info for a specific token
11
+ * - validate_token_usage: Validate token usage in context
12
+ * - list_token_categories: List categories with token counts
13
+ * - get_token_graph: Get token dependency graph
14
+ */
15
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
16
+ export declare function registerTokenTools(server: McpServer): void;
17
+ //# sourceMappingURL=token-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-tools.d.ts","sourceRoot":"","sources":["../../src/tools/token-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAoOzE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4a1D"}