FastAPI and MCP service for trusted Python Manim rendering
manim-server demonstrates solid tool design with clear naming (verb_noun pattern), comprehensive descriptions (avg 180 chars), and structured schemas. All 8 tools have input schemas with typed parameters and descriptions. However, output schemas are not explicitly documented in the source, parameter constraints lack enums/ranges, and error handling guidance is minimal. Tool composition is strong, each tool has a single responsibility and clear sequencing (list_templates → create_session → append_section → render_scene). Security is reasonable (no secrets in params), but destructive operations (close_session, reset_session) lack confirmation patterns.
Use tool append one logical animation step to an existing Manim session. The code parameter is trusted Python Manim scene-body code, written as statements run inside the current Scene construct method. Sections are appended in order, so use this for incremental scene construction after create_session. Prefer render=False while batching multiple small edits; use render=True when the client needs an immediate video update after the append. cache defaults to use and only affects render=True: use reuses Manim cache, flush deletes partial movie cache before rendering, disable renders without cache. Returns appended section latestRender only render=True.
Close one Manim session by sessionId. Use when the client is finished with a session and wants the server to remove active session storage. Returns whether the session closed; closed sessions cannot be appended or rendered.
Start here: create new Manim scene session. Use before append_section or render_scene building new animation. Call list_templates first when choosing templateId; optional templateId selects file-backed template asset TEMPLATE_DIR/<templateId>.py; missing unknown templateId falls back default. Manim-Session-ID header or sessionId cookie may set session id. Returns sessionId, title, section count, render metadata.
Get one Manim session by sessionId. Use after create_session or list_sessions to inspect the current section log, render status, and generated media URLs before deciding whether to append, render, reset, or close the session.
Output schemas not documented in source code. Tool descriptions mention return values (e.g., 'Returns sessionId, title, section count, render metadata') but no formal schema definitions visible for response models.
Destructive operations (close_session, reset_session) lack confirmation or dry-run patterns. No mention of reversibility or recovery guidance in descriptions.
Parameter 'cache' in append_section and render_scene accepts string values ('use', 'flush', 'disable') but not declared as enum. LLMs may hallucinate invalid values.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 67 | <=2025-11-25 | v2 |
List existing Manim scene sessions. Use to find prior sessionId values before get_session, append_section, render_scene, reset_session, or close_session. Returns summary metadata only; call get_session for the full section log.
Fetch complete Manim template catalog before creating session. Use compare templateId, description, useCases values, then pass selected templateId create_session. Returns all file-backed templates available under TEMPLATE_DIR.
Render an existing Manim session synchronously. Use after one or more append_section calls with render=False when the client needs a fresh video URL. cache defaults to use; valid modes are use, flush, disable. Returns full video URL and section metadata.
Reset an existing Manim session section log. Use to keep the same sessionId but remove all appended Manim sections before rebuilding the scene. This does not create a new session; call append_section next with replacement scene-body code.
Error handling descriptions are minimal. No guidance on retryability, user-fixable errors, or recovery steps. E.g., close_session raises KeyError but no hint on how to recover.
append_section 'code' parameter accepts arbitrary Python code with minimal validation guidance. Description notes it is 'trusted' but no sanitization or injection prevention documented.