@shadsapp/mcp 0.1.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.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,130 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
+ import { parseThemeDocumentInput, THEME_SCHEMA } from "@shadsapp/schema";
6
+ import { getTheme, listThemes } from "@shadsapp/themes";
7
+ const server = new Server({
8
+ name: "shads",
9
+ version: "0.1.0",
10
+ }, {
11
+ capabilities: {
12
+ tools: {},
13
+ },
14
+ });
15
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
16
+ tools: [
17
+ {
18
+ name: "list_themes",
19
+ description: "List curated public shads starter themes",
20
+ inputSchema: {
21
+ type: "object",
22
+ properties: {},
23
+ additionalProperties: false,
24
+ },
25
+ },
26
+ {
27
+ name: "get_theme",
28
+ description: "Get a public theme bundle (theme.json + theme.css)",
29
+ inputSchema: {
30
+ type: "object",
31
+ properties: {
32
+ id: {
33
+ type: "string",
34
+ description: "Theme id, e.g. workspace",
35
+ },
36
+ },
37
+ required: ["id"],
38
+ additionalProperties: false,
39
+ },
40
+ },
41
+ {
42
+ name: "validate_theme",
43
+ description: "Validate a theme.json document string",
44
+ inputSchema: {
45
+ type: "object",
46
+ properties: {
47
+ source: {
48
+ type: "string",
49
+ description: "Raw theme.json text or fenced JSON",
50
+ },
51
+ },
52
+ required: ["source"],
53
+ additionalProperties: false,
54
+ },
55
+ },
56
+ {
57
+ name: "theme_schema",
58
+ description: "Return the active shads theme document schema id",
59
+ inputSchema: {
60
+ type: "object",
61
+ properties: {},
62
+ additionalProperties: false,
63
+ },
64
+ },
65
+ ],
66
+ }));
67
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
68
+ switch (request.params.name) {
69
+ case "list_themes": {
70
+ return {
71
+ content: [
72
+ {
73
+ type: "text",
74
+ text: JSON.stringify(listThemes(), null, 2),
75
+ },
76
+ ],
77
+ };
78
+ }
79
+ case "get_theme": {
80
+ const id = String(request.params.arguments?.id ?? "");
81
+ const bundle = getTheme(id);
82
+ return {
83
+ content: [
84
+ {
85
+ type: "text",
86
+ text: JSON.stringify({
87
+ id: bundle.id,
88
+ meta: bundle.meta,
89
+ theme: bundle.theme,
90
+ themeCss: bundle.themeCss,
91
+ }, null, 2),
92
+ },
93
+ ],
94
+ };
95
+ }
96
+ case "validate_theme": {
97
+ const source = String(request.params.arguments?.source ?? "");
98
+ const result = parseThemeDocumentInput(source);
99
+ return {
100
+ content: [
101
+ {
102
+ type: "text",
103
+ text: JSON.stringify(result, null, 2),
104
+ },
105
+ ],
106
+ };
107
+ }
108
+ case "theme_schema": {
109
+ return {
110
+ content: [
111
+ {
112
+ type: "text",
113
+ text: THEME_SCHEMA,
114
+ },
115
+ ],
116
+ };
117
+ }
118
+ default:
119
+ throw new Error(`Unknown tool: ${request.params.name}`);
120
+ }
121
+ });
122
+ async function main() {
123
+ const transport = new StdioServerTransport();
124
+ await server.connect(transport);
125
+ }
126
+ main().catch((error) => {
127
+ console.error(error);
128
+ process.exit(1);
129
+ });
130
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,oCAA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AAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAA;QACH,CAAC;QACD,KAAK,cAAc,CAAC,CAAC,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,YAAY;qBACnB;iBACF;aACF,CAAA;QACH,CAAC;QACD;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,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"}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@shadsapp/mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for shads theme discovery and validation",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "bin": {
8
+ "shads-mcp": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "build": "tsc -p tsconfig.json",
21
+ "typecheck": "tsc -p tsconfig.json --noEmit"
22
+ },
23
+ "dependencies": {
24
+ "@modelcontextprotocol/sdk": "^1.17.5",
25
+ "@shadsapp/schema": "0.1.0",
26
+ "@shadsapp/themes": "0.1.0"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ }
31
+ }