mcp
v0.3.7MCP server for Miraiclip: let Claude, Codex, or any MCP client edit a video project through the command catalog — with frame previews so the agent sees its…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_state
The current project state as a compact summary: composition settings, assets, tracks with their clips (ids, kinds, time ranges), and transitions. Read this before editing — commands reference the ids it shows. All times are integer MICROSECONDS (1 second = 1000000).
| Parameter | Type | Description |
|---|---|---|
include_json | boolean | Also include the full project document as JSON (verbose — only when exact field values are needed). |
list_commands
Every editing command the project accepts, with a one-line description each. Use get_command_schema for a command's payload schema.
get_command_schema
The JSON Schema for one command type's payload.
| Parameter | Type | Description |
|---|---|---|
type * | string | The command type, e.g. "clip/add". |
dispatch
Apply ONE editing command to the project. On success the project autosaves. On failure nothing changes and the error says exactly what to fix: unknown-command lists the valid types, invalid-payload lists per-field issues, rejected carries the engine's reason code. All times are integer MICROSECONDS (1 second = 1000000).
| Parameter | Type | Description |
|---|---|---|
payload * | object | The command's payload. The schema depends on `type` — consult the command catalog. |
type * | string | The command type. |
apply_commands
Apply a BATCH of commands as one transaction: all-or-nothing (a failure rolls back everything and reports which index broke), and the whole batch undoes as a single step. Prefer this over many dispatch calls for a multi-command plan. All times are integer MICROSECONDS (1 second = 1000000).
| Parameter | Type | Description |
|---|---|---|
commands * | array | |
label | string | Optional history label for the batch. |
undo
Undo the last edit (one dispatch, or one whole apply_commands batch). Returns the resulting state summary.
redo
Redo the last undone edit. Returns the resulting state summary.
preview_frame
Render the composition at a timeline position and SEE the frame (PNG). Use it after edits to verify the result visually. Defaults to a preview-sized image; pass width/height for exact dimensions. All times are integer MICROSECONDS (1 second = 1000000).
| Parameter | Type | Description |
|---|---|---|
timeUs * | integer | Composition time to render, in microseconds. |
height | integer | |
width | integer |
check_sequence
Check a stage sequence (data-libs="stage") as one continuous shot. Seeks it around every label and reports, per beat, what survives into the next one (carried / anchored / bare), subjects that leave the frame (data-keep-in-frame), beat spacing and stray hard cuts, as warnings with times and a hint for each. Nothing is rendered or exported; warnings never block an export. Run it after composing a sequence and fix the bare boundaries.
| Parameter | Type | Description |
|---|---|---|
clipId | string | Check only this html clip (default: every html clip). |
frames | boolean | Also return a before/after frame pair (0.2 s either side) for up to 3 bare boundaries, so you can see what is replaced. |
place_sfx_from_events
Put sound effects on a continuous shot's hits. Reads the sound moments the sequence declared (tl.hit, plus presses, impacts, shakes and carry landings), adds one audio clip at each (the same sound for every hit of a kind, so the film keeps one material set), and optionally ducks a music clip under them. Add the sounds as audio assets first (search_audio / add_audio; prefer CC0 and keep to one material: all wood, or all glass). Audio clips have no pan yet, so where on screen a hit happened is reported but not applied. All times are integer MICROSECONDS (1 second = 1000000).
| Parameter | Type | Description |
|---|---|---|
clipId * | string | The html sequence clip. |
sounds * | object | Audio asset id per hit kind, e.g. { "impact": "thud", "click": "tick", "whoosh": "air" }. Kinds: impact, click, whoosh, land, shake. |
duckTo | number | Music level during a hit, as a fraction of its own (default 0.35). |
musicClipId | string | A music audio clip to lower under the hits. |
trackId | string | Audio track for the effects (default: a track "sfx", created if missing). |
volume | number | Effect level (default 0.8). |
set_beat_grid
Write a music beat grid onto a sequence so S.beat(n) and S.downbeat(n) land on the music. Pass the beats and downbeats in seconds from the start of the music (from `node mc.mjs beats <file>`), and the music clip so the offset between the music and the sequence is applied. Compose carries on S.beat / S.downbeat afterwards. All times are integer MICROSECONDS (1 second = 1000000).
| Parameter | Type | Description |
|---|---|---|
beats * | array | Beat times in seconds from the start of the music file. |
clipId * | string | The html sequence clip. |
downbeats | array | First beat of each bar, in seconds. |
musicClipId | string | The music audio clip the grid belongs to (its start and trim set the offset). |
offsetSeconds | number | Instead of musicClipId: how far into the music the sequence starts. |
export
Export the project to a video file (streams to disk; headless Chrome). MP4 needs a real Chrome install — WebM works everywhere. Relative `out` paths land next to the project file. Add `motionBlur` ({} for the defaults) on FINAL exports only: fast motion smears like film instead of strobing, at the cost of render time; leave it off for drafts and previews.
| Parameter | Type | Description |
|---|---|---|
format * | string | |
out * | string | Output file path, e.g. final.webm |
fps | number | |
height | integer | |
motionBlur | object | Shutter motion blur. {} takes the defaults. |
quality | string | |
rangeEndUs | integer | |
rangeStartUs | integer | |
width | integer |
get_project_json
The full project document as JSON — exact field values, no elision. Verbose; prefer get_state.