MoviePy MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MoviePy MCP Server Trim the video clip to the first 30 seconds and add a title overlay."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🎬 MoviePy MCP Server — Professional Documentation
A production‑grade MCP (Model Context Protocol) server that exposes 40+ video editing, animation, and audio processing tools to AI agents.
📖 Table of Contents
Related MCP server: atsurae
📌 Overview
MoviePy MCP Server is a bridge between AI agents and professional video editing. Built on FastMCP and MoviePy, it provides a comprehensive suite of tools for:
✂️ Video trimming, concatenation, and transformation
🎨 Procedural animation generation
🔊 Audio processing and mixing
🖼️ Overlay composition (text, images, PiP)
🧩 Custom animation with mathematical expressions
🛠️ Utility functions (thumbnail, frame extraction, conversion)
All tools are exposed via the standard MCP protocol, making them callable by any MCP‑compatible client (e.g., Claude Desktop, custom agents).
🏗️ Architecture
The system is structured in layers, ensuring separation of concerns and scalability.
graph TB
subgraph "AI Agent Layer"
A[AI Assistant] --> B[MCP Client]
end
subgraph "MCP Server Layer"
B --> C["FastMCP Server<br>main.py"]
C --> D["Tool Registry<br>@mcp.tool() decorators"]
D --> E1[Video Tools]
D --> E2[Audio Tools]
D --> E3[Animation Tools]
D --> E4[Utility Tools]
end
subgraph "Core Processing Layer"
E1 --> F[MoviePy Core]
E2 --> F
E3 --> F
E4 --> F
F --> G["FFmpeg Backend<br>via imageio-ffmpeg"]
G --> H["Output Files<br>.mp4, .mp3, .png"]
end
subgraph "Storage Layer"
H --> I[("moviepy_outputs/<br>uuid-named files")]
end
style A fill:#4CAF50,color:#fff
style C fill:#2196F3,color:#fff
style F fill:#FF9800,color:#fff
style G fill:#9E9E9E,color:#fff
📦 Key Components
Component | Description |
FastMCP | Manages the server lifecycle, tool registration, and protocol handling |
MoviePy | Core video manipulation library (editing, compositing, effects) |
Pillow | Image creation and rendering (for frame‑by‑frame animation) |
NumPy | Fast numerical operations for pixel‑level manipulation |
FFmpeg | Underlying encoder/decoder (managed by imageio‑ffmpeg) |
🚀 Getting Started
✅ Prerequisites
Python 3.12+ (required for the project’s dependencies)
uv– the fast Python package installer and resolverFFmpeg – installed automatically via
imageio-ffmpeg, but you can also install it manually if needed.
📥 Installation
Clone the repository
git clone https://github.com/yourusername/MoviePy_MCP.git cd MoviePy_MCPInstall dependencies
uv syncThis will install all dependencies defined in
pyproject.toml.Verify the installation
uv run python main.pyYou should see:
MoviePy MCP Server Output directory: /path/to/moviepy_outputs Starting MCP server...
🧪 Quick Test
To ensure everything works, you can run a simple tool call via any MCP client. Alternatively, test the animation engine directly:
# In a Python script (or from the REPL after importing main)
from main import create_stick_figure_runner
video_path = create_stick_figure_runner(duration=3)
print(f"Video generated: {video_path}")⚙️ Configuration
🔧 MCP Client Configuration
The server is designed to be launched by an MCP client (e.g., Claude Desktop, Cursor, etc.). Provide a configuration file similar to Config_Example.json:
{
"MoviePy_MCP": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/MoviePy_MCP",
"run",
"main.py"
]
}
}🌱 Environment Variables
Variable | Description | Default |
| Output directory for all generated files |
|
| Default frames per second for new videos |
|
| Video codec for exports |
|
| Audio codec |
|
| FFmpeg preset (ultrafast, fast, medium, slow) |
|
💡 You can set these in your shell before starting the server.
🛠️ Tool Reference
All tools are exposed as MCP tools with clear parameter names, types, and docstrings. The complete list is organised by category.
🎥 Video Editing Tools
Tool | Description | Parameters | Return |
| Retrieve metadata (duration, dimensions, fps) |
|
|
| Extract a segment between |
|
|
| Adjust playback speed ( |
|
|
| Resize by scale or explicit dimensions |
|
|
| Rotate by given angle (degrees) |
|
|
| Mirror horizontally or vertically |
|
|
| Crop to a rectangular region (pixel coordinates) |
|
|
| Concatenate multiple videos in order |
|
|
| Reverse the video playback |
|
|
| Repeat the video N times |
|
|
| Split at a given time, output two files |
|
|
| Hold a specific frame for a duration |
|
|
| Apply fade‑in and/or fade‑out |
|
|
| Crossfade between two videos |
|
|
✍️ Text & Overlay Tools
Tool | Description | Parameters | Return |
| Add text overlay to a video |
|
|
| Overlay an image on the video |
|
|
| Place one video inside another |
|
|
🔊 Audio Tools
Tool | Description | Parameters | Return |
| Add or replace audio track |
|
|
| Apply audio fade‑in/out |
|
|
| Strip audio from video |
|
|
| Replace existing audio with a new file |
|
|
| Change audio volume (0.0 = mute, 2.0 = double) |
|
|
| Extract audio as MP3 |
|
|
🎨 Animation & Generation Tools
Tool | Description | Parameters | Return |
| General‑purpose multi‑object animation engine |
|
|
| Pre‑built animated running stick figure |
|
|
| Simple animated scenes (bouncing, horizontal, orbit, pulse, etc.) |
|
|
| Moving geometric shape (circle, square, triangle) |
|
|
| Particle field with random motion |
|
|
| Text with various animation styles (fade, slide, zoom) |
|
|
| Create a video from a list of images |
|
|
| Animated moving colour gradient |
|
|
| Countdown from N to 1 |
|
|
| Typewriter‑style text appearance |
|
|
| Physics‑based bouncing ball animation |
|
|
| Animated progress/loading bar |
|
|
| Solid colour video background |
|
|
| Complete video with centred text |
|
|
🛠️ Utility Tools
Tool | Description | Parameters | Return |
| Re‑encode video with quality preset |
|
|
| Extract a frame as PNG |
|
|
| Extract a specific frame as PNG |
|
|
| Smooth zoom‑in effect |
|
|
| Pan across the video (left/right/up/down) |
|
|
📊 Workflow Diagrams
General Video Editing Pipeline
flowchart TD
A[Start] --> B[Load Input Video]
B --> C{Choose Operation}
C -->|Trim| D[Set start/end]
C -->|Speed| E[Set speed factor]
C -->|Resize| F[Set new dimensions]
C -->|Rotate| G[Set angle]
C -->|Merge| H[Load multiple videos]
C -->|Overlay| I[Add text/image]
D --> J[Process with MoviePy]
E --> J
F --> J
G --> J
H --> J
I --> J
J --> K[Write output with FFmpeg]
K --> L[Save to moviepy_outputs/]
L --> M[Return file path]Custom Animation Rendering
flowchart LR
subgraph Input
A[Object definitions]
B[Duration, resolution, fps]
C[Background colour]
end
subgraph Processing
D[Parse object list]
E[For each frame t]
F[Evaluate expressions<br/>with t]
G[Render each object<br/>on a PIL canvas]
H[Composite all objects]
I[Convert to NumPy array]
end
subgraph Output
J[Create MoviePy VideoClip]
K[FFmpeg encoding]
L[Output .mp4 file]
end
A --> D
B --> D
C --> D
D --> E
E --> F
F --> G
G --> H
H --> I
I --> J
J --> K
K --> LAnimation Expression Evaluation
flowchart TD
A["Expression String<br>e.g., '300 + 100*sin(t*4)'"] --> B[AST Parse]
B --> C{Safe?}
C -->|Yes| D[Evaluate with t]
C -->|No| E[Raise ValueError]
D --> F[Return numeric value]
subgraph "Allowed Functions & Operators"
G[+, -, *, /, **, %]
H[sin, cos, tan, abs, sqrt]
I[min, max, pi]
end
F --> G
F --> H
F --> I💡 Examples
🎬 1. Create a Full Animated Scene
result = create_custom_animation(
duration=5,
width=1280,
height=720,
background="#1a1a2e",
objects=[
{
"type": "circle",
"x": {"expression": "640 + 300*sin(t*2)"},
"y": {"expression": "360 + 200*cos(t*1.5)"},
"radius": 40,
"color": "#ff6b6b",
"rotation": {"expression": "t*60"}
},
{
"type": "rectangle",
"x": {"expression": "640 + 200*cos(t*3)"},
"y": {"expression": "360 + 150*sin(t*2.5)"},
"width": 80,
"height": 80,
"color": "#4ecdc4",
"rotation": {"expression": "t*90"}
},
{
"type": "text",
"text": "🎬 AI Animation",
"x": 640,
"y": 80,
"font_size": 64,
"color": "#ffffff"
}
]
)
print(f"Video saved to: {result}")🏃 2. Generate a Stick Figure Running
video = create_stick_figure_runner(
duration=4,
width=800,
height=600,
background="#a8d8ea"
)✂️ 3. Edit an Existing Video
# Trim, speed up, and add a watermark
info = get_video_info("input.mp4")
trimmed = trim_video("input.mp4", start=10, end=30)
fast = change_speed(trimmed["output"], speed=1.5)
watermarked = add_text(
fast["output"],
text="© 2026 My Studio",
fontsize=40,
color="white",
position=("right", "bottom")
)🔊 4. Extract and Process Audio
# Extract audio, then add it back with volume boost
audio_path = extract_audio("video.mp4")
video_with_audio = add_audio("video.mp4", audio_path, volume=1.8)🖼️ 5. Picture‑in‑Picture
result = picture_in_picture(
main_video="presentation.mp4",
small_video="speaker.mp4",
x=20,
y=20,
scale=0.25
)🧪 Performance & Benchmarks
Tests were performed on a MacBook Pro M1, 16GB RAM with SSD storage. Average times for common operations:
Operation | Duration | File Size (approx) | CPU Usage |
Trim 10‑sec segment | 2.1 s | 5.2 MB | ~80% |
Change speed (2×) | 2.8 s | 3.0 MB | ~85% |
Resize 720p → 480p | 3.0 s | 2.1 MB | ~75% |
Rotate 90° | 3.5 s | 6.0 MB | ~80% |
Merge two 10‑sec clips | 4.2 s | 10.5 MB | ~90% |
Add text overlay | 2.5 s | 5.8 MB | ~70% |
Custom animation (5 sec, 3 objects) | 5.0 s | 4.0 MB | ~95% |
Particle animation (100 particles) | 4.5 s | 3.5 MB | ~90% |
Note: Times depend on input file size, codec, and system load. The server uses
libx264withmediumpreset by default.
⚠️ Error Handling
The server implements robust error checking:
File Existence: All
input_pathparameters are validated before processing.Invalid Parameters: Type and range checks (e.g., positive duration, non‑zero speed) raise descriptive
ValueError.Audio Presence: Audio‑related tools will fail gracefully if the video has no audio track.
Expression Safety: Animation expressions are parsed with
astand a whitelist of functions/operators to prevent arbitrary code execution.Output Directory: The
moviepy_outputs/directory is created automatically.
All errors are returned as structured MCP error responses (or raised as exceptions during tool execution).
🤝 Contributing
We welcome contributions! Please follow these steps:
Fork the repository.
Create a feature branch (
git checkout -b feature/your-feature).Commit your changes with clear messages.
Push to the branch (
git push origin feature/your-feature).Open a Pull Request against the
mainbranch.
🧑💻 Development Setup
⚡ TL;DR
# Clone your fork
git clone https://github.com/yourusername/MoviePy_MCP.git
cd MoviePy_MCP
# Install with dev dependencies
uv sync
#Run Main.py script
uv run main.py
📄 License
This project is licensed under the MIT License – see the LICENSE file for details.
Made with ❤️ by Sahil Kumar
Available Tools
42 toolsadd_audioC
Add or replace the audio track of a video.
Inputs: audio_path (required), input_path (required), volume, output_path. Returns: object
add_image_overlayC
Add an image on top of a video.
Inputs: image_path (required), input_path (required), x, y, +5 more. Returns: object
add_textC
Add text overlay to a video.
Inputs: text (required), input_path (required), color, start, +4 more. Returns: object
adjust_volumeB
Change video's audio volume.
1.0 = original 0.5 = half volume 2.0 = double volume 0.0 = mute
Inputs: input_video (required), volume.
change_speedB
Change video playback speed.
speed: 0.5 = slow motion 1.0 = normal 2.0 = 2x faster
Inputs: speed (required), input_path (required), output_path. Returns: object
create_animated_sceneB
Create a procedural animated video completely from scratch.
scene_type:
bouncing
horizontal
vertical
diagonal
orbit
pulse
Useful when the user asks for a simple animated scene without providing source footage.
Inputs: width, height, duration, background, +2 more.
create_animated_textC
Create an animated text video.
animation:
fade
slide_left
slide_right
slide_up
slide_down
zoom
Inputs: text (required), width, height, duration, +4 more.
create_backgroundC
Create a solid-color video background.
Inputs: b, g, r, width, +3 more. Returns: object
create_bouncing_objectC
Create a physics-inspired bouncing ball animation.
Inputs: width, height, gravity, duration.
create_countdown_videoC
Create a countdown animation.
Inputs: width, height, seconds, background.
create_custom_animationA
Create a complete multi-object animated video from scratch.
This is a general-purpose procedural animation engine.
Multiple objects can exist in the same scene.
Supported object types: circle rectangle line triangle ellipse text
Every object can independently animate: x y rotation scale opacity size
Animation values can use expressions involving: t sin() cos() tan() abs() sqrt() pi()
Example:
{ "type": "circle", "x": { "expression": "300 + 100sin(t4)" }, "y": 300, "radius": 40, "color": "#ffffff" }
Objects are rendered in list order. Later objects appear on top of earlier objects.
This allows complex scenes such as: stick figures cars rockets planets bouncing balls animated logos simple characters UI animations kinetic typography
Inputs: fps, width, height, objects, +3 more.
create_gradient_animationC
Generate an animated moving gradient video.
Inputs: width, height, duration.
create_moving_object_videoC
Create a video with a moving geometric object.
object_type: circle, square, triangle
Inputs: width, height, duration, background, +2 more.
create_pan_animationC
Create a camera-like pan across an oversized video.
direction: left, right, up, down
Inputs: input_video (required), direction.
create_particle_animationC
Create an animated particle field from scratch.
Inputs: width, height, duration, background, +1 more.
create_progress_bar_videoC
Create an animated loading/progress bar.
Inputs: width, height, duration.
create_slideshow_videoB
Create a video slideshow from image files.
image_paths: list of image paths. transition:
fade
none
Inputs: image_paths (required), transition, seconds_per_image.
create_stick_figure_runnerA
Create a complete animated stick-figure running scene.
Includes: head body left arm right arm left leg right leg ground shadow
The complete character is created from multiple independently animated shapes.
Inputs: width, height, duration, background.
create_text_videoC
Create a complete video containing centered text.
Inputs: text (required), width, height, duration, +4 more. Returns: object
create_thumbnailC
Extract a frame from a video and save it as PNG.
Inputs: input_video (required), time.
create_typing_text_videoC
Create a typing-machine style text animation.
Inputs: text (required), width, height, duration, +1 more.
create_zoom_animationC
Apply a smooth zoom-in effect to a video.
Inputs: input_video (required), zoom_amount.
crop_videoB
Crop a video using pixel coordinates.
Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +2 more. Returns: object
crossfade_videosC
Crossfade from one video into another.
Inputs: video1 (required), video2 (required), transition_duration.
export_videoC
Export a video as MP4.
quality: ultrafast fast medium slow
Inputs: input_path (required), fps, quality, output_path. Returns: object
extract_audioC
Extract audio from a video.
Inputs: input_video (required).
extract_frameC
Extract a specific video frame as PNG.
Inputs: time (required), input_video (required).
fade_audioC
Apply audio fade-in and/or fade-out.
Inputs: input_path (required), fade_in, fade_out, output_path. Returns: object
fade_videoB
Apply video fade-in and fade-out.
Inputs: input_video (required), fade_in, fade_out.
freeze_frameC
Freeze a selected frame and hold it for a duration.
Inputs: freeze_time (required), input_video (required), freeze_duration.
get_video_infoB
Get basic information about a video.
Returns:
duration
width
height
fps
Inputs: input_path (required). Returns: object
loop_videoC
Repeat a video multiple times.
Inputs: input_video (required), loops.
merge_videosC
Concatenate multiple videos sequentially.
Inputs: input_paths (required), output_path. Returns: object
mirror_videoB
Mirror a video horizontally or vertically.
Inputs: input_path (required), direction, output_path. Returns: object
picture_in_pictureC
Put one video on top of another video.
Inputs: main_video (required), small_video (required), x, y, +4 more. Returns: object
remove_audioC
Remove audio from a video.
Inputs: input_video (required).
replace_audioC
Replace the video's existing audio.
Inputs: audio_file (required), input_video (required).
resize_videoC
Resize a video.
Use either: width + height OR: scale
Example: scale=0.5 scale=2
Inputs: input_path (required), scale, width, height, +1 more. Returns: object
reverse_videoC
Reverse a video.
Inputs: input_video (required).
rotate_videoC
Rotate a video by the specified angle.
Inputs: angle (required), input_path (required), output_path. Returns: object
split_videoC
Split a video into two separate files.
Inputs: split_time (required), input_video (required).
trim_videoC
Trim a video between start and end seconds.
Inputs: end (required), start (required), input_path (required), output_path. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 42 tools
Several tools blur together: add_audio explicitly includes 'add or replace', overlapping with replace_audio; create_thumbnail and extract_frame both save a PNG frame; and create_custom_animation is a general-purpose engine that can reproduce many dedicated generators like create_bouncing_object, create_animated_scene, and create_animated_text. The editing tools are mostly distinct, but the creation tools have serious boundary confusion.
The vast majority of tools follow a clean snake_case verb_noun pattern: create_, add_, get_, trim_, resize_, merge_, etc. The only notable deviation is picture_in_picture, which uses a noun phrase without a leading verb, but overall the naming is predictable and consistent.
42 tools is well beyond the well-scoped range for an MCP server. Many of the creation tools are highly redundant template variations that could be consolidated into a smaller set, especially since create_custom_animation already provides generalized procedural animation.
The server covers a broad video editing lifecycle: importing/inspecting video, trimming, splitting, merging, transforming, audio editing, overlays, effects, and export. Minor gaps like color filters, subtitle support, or additional export formats exist, but most common video editing workflows are supported without dead ends.
Maintenance
Related MCP Connectors
AI video editor your agent can drive: plan scenes, edit a multi-track timeline, and render MP4s.
AI video editor for agents and humans: timeline, captions, color, audio and generation as MCP tools.
AI video, image and audio generation with 140+ AI models from any MCP agent
Generate and edit images, video, voice, lip-sync and 3D models from your AI agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to perform comprehensive video and audio editing operations including trimming, effects, overlays, audio processing, and YouTube downloads.30MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to edit videos through natural language, providing tools for timeline editing, audio management, rendering, and more.2MIT
- FlicenseAqualityBmaintenanceEnables AI agents to edit video using text-based proxies, motion graphics via Hyperframes, and advanced FFmpeg rendering, turning any LLM IDE into a professional video editor.4-
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to read, edit, and export real video projects with a full multitrack timeline, effects, captions, and export capabilities.2-