ofekfell/media-mcp-editor
If you are the rightful owner of media-mcp-editor and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Media MCP Editor is a powerful media processing server that leverages FFmpeg and integrates with the Model Context Protocol (MCP) to provide comprehensive video and audio manipulation tools.
๐ฌ Media MCP Editor
Powerful FFmpeg-powered media processing server with MCP integration
Transform, edit, and process media files with ease using a comprehensive set of video and audio manipulation tools through a Model Context Protocol interface.
๐ค Process Steps
Natural Language Request -> Editing Workflow Building -> Workflow Rendering
โจ Features
๐ Media Information & Analysis
- ๐ Media Info - Comprehensive file analysis (duration, resolution, codecs, format, bitrate)
๐ฅ Video Operations
|
๐ต Audio Operations
|
๐ ๏ธ Quick Start
๐ป Local Installation
# ๐ฅ Clone the repository
git clone <repository-url>
cd media-mcp
# ๐ฆ Install dependencies
pip install -e .
# ๐ ๏ธ Install FFmpeg
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
# Windows - Download from https://ffmpeg.org/download.html
๐ Usage
๐ Connect to LLM Clients
This MCP server can be integrated with various LLM clients that support the Model Context Protocol:
Claude Desktop
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"media-mcp": {
"command": "/Users/yourusername/.local/bin/uv",
"args": [
"--directory",
"/path/to/media-mcp-editor",
"run",
"server.py"
]
}
}
}
Other MCP-Compatible Clients
- Connection: Use stdio transport with the server command
- Protocol: Model Context Protocol (MCP)
- Tools Available: All media processing operations listed below
๐ฏ API Operations
๐ Media Information
Operation | Description | Example |
---|---|---|
get_media_info ๐ | Get comprehensive media details | duration, resolution, codecs, format |
๐ฌ Basic Video Operations
Operation | Description | Example |
---|---|---|
trim โ๏ธ | Extract media portion | start: 0, duration: 30 |
cut ๐ | Crop video dimensions | width: 1280, height: 720, x: 0, y: 0 |
scale ๐ | Resize video | width: 1920, height: 1080 |
rotate ๐ | Rotate video | angle: 90 (degrees) |
speed โก | Change playback speed | factor: 2.0 (2x faster) |
blur ๐ซ๏ธ | Apply blur effect | radius: 5 |
fade ๐ญ | Fade in/out | type: "in", start: 0, duration: 2 |
๐ต Audio Operations
Operation | Description | Example |
---|---|---|
change_volume ๐ | Adjust volume | volume: 1.5 (50% louder) |
audio_mix ๐๏ธ | Mix audio streams | weights: "0.7,0.3" |
audio_resample ๐ก | Change sample rate | sample_rate: 48000 |
๐ Advanced Operations
Operation | Description | Use Case |
---|---|---|
concat ๐ | Join multiple videos | Create compilations |
crossfade ๐
| Smooth transitions between videos | Professional editing |
overlay ๐ญ | Layer videos with positioning | Picture-in-picture, watermarks |
set_fps ๐๏ธ | Change frame rate | Optimize playback, standardize |
๐ก Using Examples
Showcasing MCP's natural language interface that generates JSON workflows
๐ฌ Simple Video Editing
๐ฃ๏ธ User: "I need to trim the first 30 seconds from my video"
๐ค Generated Workflow for Rendering:
{
"action": "trim",
"params": {"start": 0, "duration": 30},
"input": {"url": "input_video.mp4"}
}
๐๏ธ Multi-Video Projects
๐ฃ๏ธ User: "Combine my intro, main content, and outro videos into one file"
๐ค Generated Workflow for Rendering:
{
"action": "concat",
"input": [
{"url": "intro.mp4"},
{"url": "main_content.mp4"},
{"url": "outro.mp4"}
]
}
๐ง Complex Workflow
๐ฃ๏ธ User: "Scale my video to 1080p, add a 2-second fade-in at the beginning, then trim it to 15 seconds starting from the 5-second mark"
๐ค Generated Workflow for Rendering:
{
"action": "trim",
"params": {"start": 5, "duration": 15},
"input": {
"action": "fade",
"params": {"fade_type": "in", "start_time": 0, "duration": 2},
"input": {
"action": "scale",
"params": {"width": 1920, "height": 1080},
"input": {"url": "https://example.com/video.mp4"}
}
}
}
๐ญ Picture-in-Picture
๐ฃ๏ธ User: "Add a small overlay video in the top-right corner of my main video"
๐ค Generated Workflow for Rendering:
{
"action": "overlay",
"params": {"x": 50, "y": 50},
"input": [
{"url": "main_video.mp4"},
{"url": "overlay_video.mp4"}
]
}
๐ Professional Transitions
๐ฃ๏ธ User: "Create a smooth 2-second crossfade transition between two 10-second video clips"
๐ค Generated Workflow for Rendering:
{
"action": "crossfade",
"params": {
"duration": 2.0,
"stream1_duration": 10.0,
"transition": "fade"
},
"input": [
{"url": "video1.mp4"},
{"url": "video2.mp4"}
]
}
๐ต Audio Processing
๐ฃ๏ธ User: "Make the audio 50% louder and change the sample rate to 48kHz"
๐ค Generated Workflow for Rendering:
{
"action": "audio_resample",
"params": {"sample_rate": 48000},
"input": {
"action": "change_volume",
"params": {"volume": 1.5},
"input": {"url": "audio_file.mp3"}
}
}
๐งช Testing
Comprehensive test suite with 38 passing tests!
# ๐งช Run all tests
python -m pytest tests/ -v
# ๐ฏ Run specific test file
python -m pytest tests/test_media_mcp_handler.py -v
# ๐ Run with coverage
python -m pytest tests/ --cov=media_mcp_handler --cov=ffmpeg_utils
๐ Test Coverage
- โ 38 Tests Passing
- ๐ฌ Media Operations - All video/audio functions
- ๐ง Workflow Processing - Complex pipeline testing
- ๐ URL Handling - Remote file processing
- ๐ File Management - Local file operations
- โ ๏ธ Error Handling - Comprehensive error scenarios
๐ License
This project is licensed under the MIT License - see the file for details.
๐ Support
- ๐ Found a bug? Open an issue
- ๐ก Have a feature request? Start a discussion
- ๐ง Need help? Check our documentation