@slatesvideo/mcp-server 0.6.2 → 0.6.4
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 +5 -6
- package/dist/server.js +82 -37
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -75,9 +75,9 @@ No environment variables, no API keys to paste into config files.
|
|
|
75
75
|
|
|
76
76
|
## What the agent can do
|
|
77
77
|
|
|
78
|
-
<!-- gen:tool-count -->
|
|
78
|
+
<!-- gen:tool-count -->189<!-- /gen:tool-count --> tools covering the full workspace: project, folder, character, location, look, and board management (create / update / delete), image generation and surgical image editing (<!-- gen:image-roster -->Nano Banana 2.1, GPT Image 2.5 Flare, GPT Image 2.5 Sunburst, FLUX 3 Image, Seedream 5 Lite<!-- /gen:image-roster --> — with project-asset reference images), video generation (<!-- gen:video-roster -->kling-v3.0-std, kling-v3.0-pro, kling-v3.0-omni, Seedance 2.0, Seedance 2.5, Gemini Omni Flash 1.1, Wan 3.0, Kling 4.0, MiniMax H3, MiniMax H3 Max, MiniMax H3 Max Turbo, LTX-2.5, LTX-2.5 Pro<!-- /gen:video-roster -->), audio generation (<!-- gen:audio-roster -->Seed Audio 1.0, ElevenLabs Sound Effects v2, Inworld Realtime TTS-2<!-- /gen:audio-roster -->), lip sync, motion transfer, background generation with status polling, timeline assembly (add / reorder / remove clips), MP4 export and FCP7 XML export for DaVinci Resolve, cost estimation, and credit balance. Bundled prompting/workflow guides are readable at runtime via the `slates_get_prompting_guide` tool — no skill installation needed for MCP-only clients.
|
|
79
79
|
|
|
80
|
-
Generation tools estimate cost first and ask for confirmation on anything over <!-- gen:confirm-credits -->17<!-- /gen:confirm-credits --> credits, so the agent cannot silently burn credits. Every tool also carries MCP annotations, so a host can auto-approve a read and warn on a delete; the <!-- gen:skill-count -->
|
|
80
|
+
Generation tools estimate cost first and ask for confirmation on anything over <!-- gen:confirm-credits -->17<!-- /gen:confirm-credits --> credits, so the agent cannot silently burn credits. Every tool also carries MCP annotations, so a host can auto-approve a read and warn on a delete; the <!-- gen:skill-count -->46<!-- /gen:skill-count --> skills your Slates account opens are exposed as MCP **prompts**, and the manual, the model capability table and the live price list as **resources**.
|
|
81
81
|
|
|
82
82
|
The timeline, export, background-generation, edit-image, and image-reference tools require a Slates desktop on agent API v2 — if a tool reports a version error, update Slates (Settings → Check for Updates) and retry.
|
|
83
83
|
|
|
@@ -92,10 +92,9 @@ The timeline, export, background-generation, edit-image, and image-reference too
|
|
|
92
92
|
The server lists every tool, and the list stays the same for the whole connection. Your client
|
|
93
93
|
decides how much of it to load: Claude Code and Codex send the model the tool names only and fetch a
|
|
94
94
|
tool's full definition when it is needed. `slates_load_tools` with `query` finds a tool by task.
|
|
95
|
-
`--tools=compact`
|
|
96
|
-
`tools/list_changed`, for a client that re-reads its list mid-chat (Claude Desktop, Claude Code in the
|
|
97
|
-
Claude app and Codex do not).
|
|
95
|
+
Legacy `--tools=compact` and `--tools=flat` launch flags are accepted; both expose the full fixed list.
|
|
98
96
|
|
|
99
|
-
`slates_get_prompting_guide`
|
|
97
|
+
`slates_get_prompting_guide` with no topic discovers guides from a brief in `query`, or lists the
|
|
98
|
+
catalog without a query. With a topic it returns a short card by default. Use `query` for a section or
|
|
100
99
|
cinematic technique ID, `depth: "index"` for headings, or `depth: "full"` for the complete guide.
|
|
101
100
|
Both text and structured content include the actual guide body. No extra loading hook is required.
|
package/dist/server.js
CHANGED
|
@@ -6,7 +6,7 @@ import { readFileSync } from 'node:fs';
|
|
|
6
6
|
import { join, dirname } from 'node:path';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
-
import { ALL_OPERATIONS,
|
|
9
|
+
import { ALL_OPERATIONS, ARCHIVE_AFTER_DAYS, brainSkills, parseSkillMetadata, MODEL_CAPABILITIES, MODEL_FACTS, SlatesCloudClient, buildMcpInstructions, BRAIN_ROUTER, MY_BRAIN_TOPIC, ROUTER_NOTICE, archiveUnusedDaily, refreshServedBrain, myBrainPreload, noteUsed, APP_MANUAL, defaultContext, toolDefinitions, cachedLatestVersion, refreshLatestVersion, updateNotice, } from '@slatesvideo/shared';
|
|
10
10
|
// Slates MCP server. Stdio transport. Wires every operation in
|
|
11
11
|
// @slatesvideo/shared as an MCP tool. Both the desktop server and the
|
|
12
12
|
// cloud API are reached through env-discovered creds in
|
|
@@ -39,25 +39,29 @@ const pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url))
|
|
|
39
39
|
// (@slatesvideo/shared → prompts/agent-doctrine.ts), surface-aware only where
|
|
40
40
|
// the mechanism genuinely differs.
|
|
41
41
|
//
|
|
42
|
-
// ⚠️ SIZE IS DELIBERATE. This is injected into EVERY client session
|
|
43
|
-
// clients truncate
|
|
44
|
-
//
|
|
45
|
-
// slates_get_prompting_guide
|
|
46
|
-
// byte count so growth is a
|
|
42
|
+
// ⚠️ SIZE IS DELIBERATE. This is injected into EVERY client session with no
|
|
43
|
+
// prompt cache, and some clients truncate long instructions, so it ships the
|
|
44
|
+
// Essentials and the every-request rules; the full working method and the guide
|
|
45
|
+
// index are a slates_get_prompting_guide call away (topic "working-method").
|
|
46
|
+
// scripts/agent-surface-lockstep-check.mjs pins the byte count so growth is a
|
|
47
|
+
// review decision, not an accident.
|
|
47
48
|
const PKG_NAME = '@slatesvideo/mcp-server';
|
|
48
49
|
// The first line names the running version so an agent can answer "what
|
|
49
50
|
// version am I on"; the notice appears only when the on-disk cache (refreshed
|
|
50
51
|
// in main(), for the NEXT launch) says a newer package is published. Read the
|
|
51
52
|
// design note in @slatesvideo/shared update-check.ts before changing either.
|
|
52
|
-
const updateAdvice = updateNotice(PKG_NAME, pkg.version, cachedLatestVersion(PKG_NAME), 'Newer models
|
|
53
|
+
const updateAdvice = updateNotice(PKG_NAME, pkg.version, cachedLatestVersion(PKG_NAME), 'Newer models are missing until it updates. Tell the user in your FIRST reply: fully quit and reopen the MCP client so npx fetches it; a global install needs `npm i -g @slatesvideo/mcp-server@latest` first.');
|
|
54
|
+
const doctrine = buildMcpInstructions();
|
|
55
|
+
const firstParagraphEnd = doctrine.indexOf('\n\n');
|
|
53
56
|
const instructions = [
|
|
54
57
|
`Slates MCP server v${pkg.version} (${PKG_NAME}).`,
|
|
58
|
+
doctrine.slice(0, firstParagraphEnd),
|
|
55
59
|
updateAdvice,
|
|
56
|
-
|
|
60
|
+
doctrine.slice(firstParagraphEnd + 2),
|
|
57
61
|
].filter((part) => !!part).join('\n\n');
|
|
58
62
|
const server = new Server({ name: 'slates-studio', version: pkg.version }, {
|
|
59
63
|
capabilities: {
|
|
60
|
-
tools: {
|
|
64
|
+
tools: {},
|
|
61
65
|
// Every bundled skill, offered in the host's own picker rather than
|
|
62
66
|
// only through a tool call the model has to decide to make.
|
|
63
67
|
prompts: {},
|
|
@@ -86,12 +90,9 @@ const server = new Server({ name: 'slates-studio', version: pkg.version }, {
|
|
|
86
90
|
// "as a side effect of other requests on the connection". Hiding definitions is
|
|
87
91
|
// the HOST's job: Claude Code and Codex send the model names only and fetch a
|
|
88
92
|
// schema on use, so the full list cost about 3,100 tokens up front in Claude
|
|
89
|
-
// Code and nothing measurable in Codex.
|
|
90
|
-
//
|
|
91
|
-
// accepted as the default it now is.
|
|
93
|
+
// Code and nothing measurable in Codex. Legacy --tools=compact and
|
|
94
|
+
// --tools=flat flags remain accepted; every launch exposes the same full list.
|
|
92
95
|
const TOOLS = toolDefinitions(ops, { surface: 'mcp' });
|
|
93
|
-
const compactTools = process.argv.includes('--tools=compact');
|
|
94
|
-
let selectedTools = new Set();
|
|
95
96
|
/**
|
|
96
97
|
* Output schemas for the ops whose result shape is STABLE.
|
|
97
98
|
*
|
|
@@ -156,7 +157,7 @@ const OUTPUT_SCHEMAS = {
|
|
|
156
157
|
},
|
|
157
158
|
};
|
|
158
159
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
159
|
-
tools: TOOLS.
|
|
160
|
+
tools: TOOLS.map((t) => ({
|
|
160
161
|
name: t.name,
|
|
161
162
|
description: t.description,
|
|
162
163
|
inputSchema: t.inputSchema,
|
|
@@ -239,6 +240,10 @@ async function elicitConfirm(message) {
|
|
|
239
240
|
return null;
|
|
240
241
|
}
|
|
241
242
|
}
|
|
243
|
+
// The guides this connection has read. One server process is one client session
|
|
244
|
+
// (stdio), so a generation is refused until its model's guide was served here:
|
|
245
|
+
// as a guide tool result, a prompt or a skill resource.
|
|
246
|
+
const guidesRead = new Set();
|
|
242
247
|
server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
243
248
|
const op = opsById.get(request.params.name);
|
|
244
249
|
if (!op) {
|
|
@@ -289,17 +294,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
|
289
294
|
}
|
|
290
295
|
let result;
|
|
291
296
|
try {
|
|
292
|
-
result = await op.run(args, { ...defaultContext(), signal: extra?.signal });
|
|
297
|
+
result = await op.run(args, { ...defaultContext(), signal: extra?.signal, guidesRead });
|
|
293
298
|
}
|
|
294
299
|
finally {
|
|
295
300
|
if (ticker)
|
|
296
301
|
clearInterval(ticker);
|
|
297
302
|
}
|
|
298
303
|
let data = result.data;
|
|
299
|
-
if (compactTools && op.id === 'slates_load_tools' && Array.isArray(data?.tools)) {
|
|
300
|
-
selectedTools = new Set(data.tools.map((t) => t.name));
|
|
301
|
-
await server.sendToolListChanged().catch(() => { });
|
|
302
|
-
}
|
|
303
304
|
// The one place the server can ask the USER instead of the model.
|
|
304
305
|
//
|
|
305
306
|
// 🚨 GATED ON THE OP HAVING A `confirm` INPUT, not merely on the flag.
|
|
@@ -318,6 +319,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
|
318
319
|
result = await op.run({ ...args, ...fingerprint, confirm: true }, {
|
|
319
320
|
...defaultContext(),
|
|
320
321
|
signal: extra?.signal,
|
|
322
|
+
guidesRead,
|
|
321
323
|
});
|
|
322
324
|
data = result.data;
|
|
323
325
|
}
|
|
@@ -331,8 +333,24 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
|
331
333
|
if (typeof data?.prompt_warning === 'string' && data.prompt_warning) {
|
|
332
334
|
warn(data.prompt_warning);
|
|
333
335
|
}
|
|
336
|
+
// The router rides the first result of a connection that has not opened it (ROUTER_NOTICE says why): as its
|
|
337
|
+
// own text block, so the result's own text still parses as the JSON many ops return, and in structured
|
|
338
|
+
// content, which is all Claude Code shows the model when it is present. Only on an op that spends nothing:
|
|
339
|
+
// a billable op's result reports a spend, and the router read there comes after the money is gone. A guide
|
|
340
|
+
// answer counts (an agent that opens a playbook first gets the router with it); the router's own answer
|
|
341
|
+
// marks it read and carries the user's brain itself.
|
|
342
|
+
let notice = null;
|
|
343
|
+
if (!op.billable && !guidesRead.has(BRAIN_ROUTER)) {
|
|
344
|
+
guidesRead.add(BRAIN_ROUTER);
|
|
345
|
+
// The user's own brain comes before the router, as in Director (plan § My brain), unless this answer was it.
|
|
346
|
+
const mine = op.id === 'slates_get_prompting_guide' && data?.topic === MY_BRAIN_TOPIC ? '' : myBrainPreload();
|
|
347
|
+
notice = mine ? `${mine}\n\n${ROUTER_NOTICE}` : ROUTER_NOTICE;
|
|
348
|
+
if (data && typeof data === 'object' && !Array.isArray(data))
|
|
349
|
+
data = { ...data, brain_router: notice };
|
|
350
|
+
}
|
|
334
351
|
const content = [
|
|
335
352
|
{ type: 'text', text: result.text },
|
|
353
|
+
...(notice ? [{ type: 'text', text: notice }] : []),
|
|
336
354
|
];
|
|
337
355
|
for (const img of result.images ?? []) {
|
|
338
356
|
content.push({ type: 'image', data: img.data, mimeType: img.mimeType });
|
|
@@ -362,30 +380,40 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
|
362
380
|
// tool call the model had to decide to make — measured at 13% compliance. As a
|
|
363
381
|
// prompt, the skill shows up in the host's own picker and the USER can invoke
|
|
364
382
|
// it, which is a completely different actor making the decision.
|
|
383
|
+
/** The bundled skills with the user's My brain laid over them, read per request like the guide op (theirs wins a name). */
|
|
384
|
+
const skillsNow = () => brainSkills().skills;
|
|
365
385
|
/** First sentence of the frontmatter description — the picker's one-liner. */
|
|
366
|
-
function skillSummary(name) {
|
|
367
|
-
const
|
|
368
|
-
const
|
|
369
|
-
const desc = fm ? /^description:\s*(.+)$/m.exec(fm[1])?.[1] : undefined;
|
|
370
|
-
const first = (desc ?? name).split(/(?<=\.)\s/)[0];
|
|
386
|
+
function skillSummary(name, skills = skillsNow()) {
|
|
387
|
+
const { description } = parseSkillMetadata(skills[name], name);
|
|
388
|
+
const first = description.split(/(?<=\.)\s/)[0];
|
|
371
389
|
return first.length > 300 ? `${first.slice(0, 297)}…` : first;
|
|
372
390
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
391
|
+
/** The names at launch, for the resource template's description and the startup line; requests read skillsNow(). */
|
|
392
|
+
const SKILL_NAMES = Object.keys(skillsNow()).sort();
|
|
393
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
394
|
+
const skills = skillsNow();
|
|
395
|
+
return {
|
|
396
|
+
prompts: Object.keys(skills).sort().map((name) => ({
|
|
397
|
+
name,
|
|
398
|
+
title: name.replace(/^slates-/, '').replace(/-/g, ' '),
|
|
399
|
+
description: skillSummary(name, skills),
|
|
400
|
+
})),
|
|
401
|
+
};
|
|
402
|
+
});
|
|
381
403
|
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
382
404
|
const name = request.params.name;
|
|
383
|
-
const
|
|
405
|
+
const brain = brainSkills();
|
|
406
|
+
const skills = brain.skills;
|
|
407
|
+
const content = skills[name];
|
|
384
408
|
if (content === undefined) {
|
|
385
|
-
throw new Error(`Unknown prompt: ${name}. Available: ${
|
|
409
|
+
throw new Error(`Unknown prompt: ${name}. Available: ${Object.keys(skills).sort().join(', ')}`);
|
|
386
410
|
}
|
|
411
|
+
guidesRead.add(name);
|
|
412
|
+
// Served is used: a My brain file read this way keeps its date, so archiveUnused never takes a file in use.
|
|
413
|
+
if (brain.mine.has(name))
|
|
414
|
+
noteUsed(name);
|
|
387
415
|
return {
|
|
388
|
-
description: skillSummary(name),
|
|
416
|
+
description: skillSummary(name, skills),
|
|
389
417
|
messages: [{ role: 'user', content: { type: 'text', text: content } }],
|
|
390
418
|
};
|
|
391
419
|
});
|
|
@@ -487,9 +515,14 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
|
487
515
|
}
|
|
488
516
|
const skill = /^slates:\/\/skill\/(.+)$/.exec(uri);
|
|
489
517
|
if (skill) {
|
|
490
|
-
const
|
|
518
|
+
const name = decodeURIComponent(skill[1]);
|
|
519
|
+
const brain = brainSkills();
|
|
520
|
+
const content = Object.hasOwn(brain.skills, name) ? brain.skills[name] : undefined;
|
|
491
521
|
if (content === undefined)
|
|
492
522
|
throw new Error(`Unknown skill: ${skill[1]}`);
|
|
523
|
+
guidesRead.add(name);
|
|
524
|
+
if (brain.mine.has(name))
|
|
525
|
+
noteUsed(name);
|
|
493
526
|
return content;
|
|
494
527
|
}
|
|
495
528
|
const shots = /^slates:\/\/project\/([^/]+)\/shots$/.exec(uri);
|
|
@@ -513,12 +546,24 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
|
513
546
|
};
|
|
514
547
|
});
|
|
515
548
|
async function main() {
|
|
549
|
+
if (process.argv.includes('--tools=compact'))
|
|
550
|
+
console.error('[slates-mcp] --tools=compact is deprecated; the server always exposes the full fixed tool list. Clients control selective loading.');
|
|
516
551
|
const transport = new StdioServerTransport();
|
|
517
552
|
await server.connect(transport);
|
|
518
553
|
if (updateAdvice)
|
|
519
554
|
console.error(`[slates-mcp] ${updateAdvice}`);
|
|
520
555
|
// Background refresh; the result is read by the next launch, never awaited.
|
|
521
556
|
void refreshLatestVersion(PKG_NAME);
|
|
557
|
+
// The playbooks, rules and model guides by the account's tier (shared skills/served.ts): the cache serves this
|
|
558
|
+
// session at once, and the first guide answer waits for this check if it is still in flight.
|
|
559
|
+
void refreshServedBrain(() => new SlatesCloudClient()).then((brain) => {
|
|
560
|
+
console.error(`[slates-mcp] brain: ${Object.keys(brain.files).length} files from the ${brain.source}${brain.problem ? ` (${brain.problem})` : ''}`);
|
|
561
|
+
});
|
|
562
|
+
// My brain files long unused move to its archive/ (skills/my-brain.ts): at most once a day, and never
|
|
563
|
+
// fatal, since a server starts with every client session.
|
|
564
|
+
const archived = archiveUnusedDaily();
|
|
565
|
+
if (archived.length)
|
|
566
|
+
console.error(`[slates-mcp] My brain: archived ${archived.length} file(s) unused for ${ARCHIVE_AFTER_DAYS} days: ${archived.join(', ')}`);
|
|
522
567
|
console.error(`[slates-mcp] server started, v${pkg.version}, ${ops.length} tools registered, ` +
|
|
523
568
|
`${SKILL_NAMES.length} skills as prompts, 3 resources + 2 templates, ` +
|
|
524
569
|
`${instructions.length} chars of agent doctrine sent as instructions`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slatesvideo/mcp-server",
|
|
3
3
|
"mcpName": "io.github.EricDisero/slates",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.4",
|
|
5
5
|
"description": "MCP server for the Slates desktop app. Your AI agent (ChatGPT via Codex, Claude, Cursor, or another local MCP client) drives a local AI video studio: projects, characters, storyboards, image and video generation. Files land on disk.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"claude-desktop",
|
|
42
42
|
"cursor",
|
|
43
43
|
"slates",
|
|
44
|
-
"veo",
|
|
45
44
|
"kling",
|
|
46
45
|
"seedance",
|
|
47
46
|
"storyboard"
|
|
@@ -50,8 +49,8 @@
|
|
|
50
49
|
"node": ">=18"
|
|
51
50
|
},
|
|
52
51
|
"dependencies": {
|
|
53
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
54
|
-
"@slatesvideo/shared": "^0.7.
|
|
52
|
+
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
53
|
+
"@slatesvideo/shared": "^0.7.8",
|
|
55
54
|
"zod": "^3.23.0"
|
|
56
55
|
},
|
|
57
56
|
"devDependencies": {
|