A cross-platform FFmpeg Model Context Protocol server
Audio/video processing made available to any MCP client through simple tool calls.
FFmpeg MCP exposes a full suite of media-processing capabilities to MCP-compatible clients (Claude Desktop, Cursor, and more):
| Category | Tools |
|---|---|
| 🔍 Metadata | Read duration, streams, codecs, resolution, and bitrate |
| 🔄 Conversion | Convert video/audio with optional scaling and codec selection |
| 📦 Compression | H.264 CRF-based size reduction with quality presets |
| ✂️ Editing | Trim by start/end or duration, merge multiple files |
| 🎵 Audio | Extract audio to MP3, AAC, WAV, FLAC, OGG, or Opus |
| 🖼️ Frames | Extract frames by interval or count, generate thumbnails |
| 💬 Subtitles | Burn SRT/ASS/VTT subtitles with styling |
| 📐 Resize | Scale videos with automatic aspect-ratio handling |
| 🎨 Overlay | Layer foreground video on background at named positions |
| 📁 Search | Find media files in a directory, optionally by name |
No FFmpeg installation needed — every package ships a platform-native FFmpeg + FFprobe runtime, resolved automatically.
- Python 3.10 or later
- One of the supported platforms
| Platform | Architecture | Runtime |
|---|---|---|
| Windows | x86_64 | bundled ffmpeg.exe + ffprobe.exe |
| Linux (incl. Kylin) | x86_64 | bundled ffmpeg + ffprobe |
git clone https://github.com/luffy666code/ffmpeg-mcp.git
cd ffmpeg-mcp
pip install -e .python __main__.pyThe server communicates over stdio using the Model Context Protocol, so it connects to any MCP client as a stdio transport server.
| Tool | Description |
|---|---|
ffmpeg_runtime_status |
Report which FFmpeg/FFprobe runtime is active and its version |
ffmpeg_find_media |
Find video/audio files under a directory, optionally by name |
ffmpeg_get_info |
Read media metadata (duration, streams, codecs, resolution, bitrate) |
ffmpeg_convert |
Convert video/audio format with optional scale and codec selection |
ffmpeg_compress |
Compress a video using H.264 CRF presets |
ffmpeg_trim |
Trim a video by start + end or duration |
ffmpeg_merge |
Merge videos — fast stream-copy, or normalized H.264/AAC re-encode |
ffmpeg_extract_audio |
Extract audio to MP3, AAC, WAV, FLAC, OGG, or Opus |
ffmpeg_extract_frames |
Extract frames at a time interval or as an even count |
ffmpeg_add_subtitles |
Burn SRT/ASS/VTT subtitles with style presets |
ffmpeg_scale |
Resize video; use -2 for one dimension to preserve aspect ratio |
ffmpeg_overlay |
Overlay a foreground video at a named position |
ffmpeg_thumbnail |
Create a JPEG thumbnail at a specified timestamp |
The runtime is located in this priority order:
- Environment —
FFMPEG_PATH/FFPROBE_PATHexplicitly set - Bundled — binaries shipped in
run/<platform>/ - System PATH —
ffmpeg/ffprobefound on$PATH
| Variable | Purpose |
|---|---|
FFMPEG_PATH |
Path to ffmpeg binary |
FFPROBE_PATH |
Path to ffprobe binary |
FFMPEG_OUTPUT_DIR |
Directory for generated outputs (default: output/) |
Build a portable package with the platform's bundled FFmpeg runtime:
Windows
package.batLinux
package.shThis uses PyInstaller to produce a single-file executable and bundles the matching FFmpeg/FFprobe binaries, then packages everything into a ZIP.
Verify the server starts and exposes tools correctly:
python self_test.pyffmpeg-mcp/
├── __main__.py # Entry point
├── ffmpeg_video_mcp/
│ ├── server.py # MCP JSON-RPC server
│ ├── tools.py # Tool implementations & schemas
│ ├── runtime.py # FFmpeg runtime resolution
│ ├── config.py # Paths & configuration
│ └── process.py # Subprocess runner
├── scripts/
│ └── build_package.py # Cross-platform package builder
├── run/ # Bundled runtime placeholder dirs
├── package.bat / package.sh # Build scripts
├── self_test.py # MCP smoke test
└── runtime-manifest.json # Bundled runtime manifest
{
"name": "ffmpeg_get_info",
"arguments": { "file_path": "/path/to/video.mp4" }
}{
"name": "ffmpeg_compress",
"arguments": { "file_path": "/path/to/video.mp4", "quality": "high" }
}MIT
- ffmpeg-mcp-lite — core capability foundation
- video-creator/ffmpeg-mcp — video search, scaling, overlay, and merging ideas
- BtbN/FFmpeg-Builds — prebuilt FFmpeg runtimes