@shadsapp/mcp 0.1.0 → 0.1.2

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/README.md ADDED
@@ -0,0 +1,190 @@
1
+ # @shadsapp/mcp
2
+
3
+ MCP server for [shads.app](https://shads.app). It gives AI clients access to curated shadcn/ui themes, theme validation, registry URLs, theme skills, and installation plans.
4
+
5
+ The server uses the MCP **stdio transport**. It runs as a child process started by an MCP client such as Claude Desktop, Cursor, VS Code, or another MCP host.
6
+
7
+ ## Requirements
8
+
9
+ - Node.js 18 or newer
10
+ - Internet access for registry tools (`resolve_share`, `get_system`, `get_skill`, and `install_plan`)
11
+ - A project using the shadcn CLI for generated install commands
12
+
13
+ `list_themes`, `get_theme`, `validate_theme`, `theme_schema`, and `list_starters` work from the installed package without a network request.
14
+
15
+ ## Installation
16
+
17
+ ### Run directly with npx
18
+
19
+ This is the simplest option. The MCP client downloads the package when it starts the server:
20
+
21
+ ```bash
22
+ npx -y @shadsapp/mcp
23
+ ```
24
+
25
+ Use the following configuration in an MCP client that supports JSON server configuration:
26
+
27
+ ```json
28
+ {
29
+ "mcpServers": {
30
+ "shads": {
31
+ "command": "npx",
32
+ "args": ["-y", "@shadsapp/mcp"]
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### Install globally
39
+
40
+ ```bash
41
+ npm install --global @shadsapp/mcp
42
+ shads-mcp
43
+ ```
44
+
45
+ Then configure the client with:
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "shads": {
51
+ "command": "shads-mcp"
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ ### Install locally in a project
58
+
59
+ ```bash
60
+ npm install --save-dev @shadsapp/mcp
61
+ ```
62
+
63
+ Use an absolute executable path when the MCP host does not inherit your project's `node_modules/.bin` path. For example:
64
+
65
+ ```json
66
+ {
67
+ "mcpServers": {
68
+ "shads": {
69
+ "command": "/absolute/path/to/project/node_modules/.bin/shads-mcp"
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ On Windows, use the generated `shads-mcp.cmd` path or run through `npx.cmd`:
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "shads": {
81
+ "command": "npx.cmd",
82
+ "args": ["-y", "@shadsapp/mcp"]
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ## Client setup
89
+
90
+ Add the configuration to the MCP client's server settings, then restart the client. The server communicates over stdin/stdout, so do not add logging or other output to stdout in a wrapper script. Diagnostics belong on stderr.
91
+
92
+ If the client supports an explicit working directory, set it to the project where shadcn commands should run. The MCP server itself does not modify that project; it returns install commands for the agent or user to review and run.
93
+
94
+ ## Available tools
95
+
96
+ | Tool | Input | Purpose |
97
+ |------|-------|---------|
98
+ | `list_themes` | `{}` | List bundled starter theme metadata. |
99
+ | `get_theme` | `{ "id": "workspace" }` | Return a bundled theme and CSS. |
100
+ | `validate_theme` | `{ "source": "..." }` | Validate raw or fenced `theme.json` text. |
101
+ | `theme_schema` | `{}` | Return the active schema id. |
102
+ | `list_starters` | `{}` | List starter registry and skill URLs. |
103
+ | `get_install_prompt` | `{ "item": "workspace", "mode": "both" }` | Return a copyable install prompt. |
104
+ | `resolve_share` | `{ "item": "abc123" }` | Resolve a registry/share item and return its prompt. |
105
+ | `get_system` | `{ "id": "workspace" }` | Return theme, skill, dependencies, and install data. |
106
+ | `get_skill` | `{ "id": "workspace" }` | Return the theme-specific skill markdown. |
107
+ | `install_plan` | `{ "id": "workspace", "mode": "existing" }` | Return validated install commands and notes. |
108
+
109
+ Starter names such as `workspace` are converted to registry item ids such as `workspace-theme`. You may also provide a theme item id, a share id, or a registry URL such as `https://shads.app/r/workspace-theme.json`.
110
+
111
+ Registry item ids accept only letters, numbers, hyphens, and underscores. This keeps generated shell commands safe to review and execute.
112
+
113
+ ## Typical workflows
114
+
115
+ ### Install a starter into an existing app
116
+
117
+ 1. Call `get_system` with `{ "id": "workspace" }`.
118
+ 2. Review the returned theme URL, skill markdown, dependencies, and prompt.
119
+ 3. Call `install_plan` with mode `existing` if you only need the command.
120
+ 4. Run the returned command from the target shadcn project.
121
+
122
+ ### Create a new app from a starter
123
+
124
+ Call `get_install_prompt` with mode `new`:
125
+
126
+ ```json
127
+ {
128
+ "item": "workspace",
129
+ "mode": "new"
130
+ }
131
+ ```
132
+
133
+ The result contains the `shadcn create` command and the relevant theme skill instructions.
134
+
135
+ ### Validate a theme document
136
+
137
+ Pass the complete JSON text or a fenced JSON block:
138
+
139
+ ````json
140
+ {
141
+ "source": "```json\n{\"$schema\":\"shads-theme/v1\",\"config\":{}}\n```"
142
+ }
143
+ ````
144
+
145
+ The result has `ok: true` and a normalized document when valid, or `ok: false` with a list of validation errors.
146
+
147
+ ## Troubleshooting
148
+
149
+ ### The client cannot start the server
150
+
151
+ Check that Node.js 18 or newer is available to the client process:
152
+
153
+ ```bash
154
+ node --version
155
+ npx -y @shadsapp/mcp
156
+ ```
157
+
158
+ For GUI clients, use an absolute command path or configure the full path to `npx`/`npx.cmd`. GUI applications often have a smaller `PATH` than your shell.
159
+
160
+ ### The server starts but registry tools fail
161
+
162
+ The remote registry tools require network access to `https://shads.app`. Check that the client process can reach the registry and that the item exists. Remote requests fail with a bounded timeout rather than waiting indefinitely.
163
+
164
+ ### Install commands do not affect the project
165
+
166
+ The server only returns commands. Run them from the target shadcn project, or configure the MCP host's working directory when supported.
167
+
168
+ ## Development
169
+
170
+ From the repository root:
171
+
172
+ ```bash
173
+ npm install
174
+ npm run test -w @shadsapp/mcp
175
+ npm run typecheck -w @shadsapp/mcp
176
+ npm run build -w @shadsapp/mcp
177
+ npm pack -w @shadsapp/mcp --dry-run
178
+ ```
179
+
180
+ The published package contains `dist`, the executable entrypoint, and this README. The server uses stderr for fatal startup diagnostics and reserves stdout for MCP protocol messages.
181
+
182
+ ## Related packages
183
+
184
+ - [`@shadsapp/schema`](https://www.npmjs.com/package/@shadsapp/schema)
185
+ - [`@shadsapp/themes`](https://www.npmjs.com/package/@shadsapp/themes)
186
+ - [`@shadsapp/cli`](https://www.npmjs.com/package/@shadsapp/cli)
187
+
188
+ ## License
189
+
190
+ MIT
package/dist/index.js CHANGED
@@ -4,9 +4,10 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
4
4
  import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
5
  import { parseThemeDocumentInput, THEME_SCHEMA } from "@shadsapp/schema";
6
6
  import { getTheme, listThemes } from "@shadsapp/themes";
7
+ import { buildAgentInstallPrompt, buildInstallPlan, listStarterInstallEntries, REGISTRY_HOMEPAGE, resolveSafeItemId, systemSkillItemId, } from "./install-prompt.js";
7
8
  const server = new Server({
8
9
  name: "shads",
9
- version: "0.1.0",
10
+ version: "0.1.1",
10
11
  }, {
11
12
  capabilities: {
12
13
  tools: {},
@@ -62,8 +63,122 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
62
63
  additionalProperties: false,
63
64
  },
64
65
  },
66
+ {
67
+ name: "list_starters",
68
+ description: "List all shads starter themes with registry install URLs for agents",
69
+ inputSchema: {
70
+ type: "object",
71
+ properties: {},
72
+ additionalProperties: false,
73
+ },
74
+ },
75
+ {
76
+ name: "get_install_prompt",
77
+ description: "Return a copyable agent install prompt for a starter, share id, or registry URL",
78
+ inputSchema: {
79
+ type: "object",
80
+ properties: {
81
+ item: {
82
+ type: "string",
83
+ description: "Starter id (workspace), theme item id, share id, or full registry URL",
84
+ },
85
+ mode: {
86
+ type: "string",
87
+ enum: ["existing", "new", "both"],
88
+ description: "Which install commands to include (default both)",
89
+ },
90
+ },
91
+ required: ["item"],
92
+ additionalProperties: false,
93
+ },
94
+ },
95
+ {
96
+ name: "resolve_share",
97
+ description: "Resolve a share or registry item URL and return title plus install prompt",
98
+ inputSchema: {
99
+ type: "object",
100
+ properties: {
101
+ item: {
102
+ type: "string",
103
+ description: "Share id, theme item id, or registry URL",
104
+ },
105
+ },
106
+ required: ["item"],
107
+ additionalProperties: false,
108
+ },
109
+ },
110
+ {
111
+ name: "get_system",
112
+ description: "Fetch a full theme package: registry theme, theme skill markdown, and install URLs",
113
+ inputSchema: {
114
+ type: "object",
115
+ properties: {
116
+ id: {
117
+ type: "string",
118
+ description: "Starter id (workspace), theme item id, share id, or registry URL",
119
+ },
120
+ },
121
+ required: ["id"],
122
+ additionalProperties: false,
123
+ },
124
+ },
125
+ {
126
+ name: "get_skill",
127
+ description: "Return the theme-specific skill markdown for a starter or share",
128
+ inputSchema: {
129
+ type: "object",
130
+ properties: {
131
+ id: {
132
+ type: "string",
133
+ description: "Starter id, theme item id, share id, or registry URL",
134
+ },
135
+ },
136
+ required: ["id"],
137
+ additionalProperties: false,
138
+ },
139
+ },
140
+ {
141
+ name: "install_plan",
142
+ description: "Ordered shell commands to install a system into a new or existing project",
143
+ inputSchema: {
144
+ type: "object",
145
+ properties: {
146
+ id: {
147
+ type: "string",
148
+ description: "Starter id, theme item id, share id, or registry URL",
149
+ },
150
+ mode: {
151
+ type: "string",
152
+ enum: ["new", "existing"],
153
+ description: "Install target (default existing)",
154
+ },
155
+ },
156
+ required: ["id"],
157
+ additionalProperties: false,
158
+ },
159
+ },
65
160
  ],
66
161
  }));
162
+ const REGISTRY_FETCH_TIMEOUT_MS = 10_000;
163
+ async function fetchRegistryItem(itemId) {
164
+ try {
165
+ const response = await fetch(`${REGISTRY_HOMEPAGE}/r/${itemId}.json`, {
166
+ headers: { Accept: "application/json" },
167
+ signal: AbortSignal.timeout(REGISTRY_FETCH_TIMEOUT_MS),
168
+ });
169
+ if (!response.ok) {
170
+ return null;
171
+ }
172
+ return (await response.json());
173
+ }
174
+ catch {
175
+ return null;
176
+ }
177
+ }
178
+ function skillMarkdownFromItem(item) {
179
+ const skillFile = item.files?.find((file) => file.target?.endsWith("SKILL.md"));
180
+ return skillFile?.content ?? null;
181
+ }
67
182
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
68
183
  switch (request.params.name) {
69
184
  case "list_themes": {
@@ -115,6 +230,180 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
115
230
  ],
116
231
  };
117
232
  }
233
+ case "list_starters": {
234
+ return {
235
+ content: [
236
+ {
237
+ type: "text",
238
+ text: JSON.stringify(listStarterInstallEntries(), null, 2),
239
+ },
240
+ ],
241
+ };
242
+ }
243
+ case "get_install_prompt": {
244
+ const item = String(request.params.arguments?.item ?? "");
245
+ const mode = request.params.arguments?.mode;
246
+ const itemId = resolveSafeItemId(item);
247
+ const prompt = buildAgentInstallPrompt({ itemId, mode });
248
+ return {
249
+ content: [
250
+ {
251
+ type: "text",
252
+ text: prompt,
253
+ },
254
+ ],
255
+ };
256
+ }
257
+ case "resolve_share": {
258
+ const item = String(request.params.arguments?.item ?? "");
259
+ const itemId = resolveSafeItemId(item);
260
+ const registryItem = await fetchRegistryItem(itemId);
261
+ if (!registryItem) {
262
+ return {
263
+ content: [
264
+ {
265
+ type: "text",
266
+ text: JSON.stringify({
267
+ error: "Registry item not found",
268
+ itemId,
269
+ }, null, 2),
270
+ },
271
+ ],
272
+ isError: true,
273
+ };
274
+ }
275
+ const prompt = buildAgentInstallPrompt({
276
+ itemId,
277
+ title: registryItem.title ?? registryItem.name,
278
+ });
279
+ return {
280
+ content: [
281
+ {
282
+ type: "text",
283
+ text: JSON.stringify({
284
+ itemId,
285
+ title: registryItem.title ?? registryItem.name ?? itemId,
286
+ prompt,
287
+ }, null, 2),
288
+ },
289
+ ],
290
+ };
291
+ }
292
+ case "get_system": {
293
+ const id = String(request.params.arguments?.id ?? "");
294
+ const itemId = resolveSafeItemId(id);
295
+ const themeItem = await fetchRegistryItem(itemId);
296
+ if (!themeItem) {
297
+ return {
298
+ content: [
299
+ {
300
+ type: "text",
301
+ text: JSON.stringify({ error: "Registry item not found", itemId }, null, 2),
302
+ },
303
+ ],
304
+ isError: true,
305
+ };
306
+ }
307
+ const skillItemId = systemSkillItemId(itemId);
308
+ const skillItem = await fetchRegistryItem(skillItemId);
309
+ const skillMarkdown = skillItem
310
+ ? skillMarkdownFromItem(skillItem)
311
+ : null;
312
+ return {
313
+ content: [
314
+ {
315
+ type: "text",
316
+ text: JSON.stringify({
317
+ itemId,
318
+ title: themeItem.title ?? themeItem.name ?? itemId,
319
+ themeUrl: `${REGISTRY_HOMEPAGE}/r/${itemId}.json`,
320
+ skillItemId,
321
+ skillUrl: `${REGISTRY_HOMEPAGE}/r/${skillItemId}.json`,
322
+ skillMarkdown,
323
+ registryDependencies: themeItem.registryDependencies ?? [],
324
+ installPrompt: buildAgentInstallPrompt({
325
+ itemId,
326
+ title: themeItem.title ?? themeItem.name,
327
+ }),
328
+ installPlan: buildInstallPlan({
329
+ itemId,
330
+ title: themeItem.title ?? themeItem.name,
331
+ mode: "existing",
332
+ }),
333
+ }, null, 2),
334
+ },
335
+ ],
336
+ };
337
+ }
338
+ case "get_skill": {
339
+ const id = String(request.params.arguments?.id ?? "");
340
+ const itemId = resolveSafeItemId(id);
341
+ const skillItemId = itemId.endsWith("-skill")
342
+ ? itemId
343
+ : systemSkillItemId(itemId);
344
+ const skillItem = await fetchRegistryItem(skillItemId);
345
+ if (!skillItem) {
346
+ return {
347
+ content: [
348
+ {
349
+ type: "text",
350
+ text: JSON.stringify({ error: "System skill not found", skillItemId }, null, 2),
351
+ },
352
+ ],
353
+ isError: true,
354
+ };
355
+ }
356
+ const markdown = skillMarkdownFromItem(skillItem);
357
+ return {
358
+ content: [
359
+ {
360
+ type: "text",
361
+ text: markdown ??
362
+ JSON.stringify({ error: "Skill markdown missing", skillItemId }, null, 2),
363
+ },
364
+ ],
365
+ isError: !markdown,
366
+ };
367
+ }
368
+ case "install_plan": {
369
+ const id = String(request.params.arguments?.id ?? "");
370
+ const mode = request.params.arguments?.mode === "new" ? "new" : "existing";
371
+ const itemId = resolveSafeItemId(id);
372
+ const registryItem = await fetchRegistryItem(itemId);
373
+ if (!registryItem) {
374
+ return {
375
+ content: [
376
+ {
377
+ type: "text",
378
+ text: JSON.stringify({ error: "Registry item not found", itemId }, null, 2),
379
+ },
380
+ ],
381
+ isError: true,
382
+ };
383
+ }
384
+ const plan = buildInstallPlan({
385
+ itemId,
386
+ mode,
387
+ title: registryItem?.title ?? registryItem?.name,
388
+ });
389
+ return {
390
+ content: [
391
+ {
392
+ type: "text",
393
+ text: JSON.stringify({
394
+ itemId,
395
+ mode,
396
+ ...plan,
397
+ prompt: buildAgentInstallPrompt({
398
+ itemId,
399
+ mode: mode === "new" ? "new" : "existing",
400
+ title: registryItem?.title ?? registryItem?.name,
401
+ }),
402
+ }, null, 2),
403
+ },
404
+ ],
405
+ };
406
+ }
118
407
  default:
119
408
  throw new Error(`Unknown tool: ${request.params.name}`);
120
409
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEvD,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,OAAO;CACjB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAA;AAED,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IAC5D,KAAK,EAAE;QACL;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,0CAA0C;YACvD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE;gBACd,oBAAoB,EAAE,KAAK;aAC5B;SACF;QACD;YACE,IA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C,CAAA;IAC3D,CAAC;AACH,CAAC,CAAC,CAAA;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;IAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AACjC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
@@ -0,0 +1,34 @@
1
+ export declare const REGISTRY_HOMEPAGE = "https://shads.app";
2
+ export declare const STARTER_PRESET_IDS: readonly ["workspace", "brief", "insights", "dispatch", "ledger", "canvas", "terminal", "launch", "commerce", "campus", "editorial"];
3
+ export type AgentInstallPromptMode = "existing" | "new" | "both";
4
+ export declare function assertSafeItemId(itemId: string): void;
5
+ export declare function registryItemUrl(origin: string, itemId: string): string;
6
+ export declare function registryInstallCommand(itemId: string, origin?: string): string;
7
+ export declare function registryCreateCommand(itemId: string, origin?: string): string;
8
+ export declare function starterThemeItemId(presetId: string): string;
9
+ export declare function systemSkillItemId(themeItemId: string): string;
10
+ export declare function resolveItemIdFromInput(input: string): string;
11
+ export declare function resolveSafeItemId(input: string): string;
12
+ export declare function buildAgentInstallPrompt(options: {
13
+ itemId: string;
14
+ origin?: string;
15
+ title?: string;
16
+ mode?: AgentInstallPromptMode;
17
+ }): string;
18
+ export declare function buildInstallPlan(options: {
19
+ itemId: string;
20
+ origin?: string;
21
+ mode?: "new" | "existing";
22
+ title?: string;
23
+ }): {
24
+ commands: string[];
25
+ notes: string[];
26
+ };
27
+ export declare function listStarterInstallEntries(origin?: string): {
28
+ id: "workspace" | "brief" | "insights" | "dispatch" | "ledger" | "canvas" | "terminal" | "launch" | "commerce" | "campus" | "editorial";
29
+ itemId: string;
30
+ url: string;
31
+ skillItemId: string;
32
+ skillUrl: string;
33
+ }[];
34
+ //# sourceMappingURL=install-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-prompt.d.ts","sourceRoot":"","sources":["../src/install-prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,sBAAsB,CAAA;AAEpD,eAAO,MAAM,kBAAkB,sIAYrB,CAAA;AAEV,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,CAAA;AAIhE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAMrD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGtE;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,SAAoB,GACzB,MAAM,CAER;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,SAAoB,GACzB,MAAM,CAER;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAa5D;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIvD;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAC/C,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,sBAAsB,CAAA;CAC9B,GAAG,MAAM,CA4CT;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,KAAK,GAAG,UAAU,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAkB1C;AAED,wBAAgB,yBAAyB,CAAC,MAAM,SAAoB;;;;;;IAQnE"}
@@ -0,0 +1,110 @@
1
+ export const REGISTRY_HOMEPAGE = "https://shads.app";
2
+ export const STARTER_PRESET_IDS = [
3
+ "workspace",
4
+ "brief",
5
+ "insights",
6
+ "dispatch",
7
+ "ledger",
8
+ "canvas",
9
+ "terminal",
10
+ "launch",
11
+ "commerce",
12
+ "campus",
13
+ "editorial",
14
+ ];
15
+ const ITEM_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;
16
+ export function assertSafeItemId(itemId) {
17
+ if (!ITEM_ID_PATTERN.test(itemId)) {
18
+ throw new Error("Invalid registry item id. Use letters, numbers, hyphens, or underscores only.");
19
+ }
20
+ }
21
+ export function registryItemUrl(origin, itemId) {
22
+ assertSafeItemId(itemId);
23
+ return `${origin}/r/${itemId}.json`;
24
+ }
25
+ export function registryInstallCommand(itemId, origin = REGISTRY_HOMEPAGE) {
26
+ return `npx shadcn@latest add ${registryItemUrl(origin, itemId)}`;
27
+ }
28
+ export function registryCreateCommand(itemId, origin = REGISTRY_HOMEPAGE) {
29
+ return `npx shadcn@latest create --name my-app --template next --preset ${registryItemUrl(origin, itemId)}`;
30
+ }
31
+ export function starterThemeItemId(presetId) {
32
+ return `${presetId}-theme`;
33
+ }
34
+ export function systemSkillItemId(themeItemId) {
35
+ return `${themeItemId}-skill`;
36
+ }
37
+ export function resolveItemIdFromInput(input) {
38
+ const trimmed = input.trim();
39
+ const urlMatch = trimmed.match(/\/r\/([^/?#]+?)(?:\.json)?(?:[/?#]|$)/);
40
+ if (urlMatch?.[1]) {
41
+ return urlMatch[1];
42
+ }
43
+ if (trimmed.endsWith("-theme") || trimmed.endsWith("-skill")) {
44
+ return trimmed;
45
+ }
46
+ if (STARTER_PRESET_IDS.includes(trimmed)) {
47
+ return starterThemeItemId(trimmed);
48
+ }
49
+ return trimmed;
50
+ }
51
+ export function resolveSafeItemId(input) {
52
+ const itemId = resolveItemIdFromInput(input);
53
+ assertSafeItemId(itemId);
54
+ return itemId;
55
+ }
56
+ export function buildAgentInstallPrompt(options) {
57
+ assertSafeItemId(options.itemId);
58
+ const origin = options.origin ?? REGISTRY_HOMEPAGE;
59
+ const mode = options.mode ?? "both";
60
+ const globalSkillCommand = registryInstallCommand("skill", origin);
61
+ const systemSkillCommand = registryInstallCommand(systemSkillItemId(options.itemId), origin);
62
+ const addCommand = registryInstallCommand(options.itemId, origin);
63
+ const createCommand = registryCreateCommand(options.itemId, origin);
64
+ const lines = [
65
+ options.title
66
+ ? `Install this shads.app theme: ${options.title}.`
67
+ : "Install this shads.app theme.",
68
+ "",
69
+ "Use the official shadcn CLI. Do not paste CSS or edit components/ui.",
70
+ "Use semantic tokens (bg-primary, text-muted-foreground, border-border).",
71
+ "Do not invent a palette — follow the installed theme skill.",
72
+ "Adapters and the theme skill install as registry dependencies automatically.",
73
+ "",
74
+ ];
75
+ if (mode === "new" || mode === "both") {
76
+ lines.push("## New project", "", "```bash", createCommand, "```", "");
77
+ }
78
+ if (mode === "existing" || mode === "both") {
79
+ lines.push("## Existing project", "", "```bash", addCommand, "```", "");
80
+ }
81
+ lines.push("## Agent rules", "", "Theme install pulls the theme skill. Optionally install the global workflow skill once:", "", "```bash", systemSkillCommand, globalSkillCommand, "```");
82
+ return lines.join("\n");
83
+ }
84
+ export function buildInstallPlan(options) {
85
+ assertSafeItemId(options.itemId);
86
+ const origin = options.origin ?? REGISTRY_HOMEPAGE;
87
+ const mode = options.mode ?? "existing";
88
+ const commands = mode === "new"
89
+ ? [registryCreateCommand(options.itemId, origin)]
90
+ : [registryInstallCommand(options.itemId, origin)];
91
+ return {
92
+ commands,
93
+ notes: [
94
+ "Theme install pulls adapters + theme skill via registryDependencies.",
95
+ "Do not paste CSS or edit components/ui.",
96
+ "Prefer the theme skill over inventing a palette.",
97
+ ...(options.title ? [`Theme: ${options.title}`] : []),
98
+ ],
99
+ };
100
+ }
101
+ export function listStarterInstallEntries(origin = REGISTRY_HOMEPAGE) {
102
+ return STARTER_PRESET_IDS.map((id) => ({
103
+ id,
104
+ itemId: starterThemeItemId(id),
105
+ url: registryItemUrl(origin, starterThemeItemId(id)),
106
+ skillItemId: systemSkillItemId(starterThemeItemId(id)),
107
+ skillUrl: registryItemUrl(origin, systemSkillItemId(starterThemeItemId(id))),
108
+ }));
109
+ }
110
+ //# sourceMappingURL=install-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-prompt.js","sourceRoot":"","sources":["../src/install-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,WAAW;IACX,OAAO;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,WAAW;CACH,CAAA;AAIV,MAAM,eAAe,GAAG,mCAAmC,CAAA;AAE3D,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAA;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,MAAc;IAC5D,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACxB,OAAO,GAAG,MAAM,MAAM,MAAM,OAAO,CAAA;AACrC,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,MAAc,EACd,MAAM,GAAG,iBAAiB;IAE1B,OAAO,yBAAyB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;AACnE,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,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ChC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,iBAAiB,CAAA;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,UAAU,CAAA;IACvC,MAAM,QAAQ,GACZ,IAAI,KAAK,KAAK;QACZ,CAAC,CAAC,CAAC,qBAAqB,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC,sBAAsB,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAEtD,OAAO;QACL,QAAQ;QACR,KAAK,EAAE;YACL,sEAAsE;YACtE,yCAAyC;YACzC,kDAAkD;YAClD,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACtD;KACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,MAAM,GAAG,iBAAiB;IAClE,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACrC,EAAE;QACF,MAAM,EAAE,kBAAkB,CAAC,EAAE,CAAC;QAC9B,GAAG,EAAE,eAAe,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACpD,WAAW,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACtD,QAAQ,EAAE,eAAe,CAAC,MAAM,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC;KAC7E,CAAC,CAAC,CAAA;AACL,CAAC"}
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@shadsapp/mcp",
3
- "version": "0.1.0",
4
- "description": "MCP server for shads theme discovery and validation",
3
+ "version": "0.1.2",
4
+ "description": "MCP server that lets AI agents list, fetch, and validate shads.app shadcn/ui themes",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "bin": {
8
8
  "shads-mcp": "./dist/index.js"
9
9
  },
10
10
  "files": [
11
- "dist"
11
+ "dist",
12
+ "README.md"
12
13
  ],
13
14
  "exports": {
14
15
  ".": {
@@ -18,14 +19,21 @@
18
19
  },
19
20
  "scripts": {
20
21
  "build": "tsc -p tsconfig.json",
21
- "typecheck": "tsc -p tsconfig.json --noEmit"
22
+ "typecheck": "tsc -p tsconfig.json --noEmit",
23
+ "test": "vitest run"
22
24
  },
23
25
  "dependencies": {
24
26
  "@modelcontextprotocol/sdk": "^1.17.5",
25
- "@shadsapp/schema": "0.1.0",
26
- "@shadsapp/themes": "0.1.0"
27
+ "@shadsapp/schema": "0.1.1",
28
+ "@shadsapp/themes": "0.1.2"
29
+ },
30
+ "devDependencies": {
31
+ "vitest": "^5.0.0"
27
32
  },
28
33
  "publishConfig": {
29
34
  "access": "public"
35
+ },
36
+ "engines": {
37
+ "node": ">=18"
30
38
  }
31
39
  }