WM

wstcpyt/manim-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

19 stars 7 forks 质量 44 趋势 22Apache-2.0

用于数学动画的 manim mcp 服务器

概览

一个以多克为主的环境,用于与马尼姆一起创建数学动画,其特色既是一个CLI界面,又是一个带有模型背景协议(MCP)支持AI助手的网络API. 1. :在孤立可复制的多克环境运行 Manim 2. :通过HTTP请求创建和管理 Manim 动画 3. :直接与克洛德等AI助手互动 4. :上传脚本并下载生成的动画. - 安装在您的系统中的多克和多克 只需从 Docker 枢纽中取出预建的图像: 在动画目录中创建 Python 文件(见下文实例),然后运行 : 访问[[T0] 的 API 文档 -p: 预览输出文件 --t: 透明背景 - -- save last frame: 仅将最后一个框架 --c COLOR: 设定背景颜色 完整的API文档可在/docs端点获取.

概述(AI 翻译)

一个以多克为主的环境,用于与马尼姆一起创建数学动画,其特色既是一个CLI界面,又是一个带有模型背景协议(MCP)支持AI助手的网络API.

□ □ □ 概览

该项目提供:

  1. ** 封闭式Manim环境**:在孤立、可复制的多克环境中运行Manim
  2. 网页API: 通过 HTTP 请求创建和管理 Manim 动画
  3. ** MCP整合**:与克劳德等AI助手的直接互动.
  4. ** 财务管理**: 上传脚本并下载生成的动画

# # # 快速启动 # # # # # # QQ Quick start

· 先决条件

  • 安装在您的系统中的多克和多克
  • 安装

QQ 选项1: 使用预建图像( 建议)

只需从 Docker 枢纽中取出预建的图像:

然后用涂鸦作曲来操作:

备选2:在当地建设

  1. 清除储存库:

  2. 构建多克图像 :

使用量

QQ CLI 模式

在 [[T0] 目录中创建 Python 文件(见下文实例),然后运行:

API 模式

启动 API 服务器 :

访问 [[T1] 的 API 文档

# # 创建动画

基本实例

创建文件 animations/example.py :

  • 运行动画

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Manim MCP

A Docker-based environment for creating mathematical animations with Manim, featuring both a CLI interface and a web API with Model Context Protocol (MCP) support for AI assistants.

📑 Overview

This project provides:

  1. Containerized Manim Environment: Run Manim in an isolated, reproducible Docker environment
  2. Web API: Create and manage Manim animations via HTTP requests
  3. MCP Integration: Direct interaction with AI assistants like Claude
  4. File Management: Upload scripts and download generated animations

🚀 Quick Start

Prerequisites

  • Docker and Docker Compose installed on your system

Installation

Simply pull the prebuilt image from Docker Hub:

docker pull wstcpyt/manim-docker-mcp:latest

Then run it with docker-compose:

docker compose up -d

Option 2: Build Locally

  1. Clone the repository:

    git clone https://github.com/YOUR_USERNAME/manim-docker-mcp.git
    cd manim-docker-mcp
    
  2. Build the Docker images:

    docker compose build
    

Usage

CLI Mode

Create a Python file in the animations directory (see example below), then run:

docker compose run manim -pql animations/example.py ExampleScene

API Mode

Start the API server:

docker compose up -d manim-api

Access the API documentation at http://localhost:8000/docs

🎬 Creating Animations

Basic Example

Create a file animations/example.py:

from manim import *

class CircleToSquare(Scene):
    def construct(self):
        circle = Circle()
        circle.set_fill(BLUE, opacity=0.5)

        square = Square()
        square.set_fill(RED, opacity=0.5)

        self.play(Create(circle))
        self.wait()
        self.play(Transform(circle, square))
        self.wait()

Running the Animation

# CLI mode with preview (-p), low quality (-ql)
docker compose run manim -pql animations/example.py CircleToSquare

# API mode
curl -X POST "http://localhost:8000/run-manim?filepath=/manim/temp/circle_example.py&scene_name=CircleToSquare&quality=low_quality"

📂 Project Structure

manim-docker-mcp/
├── animations/           # Manim animation scripts
├── app/                  # FastAPI application
├── media/                # Generated animations (CLI mode)
├── output/               # Generated animations (API mode)
├── temp/                 # Temporary files
├── uploads/              # Uploaded animation scripts
├── Dockerfile            # Docker image definition
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →