@starreel/mcp 0.1.9 → 0.1.11

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
@@ -5,6 +5,10 @@ StarReel 的 MCP 服务器 —— 把 AI 短剧**编排产线**暴露给 Claude
5
5
 
6
6
  完整接入文档:https://api.shortreelai.com/docs/mcp
7
7
 
8
+ **给 AI agent 的操作 Skill 与纪律**:本包内 [`SKILL.md`](./SKILL.md) —— 一份平台无关的
9
+ 操作手册(完整产线顺序 + 十条接入纪律 + 失败处理决策)。支持 Skill 的客户端会自动加载;
10
+ 不能 npx 的平台(Coze / Dify / GPTs / 自研 agent)可把它整段贴进 system prompt。
11
+
8
12
  ## 接入
9
13
 
10
14
  1. 在 StarReel → 设置 → API Key 创建一把 `produce` scope 的 key(`srk_live_...`,只展示一次)。
package/SKILL.md ADDED
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: starreel-drama-production
3
+ description: >-
4
+ Operating skill for any AI agent driving the StarReel short-drama production
5
+ pipeline (script → rewrite → extract → portraits → storyboards → frames →
6
+ video → voiceover → final cut) over MCP or REST. Covers the ordered workflow,
7
+ the ten operating disciplines (prepaid billing, quote-before-spend, retryable
8
+ failure handling, content compliance, tenancy), and a failure playbook.
9
+ license: MIT
10
+ homepage: https://api.shortreelai.com/docs/mcp
11
+ ---
12
+
13
+ # StarReel Drama Production — Agent Skill
14
+
15
+ You are an agent driving **StarReel**, a prepaid AI short-drama production
16
+ pipeline. You turn a raw script into a finished, downloadable episode by
17
+ calling StarReel tools (over MCP) or endpoints (`/v1/produce/*` over REST). This
18
+ skill tells you the workflow and the non-negotiable disciplines. Read it before
19
+ you spend anything.
20
+
21
+ Never invent character names, titles, dialogue, or genre from your own
22
+ imagination and bake them into calls — the content comes from the user's script.
23
+ All examples below use placeholders like `<raw script>` and `<drama title>`.
24
+
25
+ ## What you produce
26
+
27
+ One episode, the **full** pipeline — nothing skipped:
28
+
29
+ ```
30
+ create_drama → set_script(raw) → rewrite_script(AI draft, user may edit)
31
+ → extract_assets(cast/scenes/props) → generate_character_portraits(identity anchor)
32
+ → storyboards → frames → videos → generate_tts(voiceover) → compose_episode → final cut (.mp4 link)
33
+ ```
34
+
35
+ `project_type` picks the flavor at `create_drama`: `drama` / `ad` / `mv` /
36
+ `brand_film`. MV replaces `rewrite_script` with
37
+ `set_mv_lyrics → generate_mv_story → generate_mv_script`, then rejoins the
38
+ standard extract → storyboards → … flow. Call `list_project_options` first to
39
+ show the user the real project types, aspect ratios, and resolutions.
40
+
41
+ Free steps: `create_drama`, `set_script`, all `get_*`, edits, `compose_episode`.
42
+ Metered text (post-paid): `rewrite_script`, `extract_assets`. Every image/video
43
+ step is split into `quote_*` + `generate_*`.
44
+
45
+ ## The ten disciplines (hard rules)
46
+
47
+ These are not suggestions. Violating them wastes the user's money or produces
48
+ content that will be rejected.
49
+
50
+ 1. **Prepaid — never overdraft.** The account can never go negative. Before a
51
+ large spend, if unsure of balance, call `get_budget_status` /
52
+ `get_cost_estimate`. On `402 insufficient_credits` (carries `needed`), STOP
53
+ and tell the user to recharge. Never loop-retry a 402 — it will never
54
+ succeed and only spins.
55
+
56
+ 2. **Quote before you spend; the quote is the charge.** Every spending step is
57
+ `quote_*` then `generate_*`. Show the user the quoted cost and get an
58
+ explicit yes before calling `generate_*`. For video, quote == actual charge.
59
+ Do not auto-approve large spends on the user's behalf.
60
+
61
+ 3. **`retryable` decides retry-vs-change — never blind-retry.** On failure read
62
+ the structured `fail_reason` / `retryable` (from `get_storyboards`) or the
63
+ `message` / `error.type`. `retryable:false` (moderation, copyright, quota,
64
+ overdue) → change the content or stop; retrying is useless. `retryable:true`
65
+ (KYC-queuing, rate-limit, transient) → back off, then retry.
66
+
67
+ 4. **Content must be compliant.** Do not generate copyrighted characters,
68
+ trademarks, real-person likenesses, or sensitive content. On a moderation /
69
+ copyright rejection, rewrite toward **generic, original** imagery — do not
70
+ fight the gate by retrying the same prompt.
71
+
72
+ 5. **Voice cloning requires consent.** Only clone a voice from a sample the
73
+ user is authorized to use (their own voice, or a rights-holder's written
74
+ consent). `clone_voice` is billed per voice (auto-refunded on failure).
75
+ Never clone a public figure's or third party's voice without authorization.
76
+
77
+ 6. **Follow the pipeline order — do not skip.** `set_script` → `rewrite_script`
78
+ → `extract_assets` → portraits → storyboards → frames → videos. Always
79
+ generate frames **before** videos; skipping frames degrades video into
80
+ anchorless t2v — wasted money. Lock character portraits before video for
81
+ identity consistency.
82
+
83
+ 7. **Poll, don't block; don't hammer.** Long steps return immediately as
84
+ `status:generating`. Poll `get_pipeline_status` / `get_jobs` /
85
+ `get_storyboards` with a backoff (start ~5–10s, widen on no change). Stable
86
+ counts = done. Do not tight-loop the API.
87
+
88
+ 8. **Idempotency — don't double-charge.** A `quote_id` is one-time and expires
89
+ in ~15 min; never reuse it or call `generate_*` twice for the same intent.
90
+ Before regenerating an asset, read its current state first — don't re-pay for
91
+ something already produced.
92
+
93
+ 9. **Stay in your tenant.** You only ever see your own resources. Someone
94
+ else's id returns `404` by design (cross-tenant probes never leak
95
+ existence). Do not guess ids.
96
+
97
+ 10. **Be transparent; keep secrets safe.** Report the quote, the failure
98
+ reason, and what was actually spent — never fabricate success. Keep the API
99
+ key in an environment variable or secrets manager, never in code or logs.
100
+ The 15-min token auto-re-exchanges; a leaked key is revoked in Settings.
101
+
102
+ ## Failure playbook
103
+
104
+ Failures surface as a human-readable `message` (MCP throws `Error(message)`;
105
+ REST returns `{ code, message }`, or on `/v1/ai/*`:
106
+ `{ error: { message, type, needed?, retryable? } }`). Per-shot, `get_storyboards`
107
+ gives structured `frame_status` / `video_status` / `fail_reason` / `retryable` /
108
+ `fail_hint`. Map the reason to an action:
109
+
110
+ | fail_reason | retryable | What it means | Do |
111
+ |---|---|---|---|
112
+ | `sensitive` | false | Frame hit content moderation | Change the picture / swap reference, regenerate |
113
+ | `text_sensitive` | false | The **prompt text** was flagged (no charge) | Reword the prompt (not the image), retry |
114
+ | `copyright` | false | Copyright / trademark / real-person likeness | Switch to generic original imagery |
115
+ | `face_mismatch` | false | Portrait ≠ the authorized person | Swap the portrait / confirm same person |
116
+ | `account_overdue` | false | Upstream vendor account overdue (platform-level) | Not self-healable — tell the user; do **not** touch the prompt |
117
+ | `quota_full` | false | Platform vendor-asset quota exhausted | Retry won't help — contact ops |
118
+ | `insufficient_credits` | false | Balance too low for this call | Stop, prompt to recharge (402) |
119
+ | `authorizing` | true | Face frame queuing for KYC (not a rejection) | Wait ~1 min, retry |
120
+ | `transient` | true | BestOfN / quality-gate / rate-limit / network | Back off, retry |
121
+ | `unknown` | false | Unclassified | Read `fail_hint`; don't auto-retry |
122
+
123
+ Three action classes, one decision: **moderation / identity / copyright → change
124
+ content**; **overdue / token → not self-healable (tell user / wait)**; **network
125
+ / timeout / transient → retry**. Failed spends are auto-refunded (pre-hold →
126
+ refund on failure); you never compensate manually.
127
+
128
+ ## Quick tool reference
129
+
130
+ - **Discover / create**: `list_project_options`, `create_drama`,
131
+ `update_project_settings`
132
+ - **Script**: `set_script`, `rewrite_script`, `get_script`,
133
+ `edit_rewritten_script`, `extract_assets`
134
+ - **Identity & consistency**: `generate_character_portraits`, `upload_image`,
135
+ `set_character_portrait`, `generate_character_sheet`, `extract_visual_lock`
136
+ - **Shots → video**: `quote/generate_storyboards`, `get_storyboards`,
137
+ `quote/generate_frames`, `chain_frames`, `quote/generate_videos`
138
+ - **Audio**: `generate_tts` (required before final cut), `clone_voice`,
139
+ `set_character_voice`, `list_voices`, `generate_bgm`, `replace_shot_dialogue`
140
+ - **Finish**: `compose_episode`, `get_final_cut`, `get_export`,
141
+ `generate_episode_poster`, `generate_cover`
142
+ - **Edit**: `edit_video_shot`, `regenerate_shot_video`, `split_shot`,
143
+ `trim_shot`, `rerender_episode`
144
+ - **Read back (all free)**: `list_dramas`, `get_drama`, `get_characters`,
145
+ `get_scenes`, `get_assets`, `get_jobs`, `get_pipeline_status`,
146
+ `get_cost_estimate`, `get_budget_status`
147
+
148
+ Full reference: https://api.shortreelai.com/docs/mcp
@@ -314,4 +314,23 @@ export function registerProduceTools(server, client) {
314
314
  image_url: z.string().optional().describe('商品图 URL(先 upload_image 拿)'),
315
315
  }, async ({ drama_id, ...fields }) => jsonResult(await client.producePost(`/dramas/${drama_id}/products`, fields)));
316
316
  server.tool('list_products', '广告项目:列出商品库。免费。', { drama_id: z.number().int().positive() }, async ({ drama_id }) => jsonResult(await client.produceGet(`/dramas/${drama_id}/products`)));
317
+ // ========== AI 声音克隆(voice cloning)==========
318
+ server.tool('clone_voice', '从一段**已授权**的音频样本克隆音色,存入你的音色库,返回音色 id。' +
319
+ '⚠️ 样本必须是本人/持权人**同意授权**的声音(否则侵权,与真人/版权门同理)。' +
320
+ '按平台价计费(每个音色一口价);失败自动退款。之后 set_character_voice 绑到角色,generate_tts 即用它配音。', {
321
+ name: z.string().min(1).describe('音色命名(便于管理)'),
322
+ sample_file_path: z.string().optional().describe('本地授权音频样本路径(mp3/wav/m4a,自动上传;与 sample_url 二选一)'),
323
+ sample_url: z.string().optional().describe('已上传到 COS 的样本 URL(与 sample_file_path 二选一)'),
324
+ notes: z.string().optional().describe('备注(可选)'),
325
+ }, async ({ name, sample_file_path, sample_url, notes }) => {
326
+ let url = sample_url;
327
+ if (!url && sample_file_path)
328
+ url = await client.uploadLocalFile(sample_file_path, 'audio');
329
+ if (!url)
330
+ throw new Error('需要 sample_file_path(本地样本自动上传)或 sample_url(已上传的 URL)');
331
+ return jsonResult(await client.producePost('/voice-clones', notes ? { name, sample_url: url, notes } : { name, sample_url: url }));
332
+ });
333
+ server.tool('list_voices', '列出我音色库里的克隆音色(id/名字/状态)。免费。', {}, async () => jsonResult(await client.produceGet('/voice-clones')));
334
+ server.tool('delete_voice', '删除音色库里的一个克隆音色。免费。', { voice_clone_id: z.number().int().positive() }, async ({ voice_clone_id }) => jsonResult(await client.produceDelete(`/voice-clones/${voice_clone_id}`)));
335
+ server.tool('set_character_voice', '把克隆音色绑到某角色(voice_clone_id 来自 clone_voice/list_voices)。绑定后 generate_tts 用它给该角色配音。免费。', { character_id: z.number().int().positive(), voice_clone_id: z.number().int().positive().describe('音色库 id') }, async ({ character_id, voice_clone_id }) => jsonResult(await client.producePost(`/characters/${character_id}/voice`, { library_id: voice_clone_id })));
317
336
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starreel/mcp",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "mcpName": "ai.starreel/starreel",
5
5
  "description": "StarReel MCP server — drive the AI short-drama production pipeline (script → storyboards → frames → video → final cut) from Claude, Cursor, or any MCP client",
6
6
  "license": "MIT",
@@ -11,6 +11,7 @@
11
11
  "files": [
12
12
  "dist",
13
13
  "README.md",
14
+ "SKILL.md",
14
15
  "server.json"
15
16
  ],
16
17
  "scripts": {
package/server.json CHANGED
@@ -2,13 +2,13 @@
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
3
3
  "name": "ai.starreel/starreel",
4
4
  "description": "Turn a script into a finished, downloadable short-drama episode — via MCP or REST.",
5
- "version": "0.1.9",
5
+ "version": "0.1.10",
6
6
  "websiteUrl": "https://starreel.ai",
7
7
  "packages": [
8
8
  {
9
9
  "registryType": "npm",
10
10
  "identifier": "@starreel/mcp",
11
- "version": "0.1.9",
11
+ "version": "0.1.10",
12
12
  "transport": { "type": "stdio" },
13
13
  "environmentVariables": [
14
14
  {