Mcp Manimgl

io.github.daedalus由 GitHub 账号 daedalus 发布v0.1.2更新于 Oct 25, 2026

MCP server exposing manimgl mathematical animation functionality as tools for LLMs

已验证STDIO仅桌面开发者工具媒体与设计

概览

AI 生成的概览

本地 MCP 服务器,让助手构建并渲染 manimgl 数学动画,包括图形、LaTeX、旁白和背景音乐。

可以做什么
创建和配置场景,设置相机与渲染参数,保存或恢复状态,导出生成的 Python 脚本。添加几何图形、线条、箭头、文本与 LaTeX、函数图像、坐标系、矩阵和三维物体。对物体进行移动、缩放、旋转、着色和对齐。应用变换、淡入淡出、生长、旋转、书写、沿路径移动等动画。添加 TTS 旁白和来自音频或 MIDI 文件的背景音乐,然后渲染视频或保存单帧。
适用场景
适合让助手把数学或科学讲解制作成视频,例如带 LaTeX 公式和音乐的旁白教学动画,而无需手写 manimgl 代码。
运行要求
以 pip 安装的 Python 包在本地运行,通过 stdio 启动。渲染需要 render 附加组件以及 manimgl 和其系统依赖(pangocairo、OpenGL)。音频需要 ffmpeg 和 ffprobe;MIDI 需要 libfluidsynth3 和系统 SoundFont。旁白使用 gTTS,通常需要网络访问。
安装前请注意
渲染会向你指定的路径写入视频和帧文件。旁白通过 gTTS 在线服务生成,旁白文本会发送给第三方。背景音乐和 MIDI 文件从本地路径读取。渲染计算量大,依赖可用的 OpenGL 和音频库。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Manimgl,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-manimgl — MCP server exposing manimgl (Manim OpenGL) mathematical animation functionality as tools for LLMs.

[PyPI] [Python] [Ruff]

mcp-name: io.github.daedalus/mcp-manimgl

Install

bash
pip install mcp-manimgl

Optional extras:

bash
# For rendering (requires manimgl + system deps)pip install "mcp-manimgl[render]"
# For audio narration + MIDI music supportpip install "mcp-manimgl[audio]"

System Dependencies

DependencyRequired forInstall
ffmpeg + ffprobeAudio mixing, narration sync, music duckingapt install ffmpeg
libfluidsynth3MIDI file rendering to audioapt install libfluidsynth3
SoundFont (.sf2/.sf3)MIDI instrument soundsapt install fluidr3mono-gm-soundfont
pangocairo, OpenGLManim rendering engineSee 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

bash
# Run with stdio transport (default for MCP)mcp-manimgl

In Claude Desktop / Cursor / MCP clients

Add to your mcp.json:

json
{  "mcpServers": {    "mcp-manimgl": {      "command": "mcp-manimgl"    }  }}

Tools

The server exposes these tool categories:

Scene Management

  • create_scene — Create/configure a new scene
  • clear_scene — Remove all elements
  • add_wait — Add wait/pause
  • set_camera — Configure camera
  • set_config — Set global rendering config
  • save_state / restore_state — State management
  • generate_scene_script — Get the generated Python script

Mobject Creation

  • add_circle, add_square, add_rectangle, add_polygon
  • add_line, add_arrow, add_dot
  • add_text, add_tex (LaTeX)
  • add_function_graph, add_parametric_curve
  • add_coordinate_system, add_vector
  • add_labeled_point, add_brace, add_number_line
  • add_decimal_number, add_matrix
  • add_3d_object (sphere, cube, torus, cone, cylinder)

Mobject Manipulation

  • move_to, shift, scale, rotate
  • set_color, set_opacity
  • next_to, align_to

Animations

  • animate_transform, animate_fade_in/out, animate_grow
  • animate_rotate, animate_scale, animate_shift
  • animate_indicate, animate_write, animate_set_color
  • animate_move_along_path, animate_group

Audio

  • add_narration — Generate TTS (gTTS) narration that plays at the current timeline position
  • 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.

Rendering

  • render_scene — Render to video (auto-mixes background music + narration with ducking)
  • save_frame — Save single frame
  • get_render_status — Check environment

Audio Features

Narration

python
# TTS narration at current timeline positionadd_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.

python
# From an audio fileadd_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 configurationadd_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:

  1. Renders the video without audio via manimgl
  2. Places the music track (looped if needed) at the configured volume
  3. Places each narration track at its timeline position
  4. Applies sidechain compression so music volume ducks during narration
  5. 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: [YouTube]

MCP tool call sequence:

# 1. Configure scenecreate_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 positionsadd_narration("Shor's algorithm factors large numbers...")   # ~3.5sadd_narration("The factoring problem...")                     # ~18.5sadd_narration("Key insight: reduce factoring to period...")   # ~36.1sadd_narration("Quantum period finding uses superposition...") # ~55.4sadd_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:

bash
sudo apt install fluidr3mono-gm-soundfont libfluidsynth3pip install "mcp-manimgl[audio]"

Auto-discovered SoundFont paths:

  • /usr/share/sounds/sf3/ (.sf3)
  • /usr/share/sounds/sf2/ (.sf2)
  • /usr/share/fluidr3mono-gm-soundfont/

Development

bash
git clone https://github.com/dclavijo/mcp-manimgl.gitcd mcp-manimglpip install -e ".[test]"
# run testspytest
# formatruff format src/ tests/
# lint + type checkprospector --with-tool ruff --with-tool mypy src/
# security scansemgrep --config=auto --severity=ERROR src/
# find unused codevulture --min-confidence 90 src/

MCP

mcp-name: io.github.dclavijo/mcp-manimgl

来源:README.md,提交 ddfe74f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分