@genart-dev/mcp-server 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 +264 -0
- package/dist/index.cjs +0 -0
- package/package.json +13 -9
package/README.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# @genart-dev/mcp-server
|
|
2
|
+
|
|
3
|
+
[Model Context Protocol](https://modelcontextprotocol.io) server for [genart.dev](https://genart.dev) — 33 tools, 4 resources, and 3 prompts for creating and manipulating generative art with AI agents.
|
|
4
|
+
|
|
5
|
+
Works with any MCP client: [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Claude Desktop](https://claude.ai/download), [Codex CLI](https://github.com/openai/codex), [Cursor](https://cursor.sh), and more.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @genart-dev/mcp-server
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For screenshot/export capture, also install Puppeteer:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g puppeteer
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
### Claude Code
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
claude mcp add genart-mcp -- genart-mcp
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Claude Desktop
|
|
28
|
+
|
|
29
|
+
Add to `claude_desktop_config.json`:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"genart": {
|
|
35
|
+
"command": "genart-mcp"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Codex CLI
|
|
42
|
+
|
|
43
|
+
Add to `.codex/config.toml`:
|
|
44
|
+
|
|
45
|
+
```toml
|
|
46
|
+
[mcp_servers.genart]
|
|
47
|
+
command = "genart-mcp"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then ask your AI agent to create generative art:
|
|
51
|
+
|
|
52
|
+
> "Create a workspace with a p5.js sketch that draws a grid of rotating squares using the golden ratio"
|
|
53
|
+
|
|
54
|
+
## Tools (33)
|
|
55
|
+
|
|
56
|
+
### Workspace (5)
|
|
57
|
+
|
|
58
|
+
| Tool | Description |
|
|
59
|
+
|------|-------------|
|
|
60
|
+
| `create_workspace` | Create a new `.genart-workspace` with optional initial sketches |
|
|
61
|
+
| `open_workspace` | Open an existing `.genart-workspace` and load all sketches |
|
|
62
|
+
| `add_sketch_to_workspace` | Add an existing `.genart` file to the active workspace |
|
|
63
|
+
| `remove_sketch_from_workspace` | Remove a sketch from workspace (optionally delete file) |
|
|
64
|
+
| `list_workspace_sketches` | List all sketches with metadata summaries |
|
|
65
|
+
|
|
66
|
+
### Sketch Lifecycle (7)
|
|
67
|
+
|
|
68
|
+
| Tool | Description |
|
|
69
|
+
|------|-------------|
|
|
70
|
+
| `create_sketch` | Create a new `.genart` sketch — supports all 5 renderers |
|
|
71
|
+
| `open_sketch` | Open a sketch by ID and set selection |
|
|
72
|
+
| `update_sketch` | Update metadata, parameters, colors, canvas |
|
|
73
|
+
| `update_algorithm` | Replace algorithm source code with optional validation |
|
|
74
|
+
| `save_sketch` | Persist in-memory state to disk |
|
|
75
|
+
| `fork_sketch` | Create a variant with new ID and optional modifications |
|
|
76
|
+
| `delete_sketch` | Delete sketch file and remove from workspace |
|
|
77
|
+
|
|
78
|
+
### Selection & Context (4)
|
|
79
|
+
|
|
80
|
+
| Tool | Description |
|
|
81
|
+
|------|-------------|
|
|
82
|
+
| `get_selection` | Full context for selected sketch(es) — algorithm, params, colors, philosophy |
|
|
83
|
+
| `select_sketch` | Set canvas selection to one or more sketches |
|
|
84
|
+
| `get_editor_state` | Full snapshot of workspace, sketches, and selection |
|
|
85
|
+
| `set_working_directory` | Set base directory for sandboxed file operations |
|
|
86
|
+
|
|
87
|
+
### Parameters (5)
|
|
88
|
+
|
|
89
|
+
| Tool | Description |
|
|
90
|
+
|------|-------------|
|
|
91
|
+
| `set_parameters` | Update runtime parameter values |
|
|
92
|
+
| `set_colors` | Update runtime color palette values |
|
|
93
|
+
| `set_seed` | Set random seed (or generate random) |
|
|
94
|
+
| `set_canvas_size` | Change dimensions via preset or explicit W/H |
|
|
95
|
+
| `randomize_parameters` | Generate random values for all/specific parameters |
|
|
96
|
+
|
|
97
|
+
### Arrangement (3)
|
|
98
|
+
|
|
99
|
+
| Tool | Description |
|
|
100
|
+
|------|-------------|
|
|
101
|
+
| `arrange_sketches` | Move sketches to explicit canvas positions |
|
|
102
|
+
| `auto_arrange` | Auto-layout with grid, row, column, or masonry |
|
|
103
|
+
| `group_sketches` | Create/update named groups of sketches |
|
|
104
|
+
|
|
105
|
+
### Gallery (2)
|
|
106
|
+
|
|
107
|
+
| Tool | Description |
|
|
108
|
+
|------|-------------|
|
|
109
|
+
| `list_sketches` | Scan a directory for `.genart` files with metadata |
|
|
110
|
+
| `search_sketches` | Search loaded sketches by title, renderer, params, skills |
|
|
111
|
+
|
|
112
|
+
### Merge (1)
|
|
113
|
+
|
|
114
|
+
| Tool | Description |
|
|
115
|
+
|------|-------------|
|
|
116
|
+
| `merge_sketches` | Combine parameters, colors, and philosophies from 2+ sketches |
|
|
117
|
+
|
|
118
|
+
### Capture (3)
|
|
119
|
+
|
|
120
|
+
| Tool | Description |
|
|
121
|
+
|------|-------------|
|
|
122
|
+
| `capture_screenshot` | Headless capture of a sketch — returns metadata + inline JPEG for AI viewing |
|
|
123
|
+
| `capture_batch` | Capture multiple sketches in parallel |
|
|
124
|
+
| `snapshot_layout` | Structural summary of workspace layout for spatial reasoning |
|
|
125
|
+
|
|
126
|
+
### Export (1)
|
|
127
|
+
|
|
128
|
+
| Tool | Description |
|
|
129
|
+
|------|-------------|
|
|
130
|
+
| `export_sketch` | Export as standalone HTML, PNG, SVG, raw algorithm, or ZIP bundle |
|
|
131
|
+
|
|
132
|
+
### Knowledge (3)
|
|
133
|
+
|
|
134
|
+
| Tool | Description |
|
|
135
|
+
|------|-------------|
|
|
136
|
+
| `list_skills` | List available design knowledge skills by category |
|
|
137
|
+
| `load_skill` | Load a skill with full theory, principles, and examples |
|
|
138
|
+
| `get_guidelines` | Design guidelines for composition, color, parameters, animation, performance |
|
|
139
|
+
|
|
140
|
+
## Resources (4)
|
|
141
|
+
|
|
142
|
+
| URI | Description |
|
|
143
|
+
|-----|-------------|
|
|
144
|
+
| `genart://skills` | Available design knowledge skills |
|
|
145
|
+
| `genart://presets/canvas` | Canvas dimension presets (18 built-in) |
|
|
146
|
+
| `genart://gallery` | Loaded sketches with metadata summaries |
|
|
147
|
+
| `genart://renderers` | Available renderer types and metadata |
|
|
148
|
+
|
|
149
|
+
## Prompts (3)
|
|
150
|
+
|
|
151
|
+
| Prompt | Description |
|
|
152
|
+
|--------|-------------|
|
|
153
|
+
| `create-generative-art` | Guided workflow: concept → sketch → algorithm → capture → iterate |
|
|
154
|
+
| `explore-variations` | Fork and explore parameter/seed space across multiple variants |
|
|
155
|
+
| `apply-design-theory` | Apply Gestalt, color theory, composition, rhythm, or contrast principles |
|
|
156
|
+
|
|
157
|
+
## Supported Renderers
|
|
158
|
+
|
|
159
|
+
| Type | Runtime | Algorithm |
|
|
160
|
+
|------|---------|-----------|
|
|
161
|
+
| `p5` | p5.js | `function sketch(p, state) { ... }` |
|
|
162
|
+
| `three` | Three.js | `function sketch(THREE, state, container) { ... }` |
|
|
163
|
+
| `glsl` | WebGL2 | Fragment shader source |
|
|
164
|
+
| `canvas2d` | Native | `function sketch(ctx, state) { ... }` |
|
|
165
|
+
| `svg` | Native | `function sketch(state) { ... }` |
|
|
166
|
+
|
|
167
|
+
## Library API
|
|
168
|
+
|
|
169
|
+
For programmatic use (e.g., building a custom MCP host):
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
import { createServer, EditorState } from "@genart-dev/mcp-server/lib";
|
|
173
|
+
|
|
174
|
+
const state = new EditorState();
|
|
175
|
+
const server = createServer(state);
|
|
176
|
+
|
|
177
|
+
// Connect to any MCP transport
|
|
178
|
+
// ...
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Exports from `@genart-dev/mcp-server/lib`
|
|
182
|
+
|
|
183
|
+
| Export | Description |
|
|
184
|
+
|--------|-------------|
|
|
185
|
+
| `createServer(state)` | Create a configured `McpServer` instance |
|
|
186
|
+
| `EditorState` | Server-scoped mutable state (workspace, sketches, selection) |
|
|
187
|
+
| `LoadedSketch` | Type — sketch definition + file path + dirty flag |
|
|
188
|
+
| `EditorMutationType` | Type — mutation event names (`sketch:created`, `workspace:loaded`, etc.) |
|
|
189
|
+
| `EditorMutationEvent` | Type — mutation event payload |
|
|
190
|
+
| `EditorStateSnapshot` | Type — serializable snapshot of all state |
|
|
191
|
+
|
|
192
|
+
### EditorState
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
const state = new EditorState();
|
|
196
|
+
|
|
197
|
+
// Load from disk
|
|
198
|
+
await state.loadWorkspace("/path/to/project.genart-workspace");
|
|
199
|
+
|
|
200
|
+
// Access loaded sketches
|
|
201
|
+
state.sketches; // Map<string, LoadedSketch>
|
|
202
|
+
state.selection; // Set<string>
|
|
203
|
+
state.workspace; // WorkspaceDefinition | null
|
|
204
|
+
|
|
205
|
+
// Sandbox file operations (for hosted environments)
|
|
206
|
+
state.basePath = "/safe/dir";
|
|
207
|
+
state.remoteMode = true; // Return file content instead of writing to disk
|
|
208
|
+
|
|
209
|
+
// Listen for mutations
|
|
210
|
+
state.on("mutation", (event) => {
|
|
211
|
+
console.log(event.type); // "sketch:created", "workspace:loaded", etc.
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
// Serializable snapshot
|
|
215
|
+
const snapshot = state.getSnapshot();
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Modes
|
|
219
|
+
|
|
220
|
+
### stdio (default)
|
|
221
|
+
|
|
222
|
+
Standard MCP transport for CLI agents:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
genart-mcp
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Sidecar
|
|
229
|
+
|
|
230
|
+
Stdio transport + IPC mutation bridge for Electron app integration:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
genart-mcp --mode sidecar
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Mutations are forwarded to the parent process via Node IPC, enabling real-time UI updates when AI agents modify sketches.
|
|
237
|
+
|
|
238
|
+
## Agent Attribution
|
|
239
|
+
|
|
240
|
+
Most mutation tools accept optional `agent` and `model` parameters for provenance tracking:
|
|
241
|
+
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"agent": "claude-code",
|
|
245
|
+
"model": "claude-opus-4-6"
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Stored in sketch metadata to track which AI agent created or modified each sketch.
|
|
250
|
+
|
|
251
|
+
## Related Packages
|
|
252
|
+
|
|
253
|
+
| Package | Purpose |
|
|
254
|
+
|---------|---------|
|
|
255
|
+
| [`@genart-dev/format`](https://github.com/genart-dev/format) | File format types, parsers, presets |
|
|
256
|
+
| [`@genart-dev/core`](https://github.com/genart-dev/core) | Renderer adapters, skill registry (dependency) |
|
|
257
|
+
|
|
258
|
+
## Support
|
|
259
|
+
|
|
260
|
+
Questions, bugs, or feedback — [support@genart.dev](mailto:support@genart.dev) or [open an issue](https://github.com/genart-dev/mcp-server/issues).
|
|
261
|
+
|
|
262
|
+
## License
|
|
263
|
+
|
|
264
|
+
MIT
|
package/dist/index.cjs
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genart-dev/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "MCP server for genart.dev — tools, resources, and prompts for generative art",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -35,6 +35,11 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"license": "MIT",
|
|
38
|
+
"author": {
|
|
39
|
+
"name": "genart.dev",
|
|
40
|
+
"email": "support@genart.dev",
|
|
41
|
+
"url": "https://genart.dev"
|
|
42
|
+
},
|
|
38
43
|
"repository": {
|
|
39
44
|
"type": "git",
|
|
40
45
|
"url": "git+https://github.com/genart-dev/mcp-server.git"
|
|
@@ -50,13 +55,6 @@
|
|
|
50
55
|
"publishConfig": {
|
|
51
56
|
"access": "public"
|
|
52
57
|
},
|
|
53
|
-
"scripts": {
|
|
54
|
-
"build": "tsup",
|
|
55
|
-
"test": "vitest run",
|
|
56
|
-
"test:watch": "vitest",
|
|
57
|
-
"clean": "rm -rf dist",
|
|
58
|
-
"prepublishOnly": "pnpm build"
|
|
59
|
-
},
|
|
60
58
|
"dependencies": {
|
|
61
59
|
"@genart-dev/core": "^0.1.0",
|
|
62
60
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
@@ -78,5 +76,11 @@
|
|
|
78
76
|
"tsup": "^8.3.6",
|
|
79
77
|
"typescript": "^5.7.3",
|
|
80
78
|
"vitest": "^3.2.1"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"build": "tsup",
|
|
82
|
+
"test": "vitest run",
|
|
83
|
+
"test:watch": "vitest",
|
|
84
|
+
"clean": "rm -rf dist"
|
|
81
85
|
}
|
|
82
|
-
}
|
|
86
|
+
}
|