HarleyCoops/Math-To-Manim: Turn Math Prompts into Manim Films
Introduction
Creating mathematical animations that actually teach—rather than merely decorate—has traditionally demanded deep expertise in both the subject matter and low-level graphics programming. Manim, the Python↗ Bright Coding Blog animation engine popularized by 3Blue1Brown, is powerful but verbose. Most developers and educators who need to explain a concept visually face a choice: spend hours hand-crafting scene code, or settle for static diagrams that fail to convey dynamic intuition.
HarleyCoops/Math-To-Manim addresses this directly. It is a natural language math animation tool that chains six specialized reasoning agents to plan, write, and render Manim films from a single sentence prompt. The project—created by Christian H. Cooper on January 20, 2025, the day DeepSeek's R1 reasoning model launched—now runs 2,416 GitHub stars and offers three interfaces: a CLI, a REST API, and an MCP server for Claude Desktop integration. The focus keyword Math-To-Manim describes both the tool and the broader approach: recursive reasoning over mathematical explanation, rendered as procedural cinema.
What is HarleyCoops/Math-To-Manim?
Math-To-Manim is an open-source Python project (MIT License) that automates the creation of mathematical and physics animations through a structured, multi-agent reasoning pipeline. Its baseline model is Claude Fable 5, run headlessly through the Claude CLI—not via API keys, but through a standard subscription login. The system is maintained by Christian H. Cooper (HarleyCoops) and last committed on July 11, 2026.
The project's core thesis, established in its first hours, is that if a single shot of reasoning can produce a correct Pythagorean proof in Manim, a recursive chain of reasoning can produce a complete film. The v1.1 release consolidates this into a single engine called Mythos, replacing the earlier typed pipeline (now preserved in archive/).
The technical category is generative animation orchestration—not a model itself, but a harness that drives frontier reasoning models through a reproducible, artifact-producing workflow. It sits at the intersection of LLM agent systems, computer graphics, and educational technology. Its relevance now stems from two converging trends: the maturation of reasoning models capable of correct mathematical derivation, and the demand for API-accessible, automatable content pipelines that produce inspectable intermediate artifacts rather than opaque outputs.
Key Features
Six-Agent Reasoning Chain The Mythos engine decomposes every prompt through six stages: Intent (what the learner asks), Cartographer (reverse reasoning tree), Curriculum (teachable ordering), Math-Director (definitions and equations), Cinematographer (shot-by-shot camera plan), and Scene-Composer (Manim object compilation). Each stage writes a JSON artifact to disk, making the reasoning inspectable and editable mid-run.
Reverse Reasoning Tree
Before generating code, the system asks recursively: what must a viewer already know to understand this concept? It bottoms out at assumed knowledge, then walks forward as a curriculum. This is not a metaphor—it is a concrete 02_knowledge_map.json file that users can prune or extend.
Three Front Doors
v1.1 provides math-to-manim (CLI), POST /v1/runs (FastAPI REST service), and math-to-manim serve-mcp (MCP server for Claude Desktop, Claude Code, and Cowork). All three share mythos/service.py as their core, eliminating behavioral drift between interfaces.
Deterministic Offline Mode
The entire chain, API, and MCP toolset run with --offline using zero model calls and zero render dependencies. This enables CI validation and pre-flight verification without consumption costs.
Self-Defending Chain with Fallback Ladder
If Claude Fable 5 fails for model-specific reasons (overload, 5xx), the chain walks M2M_MODEL_FALLBACKS—defaulting to claude-opus-4-8, then claude-sonnet-5—through the same CLI login. Auth failures fail fast with the fix (claude /login) rather than burning retries. Degenerate outputs (e.g., a 48-byte math dossier) are rejected and retried once, aborting loudly on second offense.
Render Budget Isolation
M2M_RENDER_TIMEOUT (default 1800s) separates rendering failures from model failures, preventing timeout cascades.
Atomic Manifests
Per-stage manifest writes enable live polling progress via m2m_get_job or GET /v1/jobs/{id}—no silence until completion.
Use Cases
Educational Content Production A single parent can prompt: "My 6th grader is struggling with greatest common factors and order of operations. She's a visual learner—show it to her." The tree bottoms out at multiplication; the resulting film builds factor trees with color-coded PEMDAS and parent check questions. A photographed textbook problem works equally via MCP clients with vision capability.
Graduate-Level Research Communication The same engine handles: "Help me actually see why one loop around the exceptional point swaps the eigenvalue branches." The tree bottoms out at complex multiplication and covering spaces; the film draws the two-sheeted square-root surface and animates monodromy live.
API-Driven Documentation Pipelines
Teams generating technical documentation can POST /v1/runs with `