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 分