@simpligen/mcp 0.10.0 → 0.11.1

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.
Files changed (3) hide show
  1. package/package.json +37 -37
  2. package/src/bin.js +1 -1
  3. package/src/tools.js +21 -13
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
- {
2
- "name": "@simpligen/mcp",
3
- "version": "0.10.0",
4
- "description": "MCP server for SimpliGen -- drive local/cloud AI image & video generation from an agent.",
5
- "type": "module",
6
- "license": "MIT",
7
- "homepage": "https://simpligen.io",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/RaynoldVanHeyningen/SimpliGen.git",
11
- "directory": "packages/mcp-server"
12
- },
13
- "bin": {
14
- "simpligen-mcp": "src/bin.js"
15
- },
16
- "main": "src/index.js",
17
- "files": [
18
- "src",
19
- "README.md",
20
- "LICENSE"
21
- ],
22
- "engines": {
23
- "node": ">=18"
24
- },
25
- "publishConfig": {
26
- "access": "public"
27
- },
28
- "scripts": {
29
- "test": "node --test src/*.test.js",
30
- "prepublishOnly": "node --test src/*.test.js"
31
- },
32
- "dependencies": {
33
- "@modelcontextprotocol/sdk": "^1",
34
- "sharp": ">=0.34.5 <0.36",
35
- "zod": "^3"
36
- }
37
- }
1
+ {
2
+ "name": "@simpligen/mcp",
3
+ "version": "0.11.1",
4
+ "description": "MCP server for SimpliGen -- drive local/cloud AI image & video generation from an agent.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "homepage": "https://simpligen.io",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/RaynoldVanHeyningen/SimpliGen.git",
11
+ "directory": "packages/mcp-server"
12
+ },
13
+ "bin": {
14
+ "simpligen-mcp": "src/bin.js"
15
+ },
16
+ "main": "src/index.js",
17
+ "files": [
18
+ "src",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "scripts": {
29
+ "test": "node --test src/*.test.js",
30
+ "prepublishOnly": "node --test src/*.test.js"
31
+ },
32
+ "dependencies": {
33
+ "@modelcontextprotocol/sdk": "^1",
34
+ "sharp": ">=0.34.5 <0.36",
35
+ "zod": "^3"
36
+ }
37
+ }
package/src/bin.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  // packages/mcp-server/src/bin.js
3
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
4
  import { ControlApiClient } from './client.js';
package/src/tools.js CHANGED
@@ -32,6 +32,10 @@ const ok = (data) => ({ content: [{ type: 'text', text: JSON.stringify(data, nul
32
32
  const fail = (err) => ({ isError: true, content: [{ type: 'text', text: `${err.errorCode ? err.errorCode + ': ' : ''}${err.message || String(err)}` }] });
33
33
  const wrap = (fn) => async (args) => { try { return ok(await fn(args)); } catch (e) { return fail(e); } };
34
34
 
35
+ // A project as generate and the film tools take it. The App resolves it with one lookup
36
+ // (agentApi/projectRef.js) and refuses one that matches nothing.
37
+ const projectArg = (what) => z.string().optional().describe(`${what}: its id, slug or exact name from list_projects, e.g. "Mature" when the user says "the Mature Gallery". Leave it out for the project open in the app. A value that matches no project is refused with unknown_project, which lists the projects.`);
38
+
35
39
  // In the in-app Assistant the user approves spending and deletions on a card first.
36
40
  const APPROVAL_NOTE = ' If the result is awaiting_approval, call wait_for_approval with its proposalId and tell the user an approval card is waiting.';
37
41
 
@@ -54,7 +58,7 @@ export function registerTools(server, client, { now = Date.now, sleep = (ms) =>
54
58
  wrap(() => client.getCapabilities()));
55
59
 
56
60
  server.registerTool('get_status',
57
- { title: 'Get status', description: 'Engine running state, whether cloud is connected, credit balance, and the active project.', inputSchema: {} },
61
+ { title: 'Get status', description: 'Engine running state, whether cloud is connected, whether the user has Local only on (localOnly: then nothing may run in the cloud), credit balance, and the active project.', inputSchema: {} },
58
62
  wrap(() => client.getStatus()));
59
63
 
60
64
  // The engine's lifecycle. get_status could always report it was down and
@@ -75,11 +79,11 @@ export function registerTools(server, client, { now = Date.now, sleep = (ms) =>
75
79
  wrap(() => client.restartEngine()));
76
80
 
77
81
  server.registerTool('list_projects',
78
- { title: 'List projects', description: 'List projects (output containers).', inputSchema: {} },
82
+ { title: 'List projects', description: 'List projects with their id, slug and name. A project is what the app shows in its Gallery: the user opens one with the switcher at the top of the left rail, and new results land in the open one. When the user asks for "the Mature Gallery", that is the project named Mature. generate (project) and the film tools (projectId) take its id, slug or exact name.', inputSchema: {} },
79
83
  wrap(() => client.listProjects()));
80
84
 
81
85
  server.registerTool('create_project',
82
- { title: 'Create project', description: 'Create a new project (output container).', inputSchema: { name: z.string().describe('Project name') } },
86
+ { title: 'Create project', description: 'Create a new project, which the app shows as a Gallery. Creating it does not open it in the app: pass it as the project of generate to save there.', inputSchema: { name: z.string().describe('Project name') } },
83
87
  wrap(({ name }) => client.createProject(name)));
84
88
 
85
89
  server.registerTool('upload_file',
@@ -88,12 +92,14 @@ export function registerTools(server, client, { now = Date.now, sleep = (ms) =>
88
92
 
89
93
  server.registerTool('generate',
90
94
  {
91
- title: 'Generate', description: 'Start an image or video generation. Before writing the prompt, call get_prompt_guide for the preset and follow it. Inputs (image/referenceImages/video) are handles from upload_file. backend: local | cloud | auto. Returns a jobId (and, for local runs, an expectation with the same fields as onThisMachine for the requested settings); poll with wait_for_result or get_job.' + APPROVAL_NOTE,
95
+ title: 'Generate', description: 'Start an image or video generation. Before writing the prompt, call get_prompt_guide for the preset and follow it. Inputs (image/referenceImages/video) are handles from upload_file. backend: local | cloud | auto. auto runs locally on any PC with a local engine; if the preset is not installed you get preset_not_installed (call prepare_preset, or ask the user before choosing cloud, which costs credits). cloud is refused with cloud_disabled while the user has Local only on (get_status reports localOnly). The result is saved to the project (Gallery) named in project, else to the project open in the app. Returns a jobId (and, for local runs, an expectation with the same fields as onThisMachine for the requested settings); poll with wait_for_result or get_job.' + APPROVAL_NOTE,
92
96
  inputSchema: {
93
97
  presetId: z.string(), mediaType: z.enum(['image', 'video']), prompt: z.string(),
94
98
  packId: z.string().optional(), backend: z.enum(['local', 'cloud', 'auto']).optional(),
95
99
  negativePrompt: z.string().optional().describe('Extra terms added to the preset default negative prompt (local runs only); the default is always applied.'),
96
- project: z.string().optional(),
100
+ // Undescribed, agents never set it: Goose saved a "Mature Gallery" request into
101
+ // whichever project was open (Melvyl, 2026-11-21).
102
+ project: projectArg('The project (Gallery) to save the result to'),
97
103
  image: z.string().optional().describe('upload_file handle'),
98
104
  // A bare handle still works, so every agent written against the old
99
105
  // schema keeps working. The object form carries the per-image label,
@@ -258,6 +264,7 @@ export function registerTools(server, client, { now = Date.now, sleep = (ms) =>
258
264
  { title: 'Fill the Generate form', description: 'Fill in the Generate screen for the user (preset, prompt and settings) without generating, so they can review it and click Generate themselves.', inputSchema: {
259
265
  presetId: z.string(), prompt: z.string(), negativePrompt: z.string().optional(), characterId: z.string().optional(),
260
266
  settings: z.record(z.any()).optional().describe('Preset settings keyed by setting id (see list_capabilities).'),
267
+ keepForm: z.boolean().optional().describe('Replace only the prompt of the preset already on screen and keep everything else the user set (references, characters, other fields). Use it when improving or editing the prompt on screen.'),
261
268
  } },
262
269
  wrap((a) => client.fillGenerateForm(a)));
263
270
 
@@ -298,22 +305,23 @@ export function registerTools(server, client, { now = Date.now, sleep = (ms) =>
298
305
  name: z.string().describe('Display name for the character'),
299
306
  gender: z.enum(['woman', 'man', 'nonbinary']),
300
307
  mode: z.enum(['generate', 'upload']).describe('generate: build base portrait from description; upload: use a provided image as base'),
301
- identity: z.record(z.string()).optional().describe('An object of featureId to optionId pairs chosen from list_character_features (e.g. { hairColor: "black", eyeColor: "green" }). Do not include gender here; pass gender separately.'),
308
+ identity: z.record(z.string()).optional().describe('An object of featureId to optionId pairs chosen from list_character_features (e.g. { hairColor: "black", eyeColor: "green" }). Where a feature has allowCustom, the value may instead be your own words (e.g. { accessories: "a scarf over a parka" }). Do not include gender here; pass gender separately.'),
302
309
  baseFilePath: z.string().optional().describe('Absolute local image path; required for mode "upload"'),
310
+ basePresetId: z.string().optional().describe('Base-generation preset id from list_character_presets (the base list). Without it the first installed base model is used.'),
303
311
  timeoutSeconds: z.number().optional().describe('Max seconds to wait for base portrait generation (default 300, mode generate only)'),
304
312
  pollMs: z.number().optional().describe('Poll interval in milliseconds (default 2000, mode generate only)'),
305
313
  },
306
314
  },
307
- async ({ name, gender, mode, identity, baseFilePath, timeoutSeconds, pollMs }) => {
315
+ async ({ name, gender, mode, identity, baseFilePath, basePresetId, timeoutSeconds, pollMs }) => {
308
316
  try {
309
317
  if (mode === 'upload') {
310
318
  const up = await client.uploadFile(baseFilePath);
311
- const char = await client.createCharacter({ name, gender, mode: 'upload', identity, baseHandle: up.handle });
319
+ const char = await client.createCharacter({ name, gender, mode: 'upload', identity, baseHandle: up.handle, basePresetId });
312
320
  if (char?.status === 'awaiting_approval') return ok({ ...char, resume: RESUME_CREATE });
313
321
  return ok({ ...char, ready: true });
314
322
  }
315
323
  // mode === 'generate': create then poll until base_image_url is set
316
- const c = await client.createCharacter({ name, gender, mode: 'generate', identity });
324
+ const c = await client.createCharacter({ name, gender, mode: 'generate', identity, basePresetId });
317
325
  if (c?.status === 'awaiting_approval') return ok({ ...c, resume: RESUME_CREATE });
318
326
  const { characterId } = c;
319
327
  const deadline = Date.now() + (timeoutSeconds ?? 300) * 1000;
@@ -546,7 +554,7 @@ export function registerTools(server, client, { now = Date.now, sleep = (ms) =>
546
554
  inputSchema: {
547
555
  id: z.string().describe('Recipe id from list_recipes'),
548
556
  inputs: z.record(z.any()).describe('Input values keyed by the recipe\'s input keys (see list_recipes -> inputs).'),
549
- engine: z.enum(['local', 'cloud', 'auto']).optional().describe('Where the steps render. auto = local if every step is installed, else cloud when connected.'),
557
+ engine: z.enum(['local', 'cloud', 'auto']).optional().describe('Where the steps render. auto = local; it uses the cloud only on a PC with no local engine. cloud costs credits and is refused while the user has Local only on.'),
550
558
  },
551
559
  },
552
560
  wrap(({ id, inputs, engine }) => client.runRecipe(id, { inputs: inputs || {}, ...(engine ? { engine } : {}) })));
@@ -627,12 +635,12 @@ export function registerTools(server, client, { now = Date.now, sleep = (ms) =>
627
635
  const people = z.array(z.string()).describe('Characters by name or id (make them with create_character). As many as the preset holds: eight on MiniMax H3, up to four on the LTX cast presets. A cast too big for its preset moves the clip to an installed preset that holds it; only a cast no installed preset holds is refused.');
628
636
 
629
637
  server.registerTool('list_films',
630
- { title: 'List films', description: 'The Video Studio films of a project (default: the current one): id, title, number of clips. The film tools need the Video Studio in SimpliGen; without it they answer studio_not_installed.', inputSchema: { projectId: z.string().optional() } },
638
+ { title: 'List films', description: 'The Video Studio films of a project (default: the current one): id, title, number of clips. The film tools need the Video Studio in SimpliGen; without it they answer studio_not_installed.', inputSchema: { projectId: projectArg('The project (Gallery) whose films to list') } },
631
639
  wrap(({ projectId }) => client.listFilms(projectId)));
632
640
 
633
641
  server.registerTool('create_film',
634
- { title: 'Create a film', description: 'Create an empty Video Studio film and answer its timeline. Shape 16:9, 9:16 or 1:1; resolution 480p, 720p or 1080p; renders on this PC (local) or in the cloud. Presets per kind of shot default to the studio\'s own choice.', inputSchema: {
635
- name: z.string(), projectId: z.string().optional(),
642
+ { title: 'Create a film', description: 'Create an empty Video Studio film and answer its timeline. Shape 16:9, 9:16 or 1:1; resolution 480p, 720p or 1080p; renders on this PC (local) or in the cloud. Pick the preset per kind of shot (t2v, i2v, r2v) here or later with update_film_settings; render_clips holds every clip whose kind of shot has no preset.', inputSchema: {
643
+ name: z.string(), projectId: projectArg('The project (Gallery) the film belongs to'),
636
644
  aspect: z.enum(['16:9', '9:16', '1:1']).optional(), quality: z.enum(['480p', '720p', '1080p']).optional(),
637
645
  renderOn: z.enum(['local', 'cloud']).optional(),
638
646
  presets: z.object({ t2v: z.string().optional(), i2v: z.string().optional(), r2v: z.string().optional() }).optional().describe('Film presets per kind of shot (pack:preset ids from list_capabilities).'),