ffmpeg-mcp-server
Provides tools for inspecting, trimming, reframing, extracting audio from, and burning subtitles into media files using ffmpeg and ffprobe.
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-serverTrim clip.mp4 to 00:00:30β00:01:00 and reframe it to 9:16 for Shorts"
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-server π¬
ffmpeg-mcp-server is a deterministic, security-hardened Model Context Protocol (MCP) server that gives AI coding agents (Claude Code, Cursor, Windsurf, Cline, Gemini) safe, structured tools for inspecting, trimming, reframing (9:16 vertical shorts), extracting audio, and burning dynamic subtitles into video and audio files via ffmpeg and ffprobe.
Unlike raw shell-execution wrappers that expose agents to command injection or destructive path traversal, ffmpeg-mcp-server enforces workspace sandboxing, strict argument validation, argument-list subprocess execution (shell=False), and dry-run command inspection.
β¨ Key Features
π Sandboxed Workspace Security: Confines all input/output media operations to an explicit allowed root directory (
FFMPEG_MCP_WORKDIR), blocking path traversal (..) and symlink escapes.π Structured Media Probing (
probe_media): Extracts duration, resolution, codec, FPS, bitrates, and audio stream metadata viaffprobein clean JSON.βοΈ Frame-Accurate Clip Trimming (
trim_clip): Cuts segments with millisecond-accurate timestamps (HH:MM:SS.mmmor seconds) and configurable stream copy or H.264/AAC re-encoding.π± Vertical 9:16 Reframing (
convert_aspect_ratio): Automatically computes center-crop or blurred-pad filtergraphs for TikTok, Reels, and YouTube Shorts (9:16,1:1,16:9,4:5).π¬ Deterministic SRT Generator & Subtitle Burn-In (
generate_srt,burn_subtitles): Creates valid.srtsubtitle files from structured cue arrays and burns them into video with customizable font size and margin styling.π΅ Audio Extraction & Normalization (
extract_audio): Extracts cleanmp3,wav,flac, orm4atracks with optional EBU R128 loudness normalization (loudnorm).π§ͺ Zero-Dependency Core & Dry-Run Mode: Built on the Python standard library with a compliant JSON-RPC 2.0 stdio MCP transport, plus
dry_run=Truesupport on every mutative tool so agents can preview exactffmpegargv arrays before execution.
Related MCP server: ffmpeg-mcp
π Quick Start
Prerequisites
Python 3.10+
ffmpegandffprobeinstalled on your systemPATH(sudo apt install ffmpegorbrew install ffmpeg).
Installation
pip install -e ".[dev]"Claude Code / Claude Desktop Configuration
Add ffmpeg-mcp-server to your claude_desktop_config.json or .mcp.json:
{
"mcpServers": {
"ffmpeg": {
"command": "ffmpeg-mcp-server",
"env": {
"FFMPEG_MCP_WORKDIR": "/path/to/your/media/workspace"
}
}
}
}Or add it directly in Claude Code CLI:
claude mcp add ffmpeg -- ffmpeg-mcp-server --workdir /path/to/your/media/workspaceπ οΈ Available MCP Tools
Tool Name | Description | Supports |
| Inspect container duration, streams, resolution, FPS, and codecs via | Yes |
| Cut a media segment between | Yes |
| Reframe video to | Yes |
| Extract audio stream to | Yes |
| Build a validated | No (Pure file/string) |
| Burn an | Yes |
π§ͺ Running Tests
All unit tests run offline without requiring media fixtures or external network calls:
pytest -q
ruff check .π€ Contributing & Security
See CONTRIBUTING.md for development setup and pull request guidelines, and SECURITY.md for our security policy and sandboxing invariants.
π License
Licensed under the MIT License.
This server cannot be deployed
Maintenance
Related MCP Connectors
FFmpeg as a service for AI agents: typed video editing tools, async jobs, downloadable outputs.
- RendobarOAuthcom.rendobar
Transform video, audio and images, and generate media from prompts. FFmpeg, captions, models.
Video, audio, and image processing for AI agents: convert, transcribe, upscale - 150+ operations.
15 media & data tools for AI agents: search, transcribe, subtitles, voiceover, translate & more.
Related MCP Servers
- AlicenseBqualityBmaintenanceProvides video and audio manipulation tools powered by FFmpeg, enabling AI assistants to perform media operations such as cutting, converting, and removing silence.6139 npm2MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to safely execute ffmpeg and ffprobe operations by passing arguments as arrays, avoiding shell injection, with support for probe, convert, trim, concat, thumbnail, watermark, speed, loudnorm, and batch processing.7,310 npmMIT
- FlicenseAqualityAmaintenanceEnables AI agents to perform local video, audio, and file operations inside an isolated workspace, including cutting/concat videos, extracting audio, transcribing, and managing files, with typed responses and background job support.111-
- AlicenseBqualityCmaintenanceProvides Claude Code with local ffmpeg-based tools to probe, trim, concat, transform, overlay, mix audio, render JSON timelines, and run automated QA on video filesβno API key required.9Apache 2.0