anim-mcp
Typed stdio MCP server exposing the 2D animation toolkit with strict path and budget guardrails.
Model Context Protocol (MCP) stdio server that exposes onion, anim-studio, toonz_engine, fx, keylib, xsheet, multiplane, and lipsync as typed AI tools with enforced workspace sandboxing and spend guardrails.
git clone https://github.com/BestRoiMedia/anim-toolkit.gitWhy we built it
Letting AI coding agents construct raw shell commands around animation pipelines risks flag tampering, accidental secret reads, or runaway paid API spend. We built anim-mcp so agents invoke typed tools that pass exact argument arrays, return unaltered CLI JSON verdicts, and enforce hard safety boundaries.
Architecture & how it works
server.py runs over stdio inside a dedicated Python 3.12 MCP SDK environment and dispatches each tool call to the underlying CLI subprocess with stdin closed, a bounded timeout, and working directory pinned to the target project. Guardrails reject any path escaping the workspace root, block credential filenames (.env, .p8, service-account JSONs, keystores), strip threshold/budget/vision-bypass flags, and require an explicit confirm_budget string before studio_run can spend paid image or judge credits.
Key capabilities
- Typed MCP tools for onion, anim-studio, toonz_engine, fx, keylib, xsheet, multiplane, and lipsync
- Strict workspace path resolution (symlink-aware) and credential-file argument blocking
- Hard flag sanitization blocking --no-vision, --no-verify, --force, and threshold overrides
- Explicit confirm_budget="images=N,judge=M" confirmation gate for paid studio runs
- End-to-end stdio SDK smoke test suite verifying verdicts and guardrail refusals
Usage example
python3 anim/mcp/smoke_test.py
# Register in an MCP client config:
# command: ./anim/mcp/.venv/bin/python
# args: ["./anim/mcp/server.py"]