mcp-manimgl
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., "@mcp-manimgl create a narrated animation of Euler's formula with background music"
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.
mcp-manimgl — MCP server exposing manimgl (Manim OpenGL) mathematical animation functionality as tools for LLMs.
mcp-name: io.github.daedalus/mcp-manimgl
Install
pip install mcp-manimglOptional extras:
# For rendering (requires manimgl + system deps)
pip install "mcp-manimgl[render]"
# For audio narration + MIDI music support
pip install "mcp-manimgl[audio]"Related MCP server: manim-web
System Dependencies
Dependency | Required for | Install |
| Audio mixing, narration sync, music ducking |
|
| MIDI file rendering to audio |
|
SoundFont ( | MIDI instrument sounds |
|
pangocairo, OpenGL | Manim rendering engine | See manimgl docs |
The server checks for non-Python dependencies at startup and reports any missing ones to stderr and via the mcp-manimgl://info resource.
Usage
MCP Server
# Run with stdio transport (default for MCP)
mcp-manimglIn Claude Desktop / Cursor / MCP clients
Add to your mcp.json:
{
"mcpServers": {
"mcp-manimgl": {
"command": "mcp-manimgl"
}
}
}Tools
The server exposes these tool categories:
Scene Management
create_scene— Create/configure a new sceneclear_scene— Remove all elementsadd_wait— Add wait/pauseset_camera— Configure cameraset_config— Set global rendering configsave_state/restore_state— State managementgenerate_scene_script— Get the generated Python script
Mobject Creation
add_circle,add_square,add_rectangle,add_polygonadd_line,add_arrow,add_dotadd_text,add_tex(LaTeX)add_function_graph,add_parametric_curveadd_coordinate_system,add_vectoradd_labeled_point,add_brace,add_number_lineadd_decimal_number,add_matrixadd_3d_object(sphere, cube, torus, cone, cylinder)
Mobject Manipulation
move_to,shift,scale,rotateset_color,set_opacitynext_to,align_to
Animations
animate_transform,animate_fade_in/out,animate_growanimate_rotate,animate_scale,animate_shiftanimate_indicate,animate_write,animate_set_coloranimate_move_along_path,animate_group
Audio
add_narration— Generate TTS (gTTS) narration that plays at the current timeline positionadd_background_music— Add background music from audio files or MIDI files (auto-rendered via FluidSynth). Supports volume control, looping, and sidechain ducking during narration.
Rendering
render_scene— Render to video (auto-mixes background music + narration with ducking)save_frame— Save single frameget_render_status— Check environment
Audio Features
Narration
# TTS narration at current timeline position
add_narration("Shor's algorithm factors large numbers in polynomial time.")Background Music
Accepts audio files (.mp3, .wav, .ogg) or MIDI files (.mid, .midi). MIDI files are rendered to audio using FluidSynth and the system SoundFont.
# From an audio file
add_background_music("/path/to/music.mp3", volume=0.3, loop=True)
# From a MIDI file (auto-rendered)
add_background_music("/path/to/classical.mid", volume=0.2)
# With ducking configuration
add_background_music(
"bach_chorale.mid",
volume=0.25,
loop=True,
duck_threshold="-20dB",
duck_ratio=6,
duck_attack=0.05,
duck_release=0.3,
)When both background music and narration are present, render_scene automatically:
Renders the video without audio via manimgl
Places the music track (looped if needed) at the configured volume
Places each narration track at its timeline position
Applies sidechain compression so music volume ducks during narration
Composites everything into the final MP4 via ffmpeg
Example: Shor's Algorithm
A narrated animation explaining Shor's algorithm with LaTeX, 5 TTS narration tracks, and classical MIDI background music.
Watch:
MCP tool call sequence:
# 1. Configure scene
create_scene(background_color="#0a0a2e", resolution="1920x1080", fps=30)
# 2. Background music (auto-loops to fill video duration)
add_background_music("classical.mid", volume=0.25, loop=True)
# 3. Create mobjects + animate (5 sections)
add_tex("Shor's Algorithm", font_size=72, color="#FFD700")
add_tex("Integer Factorization on Quantum Computers", font_size=36, color="#88CCFF")
animate_fade_in("m_...", run_time=1.5)
# ... more shapes, LaTeX formulas, fade-ins, fade-outs ...
# 4. Narration at specific timeline positions
add_narration("Shor's algorithm factors large numbers...") # ~3.5s
add_narration("The factoring problem...") # ~18.5s
add_narration("Key insight: reduce factoring to period...") # ~36.1s
add_narration("Quantum period finding uses superposition...") # ~55.4s
add_narration("Summary of Shor's algorithm...") # ~76.3s
# 5. Render (auto-mixes video + narrations + ducked BGM)
render_scene(output_path="data/Shors_Algorithm.mp4")See the full scene script at shor_mcp.py in the repository root.
MIDI Rendering
MIDI files are rendered using pyfluidsynth with a system SoundFont. On Debian/Ubuntu:
sudo apt install fluidr3mono-gm-soundfont libfluidsynth3
pip install "mcp-manimgl[audio]"Auto-discovered SoundFont paths:
/usr/share/sounds/sf3/(.sf3)/usr/share/sounds/sf2/(.sf2)/usr/share/fluidr3mono-gm-soundfont/
Development
git clone https://github.com/dclavijo/mcp-manimgl.git
cd mcp-manimgl
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint + type check
prospector --with-tool ruff --with-tool mypy src/
# security scan
semgrep --config=auto --severity=ERROR src/
# find unused code
vulture --min-confidence 90 src/MCP
mcp-name: io.github.dclavijo/mcp-manimgl
Available Tools
58 toolsadd_3d_objectD
Inputs: object_type (required), color, properties, fill_opacity. Returns: object
add_arrowD
Inputs: end (required), start (required), color, stroke_width. Returns: object
add_background_musicA
Add background music to the scene.
The music plays from the beginning of the rendered video. Accepts audio files (.mp3, .wav, .ogg) or MIDI files (.mid, .midi). MIDI files are rendered to audio using FluidSynth and a system SoundFont.
When narration tracks are also present, the music volume auto-ducks during narration via sidechain compression in post-processing.
IMPORTANT: Always use MCP tools for scene operations.
Inputs: file_path (required), loop, volume, duck_ratio, +3 more. Returns: object
add_braceD
Inputs: mobject_id (required), color, label, direction. Returns: object
add_circleD
Inputs: color, radius, position, fill_opacity, +1 more. Returns: object
add_coordinate_systemD
Inputs: x_range, y_range, axis_config. Returns: object
add_custom_codeA
Inject custom Python code into the scene script.
The code will be inserted inside the construct() method body. Use this for advanced manim functionality not covered by other tools.
IMPORTANT: Always use MCP tools for scene operations. Do NOT write or execute standalone manim scripts.
Inputs: code_snippet (required). Returns: result
add_decimal_numberD
Inputs: color, value, font_size. Returns: object
add_dotD
Inputs: color, point, radius. Returns: object
add_function_graphD
Inputs: function (required), color, x_range. Returns: object
add_labeled_pointD
Inputs: label (required), point (required), color, dot_radius. Returns: object
add_lineD
Inputs: end (required), start (required), color, stroke_width. Returns: object
add_matrixD
Inputs: rows (required), color. Returns: object
add_narrationA
Generate and add a text-to-speech narration audio track to the scene.
The audio plays at the point in the timeline where this tool is called. Uses Google TTS (gTTS) for voice synthesis.
IMPORTANT: Always use MCP tools for scene operations.
Inputs: text (required), lang. Returns: object
add_number_lineD
Inputs: color, x_range. Returns: object
add_parametric_curveD
Inputs: function (required), color, t_range. Returns: object
add_polygonD
Inputs: vertices (required), color, fill_opacity, stroke_width. Returns: object
add_rectangleD
Inputs: color, width, height, position, +2 more. Returns: object
add_squareD
Inputs: color, position, side_length, fill_opacity, +1 more. Returns: object
add_texD
Inputs: tex_string (required), color, font_size. Returns: object
add_textD
Inputs: text (required), font, color, font_size. Returns: object
add_vectorD
Inputs: vector (required), color. Returns: object
add_waitB
Add a wait/pause to the scene timeline.
IMPORTANT: Always use MCP tools for scene operations.
Inputs: duration. Returns: result
align_toD
Inputs: mobject_id (required), reference_id (required), direction. Returns: result
animate_fade_inD
Inputs: mobject_id (required), run_time, shift_direction. Returns: object
animate_fade_outD
Inputs: mobject_id (required), run_time. Returns: object
animate_groupD
Inputs: animation_data (required), run_time, group_type. Returns: object
animate_growD
Inputs: mobject_id (required), run_time, grow_type. Returns: object
animate_indicateD
Inputs: mobject_id (required), run_time. Returns: object
animate_move_along_pathD
Inputs: mobject_id (required), run_time, path_type, path_config. Returns: object
animate_rotateD
Inputs: mobject_id (required), axis, angle, run_time. Returns: object
animate_scaleD
Inputs: mobject_id (required), scale_factor (required), run_time. Returns: object
animate_set_colorD
Inputs: color (required), mobject_id (required), run_time. Returns: object
animate_shiftD
Inputs: vector (required), mobject_id (required), run_time. Returns: object
animate_transformD
Inputs: mobject_id (required), run_time, rate_func, target_config, +1 more. Returns: object
animate_writeD
Inputs: mobject_id (required), run_time. Returns: object
audio_durationA
Get the duration of any audio file in seconds.
Accepts audio files (.mp3, .wav, .ogg, .mid) created by the server. Uses ffprobe internally.
Inputs: file_path (required). Returns: object
clear_sceneA
Remove all mobjects and animations from the current scene.
IMPORTANT: Always use MCP tools for scene operations.
Returns: True if successful.
Example: >>> clear_scene()
Inputs: no named parameters. Returns: result
create_sceneB
Create a new manimgl scene with the given configuration.
IMPORTANT: Always use MCP tools for scene operations. Do NOT write or execute standalone manim scripts.
Inputs: fps, resolution, frame_height, background_color. Returns: object
generate_scene_scriptA
Generate the full Python script for the current scene.
IMPORTANT: Always use MCP tools for scene operations. Do NOT write or execute standalone manim scripts. Use render_scene() and get_render_result() for rendering instead.
Returns: The complete Python script as a string.
Example: >>> generate_scene_script()
Inputs: no named parameters. Returns: result
get_render_resultA
Poll for the result of an async render started by render_scene().
Returns the render result dict when done, or a "still running" status. Keep polling until status is "completed" or "failed". The caller should use exponential backoff between polls: 1s, 2s, 4s, 8s... (cap at 30s). The count resets when the render completes or fails.
IMPORTANT: Always use this MCP tool for scene operations. Do NOT write or execute standalone manim scripts.
Inputs: render_id (required). Returns: object
get_render_statusA
Check if manimgl and OpenGL are available for rendering.
IMPORTANT: Always use this MCP tool for scene operations. Do NOT write or execute standalone manim scripts.
Returns: Dictionary with availability status of manimgl and OpenGL.
Example: >>> get_render_status()
Inputs: no named parameters. Returns: object
get_scene_infoA
Get the current scene's configuration and element counts.
IMPORTANT: Always use MCP tools for scene operations.
Returns: Scene information including resolution, mobject/animation counts.
Example: >>> get_scene_info()
Inputs: no named parameters. Returns: object
move_toD
Inputs: position (required), mobject_id (required), aligned_edge. Returns: object
next_toD
Inputs: mobject_id (required), reference_id (required), buff, direction. Returns: result
render_sceneA
Render the current scene to a video file.
Renders in the background to avoid MCP timeouts. Returns a render_id immediately. Poll get_render_result() with that render_id to check completion and get the output path.
Inputs: fmt, output_path. Returns: object
restore_stateA
Restore the scene to a previously saved state.
IMPORTANT: Always use MCP tools for scene operations.
Returns: True if state was restored, False if no saved state exists.
Example: >>> restore_state()
Inputs: no named parameters. Returns: result
rotateD
Inputs: angle (required), mobject_id (required), axis, about_point. Returns: result
save_frameA
Save a single frame (image) of the current scene.
IMPORTANT: Always use this MCP tool for scene operations. Do NOT write or execute standalone manim scripts.
Inputs: output_path. Returns: object
save_stateB
Save the current scene state for later restoration.
IMPORTANT: Always use MCP tools for scene operations.
Returns: True if state was saved.
Example: >>> save_state()
Inputs: no named parameters. Returns: result
scaleD
Inputs: mobject_id (required), scale_factor (required), about_point. Returns: result
set_cameraB
Configure the camera position and/or orientation.
IMPORTANT: Always use MCP tools for scene operations.
Inputs: position, orientation. Returns: result
set_colorD
Inputs: color (required), mobject_id (required). Returns: result
set_configC
Set global rendering configuration parameters.
IMPORTANT: Always use MCP tools for scene operations.
Inputs: config (required). Returns: result
set_opacityD
Inputs: opacity (required), mobject_id (required). Returns: result
shiftD
Inputs: vector (required), mobject_id (required). Returns: result
verify_scene_overlapsA
Detect overlapping visual elements (mobjects) in the current scene.
Computes axis-aligned bounding boxes for each mobject based on its stored position and dimension properties (radius, width, height, side_length, font_size). Reports any pair whose bounding boxes intersect.
NOTE: Positions are only reliably updated by move_to(). After shift/scale/rotate/next_to/align_to, the stored position may be stale. Text and TeX dimensions are estimated from font_size and character count — actual rendered glyphs may differ.
Returns: List of overlap reports, each with the pair of overlapping mobjects, their positions, types, and overlap magnitudes.
Example: >>> verify_scene_overlaps()
Inputs: no named parameters. Returns: result
verify_videoA
Inspect a rendered video file and return its technical properties.
Uses ffprobe to extract codec info, streams, duration, resolution, and bitrate. Verifies the file exists and has both video and audio.
IMPORTANT: Always use this MCP tool for scene operations. Do NOT write or execute standalone manim scripts.
Inputs: video_path (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 58 tools
Most tools have clear, specific purposes: add_* creates distinct object types, animate_* handles different animations, and set_*/get_* cover properties and queries. However, some overlap exists between generic tools like add_custom_code and animate_transform, and several add_* tools (e.g., add_vector vs add_arrow, add_function_graph vs add_parametric_curve) could confuse agents, especially with many missing descriptions.
Tool names follow a consistent verb_noun snake_case pattern: add_* for creation, animate_* for animations, set_* for properties, get_* for queries, and render_* for output. Minor exceptions like audio_duration don't break the overall predictability, and the grouping by prefix makes the set easy to navigate.
58 tools is excessive for a scene-builder server. Many similar operations are split into individual tools (18 add_* variants, 12 animate_* variants) that could be consolidated with parameters. While the domain is broad, the count makes the surface unwieldy and difficult for agents to choose from efficiently.
The set covers the full manim workflow: scene creation, object construction, transformations, animations, rendering, and audio. Gaps include no way to remove individual objects or animations (only clear_scene), and audio tracks once added cannot be removed or replaced. Overall, the core lifecycle is covered with minor dead ends.
Maintenance
Related MCP Connectors
Make animated videos by asking Claude, Cursor or any MCP client. Your AI writes it, we render it.
Build editable 3D scenes, direct characters and cameras, and export AI video references with MCP.
AI video, image and audio generation with 140+ AI models from any MCP agent
Direct AI video, image, music and storyboard production from any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that executes Manim Python scripts to generate and return rendered animations. It enables users to create mathematical and programmatic videos dynamically through natural language interfaces.3MIT
- AlicenseNot gradedqualityAmaintenanceMCP server for creating math animations with manim, enabling AI-driven real-time interactive creation and browser preview.8 PyPI1MIT
- AlicenseAqualityBmaintenanceEnables AI agents to generate, execute, and compile interactive Manim slide presentations through MCP tools.83MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to generate labeled contact sheets of Manim animations, scaffold storyboards from renders, and validate rendered steps against expected intents via MCP tools.MIT
