media-mcp-editor

ofekfell/media-mcp-editor

3.3

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.

Tools
5
Resources
0
Prompts
0

๐ŸŽฌ Media MCP Editor

Powerful FFmpeg-powered media processing server with MCP integration

Python FFmpeg Docker License Tests


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

  • ๐ŸŽฌ Trim - Extract portions with precision timing
  • โœ‚๏ธ Cut/Crop - Resize and position video frames
  • ๐Ÿ“ Scale - Resize to any resolution
  • ๐Ÿ”„ Rotate - Rotate by any angle
  • ๐ŸŒซ๏ธ Blur - Apply blur effects
  • ๐ŸŽญ Fade - Smooth fade in/out transitions
  • โšก Speed Control - Change playback speed
  • ๐ŸŽž๏ธ FPS Control - Frame rate adjustment

๐ŸŽต Audio Operations

  • ๐Ÿ”Š Volume Control - Precise audio level adjustment
  • ๐ŸŽš๏ธ Audio Mixing - Combine multiple audio streams
  • ๐Ÿ“ก Resampling - Change sample rates
  • ๐ŸŽผ Audio Effects - Professional audio processing

๐Ÿ› ๏ธ 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

OperationDescriptionExample
get_media_info ๐Ÿ“‹Get comprehensive media detailsduration, resolution, codecs, format

๐ŸŽฌ Basic Video Operations

OperationDescriptionExample
trim โœ‚๏ธExtract media portionstart: 0, duration: 30
cut ๐Ÿ“Crop video dimensionswidth: 1280, height: 720, x: 0, y: 0
scale ๐Ÿ“Resize videowidth: 1920, height: 1080
rotate ๐Ÿ”„Rotate videoangle: 90 (degrees)
speed โšกChange playback speedfactor: 2.0 (2x faster)
blur ๐ŸŒซ๏ธApply blur effectradius: 5
fade ๐ŸŽญFade in/outtype: "in", start: 0, duration: 2

๐ŸŽต Audio Operations

OperationDescriptionExample
change_volume ๐Ÿ”ŠAdjust volumevolume: 1.5 (50% louder)
audio_mix ๐ŸŽš๏ธMix audio streamsweights: "0.7,0.3"
audio_resample ๐Ÿ“กChange sample ratesample_rate: 48000

๐Ÿ”— Advanced Operations

OperationDescriptionUse Case
concat ๐Ÿ”—Join multiple videosCreate compilations
crossfade ๐ŸŒ…Smooth transitions between videosProfessional editing
overlay ๐ŸŽญLayer videos with positioningPicture-in-picture, watermarks
set_fps ๐ŸŽž๏ธChange frame rateOptimize 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


๐ŸŒŸ Star this project if you find it useful! ๐ŸŒŸ

*Built with โค๏ธ *

โฌ†๏ธ Back to Top