Model Context Protocol

Autonomous Video Editing with Claude and FFmpeg: The Complete MCP Guide (2026)

Turn Claude into an autonomous video editor using Model Context Protocol (MCP) and FFmpeg. Auto-trim silences, crop 16:9 footage into 9:16 vertical shorts, and burn subtitles with plain English commands.

Autonomous Video Editing with Claude and FFmpeg MCP Guide 2026
Unlocking the full power of FFmpeg through natural language: Building a local Model Context Protocol server that lets Claude inspect, cut, crop, and normalize video files autonomously.

Key takeaways

  • FFmpeg is the world's most capable video processing engine, but its arcane command syntax prevents most creators from using it; Claude solves this by writing and running filtergraphs on demand.
  • Model Context Protocol (MCP) bridges Claude Desktop or Claude Code directly to your local FFmpeg binary via standardized, secure JSON-RPC tool calls.
  • High-friction editing tasks—like cutting silence, audio loudness normalization (-14 LUFS), and converting 16:9 landscape to 9:16 blurred-background vertical reels—are handled in seconds with plain English prompts.
  • Unlike cloud-based SaaS video editors, processing video locally through Claude and FFmpeg is 100% free, private, offline-compatible, and avoids lossy online re-encoding.
  • Hardware acceleration flags (like Apple's VideoToolbox or NVIDIA's NVENC) can be automatically injected by Claude for rapid multi-threaded exports.

FFmpeg is arguably the most powerful piece of multimedia software ever written. It powers YouTube, Netflix, Discord, and VLC, capable of cutting, transcoding, filtering, and assembling video at blistering speeds. Yet for 99% of creators and developers, FFmpeg is an impenetrable black box of cryptic flags, obscure filtergraphs, and terrifying terminal syntax errors.

Enter the Model Context Protocol (MCP). By connecting Claude Desktop or Claude Code directly to a local FFmpeg MCP server, you transform Claude into an autonomous video editing engineer. Instead of Googling arcane CLI commands or manually scrubbing timelines, you simply tell Claude in plain English: "Trim the silences from this recording, crop the speaker into 9:16 vertical, add blurred letterboxing, and burn in high-contrast captions."

🔌

How Model Context Protocol Solves the FFmpeg Problem

Humans hate memorizing filter syntax like [0:v]split=2[bg][fg];[bg]scale=1080:1920:force_original_aspect_ratio=increase,boxblur=20:5[bg_blurred]. But Large Language Models are encyclopedias of syntax. With MCP, Claude doesn't just print terminal commands for you to copy-paste—it inspects the video file's codecs, calculates optimal bitrates, runs the command securely in your local environment, verifies the output, and reports back with the finished video.

The Architecture: Connecting Claude to FFmpeg

The workflow uses standard Anthropic Model Context Protocol architecture:

  1. The Client: Claude Desktop or Claude Code CLI running locally on your computer.
  2. The Protocol: Standardized JSON-RPC over stdio.
  3. The MCP Server: A lightweight Python or Node.js server exposing video manipulation tools (e.g., inspect_media, trim_silence, crop_vertical, burn_subtitles, transcode_video).
  4. The Engine: Your local FFmpeg binary executing hardware-accelerated encoding via Metal (Apple Silicon) or NVENC (NVIDIA).

Step 1: Setting Up the FFmpeg MCP Server in 5 Minutes

You can create a rock-solid, production-ready FFmpeg MCP server using Python's FastMCP library. First, ensure you have FFmpeg installed on your machine:

# On macOS via Homebrew
brew install ffmpeg

# On Ubuntu/Debian Linux
sudo apt install ffmpeg

# Install FastMCP
pip install fastmcp

Create a Python script named ffmpeg_mcp_server.py:

# ffmpeg_mcp_server.py
import subprocess
import json
import os
from fastmcp import FastMCP

mcp = FastMCP("Local-FFmpeg-Video-Studio")

@mcp.tool()
def probe_video(file_path: str) -> str:
    """Inspect video resolution, codec, duration, and audio streams using ffprobe."""
    if not os.path.exists(file_path):
        return f"Error: File '{file_path}' does not exist."
    cmd = [
        "ffprobe", "-v", "quiet", "-print_format", "json",
        "-show_format", "-show_streams", file_path
    ]
    res = subprocess.run(cmd, capture_output=True, text=True)
    return res.stdout

@mcp.tool()
def run_ffmpeg(command: str) -> str:
    """Execute an ffmpeg command within a designated media directory."""
    # Security check: ensure command starts with ffmpeg and avoids destructive host operations
    if not command.strip().startswith("ffmpeg"):
        return "Error: Command must begin with 'ffmpeg'."
    
    print(f"Executing: {command}")
    res = subprocess.run(command, shell=True, capture_output=True, text=True)
    if res.returncode != 0:
        return f"FFmpeg Error:
{res.stderr[-800:]}"
    return f"Success! Output generated.
{res.stderr[-300:]}"

if __name__ == "__main__":
    mcp.run()

Step 2: Configuring Claude Desktop

Open your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the FFmpeg server to your mcpServers dictionary:

{
  "mcpServers": {
    "ffmpeg-studio": {
      "command": "python3",
      "args": ["/Users/yourname/scripts/ffmpeg_mcp_server.py"]
    }
  }
}

Restart Claude Desktop. You will see a small hammer 🔨 icon indicating that Claude now has direct access to probe_video and run_ffmpeg.

4 Real-World Video Editing Workflows Tested with Claude

Workflow 1: Auto-Detecting and Slicing Silences

When recording tutorials, webinars, or video podcasts, creators waste immense time manually cutting out pauses, breaths, and hesitation gaps. You can prompt Claude:

"Inspect interview.mp4. Find all silent audio segments longer than 0.7 seconds with volume below -30dB, cut them out, and export a clean seamless cut to interview_tight.mp4."

Claude automatically generates and executes FFmpeg's compound silencedetect filter and assembles the timestamps into a continuous timeline, removing 15 minutes of dead air from an hour-long recording in under 45 seconds.

Workflow 2: Converting 16:9 Landscape Video into a 9:16 Vertical Reel

Turning a horizontal YouTube video into a vertical TikTok, Reel, or YouTube Short usually requires opening an editor, duplicating tracks, and manually blurring the top and bottom. With Claude, you simply say:

"Convert demo_landscape.mp4 into a 1080x1920 vertical video. Center the original 16:9 clip in the middle, and fill the top and bottom letterbox bars with a 25px Gaussian-blurred scaled version of the same video."

Behind the scenes, Claude writes and runs this complex filtergraph:

ffmpeg -i demo_landscape.mp4 -filter_complex "[0:v]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,boxblur=25:5[bg];  [0:v]scale=1080:-1[fg];  [bg][fg]overlay=(W-w)/2:(H-h)/2" -c:a copy output_reel.mp4

Workflow 3: Auto-Audio Normalization to Streaming Broadcast Standards

Podcasters and video creators frequently struggle with inconsistent audio: one guest whispers while another blows out the microphone. Claude can analyze the audio stream with the EBU R128 loudness filter and apply two-pass loudness normalization directly:

# Claude executes broadcast-standard -14 LUFS loudness normalization
ffmpeg -i podcast_rough.mp4 -af loudnorm=I=-14:LRA=7:tp=-1.5 -c:v copy podcast_mastered.mp4

Workflow 4: 90% Compression with Zero Perceptible Quality Loss

Got a 2.5GB screen capture file from OBS or Zoom that you need to send over Slack or email? Traditional web compressors degrade video into muddy artifacts. Tell Claude:

"Compress obs_recording.mov using H.265 / HEVC with a Constant Rate Factor (CRF) of 26 and AAC audio at 128k. Keep original resolution."

The result is a 180MB file (92% reduction) with razor-sharp text and crisp audio, rendered entirely on your local GPU.

Best Practices & Security Rules for Video MCP

  • Folder Sandboxing: Always constrain the MCP server to a designated working directory (e.g., ~/Videos/AI_Workspace/) so the agent cannot inadvertently touch system files.
  • GPU Hardware Acceleration: If you are on an Apple Silicon Mac, tell Claude to include -c:v h264_videotoolbox or hevc_videotoolbox to encode videos 5x faster with minimal battery drain.
  • Keep Originals Intact: Always instruct Claude to append suffixes like _edited, _vertical, or _normalized rather than overwriting source footage.
Explore More Model Context Protocol Tools

Want to build more custom AI integrations? Read our comprehensive tutorial on Building FastMCP Servers in Python or browse our verified Production MCP Server Directory.

Frequently asked questions

An FFmpeg MCP server is a lightweight local program that implements Anthropic's Model Context Protocol. It exposes video editing tools (like inspecting video metadata, trimming clips, burning subtitles, and converting formats) so that Claude Desktop or Cursor can run local FFmpeg commands directly on your computer.

Yes, provided you sandbox the server to a specific working folder and only allow valid 'ffmpeg' or 'ffprobe' commands. The Python FastMCP server pattern ensures Claude cannot run arbitrary operating system commands or delete unrelated files.

No! Only text metadata (like resolution, frame rate, duration, and terminal command logs) is passed between Claude and your machine. The actual gigabytes of video footage remain strictly on your local hard drive and are processed locally by your CPU/GPU.

Yes. FFmpeg has extensive support for multi-channel audio mixing, loudness normalization, and color LUT application (e.g., using the 'lut3d' filter). Claude can apply 3D LUT files (.cube) across an entire directory of footage with a single prompt.

Yes. Any IDE or AI desktop client that supports Model Context Protocol (such as Cursor, Windsurf, or Claude Desktop) can connect to the exact same FastMCP server configuration.
Photo of Sanket

Sanket Founder, Aiversely

Sanket runs Aiversely and writes its guides on AI tools and workflows, with AI assistance for drafting and editing.

About Aiversely →
Join WhatsApp Channel

My AI Toolkit

0 items saved in this browser