video-maker-mcp 0.1.4 → 0.1.5
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 +38 -11
- package/dist/core/assets.d.ts +25 -0
- package/dist/core/assets.js +138 -54
- package/dist/core/assets.js.map +1 -1
- package/dist/mcp/server.js +20 -4
- package/dist/mcp/server.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -117,27 +117,54 @@ Once installed, ask Codex:
|
|
|
117
117
|
The MCP workflow is:
|
|
118
118
|
|
|
119
119
|
1. `check_environment`
|
|
120
|
-
2. `
|
|
121
|
-
3. `
|
|
122
|
-
4. `
|
|
123
|
-
5. `
|
|
124
|
-
6.
|
|
125
|
-
7.
|
|
126
|
-
8. Optional: `
|
|
127
|
-
9. `
|
|
128
|
-
10. `
|
|
129
|
-
11.
|
|
120
|
+
2. `assert_image_generation_contract`
|
|
121
|
+
3. `create_video_project`
|
|
122
|
+
4. `get_video_plan_schema`
|
|
123
|
+
5. `save_video_plan`
|
|
124
|
+
6. `list_required_assets`
|
|
125
|
+
7. Codex generates the dedicated cover image and real scene images into the exact returned paths
|
|
126
|
+
8. Optional fallback: `save_generated_image`
|
|
127
|
+
9. `verify_assets`
|
|
128
|
+
10. Optional: `create_asset_contact_sheet`
|
|
129
|
+
11. `generate_audio`
|
|
130
|
+
12. `render_video`
|
|
131
|
+
13. Optional: `export_video`
|
|
130
132
|
|
|
131
133
|
Important asset contract:
|
|
132
134
|
|
|
135
|
+
- Preferred: the host supports `generate_image_to_file(prompt, absolutePath)`: call a real image model and save the generated bitmap directly to the requested local file path.
|
|
136
|
+
- Fallback: if the host image tool exposes a real generated image as a temporary local file or base64/data URL, call `save_generated_image(projectId, assetPath, sourcePath|imageBase64)` to let MCP persist it to the required asset path.
|
|
137
|
+
- If the host can only show generated images in chat and cannot expose a local file path or bytes/base64, stop. Do not continue with fallback graphics.
|
|
133
138
|
- `list_required_assets` returns the image paths the tool will use, including `assets/cover.png` and scene paths such as `assets/scene_001.png`.
|
|
134
139
|
- Codex must save the actual generated scene image to each returned `absolutePath`.
|
|
135
140
|
- The cover must be a dedicated, content-rich 9:16 cover image generated for the video. It should not be a first-frame extraction.
|
|
136
|
-
- Do not substitute SVGs, chart screenshots, CSS drawings, preview strips, or manually created placeholder graphics.
|
|
141
|
+
- Do not substitute SVGs, chart screenshots, CSS drawings, HTML/canvas/sharp scripted graphics, preview strips, first-frame extractions, or manually created placeholder graphics.
|
|
137
142
|
- `verify_assets` rejects missing files, unreadable files, wrong aspect ratios, tiny files, suspicious placeholder-sized images, and PNG files with same-name SVG sources such as `scene_001.svg`.
|
|
138
143
|
- `create_asset_contact_sheet` creates `output/asset_contact_sheet.png` from the exact image files that `render_video` will use. Check this if the preview does not match the intended generated images.
|
|
139
144
|
- If you intentionally use very small stylized images, override the size threshold with `VIDEO_MAKER_MIN_ASSET_BYTES`.
|
|
140
145
|
|
|
146
|
+
`save_generated_image` accepts exactly one source:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"projectId": "vid_...",
|
|
151
|
+
"assetPath": "assets/scene_001.png",
|
|
152
|
+
"sourcePath": "/tmp/host-generated-image.png"
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
or:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"projectId": "vid_...",
|
|
161
|
+
"assetPath": "assets/scene_001.png",
|
|
162
|
+
"imageBase64": "data:image/png;base64,..."
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
It only writes to asset paths returned by `list_required_assets`, rejects SVG input, normalizes the bitmap to the target format, and immediately runs asset validation.
|
|
167
|
+
|
|
141
168
|
## Timing Model
|
|
142
169
|
|
|
143
170
|
The video is audio-driven:
|
package/dist/core/assets.d.ts
CHANGED
|
@@ -37,6 +37,30 @@ export interface AssetContactSheetResult {
|
|
|
37
37
|
contactSheetPath: string;
|
|
38
38
|
absolutePath: string;
|
|
39
39
|
}
|
|
40
|
+
export interface SavedGeneratedImageResult {
|
|
41
|
+
projectId: string;
|
|
42
|
+
assetPath: string;
|
|
43
|
+
absolutePath: string;
|
|
44
|
+
source: "sourcePath" | "imageBase64";
|
|
45
|
+
asset: VerifiedAsset;
|
|
46
|
+
}
|
|
47
|
+
export interface ImageGenerationContract {
|
|
48
|
+
ok: false;
|
|
49
|
+
requiredCapability: "generate_image_to_file";
|
|
50
|
+
contract: {
|
|
51
|
+
operation: string;
|
|
52
|
+
mustUseRealImageModel: true;
|
|
53
|
+
mustSaveToExactAbsolutePath: true;
|
|
54
|
+
mustStopIfUnsupported: true;
|
|
55
|
+
forbiddenFallbacks: string[];
|
|
56
|
+
};
|
|
57
|
+
instruction: string;
|
|
58
|
+
}
|
|
59
|
+
export interface SaveGeneratedImageInput {
|
|
60
|
+
sourcePath?: string;
|
|
61
|
+
imageBase64?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare function imageGenerationContract(): ImageGenerationContract;
|
|
40
64
|
export declare function listRequiredAssets(projectId: string): Promise<RequiredAsset[]>;
|
|
41
65
|
export declare function verifyAssets(projectId: string): Promise<{
|
|
42
66
|
ok: boolean;
|
|
@@ -46,4 +70,5 @@ export declare function verifySceneAssets(projectId: string): Promise<{
|
|
|
46
70
|
ok: boolean;
|
|
47
71
|
assets: Array<VerifiedAsset | AssetIssue>;
|
|
48
72
|
}>;
|
|
73
|
+
export declare function saveGeneratedImage(projectId: string, assetPath: string, input: SaveGeneratedImageInput): Promise<SavedGeneratedImageResult>;
|
|
49
74
|
export declare function createAssetContactSheet(projectId: string): Promise<AssetContactSheetResult>;
|
package/dist/core/assets.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
2
3
|
import sharp from "sharp";
|
|
3
4
|
import { readVideoPlan, markStatus } from "./project.js";
|
|
4
|
-
import { toProjectPath } from "./paths.js";
|
|
5
|
+
import { resolveUserPath, toProjectPath } from "./paths.js";
|
|
5
6
|
const DEFAULT_MIN_ASSET_BYTES = 150 * 1024;
|
|
6
7
|
const MIN_ASSET_WIDTH = 720;
|
|
7
8
|
const MIN_ASSET_HEIGHT = 1280;
|
|
@@ -14,6 +15,29 @@ function minAssetBytes() {
|
|
|
14
15
|
const parsed = Number(raw);
|
|
15
16
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_MIN_ASSET_BYTES;
|
|
16
17
|
}
|
|
18
|
+
export function imageGenerationContract() {
|
|
19
|
+
return {
|
|
20
|
+
ok: false,
|
|
21
|
+
requiredCapability: "generate_image_to_file",
|
|
22
|
+
contract: {
|
|
23
|
+
operation: "generate_image_to_file(prompt, absolutePath), or fallback save_generated_image(projectId, assetPath, sourcePath|imageBase64)",
|
|
24
|
+
mustUseRealImageModel: true,
|
|
25
|
+
mustSaveToExactAbsolutePath: true,
|
|
26
|
+
mustStopIfUnsupported: true,
|
|
27
|
+
forbiddenFallbacks: [
|
|
28
|
+
"chat-only image preview without local file output",
|
|
29
|
+
"SVG generation",
|
|
30
|
+
"SVG-to-PNG conversion",
|
|
31
|
+
"HTML/CSS/canvas drawing",
|
|
32
|
+
"sharp/Jimp/canvas scripted graphics",
|
|
33
|
+
"chart or infographic screenshots",
|
|
34
|
+
"first-frame extraction",
|
|
35
|
+
"placeholder or manually composed fallback images"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
instruction: "Preferred: the host must provide a real image generation capability that can save the generated bitmap directly to the requested absolutePath. Fallback: if the host can access a real generated image file path or image bytes/base64, call save_generated_image to let MCP persist it to assetPath. If neither is possible, stop and tell the user that this host does not satisfy video-maker-mcp's image generation contract."
|
|
39
|
+
};
|
|
40
|
+
}
|
|
17
41
|
export async function listRequiredAssets(projectId) {
|
|
18
42
|
const plan = await readVideoPlan(projectId);
|
|
19
43
|
const sceneAssets = plan.scenes.map((scene) => ({
|
|
@@ -28,7 +52,7 @@ export async function listRequiredAssets(projectId) {
|
|
|
28
52
|
minHeight: MIN_ASSET_HEIGHT,
|
|
29
53
|
aspectRatio: "9:16",
|
|
30
54
|
minBytes: minAssetBytes(),
|
|
31
|
-
note: "Use a real
|
|
55
|
+
note: "Use generate_image_to_file(prompt, absolutePath): a real image model output saved exactly to this path. Do not create placeholder SVGs, charts, screenshots, HTML/CSS/canvas/sharp scripted graphics, preview strips, or manually drawn fallback graphics. If unsupported, stop."
|
|
32
56
|
}
|
|
33
57
|
}));
|
|
34
58
|
return [
|
|
@@ -44,7 +68,7 @@ export async function listRequiredAssets(projectId) {
|
|
|
44
68
|
minHeight: MIN_ASSET_HEIGHT,
|
|
45
69
|
aspectRatio: "9:16",
|
|
46
70
|
minBytes: minAssetBytes(),
|
|
47
|
-
note: "Use
|
|
71
|
+
note: "Use generate_image_to_file(prompt, absolutePath) to create a dedicated, content-rich vertical cover image. It should not be a screenshot, SVG, chart-only graphic, HTML/CSS/canvas/sharp scripted graphic, or first-frame extraction. If unsupported, stop."
|
|
48
72
|
}
|
|
49
73
|
},
|
|
50
74
|
...sceneAssets
|
|
@@ -70,57 +94,7 @@ export async function verifySceneAssets(projectId) {
|
|
|
70
94
|
}
|
|
71
95
|
async function verifyProjectAssets(projectId, options) {
|
|
72
96
|
const required = (await listRequiredAssets(projectId)).filter((asset) => options.includeCover || asset.kind !== "cover");
|
|
73
|
-
const assets = await Promise.all(required.map(
|
|
74
|
-
try {
|
|
75
|
-
await fs.access(asset.absolutePath);
|
|
76
|
-
const forbiddenSourcePath = asset.absolutePath.replace(/\.[^.]+$/, ".svg");
|
|
77
|
-
try {
|
|
78
|
-
await fs.access(forbiddenSourcePath);
|
|
79
|
-
throw new Error(`Found sibling SVG source file ${forbiddenSourcePath}. This asset appears to be a generated SVG/chart converted to PNG, not a host image-generation result.`);
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
if (error.code !== "ENOENT")
|
|
83
|
-
throw error;
|
|
84
|
-
}
|
|
85
|
-
const stat = await fs.stat(asset.absolutePath);
|
|
86
|
-
const metadata = await sharp(asset.absolutePath).metadata();
|
|
87
|
-
if (!metadata.width || !metadata.height) {
|
|
88
|
-
throw new Error("Image dimensions could not be read");
|
|
89
|
-
}
|
|
90
|
-
if (metadata.width < MIN_ASSET_WIDTH || metadata.height < MIN_ASSET_HEIGHT) {
|
|
91
|
-
throw new Error(`Image is too small: ${metadata.width}x${metadata.height}; expected at least ${MIN_ASSET_WIDTH}x${MIN_ASSET_HEIGHT}`);
|
|
92
|
-
}
|
|
93
|
-
const aspectRatio = metadata.width / metadata.height;
|
|
94
|
-
if (Math.abs(aspectRatio - TARGET_ASPECT_RATIO) > ASPECT_RATIO_TOLERANCE) {
|
|
95
|
-
throw new Error(`Image aspect ratio is ${metadata.width}:${metadata.height}; expected 9:16 vertical imagery`);
|
|
96
|
-
}
|
|
97
|
-
const minimumBytes = minAssetBytes();
|
|
98
|
-
if (stat.size < minimumBytes) {
|
|
99
|
-
throw new Error(`Image file is suspiciously small: ${stat.size} bytes; expected at least ${minimumBytes} bytes. This often means a placeholder graphic was saved instead of a host-generated image.`);
|
|
100
|
-
}
|
|
101
|
-
return {
|
|
102
|
-
kind: asset.kind,
|
|
103
|
-
sceneId: asset.sceneId,
|
|
104
|
-
assetPath: asset.assetPath,
|
|
105
|
-
absolutePath: asset.absolutePath,
|
|
106
|
-
ok: true,
|
|
107
|
-
width: metadata.width,
|
|
108
|
-
height: metadata.height,
|
|
109
|
-
bytes: stat.size,
|
|
110
|
-
format: metadata.format
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
return {
|
|
115
|
-
kind: asset.kind,
|
|
116
|
-
sceneId: asset.sceneId,
|
|
117
|
-
assetPath: asset.assetPath,
|
|
118
|
-
absolutePath: asset.absolutePath,
|
|
119
|
-
ok: false,
|
|
120
|
-
error: error instanceof Error ? error.message : String(error)
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
}));
|
|
97
|
+
const assets = await Promise.all(required.map(validateRequiredAsset));
|
|
124
98
|
const ok = assets.every((asset) => asset.ok);
|
|
125
99
|
if (ok) {
|
|
126
100
|
const cover = assets.find((asset) => asset.ok && asset.kind === "cover");
|
|
@@ -128,6 +102,116 @@ async function verifyProjectAssets(projectId, options) {
|
|
|
128
102
|
}
|
|
129
103
|
return { ok, assets };
|
|
130
104
|
}
|
|
105
|
+
async function validateRequiredAsset(asset) {
|
|
106
|
+
try {
|
|
107
|
+
await fs.access(asset.absolutePath);
|
|
108
|
+
const forbiddenSourcePath = asset.absolutePath.replace(/\.[^.]+$/, ".svg");
|
|
109
|
+
try {
|
|
110
|
+
await fs.access(forbiddenSourcePath);
|
|
111
|
+
throw new Error(`Found sibling SVG source file ${forbiddenSourcePath}. This asset appears to be a generated SVG/chart converted to PNG, not a host image-generation result.`);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (error.code !== "ENOENT")
|
|
115
|
+
throw error;
|
|
116
|
+
}
|
|
117
|
+
const stat = await fs.stat(asset.absolutePath);
|
|
118
|
+
const metadata = await sharp(asset.absolutePath).metadata();
|
|
119
|
+
if (!metadata.width || !metadata.height) {
|
|
120
|
+
throw new Error("Image dimensions could not be read");
|
|
121
|
+
}
|
|
122
|
+
if (metadata.width < MIN_ASSET_WIDTH || metadata.height < MIN_ASSET_HEIGHT) {
|
|
123
|
+
throw new Error(`Image is too small: ${metadata.width}x${metadata.height}; expected at least ${MIN_ASSET_WIDTH}x${MIN_ASSET_HEIGHT}`);
|
|
124
|
+
}
|
|
125
|
+
const aspectRatio = metadata.width / metadata.height;
|
|
126
|
+
if (Math.abs(aspectRatio - TARGET_ASPECT_RATIO) > ASPECT_RATIO_TOLERANCE) {
|
|
127
|
+
throw new Error(`Image aspect ratio is ${metadata.width}:${metadata.height}; expected 9:16 vertical imagery`);
|
|
128
|
+
}
|
|
129
|
+
const minimumBytes = minAssetBytes();
|
|
130
|
+
if (stat.size < minimumBytes) {
|
|
131
|
+
throw new Error(`Image file is suspiciously small: ${stat.size} bytes; expected at least ${minimumBytes} bytes. This often means a placeholder graphic was saved instead of a host-generated image.`);
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
kind: asset.kind,
|
|
135
|
+
sceneId: asset.sceneId,
|
|
136
|
+
assetPath: asset.assetPath,
|
|
137
|
+
absolutePath: asset.absolutePath,
|
|
138
|
+
ok: true,
|
|
139
|
+
width: metadata.width,
|
|
140
|
+
height: metadata.height,
|
|
141
|
+
bytes: stat.size,
|
|
142
|
+
format: metadata.format
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
return {
|
|
147
|
+
kind: asset.kind,
|
|
148
|
+
sceneId: asset.sceneId,
|
|
149
|
+
assetPath: asset.assetPath,
|
|
150
|
+
absolutePath: asset.absolutePath,
|
|
151
|
+
ok: false,
|
|
152
|
+
error: error instanceof Error ? error.message : String(error)
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
export async function saveGeneratedImage(projectId, assetPath, input) {
|
|
157
|
+
const required = (await listRequiredAssets(projectId)).find((asset) => asset.assetPath === assetPath);
|
|
158
|
+
if (!required) {
|
|
159
|
+
throw new Error(`assetPath is not required by this project: ${assetPath}`);
|
|
160
|
+
}
|
|
161
|
+
if ((input.sourcePath ? 1 : 0) + (input.imageBase64 ? 1 : 0) !== 1) {
|
|
162
|
+
throw new Error("Provide exactly one of sourcePath or imageBase64.");
|
|
163
|
+
}
|
|
164
|
+
const source = input.sourcePath ? "sourcePath" : "imageBase64";
|
|
165
|
+
const bytes = input.sourcePath ? await readSourceImage(input.sourcePath) : decodeImageBase64(input.imageBase64 ?? "");
|
|
166
|
+
const metadata = await sharp(bytes).metadata();
|
|
167
|
+
if (metadata.format === "svg") {
|
|
168
|
+
throw new Error("SVG input is not accepted. Provide a real bitmap generated by an image model.");
|
|
169
|
+
}
|
|
170
|
+
await fs.mkdir(path.dirname(required.absolutePath), { recursive: true });
|
|
171
|
+
await sharp(bytes)
|
|
172
|
+
.rotate()
|
|
173
|
+
.toFormat(outputFormat(required.assetPath))
|
|
174
|
+
.toFile(required.absolutePath);
|
|
175
|
+
const asset = await validateRequiredAsset(required);
|
|
176
|
+
if (!asset.ok) {
|
|
177
|
+
throw new Error(asset.error);
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
projectId,
|
|
181
|
+
assetPath,
|
|
182
|
+
absolutePath: required.absolutePath,
|
|
183
|
+
source,
|
|
184
|
+
asset
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
async function readSourceImage(sourcePath) {
|
|
188
|
+
const resolved = resolveUserPath(sourcePath);
|
|
189
|
+
if (/\.svg$/i.test(resolved)) {
|
|
190
|
+
throw new Error("SVG sourcePath is not accepted. Provide a real generated bitmap file.");
|
|
191
|
+
}
|
|
192
|
+
return fs.readFile(resolved);
|
|
193
|
+
}
|
|
194
|
+
function decodeImageBase64(value) {
|
|
195
|
+
const trimmed = value.trim();
|
|
196
|
+
if (trimmed.startsWith("data:")) {
|
|
197
|
+
const match = /^data:([^;,]+)(?:;[^,]*)?;base64,(.*)$/s.exec(trimmed);
|
|
198
|
+
if (!match)
|
|
199
|
+
throw new Error("Invalid data URL. Expected data:image/...;base64,...");
|
|
200
|
+
if (match[1].includes("svg")) {
|
|
201
|
+
throw new Error("SVG data URL is not accepted. Provide a real generated bitmap.");
|
|
202
|
+
}
|
|
203
|
+
return Buffer.from(match[2], "base64");
|
|
204
|
+
}
|
|
205
|
+
return Buffer.from(trimmed, "base64");
|
|
206
|
+
}
|
|
207
|
+
function outputFormat(assetPath) {
|
|
208
|
+
const ext = path.extname(assetPath).toLowerCase();
|
|
209
|
+
if (ext === ".jpg" || ext === ".jpeg")
|
|
210
|
+
return "jpeg";
|
|
211
|
+
if (ext === ".webp")
|
|
212
|
+
return "webp";
|
|
213
|
+
return "png";
|
|
214
|
+
}
|
|
131
215
|
export async function createAssetContactSheet(projectId) {
|
|
132
216
|
const required = await listRequiredAssets(projectId);
|
|
133
217
|
if (required.length === 0) {
|
package/dist/core/assets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/core/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/core/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,uBAAuB,GAAG,GAAG,GAAG,IAAI,CAAC;AAC3C,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,CAAC;AACnC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAuEpC,SAAS,aAAa;IACpB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;IACpD,IAAI,CAAC,GAAG;QAAE,OAAO,uBAAuB,CAAC;IACzC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,uBAAuB,CAAC;AAClF,CAAC;AAED,MAAM,U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MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QACvE,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC;aAC3C,MAAM,CAAC,UAAU,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;aACrE,GAAG,EAAE;aACL,QAAQ,EAAE,CAAC;QACd,OAAO;YACL,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,KAAK,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;YAChC,GAAG,EAAE,CAAC;SACP,CAAC;IACJ,CAAC,CAAC,CAAC,CAAC;IAEJ,MAAM,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxE,MAAM,KAAK,CAAC;QACV,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ,CAAC,MAAM,GAAG,UAAU,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG;YACjE,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,CAAC;YACX,UAAU,EAAE,SAAS;SACtB;KACF,CAAC;SACC,SAAS,CAAC,UAAU,CAAC;SACrB,GAAG,EAAE;SACL,MAAM,CAAC,YAAY,CAAC,CAAC;IAExB,OAAO;QACL,SAAS;QACT,gBAAgB,EAAE,UAAU;QAC5B,YAAY;KACb,CAAC;AACJ,CAAC"}
|
package/dist/mcp/server.js
CHANGED
|
@@ -2,7 +2,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
3
|
import * as z from "zod/v4";
|
|
4
4
|
import { checkEnvironment } from "../core/env.js";
|
|
5
|
-
import { createAssetContactSheet, listRequiredAssets, verifyAssets } from "../core/assets.js";
|
|
5
|
+
import { createAssetContactSheet, imageGenerationContract, listRequiredAssets, saveGeneratedImage, verifyAssets } from "../core/assets.js";
|
|
6
6
|
import { createVideoProject, saveVideoPlan } from "../core/project.js";
|
|
7
7
|
import { videoPlanJsonSchema } from "../core/plan-schema.js";
|
|
8
8
|
import { generateProjectAudio } from "../providers/tts/volcengine.js";
|
|
@@ -10,8 +10,9 @@ import { renderProjectVideo } from "../core/render.js";
|
|
|
10
10
|
import { exportProjectVideo } from "../core/export.js";
|
|
11
11
|
const SERVER_INSTRUCTIONS = [
|
|
12
12
|
"video-maker-mcp turns Codex-authored storyboards into local vertical MP4 videos.",
|
|
13
|
-
"Workflow: call create_video_project, get_video_plan_schema, save_video_plan, list_required_assets, generate the dedicated cover image and every scene image with
|
|
14
|
-
"The server does not generate images.
|
|
13
|
+
"Workflow: call check_environment, assert_image_generation_contract, create_video_project, get_video_plan_schema, save_video_plan, list_required_assets, generate the dedicated cover image and every scene image with host image generation into the exact absolutePath, verify_assets, optionally create_asset_contact_sheet for visual confirmation, generate_audio, then render_video.",
|
|
14
|
+
"The server does not generate images. Preferred: the host provides generate_image_to_file(prompt, absolutePath): real image model output saved directly to the requested local path. Fallback: if the host can access the generated bitmap as a local file path or base64/data URL, call save_generated_image(projectId, assetPath, sourcePath|imageBase64). If neither is possible, stop and report that the host does not satisfy the image generation contract.",
|
|
15
|
+
"Do not substitute SVGs, charts, screenshots, HTML/CSS/canvas drawings, sharp/Jimp/canvas scripted graphics, preview strips, manually created placeholder graphics, first-frame extractions, or SVG-to-PNG conversions.",
|
|
15
16
|
"Videos are 9:16, 1080x1920, zh-CN subtitles, one image per scene. Requested duration is a target; render_video uses the real narration audio duration and scales scene/subtitle timing to match it.",
|
|
16
17
|
"Rendered project files stay in ~/.video-maker. If the user wants an easy-to-find copy, pass outputDir to render_video or call export_video; default export location is ~/Downloads/video-maker/<projectId>.",
|
|
17
18
|
"Run check_environment first when setup is uncertain. If TTS credentials are missing, tell the user to run: npx -y video-maker-mcp@latest configure-tts."
|
|
@@ -33,6 +34,10 @@ export function createMcpServer() {
|
|
|
33
34
|
title: "Check local video-maker environment",
|
|
34
35
|
description: "Checks Node, ffmpeg, Codex CLI, workspace path, and Volcengine/Doubao TTS environment variables."
|
|
35
36
|
}, async () => result(await checkEnvironment()));
|
|
37
|
+
server.registerTool("assert_image_generation_contract", {
|
|
38
|
+
title: "Assert host image generation contract",
|
|
39
|
+
description: "Returns the required host capability: generate real image-model output and save it directly to the requested absolutePath. If unsupported, the host must stop instead of creating fallback graphics."
|
|
40
|
+
}, async () => result(imageGenerationContract()));
|
|
36
41
|
server.registerTool("create_video_project", {
|
|
37
42
|
title: "Create video project",
|
|
38
43
|
description: "Creates a local project directory for a Codex-driven storyboard video.",
|
|
@@ -76,8 +81,19 @@ export function createMcpServer() {
|
|
|
76
81
|
}, async ({ projectId }) => result({
|
|
77
82
|
projectId,
|
|
78
83
|
assets: await listRequiredAssets(projectId),
|
|
79
|
-
|
|
84
|
+
imageGenerationContract: imageGenerationContract().contract,
|
|
85
|
+
instruction: "Generate one dedicated cover image and one real scene image for each prompt with host image generation, then save each generated bitmap exactly to absolutePath before calling verify_assets. If the host image tool returns a temporary file path or image base64/data URL instead of saving directly, call save_generated_image with projectId, assetPath, and sourcePath or imageBase64. The cover must be content-rich and purpose-built, not a first-frame extraction. Do not create placeholder charts, SVGs, screenshots, CSS drawings, HTML/canvas/sharp scripted graphics, preview strips, SVG-to-PNG conversions, or any fallback graphic. If this host cannot provide local generated image files or bytes, stop and report unsupported host image generation."
|
|
80
86
|
}));
|
|
87
|
+
server.registerTool("save_generated_image", {
|
|
88
|
+
title: "Save generated image asset",
|
|
89
|
+
description: "Fallback bridge: saves a real host-generated image from a local sourcePath or base64/data URL into a required project assetPath, then validates it.",
|
|
90
|
+
inputSchema: {
|
|
91
|
+
projectId: z.string().min(1),
|
|
92
|
+
assetPath: z.string().min(1).describe("One of the assetPath values returned by list_required_assets, e.g. assets/scene_001.png or assets/cover.png."),
|
|
93
|
+
sourcePath: z.string().min(1).optional().describe("Local path to a real generated bitmap file exposed by the host image tool."),
|
|
94
|
+
imageBase64: z.string().min(1).optional().describe("Generated image bytes as base64 or data:image/...;base64,...")
|
|
95
|
+
}
|
|
96
|
+
}, async ({ projectId, assetPath, sourcePath, imageBase64 }) => result(await saveGeneratedImage(projectId, assetPath, { sourcePath, imageBase64 })));
|
|
81
97
|
server.registerTool("verify_assets", {
|
|
82
98
|
title: "Verify scene assets",
|
|
83
99
|
description: "Checks that all required scene images exist and can be decoded.",
|
package/dist/mcp/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3I,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAo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