Chalkcast

io.github.FredMichel由 GitHub 帳號 FredMichel 發布v0.1.0更新於 Oct 29, 2026

Author, render and visually verify Manim math animations from natural language

概覽

AI 產生的概覽

Chalkcast 讓助理撰寫、量測、修正並算繪 Manim 數學動畫,回傳影片與結構化判定,而不是盲寫腳本。

可以做什麼
  • 開啟、檢視與關閉專案工作階段,可設定畫質、影格率與主題
  • 加入場景、參數、LaTeX 公式、函數圖形、陰影面積、黎曼和、文字與幾何圖形
  • 編輯時間軸與物件:就地更新或串聯刪除物件、刪除步驟、對參數做補間動畫
  • 不產生影片即可量測畫面,檢查取景、重疊、可讀性、時序、編譯與曲線保真度,並自動修正機械性問題
  • 將場景算繪成影片並取樣影格,或快速產生單張預覽,並匯出 GIF
  • 檢查 Manim、LaTeX、ffmpeg、視覺等元件是否就緒,以及缺少時哪些功能會降級
適用情境
適合想用自然語言產出數學或科學動畫講解,並希望在畫面上核實結果、而不只是相信腳本能算繪的情況。對象是不想手寫 Manim 或 LaTeX 的教師、學生與 STEM 內容創作者。
執行需求
以 Python 套件形式在本機透過 stdio 執行,需要 Python 3.11 以上;render 附加套件會帶入 Manim 與內建 ffmpeg,公式另需 LaTeX 發行版。macOS 上須先安裝 cairo 與 pkg-config。可用 doctor 指令檢查 Manim、LaTeX、dvisvgm、physics.sty 與 ffmpeg。未宣告帳號、API 金鑰或環境變數。
安裝前請注意
算繪會在本機寫入影片與 GIF 檔案,可能耗時並佔用較多資源。仍有錯誤待辦時匯出會被阻擋,且早於最新編輯的算繪結果不能匯出。專案標示為 alpha,以視覺為基礎的意圖驗證尚未提供。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Chalkcast,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Chalkcast

Describe a concept. Get a verified animated explainer.

Chalkcast is an MCP server that lets an agent author, render, and visually verify Manim animations — so the output is a video that's actually correct on screen, not a plausible script that renders wrong.

[license] [python] [status] [MCP]

[Chalkcast showcase]

One continuous animation, authored, verified and rendered entirely through the MCP server (passed on the first render): a Fourier series grows harmonic by harmonic into a square wave, and the Gibbs overshoot (the true one, ≈ 1.179) stays at the edges. Reproduce it with python examples/showcase.py.


Who it's for

  • Educators & students — turn "explain the Fourier series" into a clean animated explainer, without learning Manim or writing LaTeX by hand.
  • STEM content creators — produce 3Blue1Brown-style animations in minutes instead of hours of coding and debugging renders.
  • Agents & tooling — a typed, verifiable MCP surface an AI can drive end to end, with a verdict it can act on instead of a video it can't inspect.

Why another Manim MCP?

Existing Manim MCP servers give the agent one tool: run this code, return the video. The agent writes Manim blind and hopes — but Manim is unforgiving (a LaTeX typo, an off-screen label, two terms overlapping, a transition firing before its target exists). The video "renders" and is still wrong, and the agent has no way to know.

Chalkcast gives the agent eyes and a correction loop:

author scene ──► render ──► inspect (verification lanes) ──► verdict     ▲                                                          │     └──────────────── fix obligations ◄──── needs_fix ─────────┘

Every render returns evidence (the artifact + sampled frames) and a structured verdict. Problems become obligations that block export until resolved. See docs/SPEC.md for the full design.

Install

One command (Claude Code; needs uv):

bash
claude mcp add chalkcast -- uvx --python 3.12 --from "chalkcast[render]" chalkcast serve

--python 3.12 matters: Chalkcast needs Python ≥ 3.11, and uv downloads one if the system Python is older (macOS ships 3.9). Then just ask in natural language.

Or with pip, into any Python ≥ 3.11 environment:

bash
pip install "chalkcast[render]"claude mcp add chalkcast -- chalkcast serve

[render] brings Manim and a bundled ffmpeg. Equations also need a LaTeX distribution. chalkcast doctor checks everything and prints the exact fix command for your OS:

bash
chalkcast doctor               # Manim / LaTeX / dvisvgm / physics.sty / ffmpegchalkcast demo                 # builds + verifies + renders the demo scene

macOS: pycairo (pulled in by Manim) has no macOS wheel and builds from source, so it needs brew install cairo pkg-config first. On a machine where Manim's native deps were built by hand, see scripts/dev-env.sh and scripts/serve.sh.

What the agent gets

GroupTools
Sessionopen_project · inspect_project · close_project
Authoringadd_scene · add_equation · add_plot · add_area · add_riemann · add_text · add_shape · add_parameter · add_step
Editingupdate_object · remove_object (cascade) · remove_step
Verificationinspect_render (measured, no video) · fix_scene (auto-repair)
Renderingrender_scene · render_frame
Exportexport_gif (blocked while error obligations remain)
Discoveryinspect_environment
  • Continuous animation: add_parameter("t"), use t in plot expressions or shape anchors (at_x="t"), then add_step("tween", param="t", value=6.28). Curves, areas and anchored dots follow it frame by frame. with_previous=True plays a step at the same time as the one before.
  • Fail fast, nothing implicit: expressions are validated when authored (an AST whitelist: x, math functions, np.<fn>, declared parameters). Colors, ranges, step targets, timeline order, and arguments that don't apply to a shape or step are rejected with a message saying what to do. Edits are all-or-nothing. Side effects (cascade removals, regrouped steps, redeclared parameters, default ranges) are reported in the result. export_gif refuses a render that predates the latest edit. Thirty-two independent audits (22, then 17, 14, 8, 4, 9, 4, 7, 5, 5, 7, 8, 5, 8, 7, 7, 10, 4, 5, 5, 8, 7, 7, 5, 7, 9, 7, 4, 10, 9, 7 and 6 findings, the last with no high-severity one; in the last thirteen, 9, 10, 8, 10, 9, 9, 9, 9, 9, 10, 8, 9 and 10 of 10 fresh explainers reached a correct GIF within two renders, and in the last one every verdict matched its frames; the last twenty-three built realistic explainers end to end and compared verdicts with frames, one of them over the real MCP stdio protocol) are pinned one test per finding in tests/test_ergonomics.py.
  • Faithful plots: dense sampling, curves split at jumps and poles (no invented risers or overshoot), clipping to the axes. A fidelity lane measures the drawn curve against the true function. Areas and Riemann sums are refused when they could not show the integral (function undefined or off the axes, y = 0 not visible).

How verification works

inspect_render builds the real Manim objects without encoding video (1–3 s) and measures them: exact bounding boxes, curve and axis ink, the drawn-vs-true error of every graph, and a strict LaTeX compile (Manim's batch mode silently "recovers" from LaTeX errors). Lanes: framing · collision · legibility · timing · compile · fidelity · range. fix_scene repairs the mechanical problems (moves, rescales, resampling) and leaves the rest as obligations for the agent.

Measured on labelled scenes (chalkcast bench, chalkcast bench --holdout N). Each held-out set was written and labelled (and checked frame by frame) by an author who never read the verifier. The first run of each set is the honest out-of-sample figure:

SetCasesFirst run: detection / false positivesBugs that run exposed
Held-out 139 (24 defective)95.8 % / 7.7 %over-strict safe margin; aliasing taken for a jump
Held-out 247 (31 defective)90.3 % / 12.8 %estimated noise after a compile error; straight arrows and box sides sampled only at their ends; equation size judged by box height
Held-out 344 (26 defective)96.2 % / 0 %an arrow's shaft was never sampled (only its tip)
Held-out 446 (25 defective)96.0 % / 0 %a label written during a zoom-in was excused as an intentional crop

After each set's bugs were fixed, every set (and the 40-case development set) scores 100 % / 0 %. From then on they are regression tests (tests/test_measured.py), not independent measures. Held-out 3 was written after the fixes for sets 1 and 2, and held-out 4 (continuous tweens, simultaneous beats, transforms, camera moves) after eleven ergonomics audits; each was run once, untouched. Held-out 4 is the current out-of-sample estimate.

Example (what the agent does)

open_project(theme="chalkboard")add_scene(title="Area under a parabola")add_text("Area under y = x^2", y=3)add_plot(functions=[{"expr":"x**2","color":"YELLOW"}], x_range=[0,2,1], y=-0.8)add_equation(r"\int_0^1 x^2 \, dx = \tfrac{1}{3}", y=2)add_step("write", targets=["text_1"])add_step("write", targets=["plot_1"])add_step("write", targets=["equation_1"])add_step("highlight", targets=["equation_1"])inspect_render()    # -> measured verdict in ~2 s, no videofix_scene()         # -> repairs framing / collision / fidelity if neededrender_scene()      # -> video + frames + verdict + obligationsexport_gif()        # -> shareable GIF (blocked if error obligations remain)

Status

Alpha. Scientific correctness is tested numerically (tests/test_science.py): shaded areas equal their integrals, Riemann rectangles their sum, drawn curves their function (including sin 30x), and the Gibbs peak its theoretical value. On PyPI and the MCP Registry (io.github.FredMichel/chalkcast). Vision-based intent verification is next (see docs/SPEC.md).

License

MIT.

來源:README.md,提交 082b28a

工具

21

open_project

Start a project session and make it the current one (later calls without project_id target it). quality: low (480p) | medium (720p) | high (1080p). fps: frame rate, default 15/30/60 for low/medium/high. theme: chalkboard|whiteboard|dark.

輸入參數fpsthemequality

inspect_project

Current project state: scenes, objects, steps, parameters and open obligations.

輸入參數project_id

close_project

Release a project session (default: the current one). If others are open, the most recently opened becomes current; the result names it.

輸入參數project_id

add_scene

Append a scene to the project; it becomes the default target of later calls without scene_id. The title is a label for you (it is not drawn: use add_text).

輸入參數titleproject_id

add_parameter

Declare a continuous scene parameter (e.g. time t). Use it by name in plot expressions or shape anchors (expr='sin(x - t)'), then animate it smoothly with add_step(kind='tween', param=name, value=...). Curves, areas and anchored shapes that use it are redrawn every frame.

輸入參數name必填valuescene_idproject_id

add_equation

Add a LaTeX equation (math mode, e.g. tex=r'e^{i\pi}+1=0'). Dirac notation (\ket{n}, \bra{n}, \braket{a}{b}, \expval{A}) and physics macros work.

輸入參數xytex必填colorscalescene_idproject_id

add_plot

Add axes with functions of x. Each function: {'expr': 'sin(x)', 'color': 'YELLOW'}. Expressions use x, bare math functions (sin, exp, sqrt, sign, ...), np.<fn>, and declared scene parameters; they are validated now. Sampling is adaptive (dense, no spline overshoot on jumps, curves split at poles and clipped to the axes); optional overrides: 'smooth': bool, 'dx': step. x_label/y_label are LaTeX. Defaults: x_range [-5, 5, 1], y_range [-3, 3, 1]; a [min, max] range gets a readable tick step (4-8 ticks, starting at min, or at 0 if 0 is inside the range); the result echoes the ranges used. Curves without a color get distinct colors suited to the theme. The axes are centred at (x, y); labels hang off them. Without functions you get bare axes.

輸入參數xywidthheightx_labelx_rangey_labely_rangescene_idfunctionsproject_idshow_numbers

add_text

Add a title/label/callout (plain text, any language). The rendered size is font_size x scale.

輸入參數xytext必填colorscalescene_idfont_sizeproject_id

add_shape

Add primitive geometry: circle|square|rectangle|triangle|arrow|dot|line, centred at (x, y) (default 0, 0). size (default 1): circle = diameter, square = side, triangle = circumradius, dot = 10 x radius (minimum radius 0.05), line/arrow = length (horizontal). rectangle: width x height (default 1 x 0.5) instead of size. line/arrow: give x1,y1,x2,y2 for an explicit segment (any direction) instead of size/x/y. Anchor in a plot's coordinates with plot_id + at_x + at_y expressions instead of x/y (they may use scene parameters, so a dot can track <x>(t) while a tween runs). Arguments that do not apply to the chosen shape are rejected.

輸入參數xyx1x2y1y2at_xat_ysizecolorshapewidth另有 4 個

add_area

Shade the area between a plotted function and the x-axis on [x_min, x_max] (the integral). [x_min, x_max] must lie within the plot's x_range, y = 0 must be on the axes, and the function must be defined and inside y_range there (otherwise an error says what to widen). It follows its plot (move the plot, not it).

輸入參數colorx_maxx_minopacityplot_id必填scene_idproject_idfunction_index

add_riemann

Riemann rectangles (left endpoints, fill opacity 0.6, one color) under a plotted function on [x_min, x_max] within the plot's x_range; (x_max - x_min)/dx must be a whole number, y = 0 must be on the axes and the function inside y_range there. Smaller dx = finer; transform coarse->fine to show convergence. They follow their plot.

輸入參數dxcolorx_maxx_minplot_id必填scene_idproject_idfunction_index

add_step

Append a timed beat. kind: write|transform|highlight|fade|camera_move|wait|tween. write/highlight/fade: all targets animate together, over `duration` (a plot's axes and curves are drawn together; highlight is a brief 1.2x pulse in the theme's accent color). An object driven by a parameter cannot be written, highlighted or faded in the same beat as a tween of that parameter (Manim freezes it). transform: one target morphs into `to` (the target keeps its id afterwards). camera_move: zoom is absolute (1 = the full frame, 2 = twice as close); focus_x/ focus_y recentre the camera, omitted = keep the current centre. tween: animate scene parameter `param` to `value` continuously (linear in time). with_previous=true plays this step at the same time as the previous one (e.g. move a curve and a dot together); not after a wait. `note` is a label for you (not drawn). Arguments that do not apply to `kind` are rejected.

輸入參數tokind必填notezoomparamvaluefocus_xfocus_ytargetsdurationscene_idproject_id另有 1 個

update_object

Change an existing object in place (only the fields you pass). Use it to reposition, rescale, recolor, retype text/LaTeX, replace plot functions or ranges, or adjust an area/Riemann interval -- no need to rebuild the scene. Explicit line/arrow segments move by their endpoints x1, y1, x2, y2. Everything is validated first: on error nothing changes. A plot's color is the default color of its curves without one (axes keep the theme ink). Areas, Riemann sums and anchored shapes follow their plot: move the plot instead.

輸入參數xydxx1x2y1y2texat_xat_ysizetext另有 17 個

remove_object

Delete an object. If steps or other objects (areas, anchored shapes) depend on it, nothing is removed unless cascade=true, which also removes the dependent objects and takes the removed ids out of steps (a step left with nothing to animate is deleted; other targets of a shared step stay). The reply lists exactly what was deleted or changed, and any object left without a step.

輸入參數cascadescene_idobject_id必填project_id

remove_step

Delete one step of the timeline (later steps are renumbered). A with_previous step that was joined to the removed one starts its own beat; it is listed in regrouped_steps.

輸入參數scene_idproject_idstep_index必填

inspect_render

Verify a scene WITHOUT rendering video (~1-2 s): builds the real Manim objects and measures them -- LaTeX/expression compile errors, off-screen objects, label collisions, curve fidelity (drawn vs true function), legibility, timing. Call it after authoring and fix what it reports before render_scene.

輸入參數scene_idproject_id

fix_scene

Automatically repair measured problems that have a mechanical fix: objects pushed back inside the frame, labels moved to the nearest free spot, curve sampling corrected, too-small text enlarged. Repeats measure->fix up to max_rounds, reports every change, and lists what still needs the author.

輸入參數scene_idmax_roundsproject_id

render_scene

Render one scene to video + sampled frames, then run verification lanes. The scene is measured first; if it cannot compile, no render is attempted.

輸入參數scene_idproject_id

render_frame

Fast single-still preview of a scene (last frame).

輸入參數scene_idproject_id

export_gif

Export the latest render of a scene as a shareable GIF, resampled to `width` pixels wide at `fps` (defaults keep GIFs small). Blocked by open error obligations of that render and by edits made since it.

輸入參數fpswidthscene_idproject_id

inspect_environment

Which providers are present (Manim, LaTeX, ffmpeg, vision) and what degrades without each.

無需輸入參數。

版本歷史

1
  1. v0.1.0最新Oct 26, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分