ffmpeg-mcp
A Python package for media processing using FFmpeg and FastMCP.

ffmpeg-mcp ๐ฌโก
A Python package for media processing using FFmpeg and FastMCP. It enables building microservices that handle video/audio tasks with clean, reusable interfaces.
๐ Overview
This project provides a framework for handling media processing tasks using:
- FFmpeg โ A powerful multimedia framework for processing audio and video files
- FastMCP โ A high-performance framework for building microservices
๐ ๏ธ Available Tools
1. Metadata & Frames
-
get_video_metadata-
param(s):
input_video_path: str
-
-
extract_frames-
params:
input_video_path: str | Pathnumber_of_frames: intframe_timestamps: int (eg: 5s, 10s, 15s, ...)
-
2. Audio
-
extract_audio-
param(s):
input_video_path: str
-
3. Video Scaling & Resizing
-
scale_video-
params:
input_video_path: strresolution: Optional[str]
-
4. Overlay Operations
-
overlay_image-
params:
input_video_path: stroverlay_image_path: strpositioning: Literal[top_left, bottom_left, top_right, bottom_right, center, top_center, bottom_center] = 'top_right'scale: tuple[int, int] | None = (100, 100)keep_audio: bool = Trueopacity: float | None = None (range 0.0โ1.0)start_time: float = 0.0 (in seconds)duration: float | None = None (in seconds; None = until end of video)
-
-
overlays_video-
params:
input_video_path: stroverlay_video_path: strpositioning: Literal[top_left, bottom_left, top_right, bottom_right] = 'top_left'
-
5. Video Editing
-
clip_video-
params:
input_video_path: strstart_timestampduration: int
-
-
crop_video-
params:
input_video_pathsafe_crop: boolheight: intwidth: intx_offset: inty_offset: int
-
-
trim_and_concatenate-
params:
input_video_pathnumber_of_trims: inttrim_timestamp: List[(start, end), (start, end), ...]
-
-
make_gif-
params:
input_video_pathstart_timestampduration
-
6. Concatenation & Transitions
-
concatenate_videos-
param(s):
file_list: list[Path]
-
-
normalize_video_clips-
params:
input_video_clips: List[str]resolution: tuple default(1280, 720)frame_rate: int default30crf: int default23audio_bitrate: str default128kpreset: str defaultfast
-
-
concat_clips_with_transition-
params:
input_video_clips: List[str]transition_types: str defaultfade(e.g., fade, wipeleft, rectcrop, coverup, etc.)transition_duration: float default2
-
๐งฐ Utilities
The utils folder contains helper functions and decorators to enhance the functionality and robustness of the media processing tools.
a. Decorators
validate_input_video_pathA decorator that checks if the video path exists, is non-empty, and is a valid video file. This ensures that all video processing functions receive a valid input file.
๐ฆ Requirements
- Python 3.12 or higher
- uv (package manager)
- FFmpeg installed on the system
๐ Usage
The package can be used to build media processing microservices that leverage the power of FFmpeg through a Python interface.
1. Clone this repo
git clone [email protected]:yubraaj11/ffmpeg-mcp.git
2. Sync the project
uv sync --frozen
3. Use via MCP - Cline config
{
"mcpServers": {
"ffmpeg-mcp": {
"autoApprove": [],
"disabled": false,
"timeout": 60,
"command": "uv",
"args": [
"--directory",
"/path/to/ffmpeg-mcp/ffmpeg_mcp",
"run",
"main.py"
],
"env": {
"PYTHONPATH": "/path/to/ffmpeg-mcp"
},
"transportType": "stdio"
}
}
}
๐ Dependencies
ffmpeg-pythonโ Python bindings for FFmpegfastmcpโ Framework for building microservicescolorlogโ Colored logging outputfastapiโ Web framework for building APIspydanticโ Data validation and settings management
Related Servers
Tapo MCP
MCP server for discovering and controlling TP-Link Tapo smart home devices via AI Agents
SignalK MCP Server
Provides AI agents with read-only access to SignalK marine data systems, enabling queries of vessel navigation data, AIS targets, and system alarms.
ShippingRates
Ocean container shipping intelligence โ D&D tariffs, freight rates, vessel schedules, and total cost calculation across 6 major carriers.
Fibrous MCP Server
A server for Fibrous Finance, a DeFi aggregation platform.
guessmarket-mcp
Trade on prediction markets from Claude Code. Browse markets, check odds, build and execute trades on-chain.
Phrases MCP Server
An MCP server for managing inspirational phrases, designed for integration with clients like Claude for Desktop.
Tidewrath
Play a roguelike MMO as an AI agent. Explore, fight, chat, and survive tsunamis via 50+ MCP tools
ThinkPLC-MCP
Interface with SIEMENS PLC S7-1500/1200 using their JSON-RPC 2.0 API, exposing PLC functionalities as MCP tools for programmatic interaction.
mlp-tax
Deterministic MLP tax computation engine. 6 tools: basis projection, estate planning, sell vs hold comparison, MLP vs ETF tax analysis, distribution stress test, and MLP reference data. Returns IRS-cited calculations for K-1 basis tracking, ยง751 recapture, and ยง199A QBI.
UPS MCP Server
An MCP server for accessing UPS shipping and logistics services.