Manim MCP Server

Manim MCP Server

site icon
2025.04.04 0
Python动画生成视频处理内容生成
Manim MCP Server 是一个基于 Model Context Protocol (MCP) 的服务,用于执行 Manim 动画代码并返回生成的视频。它允许用户发送 Manim 脚本并接收渲染后的动画。该服务具有便携性和可配置性,适用于需要动态生成动画的场景。
View on GitHub

Overview

基本能力

产品定位

Manim MCP Server 是一个动画生成服务,专门用于执行 Manim 脚本并生成动画视频。

核心功能

  • 执行 Manim Python 脚本
  • 将动画输出保存到可见的媒体文件夹
  • 允许用户在执行后清理临时文件
  • 通过环境变量进行便携和配置

适用场景

  • 动态生成动画内容
  • 教育与演示材料的自动化生成
  • 与 Claude 等工具集成,实现自动化动画生成

工具列表

  • Manim: 用于创建数学动画的 Python 库
  • MCP: Model Context Protocol,用于服务间通信

常见问题解答

  1. 如何找到 Python 可执行文件路径?
  2. Windows (PowerShell): (Get-Command python).Source
  3. Windows (Command Prompt/Terminal): where python
  4. Linux/macOS (Terminal): which python

使用教程

使用依赖

确保已安装以下软件: - Python 3.8+ - Manim (社区版) - MCP

安装命令:

pip install manim
pip install mcp

安装教程

  1. 克隆仓库:
git clone https://github.com/abhiemj/manim-mcp-server.git
cd manim-mcp-server
  1. 与 Claude 集成: 在 claude_desktop_config.json 文件中添加配置:
{
  "mcpServers": {
     "manim-server": {
      "command": "/absolute/path/to/python",
      "args": [
        "/absolute/path/to/manim-mcp-server/src/manim_server.py"
      ],
      "env": {
        "MANIM_EXECUTABLE": "/Users/[Your_username]/anaconda3/envs/manim2/Scripts/manim.exe"
      }
    }
  }
}

调试方式

确保 Python 路径正确,并检查 Manim 是否安装成功。

许可证

该项目遵循 MIT 开源许可条款。