ffmpeg-mcp
Provides AI-agent-driven video editing capabilities by exposing FFmpeg as structured tools, enabling operations like trimming, concatenation, conversion, subtitle burning, and more.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ffmpeg-mcp trim the first 10 seconds of video.mp4"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ffmpeg-mcp
An MCP (Model Context Protocol) server for AI-agent-driven video editing, powered by FFmpeg.
It exposes FFmpeg as a set of safe, structured tools that an AI agent (Claude Desktop, Claude Code, or any MCP client) can call in natural language — "trim the first 10 seconds", "burn these subtitles in", "transcribe the speech to an SRT", "cut the silent parts".
The server shells out to the installed ffmpeg/ffprobe binaries; there is no FFmpeg source build required.
Requirements
Node.js ≥ 18
FFmpeg + ffprobe on your
PATH(or setFFMPEG_PATH/FFPROBE_PATH). A full build is recommended (libass, NVENC, whisper). Tested with FFmpeg 8.1.
Related MCP server: video-editor
Install & build
npm install
npm run buildTools
Tool | What it does |
| Inspect a file: duration, format, bitrate, streams (codec/resolution/fps/channels). |
| Cut a segment by start + end/duration. Stream-copy (fast) or re-encode (frame-accurate). |
| Join clips. |
| Transcode: format/codec/resolution/fps/bitrate. Supports NVENC ( |
| Pull the audio track out (mp3/aac/wav/flac/opus). |
| Single frame at a time, or frames every N seconds. |
| Hard-burn an |
| Watermark image / picture-in-picture, with position, scale, opacity. |
| Speech → subtitles via FFmpeg's whisper filter (needs a model — see below). |
| Detect silent spans and remove them. |
All tools resolve relative paths against the working directory (or FFMPEG_MCP_WORKDIR), validate that inputs exist, and refuse to overwrite outputs unless you pass overwrite: true.
Configuration (environment variables)
Var | Purpose |
| Full path to the binaries if not on |
| Base directory for resolving relative paths. |
| Default whisper.cpp model file for |
Whisper model (for auto_subtitle)
The whisper filter needs a ggml-*.bin model (not bundled — it's large). Fetch one with the helper script:
npm run download-model # downloads ggml-base.bin into ./models
npm run download-model -- small # or another size: tiny | base | small | medium | largeThen point the server at it via WHISPER_MODEL_PATH (see registration below), or pass model per call.
You can also download manually from
huggingface.co/ggerganov/whisper.cpp.
Register with Claude
Claude Code
claude mcp add ffmpeg -- node /absolute/path/to/ffmpeg-mcp/dist/index.jsClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"ffmpeg": {
"command": "node",
"args": ["C:\\absolute\\path\\to\\ffmpeg-mcp\\dist\\index.js"],
"env": {
"WHISPER_MODEL_PATH": "C:\\models\\ggml-base.bin"
}
}
}
}Develop & verify
npm test # unit + real-ffmpeg E2E tests (fixtures generated by ffmpeg)
npm run inspect # launch the MCP Inspector against the serverThe Inspector lets you call each tool interactively and see the JSON results.
Project structure
src/
index.ts # MCP server bootstrap (stdio), tool registration
ffmpeg/
locate.ts # resolve ffmpeg/ffprobe (PATH or env override)
runner.ts # spawn wrapper: args-array (no shell), progress, errors
probe.ts # ffprobe -> structured metadata
lib/
paths.ts # input/output path validation & overwrite policy
schema.ts # shared zod fragments (timecode, resolution)
tools/ # one file per MCP tool + registry (index.ts)
test/ # unit tests + real-ffmpeg E2E (fixtures via lavfi)
scripts/
download-model.mjs # fetch a whisper ggml model into ./modelsDesign notes
No shell interpolation — ffmpeg is always invoked with an argument array, so user-supplied paths cannot inject commands.
Path safety — inputs must exist; outputs never overwrite unless
overwrite: true.No FFmpeg build — the server calls the installed binaries; nothing is compiled.
Contributing
Issues and PRs are welcome. Please run npm run build and npm test before opening a PR.
License
MIT © Sohn EuiJin
Available Tools
10 toolsauto_subtitleAuto-generate subtitles (whisper)A
Transcribe speech to subtitles using FFmpeg's built-in whisper filter. Writes an .srt (or .json/.txt) file. Requires a whisper.cpp model file: set the WHISPER_MODEL_PATH env var or pass model. Download a model, e.g. ggml-base.bin, from https://huggingface.co/ggerganov/whisper.cpp.
Inputs: input (required), output (required), model, format, +2 more.
burn_subtitlesBurn subtitlesA
Render an .srt or .ass subtitle file permanently onto the video (hard subs). Use force_style for SRT to tweak font/size/color (libass syntax, e.g. "FontName=Arial,FontSize=24").
Inputs: input (required), output (required), subtitles (required), overwrite, +1 more.
concatConcatenate clipsA
Join multiple clips end-to-end into one file. Use mode='copy' (default) when all inputs share the same codec/resolution (fast, lossless); use mode='reencode' to normalize mismatched inputs.
Inputs: inputs (required), output (required), mode, overwrite.
convertConvert / transcodeA
Transcode a video: change container format, codec, resolution, fps, or bitrate. Supports NVENC hardware encoders (e.g. codec='h264-nvenc'). The output container is inferred from the output file extension.
Inputs: input (required), output (required), crf, fps, +5 more.
cut_silenceCut silent sectionsA
Detect and remove silent sections from a video. Runs silencedetect to find quiet spans, then concatenates the remaining segments. Tune with noiseDb (threshold) and minSilence (minimum silence length to cut).
Inputs: input (required), output (required), noiseDb, overwrite, +1 more.
extract_audioExtract audioC
Extract the audio track from a video into an audio file (mp3/aac/wav/flac/opus). The format is chosen by the format field.
Inputs: input (required), output (required), format, bitrate, +1 more.
overlayOverlay image / videoB
Composite a watermark image or a picture-in-picture video on top of the base video. Choose a corner/center position, optional scale (as a fraction of base width), and opacity for images.
Inputs: input (required), output (required), overlayPath (required), scale, +3 more.
probeProbe media fileA
Inspect a video/audio file with ffprobe. Returns duration, format, bitrate, size, and a list of streams (codec, resolution, fps, channels).
Inputs: input (required).
thumbnailExtract thumbnail / framesA
Capture a single frame at a given time, or extract frames at a fixed interval. For a single frame, output is an image path (e.g. out.jpg). For interval mode, output must contain a printf pattern (e.g. frame_%04d.jpg).
Inputs: input (required), output (required), at, width, +2 more.
trimTrim a clipA
Cut a segment from a video/audio file between a start time and either an end time or a duration. By default copies streams without re-encoding (fast, lossless); set reencode=true for frame-accurate cuts.
Inputs: input (required), start (required), output (required), end, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool maps to a distinct operation: probe, trim, concat, convert, extract_audio, thumbnail, burn_subtitles, overlay, auto_subtitle, cut_silence. Minor overlaps exist—convert can effectively produce audio-only output like extract_audio, and trim/cut_silence both shorten video—but descriptions make the intended boundaries clear.
All names are snake_case and short, which is consistent. A few are bare nouns used as verbs (thumbnail, overlay) while others are verb_noun (extract_audio, burn_subtitles, cut_silence), a small stylistic deviation rather than a confusing one.
Ten tools is well within the ideal range for a media-processing server, and each one covers a genuinely distinct workflow (inspect, cut, join, transcode, audio, frames, subtitles, overlay, transcription, silence removal). No filler tools are present.
Core inspect/trim/join/convert/subtitle workflows are covered with no dead ends. However, common operations are missing: audio track replacement or mixing, soft-subtitle extraction, and crop/rotate/pad geometry changes, which cannot be composed from the existing tools.
Maintenance
Related MCP Connectors
MCP server for Clipkit — gives AI agents a video toolbox via the Clipkit schema.
FFmpeg as a service for AI agents: typed video editing tools, async jobs, downloadable outputs.
AI video editor for agents and humans: timeline, captions, color, audio and generation as MCP tools.
Hosted MCP tools for FFmpeg-style video and audio processing through FFMPEG API.
Related MCP Servers
- AlicenseBqualityCmaintenanceAn MCP server that provides 17 FFmpeg-based tools for video and audio processing, including conversion, compression, and editing. It enables AI assistants to perform complex media tasks like extracting audio, adding watermarks, and merging videos using natural language.172MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server for programmatic video editing using ffmpeg, enabling draft creation and refinement via natural language.-
- AlicenseAqualityDmaintenanceEnables LLMs to perform FFmpeg operations like clipping, merging, extracting audio, adding subtitles, and transcoding videos via a set of tools exposed as an MCP server.58MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables natural language video editing using FFmpeg, supporting operations like trimming, merging, format conversion, and more with real-time progress tracking.-