mlt-video-mcp
# mlt-video-mcp
An MCP server for timeline video editing, built on the [MLT framework](https://www.mltframework.org/)
(the engine inside Shotcut and Kdenlive). Projects are plain JSON files. The server compiles them to MLT XML and
renders with `melt`, or with a built-in ffmpeg fallback for the basic subset.
43 tools: projects and social presets (9:16, 1:1, 4:5, 16:9, 4K), media import and probing, video/audio tracks,
clips (add, trim, split, move, duplicate, speed, ripple delete), 15 effects, transitions, text overlays,
SRT/VTT subtitles, markers, MLT introspection, and rendering.
## Install and run
pip install -e .
mlt-video-mcp # stdio MCP server (or: python -m mltmcp)
MCP client config:
{ "mcpServers": { "video": { "command": "mlt-video-mcp" } } }
Requirements: Python 3.10+, `ffmpeg`/`ffprobe` on PATH. For full features install melt
(`apt install melt`, `brew install mlt`).
## What runs where
| Feature | ffmpeg fallback (tested locally) | melt (CI-tested) |
|---|---|---|
| Cut, trim, split, speed 0.1-16x, multi-track overlay, still images | yes | yes |
| Text overlays, SRT/VTT subtitles burned in | yes | yes |
| Dissolve transition | yes | yes |
| wipe_* and fade_black transitions | no (clear error) | yes |
| Effects: brightness, contrast, saturation, gamma, grayscale, blur, sharpen, vignette, flip, rotate, crop, chroma_key, fade_in, fade_out, volume | yes | yes |
| `raw` effect: any MLT filter with its own properties | no | yes |
| Audio: multi-track mix, volume, fades, music track | yes | yes |
| Render presets: social-h264, high-quality, small, webm-vp9 | yes | yes |
| `list_mlt_services`, `mlt_service_params` (full introspection) | curated subset only | yes |
`render_project(renderer="auto")` uses melt when installed, otherwise the fallback. A project using melt-only
features fails on the fallback with a message naming each gap (`fallback_report` lists them in advance).
## Honest limits
- "All options" means everything MLT exposes: the `raw` effect and `mlt_service_params` reach any MLT filter, but
only the 15 named effects have friendly parameters and fallback support.
- The melt render path is verified by CI (`.github/workflows/ci.yml` installs melt and renders a 9:16 project with two
clips, a dissolve, music, text and subtitles, then checks the output duration). Not yet checked by eye or by test:
wipe/fade_black transitions and how individual effects look under melt. Those are the likeliest places to need
adjustment.
- No auto-captioning (speech to text), stickers, or one-tap templates. Bring an SRT.
- Keyframed effect parameters are only available through `raw`.
## Tools
Project: create_project, project_info, list_presets, set_profile, validate_project, export_mlt_xml.
Media: import_media, probe_media, remove_media, extract_frame, waveform_image.
Tracks: add_track, remove_track, set_track (name, mute, hide, lock).
Clips: add_clip, remove_clip, move_clip, trim_clip, split_clip, duplicate_clip, set_clip_speed.
Effects: list_effects, add_effect, update_effect, remove_effect, clear_effects.
Transitions: list_transition_types, add_transition, remove_transition.
Text and subtitles: add_text, update_text, remove_text, import_subtitles, add_subtitle, clear_subtitles, export_subtitles.
Markers: add_marker, remove_marker.
Render and introspection: check_renderers, fallback_report, render_project, list_mlt_services, mlt_service_params.
Every tool takes the project file path first, so state lives on disk and the server is stateless.
## Example
create_project("/tmp/reel.json", "9:16")
import_media("/tmp/reel.json", "/clips/a.mp4") -> m1
add_track("/tmp/reel.json", "video") -> V1
add_clip("/tmp/reel.json", "V1", "m1", out_point=3) -> c1
add_text("/tmp/reel.json", "Hello", 0.5, 3)
render_project("/tmp/reel.json", "/tmp/reel.mp4")
## Tests
pip install -e .[test] && pytest
Covers edit logic, MLT XML structure, an end-to-end fallback render of a 9:16 project (dissolve, text, subtitles,
music, effects) checked with ffprobe and frame sampling, an MCP stdio handshake, and a melt render test that runs when melt is installed.
MIT licensed, copyright Yousef Ghaben.
TDQS
Scored across 43 tools
Each tool maps to a distinct resource+action (tracks, clips, effects, transitions, texts, subtitles, markers, render), so misselection is unlikely in the core workflow. The only real overlap is in diagnostics: check_renderers, fallback_report, and validate_project all report on ffmpeg-fallback capability, and list_effects/list_mlt_services/mlt_service_params partly overlap in describing the effect/service vocabulary.
Almost everything follows a snake_case verb_noun pattern (add_clip, remove_track, set_clip_speed, render_project), which is predictable and readable. The minor deviations are noun-only names for summary/inspection tools (project_info, fallback_report) and the varied verbs set_/update_ used for similar edits (set_track vs update_text).
43 tools is heavy and sits well above the comfortable 3-15 range, but the domain (a full non-linear editor with media, tracks, clips, effects, transitions, text, subtitles, markers, and rendering) genuinely justifies granular primitives. There is still consolidation headroom — e.g. clear_effects vs remove_effect, clear_subtitles vs remove, and three separate capability/diagnostic reporting tools.
Coverage is unusually thorough: CRUD for projects, media, tracks, clips, effects, transitions, and texts, plus subtitles, markers, inspection, validation, and export/render paths. Remaining gaps are minor but real — there is no tool to open/load an existing project file, no per-cue subtitle update/remove, and no way to delete a project.