@wizeworks/silicaui-mcp 0.35.0 → 0.37.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.
@@ -29,7 +29,7 @@
29
29
  "warning": "oklch(80% 0.11 85)",
30
30
  "warning-content": "oklch(24% 0.04 85)",
31
31
  "error": "oklch(58% 0.17 25)",
32
- "error-content": "oklch(97% 0.01 25)"
32
+ "error-content": "oklch(100% 0 0)"
33
33
  },
34
34
  "dark": {
35
35
  "base-100": "oklch(16% 0.01 255)",
package/dist/server.js CHANGED
@@ -28,12 +28,45 @@ function readOwnVersion() {
28
28
  return "unknown";
29
29
  }
30
30
  var VERSION = readOwnVersion();
31
+ var INSTRUCTIONS = `Silica UI is ONE design system delivered through THREE paths. Decide which path matches the code you are writing BEFORE writing any markup \u2014 the paths share a class vocabulary but are not interchangeable, and mixing them is the most common way an integration breaks.
32
+
33
+ 1. CSS \u2014 \`@wizeworks/silicaui\`
34
+ A Tailwind v4 plugin. You write plain HTML and put Silica's classes on it: \`<button class="btn btn-primary">\`. No JavaScript ships, so nothing is interactive \u2014 a dialog styled this way will not open. Use it for static markup, server-rendered templates (Rails, Django, PHP, Go, \u2026), email, or any framework at all. It is the floor the other two paths stand on.
35
+ \u2192 get_component(name, package "@wizeworks/silicaui") for a family's root class, its parts, and its color variants; list_classes for the literal names.
36
+
37
+ 2. React \u2014 \`@wizeworks/silicaui-react\`
38
+ Typed React components over those same classes, with Base UI supplying real behavior and accessibility: \`<Button color="primary" size="lg">\`. Use it whenever the output is React or Next.js.
39
+ \u2192 get_component(name, package "@wizeworks/silicaui-react") for real props (extracted from the TypeScript source) and a working usage example.
40
+
41
+ 3. HTML / node-tree \u2014 \`@wizeworks/silicaui-html\` + \`@wizeworks/silicaui-behaviors\`
42
+ A framework-neutral node-tree schema that projects to HTML \u2014 for generated or user-authored documents: site builders, CMS output, static export. Component macros expand to element subtrees carrying \`data-sui-*\` markers, which the zero-dependency \`@wizeworks/silicaui-behaviors\` runtime hydrates at load. That runtime is what makes path 3 interactive; without it you have path 1.
43
+ \u2192 get_component(name, package "@wizeworks/silicaui-html") for the macro; list_blocks / get_block for composed sections; list_behaviors for the marker contract.
44
+
45
+ Rules that hold on every path:
46
+ - Never invent a class, prop, color, or block key. Everything this server returns is extracted from Silica's source at release time \u2014 look it up rather than guessing, including when you are fairly confident.
47
+ - Colors are semantic tokens (get_tokens), never hex. An app can declare extra color roles; those work everywhere a built-in one does.
48
+ - Do not re-skin a component with inline styles or arbitrary hex \u2014 it defeats theming and light/dark.
49
+ - The same name can exist on more than one path with a different shape. get_component with no \`package\` returns every path's answer at once; pass \`package\` to narrow.
50
+ - Don't know the name? search_docs first. Unsure what to install? list_packages.
51
+
52
+ Signs you are on the wrong path: importing @wizeworks/silicaui-react into output that is not React; hand-writing \`data-sui-*\` markers (they come from macro expansion, never from you); shipping path-3 markup without loading @wizeworks/silicaui-behaviors; expecting path 1 alone to open a dialog.`;
31
53
  var packages = loadJson("packages");
32
54
  var tokens = loadJson("tokens");
33
55
  var classesByComponent = loadJson("classes");
34
56
  var blocks = loadJson("blocks");
35
57
  var behaviors = loadJson("behaviors");
36
58
  var components = loadJson("components");
59
+ var PATH_ORDER_LIST = [
60
+ "@wizeworks/silicaui",
61
+ "@wizeworks/silicaui-react",
62
+ "@wizeworks/silicaui-html"
63
+ ];
64
+ var PATH_ORDER = {
65
+ indexOf(pkg) {
66
+ const i = PATH_ORDER_LIST.indexOf(pkg);
67
+ return i === -1 ? PATH_ORDER_LIST.length : i;
68
+ }
69
+ };
37
70
  function toKebab(name) {
38
71
  return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
39
72
  }
@@ -42,10 +75,13 @@ function blockSummary(b) {
42
75
  return summary;
43
76
  }
44
77
  function createServer() {
45
- const server = new McpServer({
46
- name: "@wizeworks/silicaui-mcp",
47
- version: VERSION
48
- });
78
+ const server = new McpServer(
79
+ {
80
+ name: "@wizeworks/silicaui-mcp",
81
+ version: VERSION
82
+ },
83
+ { instructions: INSTRUCTIONS }
84
+ );
49
85
  server.registerTool(
50
86
  "list_packages",
51
87
  {
@@ -71,7 +107,7 @@ function createServer() {
71
107
  "list_components",
72
108
  {
73
109
  title: "List Silica UI components",
74
- description: "List component names, categories, and source packages \u2014 spans BOTH @wizeworks/silicaui-react (typed React components) and @wizeworks/silicaui-html (the framework-neutral ComponentDef macros: Dialog, Popover, Combobox, etc., for non-React output). The same name can exist in both packages with different shapes; use get_component's package param to disambiguate. Optionally filter to one package (e.g. '@wizeworks/silicaui-react', '@wizeworks/silicaui-html', '@wizeworks/silicaui-charts').",
110
+ description: "List component names, categories, and source packages \u2014 spans ALL THREE delivery paths: @wizeworks/silicaui (CSS class families for plain HTML), @wizeworks/silicaui-react (typed React components), and @wizeworks/silicaui-html (framework-neutral ComponentDef macros for generated/non-React output). The same component usually exists on more than one path with a completely different shape; get_component returns every path's answer unless you pass a package. Filter here with the package param (e.g. '@wizeworks/silicaui', '@wizeworks/silicaui-react', '@wizeworks/silicaui-html', '@wizeworks/silicaui-charts').",
75
111
  inputSchema: {
76
112
  package: z.string().optional().describe("Filter to one package name, e.g. '@wizeworks/silicaui-react'.")
77
113
  }
@@ -91,7 +127,7 @@ function createServer() {
91
127
  "get_component",
92
128
  {
93
129
  title: "Get a Silica UI component's real shape",
94
- description: "Get a component's real definition \u2014 for @wizeworks/silicaui-react: props (name, type, optional, doc \u2014 extracted from its actual TypeScript source) and a real, working usage example from the playground demos; for @wizeworks/silicaui-html: its palette category/label/icon, whether it's a container, and the BehaviorType(s) it carries (cross-reference with get_behavior for the marker contract). Use this instead of guessing prop names or shapes. Pass package when a name exists in more than one package.",
130
+ description: "Get a component's real definition on whichever delivery path you're building on \u2014 for @wizeworks/silicaui (CSS): the family's root class, every literal class it generates, its color variants, and any compound selector that reveals required markup structure; for @wizeworks/silicaui-react: props (name, type, optional, doc \u2014 extracted from its actual TypeScript source) plus a real, working usage example; for @wizeworks/silicaui-html: its palette category/label/icon, whether it's a container, and the BehaviorType(s) it carries (cross-reference get_behavior for the marker contract). Use this instead of guessing class names, prop names, or shapes. Omit package to see every path's answer side by side; pass it to get just one.",
95
131
  inputSchema: {
96
132
  name: z.string().describe("Component name, e.g. 'Button', 'DataTable', 'Dialog'."),
97
133
  package: z.string().optional().describe("Disambiguate when the name exists in more than one package, e.g. '@wizeworks/silicaui-html'.")
@@ -112,14 +148,24 @@ function createServer() {
112
148
  };
113
149
  }
114
150
  if (matches.length > 1) {
151
+ const ordered = [...matches].sort(
152
+ (a, b) => PATH_ORDER.indexOf(a.package) - PATH_ORDER.indexOf(b.package)
153
+ );
115
154
  return {
116
155
  content: [
117
156
  {
118
157
  type: "text",
119
- text: `"${name}" exists in more than one package \u2014 pass package to disambiguate: ${matches.map((c) => c.package).join(", ")}`
158
+ text: JSON.stringify(
159
+ {
160
+ name: ordered[0]?.name ?? name,
161
+ note: `"${name}" exists on ${ordered.length} delivery paths, listed below with their real (different) shapes: ${ordered.map((c) => c.package).join(", ")}. Use the one matching the code you're writing \u2014 they are not interchangeable. Pass \`package\` to get just one.`,
162
+ paths: ordered
163
+ },
164
+ null,
165
+ 2
166
+ )
120
167
  }
121
- ],
122
- isError: true
168
+ ]
123
169
  };
124
170
  }
125
171
  return { content: [{ type: "text", text: JSON.stringify(matches[0], null, 2) }] };
@@ -129,7 +175,7 @@ function createServer() {
129
175
  "list_classes",
130
176
  {
131
177
  title: "List real Silica UI CSS class names",
132
- description: "List the exact, literal CSS class names Silica UI generates for a core component (e.g. 'button', 'card', 'badge') \u2014 or all components if none given. These are extracted directly from the class generators, so they are never hallucinated. Also covers 'color-utilities' (text-*/bg-*/border-* for every declared color).",
178
+ description: "List the exact, literal CSS class names Silica UI generates for a core component (e.g. 'button', 'card', 'badge') \u2014 or all components if none given. These are extracted directly from the class generators, so they are never hallucinated. Also covers 'color-utilities' (text-*/bg-*/border-* for every declared color). This returns a flat list; for the CSS path's STRUCTURE \u2014 which class is the root, which are its parts, which are color variants \u2014 call get_component with package '@wizeworks/silicaui'.",
133
179
  inputSchema: {
134
180
  component: z.string().optional().describe("A core @wizeworks/silicaui component name, e.g. 'button'. Omit to list every component's classes.")
135
181
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;AAOA,IAAM,OAAO,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAC,CAAA;AACxD,IAAM,OAAA,GAAU,IAAA,CAAK,IAAA,CAAK,IAAA,EAAM,MAAM,CAAA;AAEtC,SAAS,SAAY,IAAA,EAAiB;AACpC,EAAA,OAAO,IAAA,CAAK,KAAA,CAAM,YAAA,CAAa,IAAA,CAAK,IAAA,CAAK,OAAA,EAAS,CAAA,EAAG,IAAI,CAAA,KAAA,CAAO,CAAA,EAAG,MAAM,CAAC,CAAA;AAC5E;AAiBA,SAAS,cAAA,GAAyB;AAGhC,EAAA,IAAI;AACF,IAAA,MAAM,MAAM,IAAA,CAAK,KAAA;AAAA,MACf,aAAa,IAAA,CAAK,IAAA,CAAK,MAAM,IAAA,EAAM,cAAc,GAAG,MAAM;AAAA,KAC5D;AACA,IAAA,IAAI,OAAO,GAAA,CAAI,OAAA,KAAY,YAAY,GAAA,CAAI,OAAA,SAAgB,GAAA,CAAI,OAAA;AAC/D,IAAA,OAAA,CAAQ,KAAA;AAAA,MACN;AAAA,KACF;AAAA,EACF,SAAS,GAAA,EAAK;AACZ,IAAA,OAAA,CAAQ,KAAA;AAAA,MACN,CAAA,gDAAA,EAAoD,IAAc,OAAO,CAAA,uBAAA;AAAA,KAC3E;AAAA,EACF;AACA,EAAA,OAAO,SAAA;AACT;AAEA,IAAM,UAAU,cAAA,EAAe;AA0E/B,IAAM,QAAA,GAAW,SAAwB,UAAU,CAAA;AACnD,IAAM,MAAA,GAAS,SAAqB,QAAQ,CAAA;AAC5C,IAAM,kBAAA,GAAqB,SAAmC,SAAS,CAAA;AACvE,IAAM,MAAA,G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AA,MAAM,SAAS,YAAA,EAAa;AAC5B,EAAA,MAAM,SAAA,GAAY,IAAI,oBAAA,EAAqB;AAC3C,EAAA,MAAM,MAAA,CAAO,QAAQ,SAAS,CAAA;AAChC","file":"server.js","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { z } from \"zod\";\n\nconst here = path.dirname(fileURLToPath(import.meta.url));\nconst dataDir = path.join(here, \"data\");\n\nfunction loadJson<T>(name: string): T {\n return JSON.parse(readFileSync(path.join(dataDir, `${name}.json`), \"utf8\")) as T;\n}\n\n/**\n * The version this catalog documents, read from our OWN package.json at\n * startup rather than baked into the generated catalog.\n *\n * Every package in the family is released in lockstep — they're all listed in\n * `fixed` in .changeset/config.json, so their versions are identical by\n * construction — which makes our own version the right answer for all of them.\n *\n * This used to be snapshotted into `packages.json` at catalog-generation time,\n * but `gen` isn't part of `build` or the release, so the number froze at\n * whichever version happened to be current the last time someone ran it by\n * hand, and the server reported 0.26.0 while npm served 0.29.0. Reading it at\n * runtime makes that drift structurally impossible instead of a step someone\n * has to remember.\n */\nfunction readOwnVersion(): string {\n // `here` is dist/ in a build and src/ in dev; package.json sits one level up\n // from both, and npm always includes it in the published tarball.\n try {\n const pkg = JSON.parse(\n readFileSync(path.join(here, \"..\", \"package.json\"), \"utf8\"),\n ) as { version?: unknown };\n if (typeof pkg.version === \"string\" && pkg.version) return pkg.version;\n console.error(\n \"[silicaui-mcp] package.json has no usable `version`; reporting 'unknown'.\",\n );\n } catch (err) {\n console.error(\n `[silicaui-mcp] could not read own package.json (${(err as Error).message}); reporting 'unknown'.`,\n );\n }\n return \"unknown\";\n}\n\nconst VERSION = readOwnVersion();\n\ninterface PackageMeta {\n name: string;\n purpose: string;\n install: string | null;\n private?: boolean;\n}\n\ninterface TokensData {\n semanticColors: string[];\n light: Record<string, string>;\n dark: Record<string, string>;\n typography: { baseFontSize: string; fontFamilyTokens: string[]; note: string };\n}\n\ninterface PropMember {\n name: string;\n optional: boolean;\n type: string;\n doc: string;\n}\n\ninterface PropsInterface {\n name: string;\n extends?: string;\n members: PropMember[];\n}\n\ninterface ComponentData {\n name: string;\n package: string;\n category: string;\n sourceFile: string;\n /** silicaui-react entries: extracted from source via TS AST. silicaui-html\n * macros carry no static description (never hand-authored — see label/icon\n * instead) and omit these two fields. */\n description?: string;\n props?: PropsInterface[];\n usageExample?: string | null;\n /** silicaui-html macros only: palette label/icon, whether it's a container,\n * and the BehaviorType(s) its expansion carries (found by actually calling\n * expand(), not guessed — see get_behavior for the marker contract). */\n label?: string;\n icon?: string;\n container?: boolean;\n behaviors?: string[];\n}\n\ninterface BlockSlot {\n name: string;\n [key: string]: unknown;\n}\n\ninterface BlockData {\n key: string;\n name: string;\n category: string;\n version: string;\n description: string;\n tags?: string[];\n colors: string[];\n behaviors: string[];\n emailEligible: boolean;\n slots: BlockSlot[];\n root: unknown;\n preview?: unknown;\n}\n\ninterface BehaviorData {\n type: string;\n description: string;\n}\n\nconst packages = loadJson<PackageMeta[]>(\"packages\");\nconst tokens = loadJson<TokensData>(\"tokens\");\nconst classesByComponent = loadJson<Record<string, string[]>>(\"classes\");\nconst blocks = loadJson<BlockData[]>(\"blocks\");\nconst behaviors = loadJson<BehaviorData[]>(\"behaviors\");\nconst components = loadJson<ComponentData[]>(\"components\");\n\nfunction toKebab(name: string): string {\n return name\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .toLowerCase();\n}\n\nfunction blockSummary(b: BlockData) {\n const { root: _root, ...summary } = b;\n return summary;\n}\n\nexport function createServer(): McpServer {\n const server = new McpServer({\n name: \"@wizeworks/silicaui-mcp\",\n version: VERSION,\n });\n\n server.registerTool(\n \"list_packages\",\n {\n title: \"List Silica UI packages\",\n description:\n \"List every package in the Silica UI family (@wizeworks/silicaui, @wizeworks/silicaui-react, @wizeworks/silicaui-html, @wizeworks/silicaui-behaviors, and the wrapper packages), with purpose, install command, and version.\",\n inputSchema: {},\n },\n async () => ({\n content: [\n {\n type: \"text\",\n // Version is stamped here, not stored in the catalog — see VERSION.\n text: JSON.stringify(\n packages.map((p) => ({ ...p, version: VERSION })),\n null,\n 2,\n ),\n },\n ],\n }),\n );\n\n server.registerTool(\n \"list_components\",\n {\n title: \"List Silica UI components\",\n description:\n \"List component names, categories, and source packages — spans BOTH @wizeworks/silicaui-react (typed React components) and @wizeworks/silicaui-html (the framework-neutral ComponentDef macros: Dialog, Popover, Combobox, etc., for non-React output). The same name can exist in both packages with different shapes; use get_component's package param to disambiguate. Optionally filter to one package (e.g. '@wizeworks/silicaui-react', '@wizeworks/silicaui-html', '@wizeworks/silicaui-charts').\",\n inputSchema: {\n package: z.string().optional().describe(\"Filter to one package name, e.g. '@wizeworks/silicaui-react'.\"),\n },\n },\n async ({ package: pkg }) => {\n const filtered = pkg ? components.filter((c) => c.package === pkg) : components;\n const summary = filtered.map(({ name, package: p, category, sourceFile }) => ({\n name,\n package: p,\n category,\n sourceFile,\n }));\n return { content: [{ type: \"text\", text: JSON.stringify(summary, null, 2) }] };\n },\n );\n\n server.registerTool(\n \"get_component\",\n {\n title: \"Get a Silica UI component's real shape\",\n description:\n \"Get a component's real definition — for @wizeworks/silicaui-react: props (name, type, optional, doc — extracted from its actual TypeScript source) and a real, working usage example from the playground demos; for @wizeworks/silicaui-html: its palette category/label/icon, whether it's a container, and the BehaviorType(s) it carries (cross-reference with get_behavior for the marker contract). Use this instead of guessing prop names or shapes. Pass package when a name exists in more than one package.\",\n inputSchema: {\n name: z.string().describe(\"Component name, e.g. 'Button', 'DataTable', 'Dialog'.\"),\n package: z.string().optional().describe(\"Disambiguate when the name exists in more than one package, e.g. '@wizeworks/silicaui-html'.\"),\n },\n },\n async ({ name, package: pkg }) => {\n let matches = components.filter((c) => c.name.toLowerCase() === name.toLowerCase());\n if (pkg) matches = matches.filter((c) => c.package === pkg);\n if (!matches.length) {\n return {\n content: [\n {\n type: \"text\",\n text: `No component named \"${name}\"${pkg ? ` in ${pkg}` : \"\"}. Call list_components to see valid names.`,\n },\n ],\n isError: true,\n };\n }\n if (matches.length > 1) {\n return {\n content: [\n {\n type: \"text\",\n text: `\"${name}\" exists in more than one package — pass package to disambiguate: ${matches.map((c) => c.package).join(\", \")}`,\n },\n ],\n isError: true,\n };\n }\n return { content: [{ type: \"text\", text: JSON.stringify(matches[0], null, 2) }] };\n },\n );\n\n server.registerTool(\n \"list_classes\",\n {\n title: \"List real Silica UI CSS class names\",\n description:\n \"List the exact, literal CSS class names Silica UI generates for a core component (e.g. 'button', 'card', 'badge') — or all components if none given. These are extracted directly from the class generators, so they are never hallucinated. Also covers 'color-utilities' (text-*/bg-*/border-* for every declared color).\",\n inputSchema: {\n component: z\n .string()\n .optional()\n .describe(\"A core @wizeworks/silicaui component name, e.g. 'button'. Omit to list every component's classes.\"),\n },\n },\n async ({ component }) => {\n if (!component) {\n return { content: [{ type: \"text\", text: JSON.stringify(classesByComponent, null, 2) }] };\n }\n const key = toKebab(component);\n const classes = classesByComponent[key];\n if (!classes) {\n return {\n content: [\n {\n type: \"text\",\n text: `No class data for \"${component}\". Known components: ${Object.keys(classesByComponent).join(\", \")}`,\n },\n ],\n isError: true,\n };\n }\n return { content: [{ type: \"text\", text: JSON.stringify({ component: key, classes }, null, 2) }] };\n },\n );\n\n server.registerTool(\n \"get_tokens\",\n {\n title: \"Get Silica UI design tokens\",\n description:\n \"Get the semantic color list and their light/dark OKLCH values, the typography token model, and the scalar theme tokens (radius/border/depth/noise/focus/disabled-opacity) with defaults, ranges, and what each one actually affects.\",\n inputSchema: {},\n },\n async () => ({ content: [{ type: \"text\", text: JSON.stringify(tokens, null, 2) }] }),\n );\n\n server.registerTool(\n \"list_blocks\",\n {\n title: \"List Silica UI composed blocks\",\n description:\n \"List composed page blocks from @wizeworks/silicaui-html (hero sections, FAQs, feature grids, …) without their full node tree. Optionally filter by category or tag.\",\n inputSchema: {\n category: z.string().optional(),\n tag: z.string().optional(),\n },\n },\n async ({ category, tag }) => {\n const filtered = blocks.filter(\n (b) => (!category || b.category === category) && (!tag || (b.tags ?? []).includes(tag)),\n );\n return { content: [{ type: \"text\", text: JSON.stringify(filtered.map(blockSummary), null, 2) }] };\n },\n );\n\n server.registerTool(\n \"get_block\",\n {\n title: \"Get a Silica UI block's full node tree\",\n description:\n \"Get one composed block's full definition, including its node tree — the real, validated structure to reuse or adapt, not a guess.\",\n inputSchema: {\n key: z.string().describe(\"The block's stable key, e.g. 'hero_split_cta'.\"),\n },\n },\n async ({ key }) => {\n const block = blocks.find((b) => b.key === key);\n if (!block) {\n return {\n content: [\n {\n type: \"text\",\n text: `No block \"${key}\". Known keys: ${blocks.map((b) => b.key).join(\", \")}`,\n },\n ],\n isError: true,\n };\n }\n return { content: [{ type: \"text\", text: JSON.stringify(block, null, 2) }] };\n },\n );\n\n server.registerTool(\n \"list_behaviors\",\n {\n title: \"List Silica UI behavior types\",\n description:\n \"List the closed set of interactive behaviors that @wizeworks/silicaui-behaviors hydrates from data-sui-* markers (the vanilla-JS runtime for non-React output). Each type is also the BehaviorType a @wizeworks/silicaui-html ComponentDef macro carries — cross-reference with get_component. Call this to see the current set rather than assuming a fixed list; it grows over time.\",\n inputSchema: {},\n },\n async () => ({ content: [{ type: \"text\", text: JSON.stringify(behaviors, null, 2) }] }),\n );\n\n server.registerTool(\n \"get_behavior\",\n {\n title: \"Get one Silica UI behavior's contract\",\n description: \"Get the marker contract and semantics for one behavior type.\",\n inputSchema: {\n type: z.string().describe(\"Behavior type, e.g. 'disclosure'.\"),\n },\n },\n async ({ type }) => {\n const behavior = behaviors.find((b) => b.type === type);\n if (!behavior) {\n return {\n content: [\n {\n type: \"text\",\n text: `No behavior \"${type}\". Known types: ${behaviors.map((b) => b.type).join(\", \")}`,\n },\n ],\n isError: true,\n };\n }\n return { content: [{ type: \"text\", text: JSON.stringify(behavior, null, 2) }] };\n },\n );\n\n server.registerTool(\n \"search_docs\",\n {\n title: \"Search Silica UI catalog data\",\n description:\n \"Full-text search across everything this server knows: component names/descriptions, block names/descriptions, behavior descriptions, literal CSS class names, and design tokens. Use this when you don't know the exact name to look up.\",\n inputSchema: {\n query: z.string().describe(\"Search term, case-insensitive.\"),\n },\n },\n async ({ query }) => {\n const q = query.toLowerCase();\n const matchedComponents = components\n .filter((c) => c.name.toLowerCase().includes(q) || (c.description ?? \"\").toLowerCase().includes(q) || (c.label ?? \"\").toLowerCase().includes(q))\n .map((c) => ({ kind: \"component\", name: c.name, package: c.package }));\n const matchedBlocks = blocks\n .filter((b) => b.name.toLowerCase().includes(q) || b.description.toLowerCase().includes(q))\n .map((b) => ({ kind: \"block\", key: b.key, name: b.name }));\n const matchedBehaviors = behaviors\n .filter((b) => b.type.toLowerCase().includes(q) || b.description.toLowerCase().includes(q))\n .map((b) => ({ kind: \"behavior\", type: b.type }));\n const matchedClasses = Object.entries(classesByComponent).flatMap(([component, classes]) =>\n classes\n .filter((cls) => cls.toLowerCase().includes(q))\n .map((cls) => ({ kind: \"class\" as const, component, class: cls })),\n );\n const matchedTokens = tokens.semanticColors\n .filter((name) => name.toLowerCase().includes(q))\n .map((name) => ({ kind: \"token\" as const, name }));\n const results = [\n ...matchedComponents,\n ...matchedBlocks,\n ...matchedBehaviors,\n ...matchedClasses,\n ...matchedTokens,\n ];\n return { content: [{ type: \"text\", text: JSON.stringify(results, null, 2) }] };\n },\n );\n\n return server;\n}\n\nexport async function main(): Promise<void> {\n const server = createServer();\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n"]}
1
+ {"version":3,"sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;AAOA,IAAM,OAAO,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAC,CAAA;AACxD,IAAM,OAAA,GAAU,IAAA,CAAK,IAAA,CAAK,IAAA,EAAM,MAAM,CAAA;AAEtC,SAA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O,CAAC,IAAA,KAAS,IAAA,CAAK,aAAY,CAAE,QAAA,CAAS,CAAC,CAAC,CAAA,CAC/C,IAAI,CAAC,IAAA,MAAU,EAAE,IAAA,EAAM,OAAA,EAAkB,MAAK,CAAE,CAAA;AACnD,MAAA,MAAM,OAAA,GAAU;AAAA,QACd,GAAG,iBAAA;AAAA,QACH,GAAG,aAAA;AAAA,QACH,GAAG,gBAAA;AAAA,QACH,GAAG,cAAA;AAAA,QACH,GAAG;AAAA,OACL;AACA,MAAA,OAAO,EAAE,OAAA,EAAS,CAAC,EAAE,MAAM,MAAA,EAAQ,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,OAAA,EAAS,IAAA,EAAM,CAAC,CAAA,EAAG,CAAA,EAAE;AAAA,IAC/E;AAAA,GACF;AAEA,EAAA,OAAO,MAAA;AACT;AAEA,eAAsB,IAAA,GAAsB;AAC1C,EAAA,MAAM,SAAS,YAAA,EAAa;AAC5B,EAAA,MAAM,SAAA,GAAY,IAAI,oBAAA,EAAqB;AAC3C,EAAA,MAAM,MAAA,CAAO,QAAQ,SAAS,CAAA;AAChC","file":"server.js","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { z } from \"zod\";\n\nconst here = path.dirname(fileURLToPath(import.meta.url));\nconst dataDir = path.join(here, \"data\");\n\nfunction loadJson<T>(name: string): T {\n return JSON.parse(readFileSync(path.join(dataDir, `${name}.json`), \"utf8\")) as T;\n}\n\n/**\n * The version this catalog documents, read from our OWN package.json at\n * startup rather than baked into the generated catalog.\n *\n * Every package in the family is released in lockstep — they're all listed in\n * `fixed` in .changeset/config.json, so their versions are identical by\n * construction — which makes our own version the right answer for all of them.\n *\n * This used to be snapshotted into `packages.json` at catalog-generation time,\n * but `gen` isn't part of `build` or the release, so the number froze at\n * whichever version happened to be current the last time someone ran it by\n * hand, and the server reported 0.26.0 while npm served 0.29.0. Reading it at\n * runtime makes that drift structurally impossible instead of a step someone\n * has to remember.\n */\nfunction readOwnVersion(): string {\n // `here` is dist/ in a build and src/ in dev; package.json sits one level up\n // from both, and npm always includes it in the published tarball.\n try {\n const pkg = JSON.parse(\n readFileSync(path.join(here, \"..\", \"package.json\"), \"utf8\"),\n ) as { version?: unknown };\n if (typeof pkg.version === \"string\" && pkg.version) return pkg.version;\n console.error(\n \"[silicaui-mcp] package.json has no usable `version`; reporting 'unknown'.\",\n );\n } catch (err) {\n console.error(\n `[silicaui-mcp] could not read own package.json (${(err as Error).message}); reporting 'unknown'.`,\n );\n }\n return \"unknown\";\n}\n\nconst VERSION = readOwnVersion();\n\ninterface PackageMeta {\n name: string;\n purpose: string;\n install: string | null;\n private?: boolean;\n}\n\ninterface TokensData {\n semanticColors: string[];\n light: Record<string, string>;\n dark: Record<string, string>;\n typography: { baseFontSize: string; fontFamilyTokens: string[]; note: string };\n}\n\ninterface PropMember {\n name: string;\n optional: boolean;\n type: string;\n doc: string;\n}\n\ninterface PropsInterface {\n name: string;\n extends?: string;\n members: PropMember[];\n}\n\n/**\n * The routing preamble every connecting client receives from `initialize`,\n * before it calls a single tool.\n *\n * Silica ships one design system through three delivery paths, and the choice\n * between them is made BEFORE any tool call — by which point per-tool\n * descriptions are too late to help. Without this, an agent got ten tools in a\n * bag and inferred the architecture from their names; the standard failure was\n * reaching for `@wizeworks/silicaui-react` while emitting non-React output, or\n * shipping node-tree markup with no behavior runtime and wondering why nothing\n * opened.\n *\n * Deliberately names no counts and no version — those drift. Package names are\n * asserted against the real catalog by verify.mjs.\n */\nconst INSTRUCTIONS = `Silica UI is ONE design system delivered through THREE paths. Decide which path matches the code you are writing BEFORE writing any markup — the paths share a class vocabulary but are not interchangeable, and mixing them is the most common way an integration breaks.\n\n1. CSS — \\`@wizeworks/silicaui\\`\n A Tailwind v4 plugin. You write plain HTML and put Silica's classes on it: \\`<button class=\"btn btn-primary\">\\`. No JavaScript ships, so nothing is interactive — a dialog styled this way will not open. Use it for static markup, server-rendered templates (Rails, Django, PHP, Go, …), email, or any framework at all. It is the floor the other two paths stand on.\n → get_component(name, package \"@wizeworks/silicaui\") for a family's root class, its parts, and its color variants; list_classes for the literal names.\n\n2. React — \\`@wizeworks/silicaui-react\\`\n Typed React components over those same classes, with Base UI supplying real behavior and accessibility: \\`<Button color=\"primary\" size=\"lg\">\\`. Use it whenever the output is React or Next.js.\n → get_component(name, package \"@wizeworks/silicaui-react\") for real props (extracted from the TypeScript source) and a working usage example.\n\n3. HTML / node-tree — \\`@wizeworks/silicaui-html\\` + \\`@wizeworks/silicaui-behaviors\\`\n A framework-neutral node-tree schema that projects to HTML — for generated or user-authored documents: site builders, CMS output, static export. Component macros expand to element subtrees carrying \\`data-sui-*\\` markers, which the zero-dependency \\`@wizeworks/silicaui-behaviors\\` runtime hydrates at load. That runtime is what makes path 3 interactive; without it you have path 1.\n → get_component(name, package \"@wizeworks/silicaui-html\") for the macro; list_blocks / get_block for composed sections; list_behaviors for the marker contract.\n\nRules that hold on every path:\n- Never invent a class, prop, color, or block key. Everything this server returns is extracted from Silica's source at release time — look it up rather than guessing, including when you are fairly confident.\n- Colors are semantic tokens (get_tokens), never hex. An app can declare extra color roles; those work everywhere a built-in one does.\n- Do not re-skin a component with inline styles or arbitrary hex — it defeats theming and light/dark.\n- The same name can exist on more than one path with a different shape. get_component with no \\`package\\` returns every path's answer at once; pass \\`package\\` to narrow.\n- Don't know the name? search_docs first. Unsure what to install? list_packages.\n\nSigns you are on the wrong path: importing @wizeworks/silicaui-react into output that is not React; hand-writing \\`data-sui-*\\` markers (they come from macro expansion, never from you); shipping path-3 markup without loading @wizeworks/silicaui-behaviors; expecting path 1 alone to open a dialog.`;\n\ninterface ComponentData {\n name: string;\n package: string;\n category: string;\n sourceFile: string;\n /** silicaui-react entries: extracted from source via TS AST. silicaui-html\n * macros carry no static description (never hand-authored — see label/icon\n * instead) and omit these two fields. */\n description?: string;\n props?: PropsInterface[];\n usageExample?: string | null;\n /** silicaui-html macros only: palette label/icon, whether it's a container,\n * and the BehaviorType(s) its expansion carries (found by actually calling\n * expand(), not guessed — see get_behavior for the marker contract). */\n label?: string;\n icon?: string;\n container?: boolean;\n behaviors?: string[];\n /** silicaui (CSS) entries only: the family's root class (null when it has\n * none — see familyPrefix/rootNote), every literal class it generates, its\n * color variants, and any compound selector that reveals required structure. */\n root?: string | null;\n familyPrefix?: string;\n rootNote?: string;\n classes?: string[];\n colorVariants?: string[];\n compoundSelectors?: string[];\n}\n\ninterface BlockSlot {\n name: string;\n [key: string]: unknown;\n}\n\ninterface BlockData {\n key: string;\n name: string;\n category: string;\n version: string;\n description: string;\n tags?: string[];\n colors: string[];\n behaviors: string[];\n emailEligible: boolean;\n slots: BlockSlot[];\n root: unknown;\n preview?: unknown;\n}\n\ninterface BehaviorData {\n type: string;\n description: string;\n}\n\nconst packages = loadJson<PackageMeta[]>(\"packages\");\nconst tokens = loadJson<TokensData>(\"tokens\");\nconst classesByComponent = loadJson<Record<string, string[]>>(\"classes\");\nconst blocks = loadJson<BlockData[]>(\"blocks\");\nconst behaviors = loadJson<BehaviorData[]>(\"behaviors\");\nconst components = loadJson<ComponentData[]>(\"components\");\n\n/** CSS → React → HTML: the order the instructions introduce the paths in, so a\n * multi-path get_component answer reads the same way every time. Packages not\n * listed (the wrappers) sort last via indexOf's -1... which sorts them FIRST,\n * so map those to a large index instead. */\nconst PATH_ORDER_LIST = [\n \"@wizeworks/silicaui\",\n \"@wizeworks/silicaui-react\",\n \"@wizeworks/silicaui-html\",\n];\nconst PATH_ORDER = {\n indexOf(pkg: string): number {\n const i = PATH_ORDER_LIST.indexOf(pkg);\n return i === -1 ? PATH_ORDER_LIST.length : i;\n },\n};\n\nfunction toKebab(name: string): string {\n return name\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .toLowerCase();\n}\n\nfunction blockSummary(b: BlockData) {\n const { root: _root, ...summary } = b;\n return summary;\n}\n\nexport function createServer(): McpServer {\n const server = new McpServer(\n {\n name: \"@wizeworks/silicaui-mcp\",\n version: VERSION,\n },\n { instructions: INSTRUCTIONS },\n );\n\n server.registerTool(\n \"list_packages\",\n {\n title: \"List Silica UI packages\",\n description:\n \"List every package in the Silica UI family (@wizeworks/silicaui, @wizeworks/silicaui-react, @wizeworks/silicaui-html, @wizeworks/silicaui-behaviors, and the wrapper packages), with purpose, install command, and version.\",\n inputSchema: {},\n },\n async () => ({\n content: [\n {\n type: \"text\",\n // Version is stamped here, not stored in the catalog — see VERSION.\n text: JSON.stringify(\n packages.map((p) => ({ ...p, version: VERSION })),\n null,\n 2,\n ),\n },\n ],\n }),\n );\n\n server.registerTool(\n \"list_components\",\n {\n title: \"List Silica UI components\",\n description:\n \"List component names, categories, and source packages — spans ALL THREE delivery paths: @wizeworks/silicaui (CSS class families for plain HTML), @wizeworks/silicaui-react (typed React components), and @wizeworks/silicaui-html (framework-neutral ComponentDef macros for generated/non-React output). The same component usually exists on more than one path with a completely different shape; get_component returns every path's answer unless you pass a package. Filter here with the package param (e.g. '@wizeworks/silicaui', '@wizeworks/silicaui-react', '@wizeworks/silicaui-html', '@wizeworks/silicaui-charts').\",\n inputSchema: {\n package: z.string().optional().describe(\"Filter to one package name, e.g. '@wizeworks/silicaui-react'.\"),\n },\n },\n async ({ package: pkg }) => {\n const filtered = pkg ? components.filter((c) => c.package === pkg) : components;\n const summary = filtered.map(({ name, package: p, category, sourceFile }) => ({\n name,\n package: p,\n category,\n sourceFile,\n }));\n return { content: [{ type: \"text\", text: JSON.stringify(summary, null, 2) }] };\n },\n );\n\n server.registerTool(\n \"get_component\",\n {\n title: \"Get a Silica UI component's real shape\",\n description:\n \"Get a component's real definition on whichever delivery path you're building on — for @wizeworks/silicaui (CSS): the family's root class, every literal class it generates, its color variants, and any compound selector that reveals required markup structure; for @wizeworks/silicaui-react: props (name, type, optional, doc — extracted from its actual TypeScript source) plus a real, working usage example; for @wizeworks/silicaui-html: its palette category/label/icon, whether it's a container, and the BehaviorType(s) it carries (cross-reference get_behavior for the marker contract). Use this instead of guessing class names, prop names, or shapes. Omit package to see every path's answer side by side; pass it to get just one.\",\n inputSchema: {\n name: z.string().describe(\"Component name, e.g. 'Button', 'DataTable', 'Dialog'.\"),\n package: z.string().optional().describe(\"Disambiguate when the name exists in more than one package, e.g. '@wizeworks/silicaui-html'.\"),\n },\n },\n async ({ name, package: pkg }) => {\n let matches = components.filter((c) => c.name.toLowerCase() === name.toLowerCase());\n if (pkg) matches = matches.filter((c) => c.package === pkg);\n if (!matches.length) {\n return {\n content: [\n {\n type: \"text\",\n text: `No component named \"${name}\"${pkg ? ` in ${pkg}` : \"\"}. Call list_components to see valid names.`,\n },\n ],\n isError: true,\n };\n }\n // A name on more than one path used to be an isError telling the caller\n // to pick a package — which costs a round trip and, worse, asks for a\n // choice the caller can't make yet: it doesn't know how the shapes\n // differ, which is the very thing it's asking about. Returning all of\n // them answers the question AND demonstrates the three paths at the one\n // moment the distinction actually matters.\n if (matches.length > 1) {\n const ordered = [...matches].sort(\n (a, b) => PATH_ORDER.indexOf(a.package) - PATH_ORDER.indexOf(b.package),\n );\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n {\n name: ordered[0]?.name ?? name,\n note:\n `\"${name}\" exists on ${ordered.length} delivery paths, listed below with their real (different) shapes: ` +\n `${ordered.map((c) => c.package).join(\", \")}. Use the one matching the code you're writing — ` +\n `they are not interchangeable. Pass \\`package\\` to get just one.`,\n paths: ordered,\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n return { content: [{ type: \"text\", text: JSON.stringify(matches[0], null, 2) }] };\n },\n );\n\n server.registerTool(\n \"list_classes\",\n {\n title: \"List real Silica UI CSS class names\",\n description:\n \"List the exact, literal CSS class names Silica UI generates for a core component (e.g. 'button', 'card', 'badge') — or all components if none given. These are extracted directly from the class generators, so they are never hallucinated. Also covers 'color-utilities' (text-*/bg-*/border-* for every declared color). This returns a flat list; for the CSS path's STRUCTURE — which class is the root, which are its parts, which are color variants — call get_component with package '@wizeworks/silicaui'.\",\n inputSchema: {\n component: z\n .string()\n .optional()\n .describe(\"A core @wizeworks/silicaui component name, e.g. 'button'. Omit to list every component's classes.\"),\n },\n },\n async ({ component }) => {\n if (!component) {\n return { content: [{ type: \"text\", text: JSON.stringify(classesByComponent, null, 2) }] };\n }\n const key = toKebab(component);\n const classes = classesByComponent[key];\n if (!classes) {\n return {\n content: [\n {\n type: \"text\",\n text: `No class data for \"${component}\". Known components: ${Object.keys(classesByComponent).join(\", \")}`,\n },\n ],\n isError: true,\n };\n }\n return { content: [{ type: \"text\", text: JSON.stringify({ component: key, classes }, null, 2) }] };\n },\n );\n\n server.registerTool(\n \"get_tokens\",\n {\n title: \"Get Silica UI design tokens\",\n description:\n \"Get the semantic color list and their light/dark OKLCH values, the typography token model, and the scalar theme tokens (radius/border/depth/noise/focus/disabled-opacity) with defaults, ranges, and what each one actually affects.\",\n inputSchema: {},\n },\n async () => ({ content: [{ type: \"text\", text: JSON.stringify(tokens, null, 2) }] }),\n );\n\n server.registerTool(\n \"list_blocks\",\n {\n title: \"List Silica UI composed blocks\",\n description:\n \"List composed page blocks from @wizeworks/silicaui-html (hero sections, FAQs, feature grids, …) without their full node tree. Optionally filter by category or tag.\",\n inputSchema: {\n category: z.string().optional(),\n tag: z.string().optional(),\n },\n },\n async ({ category, tag }) => {\n const filtered = blocks.filter(\n (b) => (!category || b.category === category) && (!tag || (b.tags ?? []).includes(tag)),\n );\n return { content: [{ type: \"text\", text: JSON.stringify(filtered.map(blockSummary), null, 2) }] };\n },\n );\n\n server.registerTool(\n \"get_block\",\n {\n title: \"Get a Silica UI block's full node tree\",\n description:\n \"Get one composed block's full definition, including its node tree — the real, validated structure to reuse or adapt, not a guess.\",\n inputSchema: {\n key: z.string().describe(\"The block's stable key, e.g. 'hero_split_cta'.\"),\n },\n },\n async ({ key }) => {\n const block = blocks.find((b) => b.key === key);\n if (!block) {\n return {\n content: [\n {\n type: \"text\",\n text: `No block \"${key}\". Known keys: ${blocks.map((b) => b.key).join(\", \")}`,\n },\n ],\n isError: true,\n };\n }\n return { content: [{ type: \"text\", text: JSON.stringify(block, null, 2) }] };\n },\n );\n\n server.registerTool(\n \"list_behaviors\",\n {\n title: \"List Silica UI behavior types\",\n description:\n \"List the closed set of interactive behaviors that @wizeworks/silicaui-behaviors hydrates from data-sui-* markers (the vanilla-JS runtime for non-React output). Each type is also the BehaviorType a @wizeworks/silicaui-html ComponentDef macro carries — cross-reference with get_component. Call this to see the current set rather than assuming a fixed list; it grows over time.\",\n inputSchema: {},\n },\n async () => ({ content: [{ type: \"text\", text: JSON.stringify(behaviors, null, 2) }] }),\n );\n\n server.registerTool(\n \"get_behavior\",\n {\n title: \"Get one Silica UI behavior's contract\",\n description: \"Get the marker contract and semantics for one behavior type.\",\n inputSchema: {\n type: z.string().describe(\"Behavior type, e.g. 'disclosure'.\"),\n },\n },\n async ({ type }) => {\n const behavior = behaviors.find((b) => b.type === type);\n if (!behavior) {\n return {\n content: [\n {\n type: \"text\",\n text: `No behavior \"${type}\". Known types: ${behaviors.map((b) => b.type).join(\", \")}`,\n },\n ],\n isError: true,\n };\n }\n return { content: [{ type: \"text\", text: JSON.stringify(behavior, null, 2) }] };\n },\n );\n\n server.registerTool(\n \"search_docs\",\n {\n title: \"Search Silica UI catalog data\",\n description:\n \"Full-text search across everything this server knows: component names/descriptions, block names/descriptions, behavior descriptions, literal CSS class names, and design tokens. Use this when you don't know the exact name to look up.\",\n inputSchema: {\n query: z.string().describe(\"Search term, case-insensitive.\"),\n },\n },\n async ({ query }) => {\n const q = query.toLowerCase();\n const matchedComponents = components\n .filter((c) => c.name.toLowerCase().includes(q) || (c.description ?? \"\").toLowerCase().includes(q) || (c.label ?? \"\").toLowerCase().includes(q))\n .map((c) => ({ kind: \"component\", name: c.name, package: c.package }));\n const matchedBlocks = blocks\n .filter((b) => b.name.toLowerCase().includes(q) || b.description.toLowerCase().includes(q))\n .map((b) => ({ kind: \"block\", key: b.key, name: b.name }));\n const matchedBehaviors = behaviors\n .filter((b) => b.type.toLowerCase().includes(q) || b.description.toLowerCase().includes(q))\n .map((b) => ({ kind: \"behavior\", type: b.type }));\n const matchedClasses = Object.entries(classesByComponent).flatMap(([component, classes]) =>\n classes\n .filter((cls) => cls.toLowerCase().includes(q))\n .map((cls) => ({ kind: \"class\" as const, component, class: cls })),\n );\n const matchedTokens = tokens.semanticColors\n .filter((name) => name.toLowerCase().includes(q))\n .map((name) => ({ kind: \"token\" as const, name }));\n const results = [\n ...matchedComponents,\n ...matchedBlocks,\n ...matchedBehaviors,\n ...matchedClasses,\n ...matchedTokens,\n ];\n return { content: [{ type: \"text\", text: JSON.stringify(results, null, 2) }] };\n },\n );\n\n return server;\n}\n\nexport async function main(): Promise<void> {\n const server = createServer();\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wizeworks/silicaui-mcp",
3
- "version": "0.35.0",
3
+ "version": "0.37.0",
4
4
  "description": "A local MCP server that lets AI coding assistants query the Silica UI design system — real class names, component props, blocks, and behaviors — instead of guessing.",
5
5
  "type": "module",
6
6
  "license": "MIT",