mcp

v0.3.7
@miraiclip/mcp Checked 4 days ago Published 21 days ago

MCP 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).

ParameterTypeDescription
include_jsonbooleanAlso 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.

ParameterTypeDescription
type *stringThe 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).

ParameterTypeDescription
payload *objectThe command's payload. The schema depends on `type` — consult the command catalog.
type *stringThe 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).

ParameterTypeDescription
commands *array
labelstringOptional 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).

ParameterTypeDescription
timeUs *integerComposition time to render, in microseconds.
heightinteger
widthinteger

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.

ParameterTypeDescription
clipIdstringCheck only this html clip (default: every html clip).
framesbooleanAlso 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).

ParameterTypeDescription
clipId *stringThe html sequence clip.
sounds *objectAudio asset id per hit kind, e.g. { "impact": "thud", "click": "tick", "whoosh": "air" }. Kinds: impact, click, whoosh, land, shake.
duckTonumberMusic level during a hit, as a fraction of its own (default 0.35).
musicClipIdstringA music audio clip to lower under the hits.
trackIdstringAudio track for the effects (default: a track "sfx", created if missing).
volumenumberEffect 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).

ParameterTypeDescription
beats *arrayBeat times in seconds from the start of the music file.
clipId *stringThe html sequence clip.
downbeatsarrayFirst beat of each bar, in seconds.
musicClipIdstringThe music audio clip the grid belongs to (its start and trim set the offset).
offsetSecondsnumberInstead 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.

ParameterTypeDescription
format *string
out *stringOutput file path, e.g. final.webm
fpsnumber
heightinteger
motionBlurobjectShutter motion blur. {} takes the defaults.
qualitystring
rangeEndUsinteger
rangeStartUsinteger
widthinteger

get_project_json

The full project document as JSON — exact field values, no elision. Verbose; prefer get_state.