@starreel/mcp 0.1.41 → 0.1.43

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,51 +1,194 @@
1
- # @starreel/mcp
1
+ # StarReel MCP
2
2
 
3
- StarReel 的 MCP 服务器 —— 把 AI 短剧**编排产线**暴露给 Claude Code / Cursor /
4
- 任何 MCP 客户端:让 AI agent 一句话从**剧本跑到可下载的成片**。
3
+ > Turn a script into a finished, downloadable short-drama episode — from Claude, Cursor, or any MCP client.
5
4
 
6
- 完整接入文档:https://api.shortreelai.com/docs/mcp
5
+ [![npm version](https://img.shields.io/npm/v/%40starreel%2Fmcp)](https://www.npmjs.com/package/@starreel/mcp)
6
+ [![npm downloads](https://img.shields.io/npm/dm/%40starreel%2Fmcp)](https://www.npmjs.com/package/@starreel/mcp)
7
+ [![license](https://img.shields.io/badge/license-MIT-blue)](./LICENSE)
8
+ [![node](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)
7
9
 
8
- **给 AI agent 的操作 Skill 与纪律**:本包内 [`SKILL.md`](./SKILL.md) —— 一份平台无关的
9
- 操作手册(完整产线顺序 + 十条接入纪律 + 失败处理决策)。支持 Skill 的客户端会自动加载;
10
- 不能 npx 的平台(Coze / Dify / GPTs / 自研 agent)可把它整段贴进 system prompt。
10
+ **StarReel** is a prepaid AI video-production pipeline. This MCP server exposes the
11
+ whole factory — **80+ tools** covering every stage — so an AI agent can take a raw
12
+ script all the way to a finished `.mp4`:
11
13
 
12
- ## 接入
14
+ ```
15
+ script → AI rewrite → cast / scenes / props extraction → character portraits & sheets
16
+ → storyboards → keyframes → video shots → voiceover (TTS) → final cut (.mp4 link)
17
+ ```
18
+
19
+ It is a thin, open client: all the heavy lifting (character-consistency gates,
20
+ frame chaining, best-of-N auditing, billing) runs server-side at
21
+ [starreel.ai](https://starreel.ai).
22
+
23
+ ## Quick start
24
+
25
+ [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=starreel&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzdGFycmVlbC9tY3AiXSwiZW52Ijp7IlNUQVJSRUVMX0FQSV9LRVkiOiJzcmtfbGl2ZV94eHgifX0=)
26
+ [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_MCP-0098FF)](https://vscode.dev/redirect/mcp/install?name=starreel&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40starreel%2Fmcp%22%5D%2C%22env%22%3A%7B%22STARREEL_API_KEY%22%3A%22srk_live_xxx%22%7D%7D)
13
27
 
14
- 1. 在 StarReel → 设置 → API Key 创建一把 `produce` scope 的 key(`srk_live_...`,只展示一次)。
15
- 2. Claude Code:
28
+ 1. Create an API key with `produce` scope in **StarReel → Settings → API Keys**
29
+ (`srk_live_...`, shown once).
30
+ 2. Add the server to Claude Code:
16
31
 
17
32
  ```bash
18
33
  claude mcp add starreel -e STARREEL_API_KEY=srk_live_xxx -- npx -y @starreel/mcp
19
34
  ```
20
35
 
21
- 其他 MCP 客户端(Cursor 等)照各自配置格式填 `npx -y @starreel/mcp` + 环境变量即可。
36
+ Or install the **Claude Code plugin** — MCP server + agent skill in one step
37
+ (set `STARREEL_API_KEY` in your shell first):
38
+
39
+ ```text
40
+ /plugin marketplace add waydaxp/starreel-mcp
41
+ /plugin install starreel@starreel
42
+ ```
43
+
44
+ 3. Ask your agent: *"Take this script and produce a full episode: `<your script>`"* —
45
+ it will quote each paid stage first and only spend after you confirm.
46
+
47
+ ## Works with any MCP client
48
+
49
+ Requires Node ≥ 18 (`npx`). The **standard config** below works as-is in
50
+ **Cursor · Windsurf · Cline / Roo Code · Claude Desktop · Trae · Cherry Studio ·
51
+ Chatbox · DeepChat** and any client that reads an `mcpServers` JSON block:
52
+
53
+ ```json
54
+ {
55
+ "mcpServers": {
56
+ "starreel": {
57
+ "command": "npx",
58
+ "args": ["-y", "@starreel/mcp"],
59
+ "env": { "STARREEL_API_KEY": "srk_live_xxx" }
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ Clients with their own format:
66
+
67
+ <details>
68
+ <summary><b>Codex CLI</b> — <code>~/.codex/config.toml</code></summary>
69
+
70
+ ```toml
71
+ [mcp_servers.starreel]
72
+ command = "npx"
73
+ args = ["-y", "@starreel/mcp"]
74
+ env = { "STARREEL_API_KEY" = "srk_live_xxx" }
75
+ ```
76
+ </details>
77
+
78
+ <details>
79
+ <summary><b>VS Code (Copilot agent mode)</b> — <code>.vscode/mcp.json</code> or user <code>mcp.json</code></summary>
80
+
81
+ ```json
82
+ {
83
+ "servers": {
84
+ "starreel": {
85
+ "command": "npx",
86
+ "args": ["-y", "@starreel/mcp"],
87
+ "env": { "STARREEL_API_KEY": "srk_live_xxx" }
88
+ }
89
+ }
90
+ }
91
+ ```
92
+ </details>
93
+
94
+ <details>
95
+ <summary><b>Gemini CLI</b> — <code>~/.gemini/settings.json</code></summary>
96
+
97
+ ```json
98
+ {
99
+ "mcpServers": {
100
+ "starreel": {
101
+ "command": "npx",
102
+ "args": ["-y", "@starreel/mcp"],
103
+ "env": { "STARREEL_API_KEY": "srk_live_xxx" }
104
+ }
105
+ }
106
+ }
107
+ ```
108
+ </details>
22
109
 
23
- ## 产线工具(从剧本到成片)
110
+ <details>
111
+ <summary><b>No Node / can't run npx?</b> (Coze, Dify, GPTs, custom agents)</summary>
24
112
 
25
- 一集短剧的完整链路,每个花钱阶段先报价、你确认后才执行:
113
+ Drive the same pipeline over REST (`/v1/produce/*`) and paste
114
+ [`SKILL.md`](./SKILL.md) into your system prompt — it carries the full
115
+ workflow order, billing disciplines, and failure playbook.
116
+ See the [API docs](https://api.shortreelai.com/docs/mcp).
117
+ </details>
26
118
 
27
- | 阶段 | 工具 |
119
+ ## What's inside
120
+
121
+ | Stage | Tools (selection) |
28
122
  |---|---|
29
- | 建剧 | `create_drama`(建剧壳+自动建集,返回 episode_id) |
30
- | 灌本 | `set_script` |
31
- | 拆镜 | `quote_storyboards` → `generate_storyboards` → `get_storyboards`(审阅) |
32
- | 出首帧 | `quote_frames` → `generate_frames` |
33
- | 出视频 | `quote_videos` → `generate_videos`(大额,报价与扣费同函数) |
34
- | 成片 | `compose_episode`(免费终拼) → `get_final_cut`(拿 COS 下载链接) |
123
+ | Project setup | `create_drama` · `update_project_settings` · `list_project_options` |
124
+ | Script | `set_script` · AI rewrite · `edit_rewritten_script` |
125
+ | Cast & world | asset extraction · `update_character` · `generate_world_concept` · `generate_art_bible` |
126
+ | Identity anchors | `generate_portraits_and_sheets` (portraits + character sheets = the consistency anchor) |
127
+ | Storyboards | `quote_storyboards` → `generate_storyboards` → `get_storyboards` |
128
+ | Frames & video | `quote_frames` → `generate_frames` · `quote_videos` → `generate_videos` |
129
+ | Audio | `generate_tts` · `generate_bgm` · `generate_sfx` · voice management |
130
+ | Finishing | `compose_episode` (free) · `get_final_cut` · `render_multi_aspect` · posters & covers |
131
+ | Localization | `translate_subtitles` · localization jobs |
132
+ | Ads / MV modes | product library & product sheets · MV lyrics → story → script |
133
+
134
+ Project types: `drama` / `ad` / `mv` / `brand_film`.
35
135
 
36
- **批量报价确认**:每个 `quote_*` 返回预估点数,agent 应把点数告诉你、你同意后才用返回的
37
- `quote_id` 调 `generate_*`。整集一次执行,不逐图打扰。长任务后台异步,用 `get_storyboards`/
38
- `get_final_cut` 轮询到完成。
136
+ ## Billing is agent-safe by design
39
137
 
40
- ## 计费与安全
138
+ - **Prepaid, never negative.** Costs are pre-authorized *before* any vendor call;
139
+ insufficient balance returns a clean `402` — nothing half-runs.
140
+ - **Quote before spend.** Big-ticket stages are `quote_*` → show the user →
141
+ `generate_*` with the returned `quote_id`. For video, **quote == actual charge**
142
+ (same function computes both).
143
+ - **Final cut is free.** Composition, transitions, SFX matching and deliverable
144
+ packaging don't bill.
145
+ - API keys are stored hashed and exchanged for 15-minute short-lived tokens;
146
+ revoke in Settings at any time.
41
147
 
42
- - 预付制:必须有余额才能生成,账户**永不为负**;成本在调厂商**之前**预授权,不够返回 402。
43
- - 视频报价 == 实际扣费(同一函数);终拼(成片)免费。
44
- - API key 只存哈希;换取的是 15 分钟短期令牌;泄露在设置页吊销即失效,不影响网页登录。
148
+ ## Built for agents: the operating skill
149
+
150
+ [`SKILL.md`](./SKILL.md) ships inside the package — a platform-agnostic operating
151
+ manual (full pipeline order + ten operating disciplines + a failure playbook).
152
+ Skill-aware clients load it automatically; on platforms that can't run `npx`
153
+ (Coze / Dify / GPTs / custom agents) paste it into the system prompt and drive
154
+ the same pipeline over REST (`/v1/produce/*`).
155
+
156
+ Install it as a standalone agent skill (Claude Code, Codex, Cursor, OpenCode
157
+ and [70+ agents](https://github.com/vercel-labs/skills#supported-agents)) via
158
+ the [`skills`](https://skills.sh) CLI:
159
+
160
+ ```bash
161
+ npx skills add waydaxp/starreel-mcp
162
+ ```
45
163
 
46
- ## 环境变量
164
+ ## Environment variables
47
165
 
48
- | 变量 | 必填 | 默认 |
166
+ | Variable | Required | Default |
49
167
  |---|---|---|
50
168
  | `STARREEL_API_KEY` | ✅ | — |
51
169
  | `STARREEL_AUTH_BASE` | | `https://api.shortreelai.com` |
170
+
171
+ ## REST API (OpenAPI)
172
+
173
+ Prefer plain REST? The full production facade is described in
174
+ [`openapi.json`](./openapi.json) (OpenAPI 3.1, 100+ operations — generated from
175
+ this package's tool surface, so `operationId`s match MCP tool names 1:1).
176
+ Browse it rendered at
177
+ [waydaxp.github.io/starreel-mcp](https://waydaxp.github.io/starreel-mcp/), or
178
+ generate a typed client for any language:
179
+
180
+ ```bash
181
+ npx openapi-typescript https://raw.githubusercontent.com/waydaxp/starreel-mcp/main/openapi.json -o starreel.d.ts
182
+ ```
183
+
184
+ ## Links
185
+
186
+ - Website: [starreel.ai](https://starreel.ai)
187
+ - API reference (OpenAPI): [waydaxp.github.io/starreel-mcp](https://waydaxp.github.io/starreel-mcp/)
188
+ - Full MCP / REST docs: [api.shortreelai.com/docs/mcp](https://api.shortreelai.com/docs/mcp)
189
+ - npm: [@starreel/mcp](https://www.npmjs.com/package/@starreel/mcp)
190
+ - 中文文档: [README.zh-CN.md](./README.zh-CN.md)
191
+
192
+ ## License
193
+
194
+ [MIT](./LICENSE) — this client is open; the production pipeline is a hosted service.
@@ -0,0 +1,108 @@
1
+ # @starreel/mcp
2
+
3
+ StarReel 的 MCP 服务器 —— 把 AI 短剧**编排产线**暴露给 Claude Code / Cursor /
4
+ 任何 MCP 客户端:让 AI agent 一句话从**剧本跑到可下载的成片**。
5
+
6
+ 完整接入文档:https://api.shortreelai.com/docs/mcp
7
+
8
+ **给 AI agent 的操作 Skill 与纪律**:本包内 [`SKILL.md`](./SKILL.md) —— 一份平台无关的
9
+ 操作手册(完整产线顺序 + 十条接入纪律 + 失败处理决策)。支持 Skill 的客户端会自动加载;
10
+ 不能 npx 的平台(Coze / Dify / GPTs / 自研 agent)可把它整段贴进 system prompt。
11
+
12
+ 也可用 [`skills`](https://skills.sh) CLI 一条命令装成独立 agent skill
13
+ (Claude Code / Codex / Cursor / OpenCode 等 70+ 工具):
14
+
15
+ ```bash
16
+ npx skills add waydaxp/starreel-mcp
17
+ ```
18
+
19
+ ## 接入
20
+
21
+ 1. 在 StarReel → 设置 → API Key 创建一把 `produce` scope 的 key(`srk_live_...`,只展示一次)。
22
+ 2. Claude Code:
23
+
24
+ ```bash
25
+ claude mcp add starreel -e STARREEL_API_KEY=srk_live_xxx -- npx -y @starreel/mcp
26
+ ```
27
+
28
+ 也可装 **Claude Code 插件**——MCP server + agent skill 一步到位
29
+ (先在 shell 里 `export STARREEL_API_KEY=srk_live_xxx`):
30
+
31
+ ```text
32
+ /plugin marketplace add waydaxp/starreel-mcp
33
+ /plugin install starreel@starreel
34
+ ```
35
+
36
+ 一键安装:
37
+ [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=starreel&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzdGFycmVlbC9tY3AiXSwiZW52Ijp7IlNUQVJSRUVMX0FQSV9LRVkiOiJzcmtfbGl2ZV94eHgifX0=)
38
+ [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_MCP-0098FF)](https://vscode.dev/redirect/mcp/install?name=starreel&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40starreel%2Fmcp%22%5D%2C%22env%22%3A%7B%22STARREEL_API_KEY%22%3A%22srk_live_xxx%22%7D%7D)
39
+
40
+ ## 全客户端接入
41
+
42
+ 要求 Node ≥ 18(能跑 `npx`)。下面这段**标准配置**在
43
+ **Cursor · Windsurf · Cline / Roo Code · Claude Desktop · Trae · Cherry Studio ·
44
+ Chatbox · DeepChat** 及任何读 `mcpServers` JSON 的客户端里通用:
45
+
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "starreel": {
50
+ "command": "npx",
51
+ "args": ["-y", "@starreel/mcp"],
52
+ "env": { "STARREEL_API_KEY": "srk_live_xxx" }
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ 格式不同的客户端:
59
+
60
+ - **Codex CLI** — `~/.codex/config.toml`:
61
+
62
+ ```toml
63
+ [mcp_servers.starreel]
64
+ command = "npx"
65
+ args = ["-y", "@starreel/mcp"]
66
+ env = { "STARREEL_API_KEY" = "srk_live_xxx" }
67
+ ```
68
+
69
+ - **VS Code(Copilot agent 模式)** — `.vscode/mcp.json` 或用户级 `mcp.json`,外层键是 `servers` 而非 `mcpServers`,内容同标准配置。
70
+ - **Gemini CLI** — `~/.gemini/settings.json`,直接放标准配置。
71
+ - **跑不了 npx 的平台(扣子 Coze / Dify / GPTs / 自研 agent)** — 走 REST(`/v1/produce/*`)+ 把 [`SKILL.md`](./SKILL.md) 整段贴进 system prompt,见[接入文档](https://api.shortreelai.com/docs/mcp)。
72
+
73
+ ## 产线工具(从剧本到成片)
74
+
75
+ 一集短剧的完整链路,每个花钱阶段先报价、你确认后才执行:
76
+
77
+ | 阶段 | 工具 |
78
+ |---|---|
79
+ | 建剧 | `create_drama`(建剧壳+自动建集,返回 episode_id) |
80
+ | 灌本 | `set_script` |
81
+ | 拆镜 | `quote_storyboards` → `generate_storyboards` → `get_storyboards`(审阅) |
82
+ | 出首帧 | `quote_frames` → `generate_frames` |
83
+ | 出视频 | `quote_videos` → `generate_videos`(大额,报价与扣费同函数) |
84
+ | 成片 | `compose_episode`(免费终拼) → `get_final_cut`(拿 COS 下载链接) |
85
+
86
+ **批量报价确认**:每个 `quote_*` 返回预估点数,agent 应把点数告诉你、你同意后才用返回的
87
+ `quote_id` 调 `generate_*`。整集一次执行,不逐图打扰。长任务后台异步,用 `get_storyboards`/
88
+ `get_final_cut` 轮询到完成。
89
+
90
+ ## 计费与安全
91
+
92
+ - 预付制:必须有余额才能生成,账户**永不为负**;成本在调厂商**之前**预授权,不够返回 402。
93
+ - 视频报价 == 实际扣费(同一函数);终拼(成片)免费。
94
+ - API key 只存哈希;换取的是 15 分钟短期令牌;泄露在设置页吊销即失效,不影响网页登录。
95
+
96
+ ## REST API(OpenAPI)
97
+
98
+ 想直接裸调 REST?整个产线门面见 [`openapi.json`](./openapi.json)
99
+ (OpenAPI 3.1,100+ 操作,从本包工具面生成,operationId 与 MCP 工具名一一对应)。
100
+ 在线渲染版:[waydaxp.github.io/starreel-mcp](https://waydaxp.github.io/starreel-mcp/);
101
+ 也可用它给任意语言生成带类型客户端(如 `npx openapi-typescript`)。
102
+
103
+ ## 环境变量
104
+
105
+ | 变量 | 必填 | 默认 |
106
+ |---|---|---|
107
+ | `STARREEL_API_KEY` | ✅ | — |
108
+ | `STARREEL_AUTH_BASE` | | `https://api.shortreelai.com` |
package/SKILL.md CHANGED
@@ -147,6 +147,16 @@ content that will be rejected.
147
147
  `generate_frames` / `generate_shot_frame` may override per call. Options:
148
148
  `gemini-3-pro-image` (Nano Banana Pro, finer, pricier), `gemini-3.1-flash-lite-image`
149
149
  (Lite, cheap), `doubao-seedream-5-0-260128` (Seedream 5.0), `gpt-image-2`.
150
+ **Video engine**: videos use a drama-level engine, set via `create_drama` /
151
+ `update_project_settings` field `video_engine`. Two options — surface the
152
+ choice to the customer with the price gap and let them decide:
153
+ `seedance-2.5` (default; full capability: frame chain / scene groups /
154
+ in-place edit / extend / reference anchors; 720p ≈ 212 pts/s) or `hailuo-3`
155
+ (MiniMax H3, beta; ≈1/3 cost at 70 pts/s for 720p; native dialogue & SFX
156
+ baked into the clip; up to 2K; ~6 min per shot; in-place edit / extend /
157
+ keyframe groups not yet available). **Set it before generating any video**:
158
+ switching never re-renders existing shots, and mixing engines inside one
159
+ drama risks style/identity drift.
150
160
  **Images are slow** (tens of seconds to minutes each; a whole episode can take
151
161
  10+ min): poll `get_storyboards` and read `frame_status` — `pending` = still
152
162
  generating (keep waiting, NEVER re-call generate_frames — that double-charges),
@@ -283,6 +293,18 @@ refund on failure); you never compensate manually.
283
293
  `generate_bgm`, `replace_shot_dialogue`
284
294
  - **Finish**: `compose_episode`, `get_final_cut`, `get_export`,
285
295
  `generate_episode_poster`, `generate_cover`
296
+ - **Assemble it yourself**: `export_handoff_pack`, `get_handoff_toolchain` —
297
+ download the per-shot raw clips, dialogue tracks, SFX, BGM and subtitles, then
298
+ decide transitions and assemble the cut on your own side. Use this instead of
299
+ `compose_episode` when you want to judge each seam yourself; use
300
+ `compose_episode` when you want the platform's finishing pipeline (pre-flight
301
+ checks, A/V duration parity, loudness mastering). Three facts that will bite you:
302
+ `audio_contract.mode="tts"` means the raw clips have **no voice** (dialogue ships
303
+ separately — skip it and the episode is silent); every shot must be cut to
304
+ `trim_head_ms`/`duration_ms` or you splice in frames the platform already QC'd out;
305
+ and all subtitle/dialogue/SFX offsets are relative to **each shot's own trimmed
306
+ start**, not to the final timeline — add whatever overlapping transitions you like
307
+ and let `compile_timeline.py` expand them, never hand-compute the shift.
286
308
  - **Edit**: `edit_video_shot`, `regenerate_shot_video`, `split_shot`,
287
309
  `trim_shot`, `rerender_episode`
288
310
  - **Read back (all free)**: `list_dramas`, `get_drama`, `get_characters`,