mediakit-mcp
Wraps ffmpeg and ffprobe to provide intent-level media inspection and processing tools, including converting, compressing to target sizes or service-specific presets, trimming, extracting audio or frames, creating GIFs, concatenating clips, and transforming video/audio with dry-run previews and safety controls.
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., "@mediakit-mcp Compress demo.mp4 to fit Discord's 10 MB limit."
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.
mediakit-mcp
Everyday media jobs for your AI agent: say what you want, not which ffmpeg flags to use.
mediakit-mcp is an MCP server that wraps ffmpeg in nine
intent-level tools: compress a video to fit Discord's 10 MB limit, turn a clip into a GIF, pull the
audio out, cut a section, grab thumbnails, join clips. The agent never has to remember
-c:v libx264 -pass 1 -passlogfile ...; you get the result and a short report, not a screen of
ffmpeg log.
Every tool has a dry run that returns the exact ffmpeg command it would execute, and nothing is ever overwritten unless you say so.
The PyPI package is
mediakit-mcp(the nameffmpeg-mcpwas already taken by another project). The GitHub repository isffmpeg-mcp.
What it looks like
Real output from the test suite:
> compress video.mp4 target_mb=1
Wrote C:\clips\video.compressed.mp4
size: 21.23 MB -> 0.93 MB (4% of the original)
duration: 6.02s | video: h264 640x360 | audio: aac
target 1 MB: met
note: two-pass encode: video 1200 kb/s, audio 128 kb/s
took 1.1s
> compress video.mp4 preset=discord-10mb dry_run=true
DRY RUN: nothing was executed. This is what would run:
Step 1/2 (analysis pass):
C:\...\ffmpeg.exe -hide_banner -nostdin -loglevel error -nostats -progress pipe:1 -y -i C:\clips\video.mp4 -map 0:v:0 -c:v libx264 -preset medium -b:v 1200000 -pix_fmt yuv420p -maxrate 1200000 -bufsize 2400000 -pass 1 -passlogfile ... -an -f null -
Step 2/2 (encode pass):
...Related MCP server: ffmpeg-mcp
Install
You need ffmpeg and ffprobe on PATH (or pointed to by FFMPEG_PATH / FFPROBE_PATH):
OS | Command |
Windows |
|
macOS |
|
Debian/Ubuntu |
|
Use a full build: the server needs libx264, libvpx-vp9, libopus and libmp3lame, and tells you which one is missing if it isn't there.
Claude Code
claude mcp add mediakit -- uvx mediakit-mcpClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"mediakit": {
"command": "uvx",
"args": ["mediakit-mcp"]
}
}
}Restrict it to the folders you work in (recommended):
{
"mcpServers": {
"mediakit": {
"command": "uvx",
"args": ["mediakit-mcp", "--dir", "C:\\Users\\you\\Videos", "--dir", "C:\\Users\\you\\Downloads"]
}
}
}Or with pip: pip install mediakit-mcp, then run mediakit-mcp.
Try asking
"What's in
C:\Videos\demo.mp4?""Compress demo.mp4 so I can send it on Discord." (
preset=discord-10mb)"Get this under 25 MB for email."
"Make a GIF of the first 4 seconds of demo.mp4, 480 px wide."
"Cut from 1:20 to 1:45 and keep the quality." / "...fast, I don't need it frame-exact."
"Extract the audio as an mp3 at 192k."
"Give me a thumbnail every 30 seconds."
"Join part1.mp4 and part2.mp4."
"Make it 720p wide and play it at 1.5x."
"Show me the ffmpeg command you'd use to convert this to webm, but don't run it."
Tools
Tool | What it does |
| ffprobe summary: container, duration, size, bitrate, every stream (codec, resolution, fps, sample rate, channels). |
| To mp4, mov, mkv (H.264+AAC), webm (VP9+Opus), mp3, wav, flac, ogg, m4a, opus, aac, or a short gif. |
|
|
|
|
| mp3, wav, flac, ogg, m4a, opus, aac, or |
| Palette-based GIF (palettegen + paletteuse). |
| PNG/JPG stills at |
| Joins same-codec clips without re-encoding; says exactly which property differs if they don't match. |
| Resize ( |
Every tool except media_info also takes output, overwrite (default false), dry_run and
timeout_s. Outputs go next to the input with a derived name: clip.mp4 becomes
clip.compressed.mp4, clip.trimmed.mp4, clip.gif, clip.audio.mp3, clip.frames/.
How compress hits a size
For target_mb=T and duration D: the total bitrate budget is T * 1 MiB * 8 * 0.95 / D (the 5%
is a margin for container overhead and rate-control error; VP9 uses 10%). Audio gets 128 kb/s, or
less if that would eat more than a quarter of the budget, and the rest goes to video. The video is
encoded in two passes with a peak cap, and if the bitrate works out below about 0.045 bits per pixel
per frame the resolution steps down a ladder (1080, 720, 480, 360, ...) rather than producing mush.
A target that is impossible even at minimum quality is an error that says how big the file would
need to be. The result always says whether the target was met. In the test suite, targets from
0.5 to 10 MB landed at 91-97% of the target.
email-25mb aims at 18 MB because attachments grow by about 37% when mailed (base64).
Safety
No shell. ffmpeg is started with an argument list, so file names with spaces, quotes or
; & |cannot inject anything. Dry-run output is quoted for pasting into cmd or PowerShell.Never overwrites by default. An existing output is an error unless
overwrite=true. ffmpeg writes toname.partial.extand the file is renamed only on success, so a failed or cancelled run leaves no half-written file and does not damage an existing one.Directory allow-list. Start with
--dir DIR(repeatable) orMEDIAKIT_ALLOWED_DIRS(separated by;on Windows,:elsewhere) and every input and output path must resolve inside one of them...and symlinks are resolved first. Without it, the server can read and write any file the user can, which is what a local ffmpeg tool normally does.Bounded runs. Each job has a timeout (default 900 s). On timeout, or when the client cancels the call, ffmpeg's whole process tree is killed and temporary files are removed.
Progress, not log spam. ffmpeg runs with
-loglevel error; progress arrives as MCP progress notifications, and a failure returns only the last few relevant stderr lines.It does not touch the network: it only runs
ffmpegandffprobe. Input names can't be turned into options because every path is resolved to an absolute path first.
Limits
concatjoins without re-encoding, so the clips must match. Useconvert/transformfirst if they don't.trim mode="fast"can only cut on keyframes, so the clip may start a little early.Hardware encoders (NVENC, QSV, VideoToolbox) are not used; software x264/VP9 is slower but consistent everywhere.
dry_runstill runsffprobeon the input (read-only) so that the command it prints is the real one.Only the first video and audio stream of a file are used.
Tests
uv sync --extra test
uv run ruff check src tests && uv run mypy --strict src
uv run pytest testsThe tests generate real media with ffmpeg's lavfi sources (testsrc2, sine), run every tool,
and check the results with ffprobe: durations within tolerance, sizes under their targets, codecs,
GIF frame counts, odd dimensions, no-audio inputs, corrupt and truncated files, existing outputs.
The runner is tested against real processes (progress, timeout, cancel, killing a grandchild
process), and tests/test_stdio_handshake.py launches the installed server over stdio and calls
every tool through MCP, including cancelling a running job.
Learn how it's built
ffmpeg-mcp-the-hard-way builds a minimal version of this server in seven modules.
License
MIT
Available Tools
9 toolscompressA
Make a video smaller. Three ways to say how:
target_mb: aim for a file size in MB (MiB). Uses a two-pass encode with bitrate maths (video bitrate = target size / duration - audio, with a 5% safety margin) and lowers the resolution automatically when the bitrate would be too low to look decent. The result reports whether the target was met; errors if the target is impossibly small.
preset: discord-10mb, discord-50mb, whatsapp (16 MB, 720p max), email-25mb (aims at 18 MB because attachments grow ~37% when mailed), or web (quality-based, 1080p max).
neither: a quality-based (CRF) re-encode controlled by quality low|medium|high.
max_height: never exceed this height in pixels. output ending in .webm uses VP9/Opus, otherwise H.264/AAC (default output: name.compressed.mp4 next to the input). overwrite: replace an existing output. dry_run: return the ffmpeg commands (both passes) without running them. timeout_s: stop after this many seconds.
Inputs: input (required), output, preset, dry_run, +5 more. Returns: result
concatA
Join clips end to end without re-encoding (fast and lossless).
The clips must share codec, resolution, pixel format, frame rate and audio parameters (for example several recordings from one camera or pieces made by trim). If they differ, the error says exactly which property differs; convert/transform them to match first. Default output: first.concat.ext next to the first input.
Inputs: inputs (required), output, dry_run, overwrite, +1 more. Returns: result
convertA
Convert a file to another format with sensible codecs.
Video: mp4/mov/mkv (H.264 + AAC), webm (VP9 + Opus). Audio: mp3, wav, flac, ogg, m4a, opus, aac. gif: the first 5 seconds (use make_gif for control). Choose the target with format (e.g. "webm") or by the extension of output; the default output sits next to the input.
quality: low | medium | high (trades size for fidelity). For a size limit use compress. overwrite: replace an existing output (default: refuse). dry_run: return the ffmpeg command instead of running it. timeout_s: stop ffmpeg after this many seconds.
Inputs: input (required), format, output, dry_run, +3 more. Returns: result
extract_audioB
Pull the audio track out of a video (or re-encode an audio file).
format: mp3 (default), wav, flac, ogg, m4a, opus, aac, or "copy" to keep the original audio stream untouched (fast, lossless; picks the matching extension). bitrate: for lossy formats, e.g. "192k" (overrides quality). Fails clearly if the input has no audio. Default output: name.audio.mp3 next to the input.
Inputs: input (required), format, output, bitrate, +4 more. Returns: result
extract_framesA
Save still images (thumbnails) from a video.
Either times (a list like [1, 12.5, "0:01:30"]: one image per time) or every_s (one image every N seconds, starting at 0). With neither, one frame from the middle. format: png (default) or jpg. width: resize to this width (aspect kept). max_frames guards against producing thousands of files. Images go to output_dir (default: a "name.frames" folder next to the input) as name.frame-12.5s.png or name.frame-0001.png.
Inputs: input (required), times, width, format, +6 more. Returns: result
make_gifA
Make a high-quality animated GIF from a video (two-step palette: palettegen + paletteuse).
start: where to begin (default 0). duration: seconds to capture (default 5, max 30; it is shortened if the clip ends sooner). fps 1-30 (default 12). width in pixels (default 480, height keeps the aspect ratio; never upscaled). loop: repeat forever (default true). GIFs grow fast: for long clips use convert to mp4/webm instead.
Inputs: input (required), fps, loop, start, +6 more. Returns: result
media_infoA
Summarize a media file with ffprobe: container, duration, size, bitrate, and every stream (codec, resolution, fps, sample rate, channels). Use it first to learn what you have before compressing or converting, and to check results afterwards.
input: path to an audio/video/image file.
Inputs: input (required). Returns: result
transformA
Resize, crop and/or change the speed of a video (re-encodes with H.264/AAC, or VP9 for .webm).
width / height: target size in pixels; give one and the other keeps the aspect ratio. crop: "W:H" (centered) or "W:H:X:Y" in pixels, applied before resizing. speed: 0.25-4 (2 = twice as fast, 0.5 = slow motion); audio is retimed to match. Default output: name.transformed.ext.
Inputs: input (required), crop, speed, width, +5 more. Returns: result
trimA
Cut a section out of a video or audio file.
start, end, duration: seconds (12.5) or [HH:]MM:SS[.ms] ("1:02:03.5"). Give start and end, or start and duration; with only start the cut runs to the end of the file. mode: "accurate" (default) re-encodes so the cut is frame-exact; "fast" copies the streams without re-encoding (instant, lossless) but the cut snaps to the keyframe before start, so the clip may begin a little early. Default output: name.trimmed.ext.
Inputs: input (required), end, mode, start, +5 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct operation (info, convert, compress, trim, gif, frames, concat, transform), and descriptions steer between them (e.g. 'for a size limit use compress', 'use make_gif for control'). However, overlap remains: compress with only a quality setting is essentially a quality-based re-encode that duplicates convert's quality path, and extract_audio's 're-encode an audio file' overlaps with convert for audio targets.
Mostly verb-based snake_case (convert, compress, trim, extract_audio, extract_frames, make_gif, transform), with two terse exceptions: the noun-style media_info and the bare verb concat. Predictable and readable overall, but not a strict uniform pattern.
Nine tools is a well-scoped surface for an ffmpeg wrapper: one tool per common media operation, with no filler or trivially thin coverage. Each tool has a clear reason to exist.
Covers the core lifecycle well: inspect (media_info), convert, resize/crop/speed (transform), shrink (compress), cut (trim), extract (audio, frames), compose (concat, make_gif). Gaps exist around muxing/replacing audio tracks, subtitle handling, and watermark/normalize operations, but agents can work around most of these with the given tools.
Related MCP Connectors
Transform video, audio and images, and generate media from prompts. FFmpeg, captions, models.
FFmpeg as a service for AI agents: typed video editing tools, async jobs, downloadable outputs.
Video, audio, and image processing for AI agents: convert, transcribe, upscale - 150+ operations.
Image and video AI tools and your own pipelines, run from any AI assistant.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides powerful video and audio editing capabilities through FFmpeg, enabling AI assistants to perform professional-grade operations including format conversion, trimming, overlays, transitions, and advanced audio processing.2790MIT
- AlicenseBqualityBmaintenanceProvides video and audio manipulation tools powered by FFmpeg, enabling AI assistants to perform media operations such as cutting, converting, and removing silence.6550 npm2MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to perform video and audio processing tasks such as format conversion, cutting, merging, and adding effects via FFmpeg, with hardware acceleration support.193-
- AlicenseAqualityDmaintenanceProvides 30+ FFmpeg video and audio editing tools via MCP, enabling AI assistants to perform operations like trimming, transcoding, overlays, and composition directly.274MIT