@simpligen/mcp 0.7.0 → 0.8.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/README.md CHANGED
@@ -1,47 +1,47 @@
1
- # @simpligen/mcp
2
-
3
- MCP server that lets an AI agent drive SimpliGen (local + cloud AI image/video generation). Requires the SimpliGen desktop app running and a pairing token (Settings -> Connect an agent).
4
-
5
- ## Configure (Claude Code / Claude Desktop)
6
-
7
- The easiest path is in the SimpliGen app: **Settings -> Connect an agent**, pick your client, and click Install (or copy the guided command). The manual config below is the fallback.
8
-
9
- ```json
10
- {
11
- "mcpServers": {
12
- "simpligen": {
13
- "command": "npx",
14
- "args": ["-y", "@simpligen/mcp"],
15
- "env": { "SIMPLIGEN_TOKEN": "sg-agent-..." }
16
- }
17
- }
18
- }
19
- ```
20
-
21
- ## Tools
22
-
23
- `list_capabilities`, `get_status`, `list_projects`, `create_project`, `upload_file`, `generate`, `get_job`, `wait_for_result`, `list_jobs`, `cancel_job`, `prepare_preset`, `get_result_image`, `wait_for_approval`, `get_app_context`, `fill_generate_form`, `open_screen`, `accept_character_base`.
24
-
25
- **Approval flow (SimpliGen's in-app Assistant).** A token the app issues for its own Assistant panel is flagged `approvalRequired`. With it, any call that queues a generation, renders or exports a film, runs a recipe, or deletes a character or product does not run. It returns `awaiting_approval` with a `proposalId`, and the user sees an approval card in the app. Call `wait_for_approval(proposalId)` (it long-polls in short rounds, like `wait_for_result`). It returns the real result once the user clicks Approve, or `declined` with the user's optional reason so you can adjust and propose again. For `regenerate_character_base`, the approved result carries a base job id: wait on it with `wait_for_result`, then call `accept_character_base`. Normal pairing tokens (Claude Desktop and other clients) never see this flow.
26
-
27
- **Screen tools.** `get_app_context` returns what the user is looking at. `fill_generate_form` fills the visible Generate form and never presses Generate. `open_screen` navigates the app. They work for outside MCP clients too.
28
-
29
- **Video Studio** (connector 0.5.0 or newer): `list_films`, `create_film`, `get_film`, `update_film_settings`, `add_track`, `move_track`, `detect_tempo`, `add_clip`, `update_clip`, `move_clip`, `trim_clip`, `remove_clip`, `apply_film_plan`, `set_fades`, `add_marker`, `set_export_range`, `render_clips`, `wait_for_renders`, `list_takes`, `use_take`, `export_film`, `list_locations`, `create_location`. An agent can build a whole music video: a song, its tempo, clips on the bars, shots, renders and the export. With the film open in the Video Studio every change shows live and undoes with Ctrl+Z. These tools are listed only when your SimpliGen has the Video Studio (connector 0.5.1 or newer, SimpliGen 1.75 or newer). If the agent starts before SimpliGen is running, they appear within a minute of SimpliGen starting; an agent app that does not refresh its tool list shows them after a restart.
30
-
31
- `get_result_image` returns a completed job's result image inline (a viewable image block) so the agent can display it in chat. Claude clients cap a tool result at ~1MB and only render base64 image blocks, so large renders are re-encoded to a **full-resolution WebP** preview (same dimensions; quality steps down, and only very large images are resized) that fits the cap. The uncompressed original file path is always included in the caption, so the agent keeps the full-quality artifact. Video results return the file path instead.
32
-
33
- ## Env
34
-
35
- - `SIMPLIGEN_TOKEN` (required) -- pairing token from the app.
36
- - `SIMPLIGEN_API_PORT` (optional) -- override the control-API port (else read from the app's discovery file).
37
- - `SIMPLIGEN_USERDATA_DIR` / `SIMPLIGEN_APP_NAME` (optional) -- locate the app's data dir (CN variant / custom).
38
-
39
- ## Manual smoke (for maintainers)
40
-
41
- With the app running and a token issued:
42
-
43
- ```bash
44
- SIMPLIGEN_TOKEN=<token> npx @modelcontextprotocol/inspector node src/bin.js
45
- ```
46
-
47
- Verify: tool list appears; call `get_status`; call `list_capabilities`; call `upload_file` with a PNG path and confirm a handle is returned; call `generate` with a local preset and confirm a `jobId`; call `wait_for_result` and confirm a `resultPath`; call `get_result_image` and confirm the image renders inline.
1
+ # @simpligen/mcp
2
+
3
+ MCP server that lets an AI agent drive SimpliGen (local + cloud AI image/video generation). Requires the SimpliGen desktop app running and a pairing token (Settings -> Connect an agent).
4
+
5
+ ## Configure (Claude Code / Claude Desktop)
6
+
7
+ The easiest path is in the SimpliGen app: **Settings -> Connect an agent**, pick your client, and click Install (or copy the guided command). The manual config below is the fallback.
8
+
9
+ ```json
10
+ {
11
+ "mcpServers": {
12
+ "simpligen": {
13
+ "command": "npx",
14
+ "args": ["-y", "@simpligen/mcp"],
15
+ "env": { "SIMPLIGEN_TOKEN": "sg-agent-..." }
16
+ }
17
+ }
18
+ }
19
+ ```
20
+
21
+ ## Tools
22
+
23
+ `list_capabilities`, `get_status`, `list_projects`, `create_project`, `upload_file`, `generate`, `get_job`, `wait_for_result`, `list_jobs`, `cancel_job`, `prepare_preset`, `get_result_image`, `wait_for_approval`, `get_app_context`, `fill_generate_form`, `open_screen`, `accept_character_base`.
24
+
25
+ **Approval flow (SimpliGen's in-app Assistant).** A token the app issues for its own Assistant panel is flagged `approvalRequired`. With it, any call that queues a generation, renders or exports a film, runs a recipe, or deletes a character or product does not run. It returns `awaiting_approval` with a `proposalId`, and the user sees an approval card in the app. Call `wait_for_approval(proposalId)` (it long-polls in short rounds, like `wait_for_result`). It returns the real result once the user clicks Approve, or `declined` with the user's optional reason so you can adjust and propose again. For `regenerate_character_base`, the approved result carries a base job id: wait on it with `wait_for_result`, then call `accept_character_base`. Normal pairing tokens (Claude Desktop and other clients) never see this flow.
26
+
27
+ **Screen tools.** `get_app_context` returns what the user is looking at. `fill_generate_form` fills the visible Generate form and never presses Generate. `open_screen` navigates the app. They work for outside MCP clients too.
28
+
29
+ **Video Studio** (connector 0.5.0 or newer): `list_films`, `create_film`, `get_film`, `update_film_settings`, `add_track`, `move_track`, `detect_tempo`, `add_clip`, `update_clip`, `move_clip`, `trim_clip`, `remove_clip`, `apply_film_plan`, `set_fades`, `add_marker`, `set_export_range`, `render_clips`, `wait_for_renders`, `list_takes`, `use_take`, `export_film`, `list_locations`, `create_location`. An agent can build a whole music video: a song, its tempo, clips on the bars, shots, renders and the export. With the film open in the Video Studio every change shows live and undoes with Ctrl+Z. They need the Video Studio in SimpliGen (SimpliGen 1.75 or newer). Since connector 0.8.0 they are always listed; without the studio each one answers `studio_not_installed`.
30
+
31
+ `get_result_image` returns a completed job's result image inline (a viewable image block) so the agent can display it in chat. Claude clients cap a tool result at ~1MB and only render base64 image blocks, so large renders are re-encoded to a **full-resolution WebP** preview (same dimensions; quality steps down, and only very large images are resized) that fits the cap. The uncompressed original file path is always included in the caption, so the agent keeps the full-quality artifact. Video results return the file path instead.
32
+
33
+ ## Env
34
+
35
+ - `SIMPLIGEN_TOKEN` (required) -- pairing token from the app.
36
+ - `SIMPLIGEN_API_PORT` (optional) -- override the control-API port (else read from the app's discovery file).
37
+ - `SIMPLIGEN_USERDATA_DIR` / `SIMPLIGEN_APP_NAME` (optional) -- locate the app's data dir (CN variant / custom).
38
+
39
+ ## Manual smoke (for maintainers)
40
+
41
+ With the app running and a token issued:
42
+
43
+ ```bash
44
+ SIMPLIGEN_TOKEN=<token> npx @modelcontextprotocol/inspector node src/bin.js
45
+ ```
46
+
47
+ Verify: tool list appears; call `get_status`; call `list_capabilities`; call `upload_file` with a PNG path and confirm a handle is returned; call `generate` with a local preset and confirm a `jobId`; call `wait_for_result` and confirm a `resultPath`; call `get_result_image` and confirm the image renders inline.
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
- {
2
- "name": "@simpligen/mcp",
3
- "version": "0.7.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.8.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
+ }
package/src/bin.js CHANGED
@@ -1,16 +1,13 @@
1
1
  #!/usr/bin/env node
2
- // packages/mcp-server/src/bin.js
3
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
- import { ControlApiClient } from './client.js';
5
- import { createMcpServer } from './server.js';
6
-
7
- async function main() {
8
- const client = new ControlApiClient(); // resolves port (discovery file) + token (SIMPLIGEN_TOKEN)
9
- const server = createMcpServer(client);
10
- // Whether the app holds the Video Studio decides which tools the client first sees.
11
- // A closed app answers at once; a stuck one gets 3 s, then the poll takes over.
12
- await Promise.race([server.studioGate.refresh(), new Promise((r) => setTimeout(r, 3000).unref())]);
13
- await server.connect(new StdioServerTransport());
14
- }
15
-
16
- main().catch((err) => { console.error('[simpligen-mcp] fatal:', err?.message || err); process.exit(1); });
2
+ // packages/mcp-server/src/bin.js
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { ControlApiClient } from './client.js';
5
+ import { createMcpServer } from './server.js';
6
+
7
+ async function main() {
8
+ const client = new ControlApiClient(); // resolves port (discovery file) + token (SIMPLIGEN_TOKEN)
9
+ const server = createMcpServer(client);
10
+ await server.connect(new StdioServerTransport());
11
+ }
12
+
13
+ main().catch((err) => { console.error('[simpligen-mcp] fatal:', err?.message || err); process.exit(1); });
package/src/index.js CHANGED
@@ -1,7 +1,6 @@
1
- // packages/mcp-server/src/index.js
2
- export { ControlApiClient, ControlApiError } from './client.js';
3
- export { createMcpServer } from './server.js';
4
- export { registerTools, TOOL_NAMES, STUDIO_TOOL_NAMES } from './tools.js';
5
- export { createStudioGate } from './studioGate.js';
6
- export { buildResultImageContent } from './resultImage.js';
7
- export { resolveUserDataDir, readDiscoveryPort } from './userdata.js';
1
+ // packages/mcp-server/src/index.js
2
+ export { ControlApiClient, ControlApiError } from './client.js';
3
+ export { createMcpServer } from './server.js';
4
+ export { registerTools, TOOL_NAMES, STUDIO_TOOL_NAMES } from './tools.js';
5
+ export { buildResultImageContent } from './resultImage.js';
6
+ export { resolveUserDataDir, readDiscoveryPort } from './userdata.js';
package/src/server.js CHANGED
@@ -1,24 +1,15 @@
1
- // packages/mcp-server/src/server.js
2
- import { createRequire } from 'node:module';
3
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
- import { registerTools } from './tools.js';
5
- import { createStudioGate } from './studioGate.js';
6
-
7
- const { version } = createRequire(import.meta.url)('../package.json');
8
-
9
- /**
10
- * @param {object} client a ControlApiClient
11
- * @param {{ studioPollMs?: number }} [options] how often to ask the app whether it holds the Video Studio
12
- */
13
- export function createMcpServer(client, { studioPollMs } = {}) {
14
- const server = new McpServer({ name: 'simpligen', version });
15
- let gate = null;
16
- const { studioTools } = registerTools(server, client, { onStatus: (status) => gate?.observe(status) });
17
- gate = createStudioGate({ client, tools: studioTools, notify: () => server.sendToolListChanged(), pollMs: studioPollMs });
18
- // The gate asks the app once a client is connected, and stops when it goes.
19
- server.server.oninitialized = () => gate.start();
20
- server.server.onclose = () => gate.stop();
21
- // bin.js reads the status once before connecting, so the first tool list is already right.
22
- server.studioGate = gate;
23
- return server;
24
- }
1
+ // packages/mcp-server/src/server.js
2
+ import { createRequire } from 'node:module';
3
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+ import { registerTools } from './tools.js';
5
+
6
+ const { version } = createRequire(import.meta.url)('../package.json');
7
+
8
+ /**
9
+ * @param {object} client a ControlApiClient
10
+ */
11
+ export function createMcpServer(client) {
12
+ const server = new McpServer({ name: 'simpligen', version });
13
+ registerTools(server, client);
14
+ return server;
15
+ }