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 分