@pinepaper.studio/mcp-server 1.6.0 → 1.6.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 +9 -24
- package/dist/browser/bridge.d.ts +48 -4
- package/dist/browser/bridge.d.ts.map +1 -1
- package/dist/browser/bridge.js +79 -18
- package/dist/browser/bridge.js.map +1 -1
- package/manifest.json +29 -13
- package/package.json +13 -3
package/README.md
CHANGED
|
@@ -29,11 +29,13 @@ The server exposes **121 tools** across drawing, animation, diagrams, maps, typo
|
|
|
29
29
|
|
|
30
30
|
## Made with tool calls
|
|
31
31
|
|
|
32
|
-
Every graphic below is an animated SVG produced through this server's tool surface — the arguments shown
|
|
32
|
+
Every graphic below is an animated SVG produced through this server's tool surface — the arguments shown with each result are what an AI agent passes to the named tool. They aren't shell commands; **[Run these yourself](#run-these-yourself)** below shows the three ways to execute them.
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
<!-- Stacked (image then code) rather than a two-column table so the SVGs render on
|
|
35
|
+
mobile — GitHub keeps HTML tables two-column on narrow screens, which squeezes
|
|
36
|
+
the image column to nothing. -->
|
|
37
|
+
|
|
38
|
+
<p align="center"><img src="assets/poster-sunburst.svg" width="360" alt="The graph is the animation — canvas view above, typed-edge graph below"></p>
|
|
37
39
|
|
|
38
40
|
```js
|
|
39
41
|
// The scene IS a graph: two items, two declared edges —
|
|
@@ -46,11 +48,7 @@ Every graphic below is an animated SVG produced through this server's tool surfa
|
|
|
46
48
|
"options": { "speed": 0.18 } }
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
<td align="center"><img src="assets/poster-sunburst.svg" width="260" alt="The graph is the animation — canvas view above, typed-edge graph below"></td>
|
|
51
|
-
</tr>
|
|
52
|
-
<tr>
|
|
53
|
-
<td>
|
|
51
|
+
<p align="center"><img src="assets/easing-splashes.svg" width="420" alt="Five easing curves compared on vertical rails"></p>
|
|
54
52
|
|
|
55
53
|
```js
|
|
56
54
|
// Five rails, five named easings, one loop — each dot is
|
|
@@ -64,11 +62,7 @@ for (const easing of ['linear', 'easeIn', 'easeOut',
|
|
|
64
62
|
}
|
|
65
63
|
```
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
<td align="center"><img src="assets/easing-splashes.svg" width="300" alt="Five easing curves compared on vertical rails"></td>
|
|
69
|
-
</tr>
|
|
70
|
-
<tr>
|
|
71
|
-
<td>
|
|
65
|
+
<p align="center"><img src="assets/equation-path.svg" width="420" alt="A dot tracing the rose curve r = cos(2θ)"></p>
|
|
72
66
|
|
|
73
67
|
```js
|
|
74
68
|
// The engine solves the curve; the exporter bakes the
|
|
@@ -82,11 +76,7 @@ for (const easing of ['linear', 'easeIn', 'easeOut',
|
|
|
82
76
|
"duration": 8, "loop": true } }
|
|
83
77
|
```
|
|
84
78
|
|
|
85
|
-
|
|
86
|
-
<td align="center"><img src="assets/equation-path.svg" width="300" alt="A dot tracing the rose curve r = cos(2θ)"></td>
|
|
87
|
-
</tr>
|
|
88
|
-
<tr>
|
|
89
|
-
<td>
|
|
79
|
+
<p align="center"><img src="assets/live-badge.svg" width="300" alt="LIVE status chip with blinking green dot"></p>
|
|
90
80
|
|
|
91
81
|
```js
|
|
92
82
|
// Status chip: pale panel, slate bar, green dot blinking
|
|
@@ -98,11 +88,6 @@ for (const easing of ['linear', 'easeIn', 'easeOut',
|
|
|
98
88
|
"options": { "speed": 1.0 } } // only the dot blinks
|
|
99
89
|
```
|
|
100
90
|
|
|
101
|
-
</td>
|
|
102
|
-
<td align="center"><img src="assets/live-badge.svg" width="220" alt="LIVE status chip with blinking green dot"></td>
|
|
103
|
-
</tr>
|
|
104
|
-
</table>
|
|
105
|
-
|
|
106
91
|
All five showcase files (including the banner) live in [`assets/`](assets/) — tiny (4–11 KB), dependency-free, loop forever, and render anywhere SVG renders: GitHub READMEs, docs sites, dashboards, emails that allow SVG. They follow one editorial design system (serif mastheads, hairline rules, slate ink on paper white, framed canvas stages, typed-edge graph diagrams) supplied to the agent as context — share a design guideline with your agent and the tool calls come out on-system.
|
|
107
92
|
|
|
108
93
|
### Try it interactive
|
package/dist/browser/bridge.d.ts
CHANGED
|
@@ -86,15 +86,47 @@ export declare class PinePaperBridge {
|
|
|
86
86
|
*/
|
|
87
87
|
destroy(): void;
|
|
88
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Configuration for the studio-side message handler.
|
|
91
|
+
*/
|
|
92
|
+
export interface StudioHandlerConfig {
|
|
93
|
+
/**
|
|
94
|
+
* REQUIRED. Exact origins permitted to drive this studio window.
|
|
95
|
+
* Wildcards are rejected: a `'*'` allowlist on a handler that can run
|
|
96
|
+
* code means any page holding a window reference (opener, embedder,
|
|
97
|
+
* `window.open` result) gets code execution in this origin.
|
|
98
|
+
*/
|
|
99
|
+
allowedOrigins: string[];
|
|
100
|
+
/**
|
|
101
|
+
* Optional host-supplied executor for `execute-code` requests.
|
|
102
|
+
*
|
|
103
|
+
* This package deliberately ships NO code evaluator. If the host does
|
|
104
|
+
* not inject one, `execute-code` is refused. Hosts that want it wire
|
|
105
|
+
* their own sandbox/governor here and own that decision explicitly.
|
|
106
|
+
*/
|
|
107
|
+
executeCode?: (code: string) => Promise<unknown>;
|
|
108
|
+
/**
|
|
109
|
+
* Allow `mcp-request` messages to dispatch MCP tool calls. Off by
|
|
110
|
+
* default — tool dispatch mutates the host document.
|
|
111
|
+
*/
|
|
112
|
+
allowToolCalls?: boolean;
|
|
113
|
+
}
|
|
89
114
|
/**
|
|
90
115
|
* Message handler for PinePaper Studio side
|
|
91
116
|
*
|
|
92
117
|
* Install this in PinePaper Studio to handle incoming bridge messages.
|
|
118
|
+
*
|
|
119
|
+
* SECURITY: this handler is a remote-control surface for the window it is
|
|
120
|
+
* installed in. It therefore requires an explicit origin allowlist, ships
|
|
121
|
+
* no code evaluator (see `StudioHandlerConfig.executeCode`), and keeps
|
|
122
|
+
* tool dispatch opt-in.
|
|
93
123
|
*/
|
|
94
124
|
export declare class PinePaperStudioHandler {
|
|
95
125
|
private allowedOrigins;
|
|
126
|
+
private executeCodeFn?;
|
|
127
|
+
private allowToolCalls;
|
|
96
128
|
private messageHandler;
|
|
97
|
-
constructor(
|
|
129
|
+
constructor(config: StudioHandlerConfig | string[]);
|
|
98
130
|
/**
|
|
99
131
|
* Handle incoming messages
|
|
100
132
|
*/
|
|
@@ -104,7 +136,15 @@ export declare class PinePaperStudioHandler {
|
|
|
104
136
|
*/
|
|
105
137
|
private handlePing;
|
|
106
138
|
/**
|
|
107
|
-
* Handle code execution request
|
|
139
|
+
* Handle code execution request.
|
|
140
|
+
*
|
|
141
|
+
* This package ships no evaluator. Code runs only through an executor the
|
|
142
|
+
* HOST injected via `StudioHandlerConfig.executeCode`; otherwise the
|
|
143
|
+
* request is refused. Historically this path dynamically evaluated the
|
|
144
|
+
* message payload, which — combined with the old wildcard origin default —
|
|
145
|
+
* let any page holding a window reference run arbitrary code in the studio
|
|
146
|
+
* origin and read the result back over postMessage (CVE-class: cross-origin
|
|
147
|
+
* remote code execution; reported by Socket.dev 2026-08-01).
|
|
108
148
|
*/
|
|
109
149
|
private handleExecuteCode;
|
|
110
150
|
/**
|
|
@@ -121,7 +161,11 @@ export declare class PinePaperStudioHandler {
|
|
|
121
161
|
*/
|
|
122
162
|
export declare function createBridge(config: BridgeConfig): PinePaperBridge;
|
|
123
163
|
/**
|
|
124
|
-
* Create a handler for PinePaper Studio side
|
|
164
|
+
* Create a handler for PinePaper Studio side.
|
|
165
|
+
*
|
|
166
|
+
* `config.allowedOrigins` is REQUIRED and must list exact origins — there is
|
|
167
|
+
* deliberately no default. This handler remote-controls the window it is
|
|
168
|
+
* installed in; a permissive default is a cross-origin foothold.
|
|
125
169
|
*/
|
|
126
|
-
export declare function createStudioHandler(
|
|
170
|
+
export declare function createStudioHandler(config: StudioHandlerConfig | string[]): PinePaperStudioHandler;
|
|
127
171
|
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -1 +1 @@
|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AAE;IA2BlD;;OAEG;IACH,OAAO,CAAC,aAAa;IAiCrB;;OAEG;IACH,OAAO,CAAC,UAAU;IAYlB;;;;;;;;;;OAUG;YACW,iBAAiB;IAqD/B;;OAEG;YACW,gBAAgB;IA2D9B;;OAEG;IACH,OAAO,IAAI,IAAI;CAGhB;AAMD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,mBAAmB,GAAG,MAAM,EAAE,GACrC,sBAAsB,CAExB"}
|
package/dist/browser/bridge.js
CHANGED
|
@@ -187,19 +187,38 @@ export class PinePaperBridge {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
// =============================================================================
|
|
191
|
-
// PINEPAPER STUDIO HANDLER (runs inside PinePaper)
|
|
192
|
-
// =============================================================================
|
|
193
190
|
/**
|
|
194
191
|
* Message handler for PinePaper Studio side
|
|
195
192
|
*
|
|
196
193
|
* Install this in PinePaper Studio to handle incoming bridge messages.
|
|
194
|
+
*
|
|
195
|
+
* SECURITY: this handler is a remote-control surface for the window it is
|
|
196
|
+
* installed in. It therefore requires an explicit origin allowlist, ships
|
|
197
|
+
* no code evaluator (see `StudioHandlerConfig.executeCode`), and keeps
|
|
198
|
+
* tool dispatch opt-in.
|
|
197
199
|
*/
|
|
198
200
|
export class PinePaperStudioHandler {
|
|
199
201
|
allowedOrigins;
|
|
202
|
+
executeCodeFn;
|
|
203
|
+
allowToolCalls;
|
|
200
204
|
messageHandler;
|
|
201
|
-
constructor(
|
|
202
|
-
|
|
205
|
+
constructor(config) {
|
|
206
|
+
const cfg = Array.isArray(config)
|
|
207
|
+
? { allowedOrigins: config }
|
|
208
|
+
: config;
|
|
209
|
+
const origins = cfg?.allowedOrigins;
|
|
210
|
+
if (!Array.isArray(origins) || origins.length === 0) {
|
|
211
|
+
throw new Error('PinePaperStudioHandler: `allowedOrigins` is required — pass the exact ' +
|
|
212
|
+
"origins allowed to drive this window, e.g. ['https://pinepaper.studio'].");
|
|
213
|
+
}
|
|
214
|
+
if (origins.some((o) => typeof o !== 'string' || o.trim() === '' || o.includes('*'))) {
|
|
215
|
+
throw new Error('PinePaperStudioHandler: wildcard/empty origins are not allowed. ' +
|
|
216
|
+
'List exact origins — a wildcard lets any page that holds a window ' +
|
|
217
|
+
'reference drive this studio.');
|
|
218
|
+
}
|
|
219
|
+
this.allowedOrigins = [...origins];
|
|
220
|
+
this.executeCodeFn = cfg.executeCode;
|
|
221
|
+
this.allowToolCalls = cfg.allowToolCalls === true;
|
|
203
222
|
this.messageHandler = this.handleMessage.bind(this);
|
|
204
223
|
window.addEventListener('message', this.messageHandler);
|
|
205
224
|
}
|
|
@@ -207,9 +226,14 @@ export class PinePaperStudioHandler {
|
|
|
207
226
|
* Handle incoming messages
|
|
208
227
|
*/
|
|
209
228
|
handleMessage(event) {
|
|
210
|
-
// Validate origin
|
|
211
|
-
if (!this.allowedOrigins.includes(
|
|
212
|
-
|
|
229
|
+
// Validate origin — exact match only, no wildcard escape hatch.
|
|
230
|
+
if (!this.allowedOrigins.includes(event.origin)) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
// Replies go back to the sending window; without one there is nothing
|
|
234
|
+
// to answer and no way to scope the response.
|
|
235
|
+
const source = event.source;
|
|
236
|
+
if (!source) {
|
|
213
237
|
return;
|
|
214
238
|
}
|
|
215
239
|
const message = event.data;
|
|
@@ -218,13 +242,13 @@ export class PinePaperStudioHandler {
|
|
|
218
242
|
}
|
|
219
243
|
switch (message.type) {
|
|
220
244
|
case 'ping':
|
|
221
|
-
this.handlePing(
|
|
245
|
+
this.handlePing(source, event.origin);
|
|
222
246
|
break;
|
|
223
247
|
case 'execute-code':
|
|
224
|
-
this.handleExecuteCode(message,
|
|
248
|
+
this.handleExecuteCode(message, source, event.origin);
|
|
225
249
|
break;
|
|
226
250
|
case 'mcp-request':
|
|
227
|
-
this.handleMCPRequest(message,
|
|
251
|
+
this.handleMCPRequest(message, source, event.origin);
|
|
228
252
|
break;
|
|
229
253
|
}
|
|
230
254
|
}
|
|
@@ -240,14 +264,33 @@ export class PinePaperStudioHandler {
|
|
|
240
264
|
}, origin);
|
|
241
265
|
}
|
|
242
266
|
/**
|
|
243
|
-
* Handle code execution request
|
|
267
|
+
* Handle code execution request.
|
|
268
|
+
*
|
|
269
|
+
* This package ships no evaluator. Code runs only through an executor the
|
|
270
|
+
* HOST injected via `StudioHandlerConfig.executeCode`; otherwise the
|
|
271
|
+
* request is refused. Historically this path dynamically evaluated the
|
|
272
|
+
* message payload, which — combined with the old wildcard origin default —
|
|
273
|
+
* let any page holding a window reference run arbitrary code in the studio
|
|
274
|
+
* origin and read the result back over postMessage (CVE-class: cross-origin
|
|
275
|
+
* remote code execution; reported by Socket.dev 2026-08-01).
|
|
244
276
|
*/
|
|
245
277
|
async handleExecuteCode(message, source, origin) {
|
|
246
278
|
const { code } = message.payload;
|
|
279
|
+
if (!this.executeCodeFn) {
|
|
280
|
+
source.postMessage({
|
|
281
|
+
type: 'code-result',
|
|
282
|
+
id: message.id,
|
|
283
|
+
payload: {
|
|
284
|
+
success: false,
|
|
285
|
+
error: 'Code execution is not enabled on this bridge. The host must ' +
|
|
286
|
+
'supply StudioHandlerConfig.executeCode to opt in.',
|
|
287
|
+
},
|
|
288
|
+
source: 'pinepaper-studio',
|
|
289
|
+
}, origin);
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
247
292
|
try {
|
|
248
|
-
|
|
249
|
-
// eslint-disable-next-line no-eval
|
|
250
|
-
const result = await eval(`(async () => { ${code} })()`);
|
|
293
|
+
const result = await this.executeCodeFn(code);
|
|
251
294
|
source.postMessage({
|
|
252
295
|
type: 'code-result',
|
|
253
296
|
id: message.id,
|
|
@@ -272,6 +315,20 @@ export class PinePaperStudioHandler {
|
|
|
272
315
|
*/
|
|
273
316
|
async handleMCPRequest(message, source, origin) {
|
|
274
317
|
const { tool, arguments: args } = message.payload;
|
|
318
|
+
// Tool dispatch mutates the host document — opt-in only.
|
|
319
|
+
if (!this.allowToolCalls) {
|
|
320
|
+
source.postMessage({
|
|
321
|
+
type: 'mcp-response',
|
|
322
|
+
id: message.id,
|
|
323
|
+
payload: {
|
|
324
|
+
success: false,
|
|
325
|
+
error: 'Tool calls are not enabled on this bridge. Set ' +
|
|
326
|
+
'StudioHandlerConfig.allowToolCalls to opt in.',
|
|
327
|
+
},
|
|
328
|
+
source: 'pinepaper-studio',
|
|
329
|
+
}, origin);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
275
332
|
try {
|
|
276
333
|
// Import and use the handler
|
|
277
334
|
const { handleToolCall } = await import('../tools/handlers.js');
|
|
@@ -312,9 +369,13 @@ export function createBridge(config) {
|
|
|
312
369
|
return new PinePaperBridge(config);
|
|
313
370
|
}
|
|
314
371
|
/**
|
|
315
|
-
* Create a handler for PinePaper Studio side
|
|
372
|
+
* Create a handler for PinePaper Studio side.
|
|
373
|
+
*
|
|
374
|
+
* `config.allowedOrigins` is REQUIRED and must list exact origins — there is
|
|
375
|
+
* deliberately no default. This handler remote-controls the window it is
|
|
376
|
+
* installed in; a permissive default is a cross-origin foothold.
|
|
316
377
|
*/
|
|
317
|
-
export function createStudioHandler(
|
|
318
|
-
return new PinePaperStudioHandler(
|
|
378
|
+
export function createStudioHandler(config) {
|
|
379
|
+
return new PinePaperStudioHandler(config);
|
|
319
380
|
}
|
|
320
381
|
//# sourceMappingURL=bridge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../src/browser/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA2BH,gFAAgF;AAChF,uBAAuB;AACvB,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IAClB,MAAM,CAAyB;IAC/B,eAAe,GAAgC,IAAI,GAAG,EAAE,CAAC;IACzD,OAAO,GAAG,KAAK,CA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AAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7D,CAAC;CACF;AAED,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAoB;IAC/C,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAsC;IAEtC,OAAO,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC"}
|
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "pinepaper-mcp",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.2",
|
|
5
5
|
"display_name": "PinePaper Studio",
|
|
6
6
|
"description": "Create animated graphics with AI using PinePaper Studio",
|
|
7
7
|
"long_description": "PinePaper MCP Server enables Claude to create, animate, and export graphics through PinePaper Studio. Features include shape creation, relation-based animations (orbits, follows, attached_to), procedural generators, visual effects, SVG export with animations, asset search & import from 4 open repositories (500k+ icons), performance metrics tracking, diagram tools for flowcharts/UML/network diagrams with smart connectors and auto-layout, enhanced error messages with canvas context, Agent Flow Mode for content automation pipelines with batch operations and smart platform exports (Instagram, TikTok, YouTube, etc.), interactive triggers (click, hover, drag events), quiz/LMS integration with SCORM/xAPI support, Letter Collage for stylized text with per-letter customization (Wordle, magazine cutout, gradient styles with 24+ palettes), and canvas presets for social media platforms. Supports two execution modes: Puppeteer (live browser execution) and Code (generate code for manual paste).",
|
|
@@ -33,26 +33,42 @@
|
|
|
33
33
|
"entry_point": "dist/cli.js",
|
|
34
34
|
"mcp_config": {
|
|
35
35
|
"command": "node",
|
|
36
|
-
"args": [
|
|
36
|
+
"args": [
|
|
37
|
+
"${__dirname}/dist/cli.js"
|
|
38
|
+
]
|
|
37
39
|
},
|
|
38
40
|
"options": {
|
|
39
41
|
"mode": {
|
|
40
42
|
"type": "string",
|
|
41
43
|
"description": "Execution mode: 'puppeteer' (live browser) or 'code' (generate only)",
|
|
42
44
|
"default": "puppeteer",
|
|
43
|
-
"enum": [
|
|
45
|
+
"enum": [
|
|
46
|
+
"puppeteer",
|
|
47
|
+
"code"
|
|
48
|
+
]
|
|
44
49
|
},
|
|
45
50
|
"toolkit": {
|
|
46
51
|
"type": "string",
|
|
47
52
|
"description": "Tool visibility profile controlling which tools are exposed",
|
|
48
53
|
"default": "agent",
|
|
49
|
-
"enum": [
|
|
54
|
+
"enum": [
|
|
55
|
+
"full",
|
|
56
|
+
"agent",
|
|
57
|
+
"diagram",
|
|
58
|
+
"map",
|
|
59
|
+
"font",
|
|
60
|
+
"minimal"
|
|
61
|
+
]
|
|
50
62
|
},
|
|
51
63
|
"verbosity": {
|
|
52
64
|
"type": "string",
|
|
53
65
|
"description": "Tool description detail level. 'minimal' uses 1-line summaries with on-demand guide tool",
|
|
54
66
|
"default": "compact",
|
|
55
|
-
"enum": [
|
|
67
|
+
"enum": [
|
|
68
|
+
"verbose",
|
|
69
|
+
"compact",
|
|
70
|
+
"minimal"
|
|
71
|
+
]
|
|
56
72
|
}
|
|
57
73
|
},
|
|
58
74
|
"env": {
|
|
@@ -161,7 +177,7 @@
|
|
|
161
177
|
},
|
|
162
178
|
{
|
|
163
179
|
"name": "pinepaper_event",
|
|
164
|
-
"description": "Event channel for scene chains (S11). action:'create' {name}
|
|
180
|
+
"description": "Event channel for scene chains (S11). action:'create' {name}\u2192eventId, or 'pulse' {eventId}. Wire beats with on_event_fire_after/add_relation/set_color relations (event as sourceId)."
|
|
165
181
|
},
|
|
166
182
|
{
|
|
167
183
|
"name": "pinepaper_construction_sequence",
|
|
@@ -177,7 +193,7 @@
|
|
|
177
193
|
},
|
|
178
194
|
{
|
|
179
195
|
"name": "pinepaper_detect_objects",
|
|
180
|
-
"description": "On-device image detection: DETR 80-class, or queries:[
|
|
196
|
+
"description": "On-device image detection: DETR 80-class, or queries:[\u2026] open-vocabulary (OWL-ViT). asNodes:true \u2192 image-anchored design nodes. {itemId?, threshold?, asNodes?, queries?}"
|
|
181
197
|
},
|
|
182
198
|
{
|
|
183
199
|
"name": "pinepaper_extract_object",
|
|
@@ -189,7 +205,7 @@
|
|
|
189
205
|
},
|
|
190
206
|
{
|
|
191
207
|
"name": "pinepaper_validate_scene",
|
|
192
|
-
"description": "Audit the live canvas (dangling refs, unknown types/props, keyframes, cycles)
|
|
208
|
+
"description": "Audit the live canvas (dangling refs, unknown types/props, keyframes, cycles) \u2192 structured diagnostics. Optional ops[] to pre-validate proposed mutations."
|
|
193
209
|
},
|
|
194
210
|
{
|
|
195
211
|
"name": "pinepaper_capture_frames",
|
|
@@ -213,11 +229,11 @@
|
|
|
213
229
|
},
|
|
214
230
|
{
|
|
215
231
|
"name": "pinepaper_instantiate_ontology",
|
|
216
|
-
"description": "Compile a pp: JSON-LD design graph (typed nodes + structural edges like on_top_of) into a live scene
|
|
232
|
+
"description": "Compile a pp: JSON-LD design graph (typed nodes + structural edges like on_top_of) into a live scene \u2014 roots placed, the rest positioned by relations. {doc, canvas?, defaultGeometry?} \u2192 {itemIds, diagnostics}."
|
|
217
233
|
},
|
|
218
234
|
{
|
|
219
235
|
"name": "pinepaper_lint_scene",
|
|
220
|
-
"description": "Read-only relational-density audit of the live scene
|
|
236
|
+
"description": "Read-only relational-density audit of the live scene \u2192 {density, suggestions}. Flags coordinate-driven scenes and proposes structural relations for unrelated items already in position. {eps?, cap?}"
|
|
221
237
|
},
|
|
222
238
|
{
|
|
223
239
|
"name": "pinepaper_add_relation",
|
|
@@ -417,7 +433,7 @@
|
|
|
417
433
|
},
|
|
418
434
|
{
|
|
419
435
|
"name": "pinepaper_font",
|
|
420
|
-
"description": "Font Studio. action: show_studio|set_name|create_glyph|create_space|remove_glyph|set_metrics|export|cleanup_path
|
|
436
|
+
"description": "Font Studio. action: show_studio|set_name|create_glyph|create_space|remove_glyph|set_metrics|export|cleanup_path|\u2026 (16 actions; see pinepaper_tool_guide)."
|
|
421
437
|
},
|
|
422
438
|
{
|
|
423
439
|
"name": "pinepaper_create_letter_collage",
|
|
@@ -525,7 +541,7 @@
|
|
|
525
541
|
},
|
|
526
542
|
{
|
|
527
543
|
"name": "pinepaper_analyze_design",
|
|
528
|
-
"description": "Analyze template definition
|
|
544
|
+
"description": "Analyze template definition \u2192 typed graph, patterns, math functions, semantics, fingerprint, JSON-LD."
|
|
529
545
|
},
|
|
530
546
|
{
|
|
531
547
|
"name": "pinepaper_validate_design",
|
|
@@ -533,7 +549,7 @@
|
|
|
533
549
|
},
|
|
534
550
|
{
|
|
535
551
|
"name": "pinepaper_validate",
|
|
536
|
-
"description": "Semantic validation of the live scene/op
|
|
552
|
+
"description": "Semantic validation of the live scene/op \u2192 structured diagnostics {code, severity, message, fix}. mode:'scene'|'op'. Catches missing targets (+did-you-mean), bad params, cycles."
|
|
537
553
|
},
|
|
538
554
|
{
|
|
539
555
|
"name": "pinepaper_query_ontology",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinepaper.studio/mcp-server",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"mcpName": "io.github.pinepaper/mcp-server",
|
|
5
5
|
"description": "MCP Server for PinePaper Studio - Create animated graphics with AI",
|
|
6
6
|
"type": "module",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"node": ">=18.0.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
63
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
64
64
|
"puppeteer": "^24.37.3",
|
|
65
65
|
"zod": "^3.22.4"
|
|
66
66
|
},
|
|
@@ -86,5 +86,15 @@
|
|
|
86
86
|
"README.fr.md",
|
|
87
87
|
"README.de.md",
|
|
88
88
|
"README.hi.md"
|
|
89
|
-
]
|
|
89
|
+
],
|
|
90
|
+
"overrides": {
|
|
91
|
+
"es-define-property": "npm:@socketregistry/es-define-property@^1.0.7",
|
|
92
|
+
"function-bind": "npm:@socketregistry/function-bind@^1.0.7",
|
|
93
|
+
"gopd": "npm:@socketregistry/gopd@^1.0.7",
|
|
94
|
+
"has-symbols": "npm:@socketregistry/has-symbols@^1.0.7",
|
|
95
|
+
"hasown": "npm:@socketregistry/hasown@^1.0.7",
|
|
96
|
+
"object-assign": "npm:@socketregistry/object-assign@^1.0.5",
|
|
97
|
+
"safer-buffer": "npm:@socketregistry/safer-buffer@^1.0.10",
|
|
98
|
+
"side-channel": "npm:@socketregistry/side-channel@^1.0.10"
|
|
99
|
+
}
|
|
90
100
|
}
|