This project validates and demonstrates the capabilities of the ffmpeg-mcp Model Context Protocol (MCP) server.
- Python: 3.10 or higher
- ffmpeg: System-wide installation
- uv: Python package manager
# Install ffmpeg
brew install ffmpeg
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.local/bin/envffmpeg-mcp-poc/
├── README.md # This file
├── assets/ # Test video files (generated)
├── ffmpeg-mcp/ # Cloned MCP server repository
├── output/ # Generated output files (created on run)
├── scripts/ # Helper scripts
│ └── generate_assets.sh
├── pyproject.toml # Project dependencies
└── run_poc.py # Main test script
-
Install ffmpeg-mcp dependencies:
cd ffmpeg-mcp uv sync cd ..
-
Install PoC dependencies:
uv sync
-
Generate test assets:
./scripts/generate_assets.sh
Execute the test script:
uv run python run_poc.pyThe script will:
- Start the ffmpeg-mcp MCP server
- Execute video operations:
get_video_info: Get metadata of source videoclip_video: Extract a 3-second clipscale_video: Resize video to 320x240overlay_video: Create picture-in-picture effectconcat_videos: Stitch two clips together
- Validate output files are created
============================================================
FFmpeg MCP Proof of Concept
============================================================
============================================================
Checking Prerequisites
============================================================
[OK] Source A: /path/to/assets/source_a.mp4
[OK] Source B: /path/to/assets/source_b.mp4
============================================================
Starting MCP Server
============================================================
...
============================================================
Test Summary
============================================================
[PASS] clip_test.mp4
[PASS] scaled_test.mp4
[PASS] overlay_test.mp4
[PASS] concat_test.mp4
Results: 4 passed, 0 failed
*** All tests PASSED! ffmpeg-mcp is working correctly. ***
To use ffmpeg-mcp with Claude Desktop or VSCode, add the following to your MCP settings:
{
"mcpServers": {
"ffmpeg-mcp": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/ffmpeg-mcp-poc/ffmpeg-mcp",
"run",
"ffmpeg-mcp"
]
}
}
}Replace /absolute/path/to/ffmpeg-mcp-poc with the actual path to this project.
The ffmpeg-mcp server provides these tools:
| Tool | Description |
|---|---|
find_video_path |
Recursively search for video files |
get_video_info |
Get video metadata (duration, fps, codec, etc.) |
clip_video |
Extract a segment from a video |
scale_video |
Resize video to specified dimensions |
overlay_video |
Create picture-in-picture effect |
concat_videos |
Stitch multiple videos together |
play_video |
Play video with ffplay |
extract_frames_from_video |
Extract frames as images |
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.local/bin/envInstall ffmpeg:
brew install ffmpeg # macOSGenerate them:
./scripts/generate_assets.sh