{
  "markdown": "**mcp-manimgl** — MCP server exposing manimgl (Manim OpenGL) mathematical animation functionality as tools for LLMs.\n\n[![PyPI](https://img.shields.io/pypi/v/mcp-manimgl.svg)](https://pypi.org/project/mcp-manimgl/)\n[![Python](https://img.shields.io/pypi/pyversions/mcp-manimgl.svg)](https://pypi.org/project/mcp-manimgl/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/master/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\nmcp-name: io.github.daedalus/mcp-manimgl\n\n## Install\n\n```bash\npip install mcp-manimgl\n```\n\nOptional extras:\n\n```bash\n# For rendering (requires manimgl + system deps)\npip install \"mcp-manimgl[render]\"\n\n# For audio narration + MIDI music support\npip install \"mcp-manimgl[audio]\"\n```\n\n## System Dependencies\n\n| Dependency | Required for | Install |\n|---|---|---|\n| `ffmpeg` + `ffprobe` | Audio mixing, narration sync, music ducking | `apt install ffmpeg` |\n| `libfluidsynth3` | MIDI file rendering to audio | `apt install libfluidsynth3` |\n| SoundFont (`.sf2`/`.sf3`) | MIDI instrument sounds | `apt install fluidr3mono-gm-soundfont` |\n| pangocairo, OpenGL | Manim rendering engine | See [manimgl docs](https://github.com/3b1b/manim) |\n\nThe server checks for non-Python dependencies at startup and reports any missing ones to stderr and via the `mcp-manimgl://info` resource.\n\n## Usage\n\n### MCP Server\n\n```bash\n# Run with stdio transport (default for MCP)\nmcp-manimgl\n```\n\n### In Claude Desktop / Cursor / MCP clients\n\nAdd to your `mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"mcp-manimgl\": {\n      \"command\": \"mcp-manimgl\"\n    }\n  }\n}\n```\n\n## Tools\n\nThe server exposes these tool categories:\n\n### Scene Management\n- `create_scene` — Create/configure a new scene\n- `clear_scene` — Remove all elements\n- `add_wait` — Add wait/pause\n- `set_camera` — Configure camera\n- `set_config` — Set global rendering config\n- `save_state` / `restore_state` — State management\n- `generate_scene_script` — Get the generated Python script\n\n### Mobject Creation\n- `add_circle`, `add_square`, `add_rectangle`, `add_polygon`\n- `add_line`, `add_arrow`, `add_dot`\n- `add_text`, `add_tex` (LaTeX)\n- `add_function_graph`, `add_parametric_curve`\n- `add_coordinate_system`, `add_vector`\n- `add_labeled_point`, `add_brace`, `add_number_line`\n- `add_decimal_number`, `add_matrix`\n- `add_3d_object` (sphere, cube, torus, cone, cylinder)\n\n### Mobject Manipulation\n- `move_to`, `shift`, `scale`, `rotate`\n- `set_color`, `set_opacity`\n- `next_to`, `align_to`\n\n### Animations\n- `animate_transform`, `animate_fade_in/out`, `animate_grow`\n- `animate_rotate`, `animate_scale`, `animate_shift`\n- `animate_indicate`, `animate_write`, `animate_set_color`\n- `animate_move_along_path`, `animate_group`\n\n### Audio\n- `add_narration` — Generate TTS (gTTS) narration that plays at the current timeline position\n- `add_background_music` — Add background music from audio files or **MIDI files** (auto-rendered via FluidSynth). Supports volume control, looping, and sidechain ducking during narration.\n\n### Rendering\n- `render_scene` — Render to video (auto-mixes background music + narration with ducking)\n- `save_frame` — Save single frame\n- `get_render_status` — Check environment\n\n## Audio Features\n\n### Narration\n\n```python\n# TTS narration at current timeline position\nadd_narration(\"Shor's algorithm factors large numbers in polynomial time.\")\n```\n\n### Background Music\n\nAccepts audio files (`.mp3`, `.wav`, `.ogg`) or MIDI files (`.mid`, `.midi`). MIDI files are rendered to audio using FluidSynth and the system SoundFont.\n\n```python\n# From an audio file\nadd_background_music(\"/path/to/music.mp3\", volume=0.3, loop=True)\n\n# From a MIDI file (auto-rendered)\nadd_background_music(\"/path/to/classical.mid\", volume=0.2)\n\n# With ducking configuration\nadd_background_music(\n    \"bach_chorale.mid\",\n    volume=0.25,\n    loop=True,\n    duck_threshold=\"-20dB\",\n    duck_ratio=6,\n    duck_attack=0.05,\n    duck_release=0.3,\n)\n```\n\nWhen both background music and narration are present, `render_scene` automatically:\n1. Renders the video without audio via manimgl\n2. Places the music track (looped if needed) at the configured volume\n3. Places each narration track at its timeline position\n4. Applies sidechain compression so music volume ducks during narration\n5. Composites everything into the final MP4 via ffmpeg\n\n## Example: Shor's Algorithm\n\nA narrated animation explaining Shor's algorithm with LaTeX, 5 TTS narration tracks, and classical MIDI background music.\n\n> **Watch:** [![YouTube](https://img.youtube.com/vi/ojtm5Yuf33A/hqdefault.jpg)](https://youtu.be/ojtm5Yuf33A)\n\nMCP tool call sequence:\n\n```\n# 1. Configure scene\ncreate_scene(background_color=\"#0a0a2e\", resolution=\"1920x1080\", fps=30)\n\n# 2. Background music (auto-loops to fill video duration)\nadd_background_music(\"classical.mid\", volume=0.25, loop=True)\n\n# 3. Create mobjects + animate (5 sections)\nadd_tex(\"Shor's Algorithm\", font_size=72, color=\"#FFD700\")\nadd_tex(\"Integer Factorization on Quantum Computers\", font_size=36, color=\"#88CCFF\")\nanimate_fade_in(\"m_...\", run_time=1.5)\n# ... more shapes, LaTeX formulas, fade-ins, fade-outs ...\n\n# 4. Narration at specific timeline positions\nadd_narration(\"Shor's algorithm factors large numbers...\")   # ~3.5s\nadd_narration(\"The factoring problem...\")                     # ~18.5s\nadd_narration(\"Key insight: reduce factoring to period...\")   # ~36.1s\nadd_narration(\"Quantum period finding uses superposition...\") # ~55.4s\nadd_narration(\"Summary of Shor's algorithm...\")               # ~76.3s\n\n# 5. Render (auto-mixes video + narrations + ducked BGM)\nrender_scene(output_path=\"data/Shors_Algorithm.mp4\")\n```\n\nSee the full scene script at `shor_mcp.py` in the repository root.\n\n## MIDI Rendering\n\nMIDI files are rendered using `pyfluidsynth` with a system SoundFont. On Debian/Ubuntu:\n\n```bash\nsudo apt install fluidr3mono-gm-soundfont libfluidsynth3\npip install \"mcp-manimgl[audio]\"\n```\n\nAuto-discovered SoundFont paths:\n- `/usr/share/sounds/sf3/` (`.sf3`)\n- `/usr/share/sounds/sf2/` (`.sf2`)\n- `/usr/share/fluidr3mono-gm-soundfont/`\n\n## Development\n\n```bash\ngit clone https://github.com/dclavijo/mcp-manimgl.git\ncd mcp-manimgl\npip install -e \".[test]\"\n\n# run tests\npytest\n\n# format\nruff format src/ tests/\n\n# lint + type check\nprospector --with-tool ruff --with-tool mypy src/\n\n# security scan\nsemgrep --config=auto --severity=ERROR src/\n\n# find unused code\nvulture --min-confidence 90 src/\n```\n\n## MCP\n\nmcp-name: io.github.dclavijo/mcp-manimgl\n",
  "bytes": 6493,
  "sha": "5363ac0e52b3d9fe458cd00e65233ec6a89ba4554c479873e66becbe240d306e",
  "repo_slug": "daedalus/mcp-manimgl",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_daedalus_mcp_manimgl_9f28c51e/readme"
}