shadermesh-mcp 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +88 -2
- package/dist/index.js +725 -0
- package/package.json +41 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ShaderMesh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,89 @@
|
|
|
1
|
-
#
|
|
1
|
+
# shadermesh-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An MCP server that lets Claude Code, Cursor or Windsurf browse, install and
|
|
4
|
+
recolour interactive WebGL shader backgrounds directly in a project.
|
|
5
|
+
|
|
6
|
+
## Add it
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
claude mcp add shadermesh npx -y shadermesh-mcp
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Cursor and Windsurf take the same thing as JSON:
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"mcpServers": {
|
|
17
|
+
"shadermesh": { "command": "npx", "args": ["-y", "shadermesh-mcp"] }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Then ask for what you want: *"add a dark interactive aurora background to my
|
|
23
|
+
hero section"*.
|
|
24
|
+
|
|
25
|
+
## Tools
|
|
26
|
+
|
|
27
|
+
### `list_shaders`
|
|
28
|
+
|
|
29
|
+
Browse the catalog. `category` accepts the catalog names (`liquid`, `aurora`,
|
|
30
|
+
`grain`, `glass`, `grid`, `ray`) and the names people actually reach for
|
|
31
|
+
(`mesh` → liquid, `geometric` → grid, `cosmic` → ray). `mood` is one of `dark`,
|
|
32
|
+
`vibrant`, `pastel`, `minimal`. `free_only` hides Pro presets.
|
|
33
|
+
|
|
34
|
+
Returns slugs, descriptions, default palettes and free/Pro status.
|
|
35
|
+
|
|
36
|
+
### `install_shader`
|
|
37
|
+
|
|
38
|
+
Writes a self-contained component into the project, plus the shared runtime if
|
|
39
|
+
it is missing. The component has no runtime dependency on any package — the
|
|
40
|
+
source is copied in.
|
|
41
|
+
|
|
42
|
+
| Argument | Notes |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `slug` | Required. |
|
|
45
|
+
| `targetDir` | Relative to the project root. Defaults to `shadermesh.json`, else `src/components/ui/shaders`. |
|
|
46
|
+
| `colors` | Three hex stops baked in as the component's defaults. |
|
|
47
|
+
| `bg` | Background hex baked in as the default. |
|
|
48
|
+
| `overwrite` | Replace an existing component. Defaults to false. |
|
|
49
|
+
|
|
50
|
+
Returns the exact JSX to use it.
|
|
51
|
+
|
|
52
|
+
### `customize_shader_palette`
|
|
53
|
+
|
|
54
|
+
Turns one brand colour into a three-stop palette plus a background. `scheme` is
|
|
55
|
+
`analogous`, `complementary`, `triadic` or `monochrome`; `mood` retunes
|
|
56
|
+
saturation and lightness; `background` forces dark or light, and `auto` matches
|
|
57
|
+
the named preset's own background. Pass the result straight to
|
|
58
|
+
`install_shader` as `colors` and `bg`.
|
|
59
|
+
|
|
60
|
+
## Where it writes
|
|
61
|
+
|
|
62
|
+
The server writes only inside the workspace the client launched it in
|
|
63
|
+
(`SHADERMESH_PROJECT_ROOT` overrides it). Tool arguments come from a model
|
|
64
|
+
reading a conversation, so they are treated as untrusted: absolute paths and
|
|
65
|
+
`..` escapes are refused rather than normalised.
|
|
66
|
+
|
|
67
|
+
It reads `shadermesh.json` when the project has one. If not, it infers
|
|
68
|
+
TypeScript vs JavaScript, `src/` vs root, Tailwind and the path alias from
|
|
69
|
+
what is actually on disk — `shadermesh init` is not a prerequisite.
|
|
70
|
+
|
|
71
|
+
## Licensing
|
|
72
|
+
|
|
73
|
+
Pro presets need a key, read from `SHADERMESH_LICENSE_KEY` or
|
|
74
|
+
`~/.shadermeshrc`. The server never asks for a key through the conversation;
|
|
75
|
+
when one is missing it tells the assistant to have the user run
|
|
76
|
+
`npx shadermesh-cli auth` in their own terminal instead.
|
|
77
|
+
|
|
78
|
+
## Self-hosting
|
|
79
|
+
|
|
80
|
+
`SHADERMESH_REGISTRY_URL=http://localhost:3000` points the server at a local
|
|
81
|
+
registry.
|
|
82
|
+
|
|
83
|
+
## Development
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pnpm --filter shadermesh-mcp build
|
|
87
|
+
node packages/mcp-server/scripts/smoke.mjs /path/to/a/project # protocol check
|
|
88
|
+
node packages/mcp-server/scripts/scenario.mjs /path/to/a/project # the full flow
|
|
89
|
+
```
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
+
|
|
7
|
+
// ../shared/src/config.ts
|
|
8
|
+
import { readFile, writeFile } from "fs/promises";
|
|
9
|
+
import { join } from "path";
|
|
10
|
+
var CONFIG_FILE = "shadermesh.json";
|
|
11
|
+
var DEFAULT_REGISTRY = process.env.SHADERMESH_REGISTRY_URL?.replace(/\/$/, "") ?? "https://shadermesh.dev";
|
|
12
|
+
async function readConfig(root) {
|
|
13
|
+
try {
|
|
14
|
+
const raw = await readFile(join(root, CONFIG_FILE), "utf8");
|
|
15
|
+
const parsed = JSON.parse(raw);
|
|
16
|
+
if (!parsed || typeof parsed !== "object") return null;
|
|
17
|
+
const config = parsed;
|
|
18
|
+
if (process.env.SHADERMESH_REGISTRY_URL) {
|
|
19
|
+
config.registry = DEFAULT_REGISTRY;
|
|
20
|
+
}
|
|
21
|
+
return config;
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// ../shared/src/detect.ts
|
|
28
|
+
import { readFile as readFile2, stat } from "fs/promises";
|
|
29
|
+
import { join as join2 } from "path";
|
|
30
|
+
async function exists(path) {
|
|
31
|
+
try {
|
|
32
|
+
await stat(path);
|
|
33
|
+
return true;
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function readJson(path) {
|
|
39
|
+
try {
|
|
40
|
+
const raw = await readFile2(path, "utf8");
|
|
41
|
+
const stripped = raw.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|[^:])\/\/.*$/gm, "$1").replace(/,(\s*[}\]])/g, "$1");
|
|
42
|
+
const parsed = JSON.parse(stripped);
|
|
43
|
+
return parsed && typeof parsed === "object" ? parsed : null;
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function dependencyVersion(pkg, name) {
|
|
49
|
+
if (!pkg) return null;
|
|
50
|
+
for (const field of ["dependencies", "devDependencies", "peerDependencies"]) {
|
|
51
|
+
const deps = pkg[field];
|
|
52
|
+
if (deps && typeof deps === "object") {
|
|
53
|
+
const value = deps[name];
|
|
54
|
+
if (typeof value === "string") return value;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function majorOf(range) {
|
|
60
|
+
if (!range) return null;
|
|
61
|
+
const match = /(\d+)/.exec(range);
|
|
62
|
+
return match ? Number(match[1]) : null;
|
|
63
|
+
}
|
|
64
|
+
async function detectProject(root) {
|
|
65
|
+
const pkg = await readJson(join2(root, "package.json"));
|
|
66
|
+
const tsconfigPath = join2(root, "tsconfig.json");
|
|
67
|
+
const typescript = await exists(tsconfigPath);
|
|
68
|
+
const srcDir = await exists(join2(root, "src"));
|
|
69
|
+
let framework = "unknown";
|
|
70
|
+
if (dependencyVersion(pkg, "next")) framework = "next";
|
|
71
|
+
else if (dependencyVersion(pkg, "@remix-run/react")) framework = "remix";
|
|
72
|
+
else if (dependencyVersion(pkg, "astro")) framework = "astro";
|
|
73
|
+
else if (dependencyVersion(pkg, "vite")) framework = "vite";
|
|
74
|
+
const tailwindRange = dependencyVersion(pkg, "tailwindcss");
|
|
75
|
+
let alias = null;
|
|
76
|
+
if (typescript) {
|
|
77
|
+
const tsconfig = await readJson(tsconfigPath);
|
|
78
|
+
const compilerOptions = tsconfig?.["compilerOptions"];
|
|
79
|
+
const paths = compilerOptions && typeof compilerOptions === "object" ? compilerOptions["paths"] : void 0;
|
|
80
|
+
if (paths && typeof paths === "object") {
|
|
81
|
+
for (const key of Object.keys(paths)) {
|
|
82
|
+
if (key.endsWith("/*")) {
|
|
83
|
+
alias = key.slice(0, -2);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
root,
|
|
91
|
+
framework,
|
|
92
|
+
typescript,
|
|
93
|
+
srcDir,
|
|
94
|
+
tailwind: Boolean(tailwindRange),
|
|
95
|
+
tailwindVersion: majorOf(tailwindRange),
|
|
96
|
+
alias
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function proposeConfig(detected, registry2) {
|
|
100
|
+
const base = detected.srcDir ? "src" : ".";
|
|
101
|
+
const components = `${base}/components/ui/shaders`.replace(/^\.\//, "");
|
|
102
|
+
const lib = `${base}/lib`.replace(/^\.\//, "");
|
|
103
|
+
const runtimeImport = detected.alias ? `${detected.alias}/lib/shader-runtime` : "../../../lib/shader-runtime";
|
|
104
|
+
return {
|
|
105
|
+
$schema: `${registry2}/schema.json`,
|
|
106
|
+
typescript: detected.typescript,
|
|
107
|
+
tailwind: detected.tailwind,
|
|
108
|
+
aliases: { components, lib, runtimeImport },
|
|
109
|
+
registry: registry2
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// ../shared/src/registry.ts
|
|
114
|
+
var RegistryError = class extends Error {
|
|
115
|
+
constructor(message, status, code) {
|
|
116
|
+
super(message);
|
|
117
|
+
this.name = "RegistryError";
|
|
118
|
+
this.status = status;
|
|
119
|
+
this.code = code;
|
|
120
|
+
}
|
|
121
|
+
/** A Pro preset was requested without a valid licence. */
|
|
122
|
+
get needsLicense() {
|
|
123
|
+
return this.status === 402 || this.status === 403;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
async function request(url, key) {
|
|
127
|
+
let response;
|
|
128
|
+
try {
|
|
129
|
+
response = await fetch(url, {
|
|
130
|
+
headers: {
|
|
131
|
+
accept: "application/json",
|
|
132
|
+
// The key travels as a bearer token so it never lands in a URL or a
|
|
133
|
+
// proxy log.
|
|
134
|
+
...key ? { authorization: `Bearer ${key}` } : {}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
} catch (error) {
|
|
138
|
+
throw new RegistryError(
|
|
139
|
+
`Could not reach the registry at ${new URL(url).origin}. ${error instanceof Error ? error.message : String(error)}`,
|
|
140
|
+
0,
|
|
141
|
+
"network"
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
if (!response.ok) {
|
|
145
|
+
let body = {};
|
|
146
|
+
try {
|
|
147
|
+
body = await response.json();
|
|
148
|
+
} catch {
|
|
149
|
+
}
|
|
150
|
+
throw new RegistryError(
|
|
151
|
+
body.message ?? `Registry responded ${response.status}.`,
|
|
152
|
+
response.status,
|
|
153
|
+
body.error ?? "http_error"
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
return await response.json();
|
|
157
|
+
}
|
|
158
|
+
async function fetchCatalog(registry2) {
|
|
159
|
+
return request(`${registry2.replace(/\/$/, "")}/api/registry`);
|
|
160
|
+
}
|
|
161
|
+
async function fetchPreset(config, slug, key, options = {}) {
|
|
162
|
+
const url = new URL(
|
|
163
|
+
`${config.registry.replace(/\/$/, "")}/api/registry/${encodeURIComponent(slug)}`
|
|
164
|
+
);
|
|
165
|
+
url.searchParams.set("ts", String(config.typescript));
|
|
166
|
+
url.searchParams.set("tailwind", String(config.tailwind));
|
|
167
|
+
url.searchParams.set("componentDir", config.aliases.components);
|
|
168
|
+
url.searchParams.set("libDir", config.aliases.lib);
|
|
169
|
+
url.searchParams.set("runtimeImport", config.aliases.runtimeImport);
|
|
170
|
+
if (options.colors) url.searchParams.set("colors", options.colors.join(","));
|
|
171
|
+
if (options.bg) url.searchParams.set("bg", options.bg);
|
|
172
|
+
return request(url.toString(), key);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// ../shared/src/rc.ts
|
|
176
|
+
import { chmod, mkdir, readFile as readFile3, writeFile as writeFile2 } from "fs/promises";
|
|
177
|
+
import { homedir } from "os";
|
|
178
|
+
import { dirname, join as join3 } from "path";
|
|
179
|
+
function rcPath() {
|
|
180
|
+
return process.env.SHADERMESH_RC ?? join3(homedir(), ".shadermeshrc");
|
|
181
|
+
}
|
|
182
|
+
async function readRc() {
|
|
183
|
+
try {
|
|
184
|
+
const raw = await readFile3(rcPath(), "utf8");
|
|
185
|
+
const parsed = JSON.parse(raw);
|
|
186
|
+
if (parsed && typeof parsed === "object") return parsed;
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
return {};
|
|
190
|
+
}
|
|
191
|
+
async function resolveLicenseKey() {
|
|
192
|
+
const fromEnv = process.env.SHADERMESH_LICENSE_KEY?.trim();
|
|
193
|
+
if (fromEnv) return fromEnv;
|
|
194
|
+
const rc = await readRc();
|
|
195
|
+
return rc.licenseKey?.trim() || void 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// src/tools/list-shaders.ts
|
|
199
|
+
import { z } from "zod";
|
|
200
|
+
var CATEGORY_ALIASES = {
|
|
201
|
+
mesh: "liquid",
|
|
202
|
+
liquid: "liquid",
|
|
203
|
+
aurora: "aurora",
|
|
204
|
+
ribbon: "aurora",
|
|
205
|
+
grain: "grain",
|
|
206
|
+
topographic: "grain",
|
|
207
|
+
glass: "glass",
|
|
208
|
+
caustics: "glass",
|
|
209
|
+
geometric: "grid",
|
|
210
|
+
grid: "grid",
|
|
211
|
+
dots: "grid",
|
|
212
|
+
cosmic: "ray",
|
|
213
|
+
ray: "ray",
|
|
214
|
+
glow: "ray"
|
|
215
|
+
};
|
|
216
|
+
var listShadersSchema = {
|
|
217
|
+
category: z.enum([
|
|
218
|
+
"all",
|
|
219
|
+
"mesh",
|
|
220
|
+
"liquid",
|
|
221
|
+
"aurora",
|
|
222
|
+
"grain",
|
|
223
|
+
"glass",
|
|
224
|
+
"geometric",
|
|
225
|
+
"grid",
|
|
226
|
+
"cosmic",
|
|
227
|
+
"ray"
|
|
228
|
+
]).optional().describe("Visual family. `mesh` maps to liquid, `geometric` to grid, `cosmic` to ray."),
|
|
229
|
+
mood: z.enum(["dark", "vibrant", "pastel", "minimal"]).optional().describe("Overall feel of the default palette."),
|
|
230
|
+
free_only: z.boolean().optional().describe("Only presets that need no licence.")
|
|
231
|
+
};
|
|
232
|
+
function describe(preset) {
|
|
233
|
+
const badge = preset.free ? "free" : "PRO";
|
|
234
|
+
return [
|
|
235
|
+
`\u2022 ${preset.slug} \u2014 ${preset.name} [${badge}, ${preset.category}, ${preset.mood}]`,
|
|
236
|
+
` ${preset.description}`,
|
|
237
|
+
` palette: ${preset.colors.join(" ")} on ${preset.bg}`
|
|
238
|
+
].join("\n");
|
|
239
|
+
}
|
|
240
|
+
async function listShaders(registry2, args) {
|
|
241
|
+
const catalog = await fetchCatalog(registry2);
|
|
242
|
+
let presets = catalog.presets;
|
|
243
|
+
if (args.category && args.category !== "all") {
|
|
244
|
+
const resolved = CATEGORY_ALIASES[args.category] ?? args.category;
|
|
245
|
+
presets = presets.filter((preset) => preset.category === resolved);
|
|
246
|
+
}
|
|
247
|
+
if (args.mood) presets = presets.filter((preset) => preset.mood === args.mood);
|
|
248
|
+
if (args.free_only) presets = presets.filter((preset) => preset.free);
|
|
249
|
+
if (presets.length === 0) {
|
|
250
|
+
return {
|
|
251
|
+
content: [
|
|
252
|
+
{
|
|
253
|
+
type: "text",
|
|
254
|
+
text: `No presets match that filter. The catalog has ${catalog.count} presets across liquid, aurora, grain, glass, grid and ray. Try category "all".`
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
structuredContent: { count: 0, presets: [] }
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
const header = `${presets.length} of ${catalog.count} presets` + (args.category && args.category !== "all" ? ` in ${args.category}` : "") + (args.mood ? `, ${args.mood} mood` : "");
|
|
261
|
+
return {
|
|
262
|
+
content: [
|
|
263
|
+
{
|
|
264
|
+
type: "text",
|
|
265
|
+
text: [
|
|
266
|
+
header,
|
|
267
|
+
"",
|
|
268
|
+
presets.map(describe).join("\n\n"),
|
|
269
|
+
"",
|
|
270
|
+
"Install one with the install_shader tool, or `npx shadermesh-cli add <slug>`."
|
|
271
|
+
].join("\n")
|
|
272
|
+
}
|
|
273
|
+
],
|
|
274
|
+
structuredContent: {
|
|
275
|
+
count: presets.length,
|
|
276
|
+
presets: presets.map((preset) => ({
|
|
277
|
+
slug: preset.slug,
|
|
278
|
+
name: preset.name,
|
|
279
|
+
category: preset.category,
|
|
280
|
+
mood: preset.mood,
|
|
281
|
+
description: preset.description,
|
|
282
|
+
free: preset.free,
|
|
283
|
+
colors: preset.colors,
|
|
284
|
+
bg: preset.bg
|
|
285
|
+
}))
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// src/tools/install-shader.ts
|
|
291
|
+
import { z as z2 } from "zod";
|
|
292
|
+
|
|
293
|
+
// src/lib/workspace.ts
|
|
294
|
+
import { mkdir as mkdir2, stat as stat2, writeFile as writeFile3 } from "fs/promises";
|
|
295
|
+
import { dirname as dirname2, isAbsolute, join as join4, relative, resolve } from "path";
|
|
296
|
+
function workspaceRoot() {
|
|
297
|
+
return process.env.SHADERMESH_PROJECT_ROOT ? resolve(process.env.SHADERMESH_PROJECT_ROOT) : process.cwd();
|
|
298
|
+
}
|
|
299
|
+
function safeJoin(root, candidate) {
|
|
300
|
+
if (isAbsolute(candidate)) return null;
|
|
301
|
+
const target = resolve(root, candidate);
|
|
302
|
+
const rel = relative(root, target);
|
|
303
|
+
if (rel.startsWith("..") || isAbsolute(rel)) return null;
|
|
304
|
+
return target;
|
|
305
|
+
}
|
|
306
|
+
async function exists2(path) {
|
|
307
|
+
try {
|
|
308
|
+
await stat2(path);
|
|
309
|
+
return true;
|
|
310
|
+
} catch {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
async function resolveProjectConfig(root) {
|
|
315
|
+
const existing = await readConfig(root);
|
|
316
|
+
if (existing) return { config: existing, source: "shadermesh.json" };
|
|
317
|
+
const detected = await detectProject(root);
|
|
318
|
+
return { config: proposeConfig(detected, DEFAULT_REGISTRY), source: "detected" };
|
|
319
|
+
}
|
|
320
|
+
async function writeFileSafely(root, relPath, content, overwrite) {
|
|
321
|
+
const target = safeJoin(root, relPath);
|
|
322
|
+
if (!target) {
|
|
323
|
+
return { path: relPath, written: false, reason: "path escapes the project root" };
|
|
324
|
+
}
|
|
325
|
+
if (await exists2(target) && !overwrite) {
|
|
326
|
+
return { path: relPath, written: false, reason: "already exists" };
|
|
327
|
+
}
|
|
328
|
+
await mkdir2(dirname2(target), { recursive: true });
|
|
329
|
+
await writeFile3(target, content, "utf8");
|
|
330
|
+
return { path: relPath, written: true };
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// src/tools/install-shader.ts
|
|
334
|
+
var HEX = /^#?[0-9a-fA-F]{6}$/;
|
|
335
|
+
var installShaderSchema = {
|
|
336
|
+
slug: z2.string().describe("Preset slug, e.g. `aurora-silk`. Use list_shaders to find one."),
|
|
337
|
+
targetDir: z2.string().optional().describe(
|
|
338
|
+
"Where to write the component, relative to the project root. Defaults to the project's shadermesh.json, or src/components/ui/shaders."
|
|
339
|
+
),
|
|
340
|
+
colors: z2.array(z2.string()).length(3).optional().describe("Three hex colours baked in as the component's defaults. Pass the output of customize_shader_palette."),
|
|
341
|
+
bg: z2.string().optional().describe("Background hex baked in as the component's default. Pass alongside colours from customize_shader_palette."),
|
|
342
|
+
overwrite: z2.boolean().optional().describe("Replace files that already exist. Defaults to false.")
|
|
343
|
+
};
|
|
344
|
+
async function installShader(args) {
|
|
345
|
+
const root = workspaceRoot();
|
|
346
|
+
const { config, source } = await resolveProjectConfig(root);
|
|
347
|
+
if (args.targetDir) {
|
|
348
|
+
if (!safeJoin(root, args.targetDir)) {
|
|
349
|
+
return {
|
|
350
|
+
isError: true,
|
|
351
|
+
content: [
|
|
352
|
+
{
|
|
353
|
+
type: "text",
|
|
354
|
+
text: `Refusing to write to "${args.targetDir}": it resolves outside the project root (${root}).`
|
|
355
|
+
}
|
|
356
|
+
]
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
config.aliases.components = args.targetDir;
|
|
360
|
+
}
|
|
361
|
+
let colors;
|
|
362
|
+
if (args.colors) {
|
|
363
|
+
const normalised = args.colors.map((c) => c.startsWith("#") ? c : `#${c}`);
|
|
364
|
+
if (!normalised.every((c) => HEX.test(c))) {
|
|
365
|
+
return {
|
|
366
|
+
isError: true,
|
|
367
|
+
content: [
|
|
368
|
+
{
|
|
369
|
+
type: "text",
|
|
370
|
+
text: `Those colours are not six-digit hex values: ${args.colors.join(", ")}`
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
colors = [normalised[0], normalised[1], normalised[2]];
|
|
376
|
+
}
|
|
377
|
+
let bg;
|
|
378
|
+
if (args.bg) {
|
|
379
|
+
const candidate = args.bg.startsWith("#") ? args.bg : `#${args.bg}`;
|
|
380
|
+
if (!HEX.test(candidate)) {
|
|
381
|
+
return {
|
|
382
|
+
isError: true,
|
|
383
|
+
content: [
|
|
384
|
+
{ type: "text", text: `"${args.bg}" is not a six-digit hex colour.` }
|
|
385
|
+
]
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
bg = candidate;
|
|
389
|
+
}
|
|
390
|
+
const key = await resolveLicenseKey();
|
|
391
|
+
let payload;
|
|
392
|
+
try {
|
|
393
|
+
payload = await fetchPreset(config, args.slug, key, {
|
|
394
|
+
...colors ? { colors } : {},
|
|
395
|
+
...bg ? { bg } : {}
|
|
396
|
+
});
|
|
397
|
+
} catch (error) {
|
|
398
|
+
if (error instanceof RegistryError && error.needsLicense) {
|
|
399
|
+
return {
|
|
400
|
+
isError: true,
|
|
401
|
+
content: [
|
|
402
|
+
{
|
|
403
|
+
type: "text",
|
|
404
|
+
text: `"${args.slug}" is a Pro preset and no valid licence was found.
|
|
405
|
+
|
|
406
|
+
Ask the user to run \`npx shadermesh-cli auth\` in their terminal, or to set SHADERMESH_LICENSE_KEY. Do not ask them to paste the key into this chat.
|
|
407
|
+
|
|
408
|
+
Free alternatives are available via list_shaders with free_only: true.`
|
|
409
|
+
}
|
|
410
|
+
]
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
return {
|
|
414
|
+
isError: true,
|
|
415
|
+
content: [
|
|
416
|
+
{
|
|
417
|
+
type: "text",
|
|
418
|
+
text: error instanceof Error ? error.message : String(error)
|
|
419
|
+
}
|
|
420
|
+
]
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
const results = [];
|
|
424
|
+
for (const file of payload.files) {
|
|
425
|
+
const overwrite = file.kind === "runtime" ? false : args.overwrite ?? false;
|
|
426
|
+
results.push(await writeFileSafely(root, file.path, file.content, overwrite));
|
|
427
|
+
}
|
|
428
|
+
const written = results.filter((r) => r.written);
|
|
429
|
+
const skipped = results.filter((r) => !r.written);
|
|
430
|
+
const lines = [
|
|
431
|
+
`Installed ${payload.name} (${payload.category}) into ${root}.`,
|
|
432
|
+
"",
|
|
433
|
+
...written.map((r) => ` wrote ${r.path}`),
|
|
434
|
+
...skipped.map((r) => ` skipped ${r.path} \u2014 ${r.reason}`),
|
|
435
|
+
"",
|
|
436
|
+
`Project settings came from ${source}.`,
|
|
437
|
+
"",
|
|
438
|
+
"Usage:",
|
|
439
|
+
"",
|
|
440
|
+
payload.usage,
|
|
441
|
+
"",
|
|
442
|
+
'The component fills its parent, so give it a height (`className="h-screen"`).',
|
|
443
|
+
"Children render above the canvas automatically."
|
|
444
|
+
];
|
|
445
|
+
if (skipped.some((r) => r.reason === "already exists" && !r.path.includes("shader-runtime"))) {
|
|
446
|
+
lines.push("", "Pass overwrite: true to replace the existing component.");
|
|
447
|
+
}
|
|
448
|
+
return {
|
|
449
|
+
content: [{ type: "text", text: lines.join("\n") }],
|
|
450
|
+
structuredContent: {
|
|
451
|
+
slug: payload.slug,
|
|
452
|
+
component: payload.component,
|
|
453
|
+
root,
|
|
454
|
+
written: written.map((r) => r.path),
|
|
455
|
+
skipped: skipped.map((r) => ({ path: r.path, reason: r.reason })),
|
|
456
|
+
usage: payload.usage,
|
|
457
|
+
...colors ? { colors } : {},
|
|
458
|
+
...bg ? { bg } : {}
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// src/tools/customize-palette.ts
|
|
464
|
+
import { z as z3 } from "zod";
|
|
465
|
+
|
|
466
|
+
// src/lib/color.ts
|
|
467
|
+
var clamp = (value, min = 0, max = 1) => Math.min(max, Math.max(min, value));
|
|
468
|
+
function parseHex(input) {
|
|
469
|
+
let hex = input.trim().replace(/^#/, "");
|
|
470
|
+
if (hex.length === 3) hex = hex.replace(/./g, (c) => c + c);
|
|
471
|
+
if (!/^[0-9a-fA-F]{6}$/.test(hex)) return null;
|
|
472
|
+
const r = parseInt(hex.slice(0, 2), 16) / 255;
|
|
473
|
+
const g = parseInt(hex.slice(2, 4), 16) / 255;
|
|
474
|
+
const b = parseInt(hex.slice(4, 6), 16) / 255;
|
|
475
|
+
const max = Math.max(r, g, b);
|
|
476
|
+
const min = Math.min(r, g, b);
|
|
477
|
+
const l = (max + min) / 2;
|
|
478
|
+
const delta = max - min;
|
|
479
|
+
if (delta === 0) return { h: 0, s: 0, l };
|
|
480
|
+
const s = delta / (1 - Math.abs(2 * l - 1));
|
|
481
|
+
let h;
|
|
482
|
+
if (max === r) h = (g - b) / delta % 6;
|
|
483
|
+
else if (max === g) h = (b - r) / delta + 2;
|
|
484
|
+
else h = (r - g) / delta + 4;
|
|
485
|
+
h *= 60;
|
|
486
|
+
if (h < 0) h += 360;
|
|
487
|
+
return { h, s: clamp(s), l: clamp(l) };
|
|
488
|
+
}
|
|
489
|
+
function toHex({ h, s, l }) {
|
|
490
|
+
const hue = (h % 360 + 360) % 360;
|
|
491
|
+
const sat = clamp(s);
|
|
492
|
+
const lum = clamp(l);
|
|
493
|
+
const c = (1 - Math.abs(2 * lum - 1)) * sat;
|
|
494
|
+
const x = c * (1 - Math.abs(hue / 60 % 2 - 1));
|
|
495
|
+
const m = lum - c / 2;
|
|
496
|
+
let rgb;
|
|
497
|
+
if (hue < 60) rgb = [c, x, 0];
|
|
498
|
+
else if (hue < 120) rgb = [x, c, 0];
|
|
499
|
+
else if (hue < 180) rgb = [0, c, x];
|
|
500
|
+
else if (hue < 240) rgb = [0, x, c];
|
|
501
|
+
else if (hue < 300) rgb = [x, 0, c];
|
|
502
|
+
else rgb = [c, 0, x];
|
|
503
|
+
return `#${rgb.map(
|
|
504
|
+
(channel) => Math.round((channel + m) * 255).toString(16).padStart(2, "0")
|
|
505
|
+
).join("")}`;
|
|
506
|
+
}
|
|
507
|
+
function luminance(hex) {
|
|
508
|
+
const h = hex.replace(/^#/, "");
|
|
509
|
+
if (h.length !== 6) return 0;
|
|
510
|
+
const channels = [0, 2, 4].map((i) => {
|
|
511
|
+
const v = parseInt(h.slice(i, i + 2), 16) / 255;
|
|
512
|
+
return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
|
|
513
|
+
});
|
|
514
|
+
return 0.2126 * channels[0] + 0.7152 * channels[1] + 0.0722 * channels[2];
|
|
515
|
+
}
|
|
516
|
+
var SCHEME_OFFSETS = {
|
|
517
|
+
analogous: [0, 32, -28],
|
|
518
|
+
complementary: [0, 180, 150],
|
|
519
|
+
triadic: [0, 120, 240],
|
|
520
|
+
monochrome: [0, 0, 0]
|
|
521
|
+
};
|
|
522
|
+
var MOOD_TARGETS = {
|
|
523
|
+
// Deep and cinematic: a mid base, a darker partner, one bright accent.
|
|
524
|
+
dark: { s: [0.72, 0.68, 0.85], l: [0.52, 0.38, 0.72] },
|
|
525
|
+
// Pushed saturation across the board.
|
|
526
|
+
vibrant: { s: [0.9, 0.85, 0.95], l: [0.56, 0.5, 0.68] },
|
|
527
|
+
// Washed and airy.
|
|
528
|
+
pastel: { s: [0.45, 0.4, 0.5], l: [0.78, 0.72, 0.86] },
|
|
529
|
+
// Nearly neutral, with just enough hue to avoid looking grey.
|
|
530
|
+
minimal: { s: [0.22, 0.16, 0.3], l: [0.55, 0.42, 0.72] }
|
|
531
|
+
};
|
|
532
|
+
function buildPalette(brandHex, options = {}) {
|
|
533
|
+
const brand = parseHex(brandHex);
|
|
534
|
+
if (!brand) return null;
|
|
535
|
+
const scheme = options.scheme ?? "analogous";
|
|
536
|
+
const mood = options.mood ?? "dark";
|
|
537
|
+
const offsets = SCHEME_OFFSETS[scheme];
|
|
538
|
+
const targets = MOOD_TARGETS[mood];
|
|
539
|
+
const stops = [];
|
|
540
|
+
const rationale = [];
|
|
541
|
+
for (let i = 0; i < 3; i++) {
|
|
542
|
+
const offset = offsets[i];
|
|
543
|
+
const targetS = targets.s[i];
|
|
544
|
+
const targetL = targets.l[i];
|
|
545
|
+
const l = scheme === "monochrome" ? clamp(targetL + (i - 1) * 0.14) : targetL;
|
|
546
|
+
const s = i === 0 ? clamp((brand.s + targetS) / 2) : targetS;
|
|
547
|
+
const stop = toHex({ h: brand.h + offset, s, l });
|
|
548
|
+
stops.push(stop);
|
|
549
|
+
if (i === 0) {
|
|
550
|
+
rationale.push(`${stop} \u2014 your brand hue (${Math.round(brand.h)}\xB0), retuned for the ${mood} mood.`);
|
|
551
|
+
} else if (scheme === "monochrome") {
|
|
552
|
+
rationale.push(`${stop} \u2014 same hue, lightness ${Math.round(l * 100)}%.`);
|
|
553
|
+
} else {
|
|
554
|
+
rationale.push(
|
|
555
|
+
`${stop} \u2014 hue rotated ${offset > 0 ? "+" : ""}${offset}\xB0 (${scheme}).`
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
const wantsLight = options.background === "light" || options.background !== "dark" && (mood === "pastel" || mood === "minimal");
|
|
560
|
+
const bg = toHex({
|
|
561
|
+
h: brand.h,
|
|
562
|
+
s: wantsLight ? clamp(brand.s * 0.12) : clamp(brand.s * 0.45),
|
|
563
|
+
l: wantsLight ? 0.975 : 0.045
|
|
564
|
+
});
|
|
565
|
+
rationale.push(
|
|
566
|
+
`${bg} \u2014 ${wantsLight ? "near-white" : "near-black"} carrying a trace of the brand hue, so the background never reads as flat ${wantsLight ? "white" : "black"}.`
|
|
567
|
+
);
|
|
568
|
+
return {
|
|
569
|
+
colors: [stops[0], stops[1], stops[2]],
|
|
570
|
+
bg,
|
|
571
|
+
scheme,
|
|
572
|
+
mood,
|
|
573
|
+
rationale
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// src/tools/customize-palette.ts
|
|
578
|
+
var customizePaletteSchema = {
|
|
579
|
+
brand_color: z3.string().describe("The brand colour as hex, e.g. `#7c3aed`. It becomes the first stop."),
|
|
580
|
+
slug: z3.string().optional().describe("Preset the palette is for. Used to match the background's lightness and to build the snippet."),
|
|
581
|
+
scheme: z3.enum(["analogous", "complementary", "triadic", "monochrome"]).optional().describe("Hue relationship between the three stops. Defaults to analogous."),
|
|
582
|
+
mood: z3.enum(["dark", "vibrant", "pastel", "minimal"]).optional().describe("How saturated and light the stops should be. Defaults to dark."),
|
|
583
|
+
background: z3.enum(["dark", "light", "auto"]).optional().describe("Force a dark or light background. `auto` follows the preset, then the mood.")
|
|
584
|
+
};
|
|
585
|
+
function pascal(slug) {
|
|
586
|
+
return slug.split(/[-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
587
|
+
}
|
|
588
|
+
async function customizePalette(registry2, args) {
|
|
589
|
+
let background = args.background ?? "auto";
|
|
590
|
+
let presetNote = "";
|
|
591
|
+
if (args.slug && background === "auto") {
|
|
592
|
+
try {
|
|
593
|
+
const catalog = await fetchCatalog(registry2);
|
|
594
|
+
const preset = catalog.presets.find((p) => p.slug === args.slug);
|
|
595
|
+
if (preset) {
|
|
596
|
+
background = luminance(preset.bg) > 0.4 ? "light" : "dark";
|
|
597
|
+
presetNote = `Matched to ${preset.name}, which is authored on ${preset.bg}.`;
|
|
598
|
+
}
|
|
599
|
+
} catch {
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
const palette = buildPalette(args.brand_color, {
|
|
603
|
+
...args.scheme ? { scheme: args.scheme } : {},
|
|
604
|
+
...args.mood ? { mood: args.mood } : {},
|
|
605
|
+
background
|
|
606
|
+
});
|
|
607
|
+
if (!palette) {
|
|
608
|
+
return {
|
|
609
|
+
isError: true,
|
|
610
|
+
content: [
|
|
611
|
+
{
|
|
612
|
+
type: "text",
|
|
613
|
+
text: `"${args.brand_color}" is not a hex colour. Use a form like #7c3aed.`
|
|
614
|
+
}
|
|
615
|
+
]
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
const component = args.slug ? pascal(args.slug) : "ShaderMesh";
|
|
619
|
+
const snippet = args.slug ? [
|
|
620
|
+
`<${component}`,
|
|
621
|
+
` colors={["${palette.colors[0]}", "${palette.colors[1]}", "${palette.colors[2]}"]}`,
|
|
622
|
+
` bg="${palette.bg}"`,
|
|
623
|
+
` className="h-screen"`,
|
|
624
|
+
`/>`
|
|
625
|
+
].join("\n") : [
|
|
626
|
+
`<ShaderMesh`,
|
|
627
|
+
` preset={preset}`,
|
|
628
|
+
` colors={["${palette.colors[0]}", "${palette.colors[1]}", "${palette.colors[2]}"]}`,
|
|
629
|
+
` bg="${palette.bg}"`,
|
|
630
|
+
`/>`
|
|
631
|
+
].join("\n");
|
|
632
|
+
const cli = args.slug ? `npx shadermesh-cli add ${args.slug}` : "npx shadermesh-cli add <slug>";
|
|
633
|
+
return {
|
|
634
|
+
content: [
|
|
635
|
+
{
|
|
636
|
+
type: "text",
|
|
637
|
+
text: [
|
|
638
|
+
`${palette.scheme} palette, ${palette.mood} mood, from ${args.brand_color}:`,
|
|
639
|
+
"",
|
|
640
|
+
...palette.rationale.map((line) => ` ${line}`),
|
|
641
|
+
...presetNote ? ["", presetNote] : [],
|
|
642
|
+
"",
|
|
643
|
+
"Props:",
|
|
644
|
+
"",
|
|
645
|
+
snippet,
|
|
646
|
+
"",
|
|
647
|
+
`Install the component first with install_shader, or \`${cli}\`.`
|
|
648
|
+
].join("\n")
|
|
649
|
+
}
|
|
650
|
+
],
|
|
651
|
+
structuredContent: {
|
|
652
|
+
colors: palette.colors,
|
|
653
|
+
bg: palette.bg,
|
|
654
|
+
scheme: palette.scheme,
|
|
655
|
+
mood: palette.mood,
|
|
656
|
+
...args.slug ? { slug: args.slug, component } : {},
|
|
657
|
+
snippet
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// src/index.ts
|
|
663
|
+
var VERSION = "0.1.0";
|
|
664
|
+
var registry = DEFAULT_REGISTRY;
|
|
665
|
+
var server = new McpServer(
|
|
666
|
+
{ name: "shadermesh", version: VERSION },
|
|
667
|
+
{
|
|
668
|
+
instructions: [
|
|
669
|
+
"shadermesh provides interactive WebGL mesh-gradient and micro-shader backgrounds.",
|
|
670
|
+
"",
|
|
671
|
+
"Typical flow: call list_shaders to find a preset that matches the request",
|
|
672
|
+
"(category and mood are the useful filters), then install_shader to write a",
|
|
673
|
+
"self-contained component into the user's project. The component has no",
|
|
674
|
+
"runtime dependency on any package \u2014 the source is copied in.",
|
|
675
|
+
"",
|
|
676
|
+
"If the user mentions a brand colour, call customize_shader_palette first and",
|
|
677
|
+
"pass the resulting colours to install_shader.",
|
|
678
|
+
"",
|
|
679
|
+
"Pro presets need a licence key. Never ask the user to paste a key into the",
|
|
680
|
+
"conversation: tell them to run `npx shadermesh-cli auth` in their terminal."
|
|
681
|
+
].join("\n")
|
|
682
|
+
}
|
|
683
|
+
);
|
|
684
|
+
server.registerTool(
|
|
685
|
+
"list_shaders",
|
|
686
|
+
{
|
|
687
|
+
title: "List shader presets",
|
|
688
|
+
description: "Browse the shader catalog by category and mood. Returns slugs, descriptions, default palettes and whether each preset is free or Pro.",
|
|
689
|
+
inputSchema: listShadersSchema
|
|
690
|
+
},
|
|
691
|
+
async (args) => listShaders(registry, args)
|
|
692
|
+
);
|
|
693
|
+
server.registerTool(
|
|
694
|
+
"install_shader",
|
|
695
|
+
{
|
|
696
|
+
title: "Install a shader component",
|
|
697
|
+
description: "Write a self-contained shader background component into the user's project, along with the shared runtime if it is missing. Returns the exact JSX to use it.",
|
|
698
|
+
inputSchema: installShaderSchema
|
|
699
|
+
},
|
|
700
|
+
async (args) => installShader(args)
|
|
701
|
+
);
|
|
702
|
+
server.registerTool(
|
|
703
|
+
"customize_shader_palette",
|
|
704
|
+
{
|
|
705
|
+
title: "Build a palette from a brand colour",
|
|
706
|
+
description: "Turn one brand hex colour into a harmonious three-stop palette plus a background, ready to pass to a shader component.",
|
|
707
|
+
inputSchema: customizePaletteSchema
|
|
708
|
+
},
|
|
709
|
+
async (args) => customizePalette(registry, args)
|
|
710
|
+
);
|
|
711
|
+
async function main() {
|
|
712
|
+
const transport = new StdioServerTransport();
|
|
713
|
+
await server.connect(transport);
|
|
714
|
+
process.stderr.write(
|
|
715
|
+
`shadermesh mcp ${VERSION} \xB7 registry ${registry} \xB7 workspace ${workspaceRoot()}
|
|
716
|
+
`
|
|
717
|
+
);
|
|
718
|
+
}
|
|
719
|
+
main().catch((error) => {
|
|
720
|
+
process.stderr.write(
|
|
721
|
+
`shadermesh mcp failed to start: ${error instanceof Error ? error.stack ?? error.message : String(error)}
|
|
722
|
+
`
|
|
723
|
+
);
|
|
724
|
+
process.exit(1);
|
|
725
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shadermesh-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for shadermesh — browse, install and recolour interactive WebGL shader backgrounds from Claude Code, Cursor or Windsurf.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"shadermesh-mcp": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"mcp",
|
|
17
|
+
"model-context-protocol",
|
|
18
|
+
"shadermesh",
|
|
19
|
+
"webgl",
|
|
20
|
+
"shader",
|
|
21
|
+
"claude"
|
|
22
|
+
],
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
25
|
+
"zod": "^4.6.7"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^22.10.2",
|
|
29
|
+
"tsup": "^8.3.5",
|
|
30
|
+
"typescript": "^5.7.2",
|
|
31
|
+
"shadermesh-shared": "0.1.0"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsup",
|
|
41
|
+
"dev": "tsup --watch",
|
|
42
|
+
"typecheck": "tsc --noEmit"
|
|
43
|
+
}
|
|
6
44
|
}
|