Skip to main content
Glama

MediaKit for Agents

Give your coding agent eyes and ears for media. MediaKit is a small MCP server + CLI that wraps ffmpeg — trim, crop, resize, captions, loudness, thumbnails, frame grabs, audio extraction, concat, and conversion — so an agent can actually work with video and audio instead of guessing.

Coding agents are blind and deaf to media. They can read a 10,000-line codebase but can't tell you how long a clip is, pull a frame from it, or make it vertical. MediaKit fixes that with one install.

Quickstart

npx mediakit-for-agents probe clip.mp4

Or install it globally:

npm install -g mediakit-for-agents
mediakit trim clip.mp4 --start 2 --duration 8 -o clip-short.mp4

Use it from Claude Code / Cursor / Codex (MCP)

Add to your MCP config (.mcp.json or your client's settings):

{
  "mcpServers": {
    "mediakit": {
      "command": "npx",
      "args": ["-y", "mediakit-for-agents", "mcp"]
    }
  }
}

Then ask your agent things like:

  • "How long is this video, and what's its resolution?"

  • "Make this clip vertical 1080×1920 and burn the captions in."

  • "Normalize the voiceover to -14 LUFS and pull out the audio as MP3."

Requirements: ffmpeg and ffprobe on your PATH (ffmpeg.org/download). Node 18+.

Related MCP server: ffmpeg-mcp

Tools

Tool

What it does

CLI

probe

Duration, dimensions, codecs, streams (ffprobe)

mediakit probe in.mp4

trim

Cut a clip by start + duration/end

mediakit trim in.mp4 --start 2 --duration 5 -o out.mp4

crop

Crop to a rectangle (w, h, x, y)

mediakit crop in.mp4 --width 720 --height 1280 -o out.mp4

resize

Resize, keeping aspect ratio by default

mediakit resize in.mp4 --width 1080 -o out.mp4

extract_audio

Pull the audio track out (mp3/aac/wav/ogg/opus/flac)

mediakit extract-audio in.mp4 -o out.mp3

extract_frame

Grab one frame at a timestamp

mediakit extract-frame in.mp4 --timestamp 3.5 -o frame.png

thumbnail

Contact sheet of N evenly spaced frames

mediakit thumbnail in.mp4 --frames 6 -o sheet.jpg

loudness

Normalize to a loudness target (default −14 LUFS)

mediakit loudness in.mp3 -o out.mp3

concat

Join 2+ files into one (re-encodes, mixed codecs OK)

mediakit concat a.mp4 b.mp4 -o joined.mp4

burn_captions

Burn .srt/.ass/.vtt subtitles into the video

mediakit burn-captions in.mp4 --captions subs.srt -o out.mp4

convert

Change container/codec (omit a codec to stream-copy)

mediakit convert in.mov -o out.mp4 --video-codec libx264

Every tool returns a concise JSON result: output path, size, and the verified duration/dimensions of what it produced.

Demo: 16:9 clip → vertical captioned Short

# 1. Inspect the source
mediakit probe input.mp4

# 2. Center-crop to 9:16, then resize to 1080×1920
mediakit crop input.mp4 --width 720 --height 1280 --x 280 --y 0 -o cropped.mp4
mediakit resize cropped.mp4 --width 1080 -o vertical.mp4

# 3. Burn captions on
mediakit burn-captions vertical.mp4 --captions captions.srt -o short.mp4

# 4. Check the result
mediakit probe short.mp4   # 1080x1920, same duration, captions visible

See skills/shorts-video/SKILL.md for the full script → captioned vertical-video workflow.

Safety

  • No shell is ever involved: every ffmpeg call uses execFile with an argument array, so filenames and user input can't inject commands.

  • Outputs are never allowed to overwrite their inputs.

  • Inputs are validated (must exist and be readable) before ffmpeg runs.

Skills included

License

MIT — see LICENSE.

Available Tools

11 tools
burn_captionsB

Burn subtitles into the video (hardcoded, always visible). Accepts .srt, .ass or .vtt. Style: white bold text on a semi-transparent black box at the bottom.

Inputs: input (required), output (required), captions (required), font_size.

concatA

Join 2+ media files into one. Re-encodes, so inputs may differ in codec or size.

Inputs: inputs (required), output (required), audio_codec, video_codec.

convertB

Change container or codec. Omit video_codec/audio_codec to stream-copy that stream. crf 23 is a good default for H.264.

Inputs: input (required), output (required), crf, preset, +2 more.

cropC

Crop a video to a rectangle. width/height/x/y in pixels; must fit inside the source frame.

Inputs: input (required), width (required), height (required), output (required), +2 more.

extract_audioB

Extract the audio track to mp3, aac, wav, ogg, opus or flac (from the output extension).

Inputs: input (required), output (required), format.

extract_frameC

Grab a single frame at a timestamp as PNG/JPG/WebP.

Inputs: input (required), output (required), timestamp.

loudnessA

Normalize loudness to a target (default -14 LUFS, the YouTube/Spotify standard) with a single-pass loudnorm filter. Good for speech and creator audio.

Inputs: input (required), output (required), format, target_lufs.

probeA

Inspect a media file with ffprobe: duration, dimensions, codecs, streams.

Inputs: input (required).

resizeA

Resize a video. Give width and/or height; with keep_aspect (default) the other dimension follows the aspect ratio and is rounded to an even number.

Inputs: input (required), output (required), width, height, +1 more.

thumbnailA

Build a contact sheet: N evenly spaced frames tiled into a grid image.

Inputs: input (required), output (required), width, frames, +1 more.

trimA

Cut a clip out of a media file. Give start (seconds) plus duration OR end. Re-encodes by default for frame-accurate cuts; set stream_copy=true for fast lossless cuts (keyframe boundaries only).

Inputs: input (required), output (required), end, start, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool targets a clearly distinct media operation: probing, converting, concatenating, trimming, cropping, resizing, audio extraction, frame extraction, thumbnails, loudness normalization, and caption burning. Overlaps such as trim vs. extract_frame and thumbnail vs. extract_frame are resolved by their descriptions and output types.

    Naming Consistency4/5

    Most tools use a consistent snake_case verb_noun or verb pattern: concat, burn_captions, convert, probe, trim, crop, resize, extract_audio, extract_frame. The nouns thumbnail and loudness are minor deviations, though they remain readable and predictable.

    Tool Count5/5

    Eleven tools is well-scoped for a media processing toolkit, covering common ffmpeg workflows without excessive fragmentation. Each tool has a clear job and none feels redundant.

    Completeness4/5

    The surface covers most core media lifecycle operations: inspect, convert, trim, concat, crop, resize, extract audio/frames, thumbnail, loudness, and captions. Minor gaps exist, such as replacing or muxing separate audio/video tracks and extracting embedded subtitles, but agents can work around many of these with existing tools.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers