@simpligen/mcp 0.8.1 → 0.9.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,71 @@
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`, `import_clip` (0.8.1), `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.
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`, `import_clip` (0.8.1), `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
+ ## If your client does not forward env vars
34
+
35
+ Some MCP clients spawn the server without passing `env` through, and the connector
36
+ then reports `missing_token` however carefully the variable was set. Pass the token
37
+ as an argument instead, which every client can express:
38
+
39
+ ```json
40
+ {
41
+ "mcpServers": {
42
+ "simpligen": {
43
+ "command": "npx",
44
+ "args": ["-y", "@simpligen/mcp", "--token", "sg-agent-..."]
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ `--port` works the same way. Both accept `--name value` or `--name=value`.
51
+
52
+ The environment is still the better route where it works: an argument is visible in
53
+ the process list and an environment variable is not. Use this when the client leaves
54
+ you no choice.
55
+
56
+ ## Env
57
+
58
+ - `SIMPLIGEN_TOKEN` (required) -- pairing token from the app.
59
+ - `SIMPLIGEN_API_PORT` (optional) -- override the control-API port (else read from the app's discovery file).
60
+ - Both can be given as `--token` / `--port` arguments instead; see above.
61
+ - `SIMPLIGEN_USERDATA_DIR` / `SIMPLIGEN_APP_NAME` (optional) -- locate the app's data dir (CN variant / custom).
62
+
63
+ ## Manual smoke (for maintainers)
64
+
65
+ With the app running and a token issued:
66
+
67
+ ```bash
68
+ SIMPLIGEN_TOKEN=<token> npx @modelcontextprotocol/inspector node src/bin.js
69
+ ```
70
+
71
+ 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.8.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
- }
1
+ {
2
+ "name": "@simpligen/mcp",
3
+ "version": "0.9.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,13 +1,18 @@
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
- await server.connect(new StdioServerTransport());
11
- }
12
-
13
- 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
+ import { parseCliArgs } from './cliArgs.js';
7
+
8
+ async function main() {
9
+ // Token and port come from the environment by default. A client that cannot
10
+ // forward environment variables to the process it spawns may pass them as
11
+ // arguments instead, which every MCP client can express (TASK-1466).
12
+ const cli = parseCliArgs(process.argv.slice(2));
13
+ const client = new ControlApiClient(cli); // else: port from the discovery file, token from SIMPLIGEN_TOKEN
14
+ const server = createMcpServer(client);
15
+ await server.connect(new StdioServerTransport());
16
+ }
17
+
18
+ main().catch((err) => { console.error('[simpligen-mcp] fatal:', err?.message || err); process.exit(1); });
package/src/cliArgs.js ADDED
@@ -0,0 +1,51 @@
1
+ // packages/mcp-server/src/cliArgs.js
2
+ //
3
+ // The pairing token and the control-API port, read from the command line.
4
+ //
5
+ // WHY THIS EXISTS. The token could only be given through SIMPLIGEN_TOKEN, so a
6
+ // client that does not forward environment variables to the process it spawns
7
+ // could not use SimpliGen at all, and said so with `missing_token`. Every MCP
8
+ // client can express `args`; not every one forwards `env`. nolayups1047 lost a
9
+ // working setup to exactly this on ChatGPT for Windows, with the variable set
10
+ // in the client's own key/value box (2026-11-08, TASK-1466).
11
+ //
12
+ // The environment remains the default and the documented route. These only
13
+ // fill in when a client cannot. A value passed here is visible in the process
14
+ // list, which an environment variable is not, so it is the fallback rather
15
+ // than the recommendation.
16
+ //
17
+ // Deliberately forgiving: an unparseable value is dropped rather than passed
18
+ // on, and an unknown argument is ignored rather than fatal. This runs before a
19
+ // stdio server has a transport, so a throw here is a connector that dies with
20
+ // nothing the user can read.
21
+
22
+ /**
23
+ * @param {string[]} argv process.argv.slice(2)
24
+ * @returns {{ token?: string, port?: number }}
25
+ */
26
+ export function parseCliArgs(argv = []) {
27
+ const out = {};
28
+ const list = Array.isArray(argv) ? argv : [];
29
+
30
+ /** `--name value` or `--name=value`, whichever the client wrote. */
31
+ const valueOf = (name, i) => {
32
+ const arg = list[i];
33
+ if (arg === `--${name}`) return list[i + 1];
34
+ if (typeof arg === 'string' && arg.startsWith(`--${name}=`)) return arg.slice(name.length + 3);
35
+ return undefined;
36
+ };
37
+
38
+ for (let i = 0; i < list.length; i++) {
39
+ const token = valueOf('token', i);
40
+ // An empty value is NOT a token. Without this, `--token` with nothing
41
+ // after it would blank a perfectly good environment variable.
42
+ if (typeof token === 'string' && token.length > 0) out.token = token;
43
+
44
+ const port = valueOf('port', i);
45
+ if (typeof port === 'string' && port.length > 0) {
46
+ const n = Number(port);
47
+ if (Number.isInteger(n) && n > 0 && n <= 65535) out.port = n;
48
+ }
49
+ }
50
+ return out;
51
+ }