Are you the author? Sign in to claim
manim-mcp
A Model Context Protocol (MCP) server for compiling and serving Manim animations.
app/server.py) - For REST API calls, testing, and web integrationmcp_server.py) - For Claude Desktop, Dify, and other MCP clientsSee MCP_SETUP.md for detailed MCP configuration instructions.
A FastAPI-based MCP (Model Control Protocol) server that provides two main tools:
requirements.txt)Clone the repository:
git clone <repository-url>
cd manim-mcp-server
Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install the required packages:
pip install -r requirements.txt
Install Manim and its dependencies:
pip install manim
.env file):
SECRET_KEY=your-secret-key-here
ACCESS_TOKEN_EXPIRE_MINUTES=30
Option 1: Using the startup script (recommended)
./start_server.sh
Option 2: Using uvicorn directly
uvicorn app.server:app --reload
The server will be available at http://localhost:8000
Once the server is running, you can access the interactive API documentation at:
GET / - Get server information and available toolsPOST /tools/manim_compile - Compile Manim code
{
"parameters": {
"code": "from manim import *\nclass Example(Scene):\n def construct(self):\n circle = Circle()\n self.play(Create(circle))",
"scene_name": "Example"
}
}
Parameters:
code (required): The Manim Python code to compilescene_name (required): Name of the specific scene class to compileGET /videos/{file_id} - Download a compiled video by IDGET /v1/tools - List all available toolsPOST /v1/tools/call - Call a tool (LangGraph compatible)
{
"tool": "manim_compile",
"parameters": {
"code": "from manim import *\nclass Example(Scene):\n def construct(self):\n circle = Circle()\n self.play(Create(circle))"
}
}
curl http://localhost:8000/
curl -X 'POST' \
'http://localhost:8000/tools/manim_compile' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"parameters": {
"code": "from manim import *\nclass Example(Scene):\n def construct(self):\n circle = Circle()\n self.play(Create(circle))"
}
}'
# Replace VIDEO_ID with the file_id from the compile response
curl -X 'GET' \
'http://localhost:8000/videos/VIDEO_ID' \
--output output.mp4
curl -X 'POST' \
'http://localhost:8000/tools/manim_compile' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"parameters": {
"code": "from manim import *\nclass Scene1(Scene):\n def construct(self):\n circle = Circle()\n self.play(Create(circle))\n\nclass Scene2(Scene):\n def construct(self):\n square = Square()\n self.play(Create(square))",
"scene_name": "Scene1"
}
}'
curl http://localhost:8000/v1/tools
python example_usage.py
See TESTING.md for detailed testing instructions.
Quick test:
# Run tool tests (no server needed)
python test_tools.py
# Run API tests (server must be running)
python test_api.py
This project is licensed under the MIT License - see the LICENSE file for details.
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official GitHub integration for repos, issues, PRs, and CI/CD workflows