PM

paulnegz/manim-mcp

开发工具

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

22 stars 6 forks 质量 60 趋势 0MIT

通过 Manim 实现文本转视频动画。视频的文本→代码→。CLI、代理模式和 MCP 服务器

概览

文本转视频动画,由manimgl(3Blue1Brown的库)和多智能体LLM流水线驱动。描述你想看到的内容,就能获得渲染出来的动画。 作为 、 、 或 ,与 Claude 等 AI 助手集成。 - - 使用 5,300+ 索引文档进行高质量代码生成: - 3,140 个 3Blue1Brown 场景示例 - 1,652 个带有精确参数的 manimgl API 签名 - 101 个动画模式模板(黎曼求和、变换、物理等) - 470 个库文档文件 - 16+ 常见错误模式 - - 可选的 AST 感知语义代码搜索,使用 Probe: - 基于树状的代码解析(理解 Python 结构) - 混合 BM25 + TF-IDF 排名以提升关键词匹配 - 完整的代码块提取(无截断) - - 每个视频使用 2+ 个动画模式以保证专业质量 - - 概念分析、场景规划、代码生成和代码审查 - - 存储错误模式和修正以持续改进 - - 支持 Google...

概述(AI 翻译)

文本转视频动画,由manimgl(3Blue1Brown的库)和多智能体LLM流水线驱动。描述你想看到的内容,就能获得渲染出来的动画。

它可以作为CLI工具、LLM驱动的代理或MCP服务器,用于与像Claude这样的AI助手集成。

示例

圆到正方形变换 三维旋转立方体
manim-mcp gen "Transform a blue circle into a red square" manim-mcp gen "A 3D cube rotating. Use ThreeDScene."

在YouTube上观看20+个示例动画

特色

  • RAG 驱动代码生成 - 使用 5,300+ 索引文档进行高质量代码生成:
  • 3,140 个 3Blue1Brown 场景示例
  • 1,652个带有精确参数的manimgl API签名
  • 101个动画模式模板(黎曼求和、变换、物理等)
  • 470 个图书馆文档文件
  • 16+常见错误的误差模式
  • 探针集成 - 可选的AST感知语义代码搜索,使用Probe:
  • 基于树置的代码解析(理解 Python 结构)
  • 混合BM25 + TF-IDF排名,以提升关键词匹配
  • 完整的代码块提取(无截断)

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

README

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

manim-mcp

Text-to-video animation powered by manimgl (3Blue1Brown’s library) and a multi-agent LLM pipeline. Describe what you want to see, and get a rendered animation back.

Works as a CLI tool, an LLM-powered agent, or an MCP server for integration with AI assistants like Claude.

Examples

Circle to Square Transform 3D Rotating Cube
manim-mcp gen "Transform a blue circle into a red square" manim-mcp gen "A 3D cube rotating. Use ThreeDScene."

Watch 20+ example animations on YouTube

Features

  • RAG-powered code generation - Uses 5,300+ indexed documents for high-quality code generation:
    • 3,140 3Blue1Brown scene examples
    • 1,652 manimgl API signatures with exact parameters
    • 101 animation pattern templates (Riemann sums, transforms, physics, etc.)
    • 470 library documentation files
    • 16+ error patterns for common mistakes
  • Probe integration - Optional AST-aware semantic code search using Probe:
    • Tree-sitter based code parsing (understands Python structure)
    • Hybrid BM25 + TF-IDF ranking for better keyword matching
    • Complete code block extraction (no truncation)
  • Multi-animation videos - Each video uses 2+ animation patterns for professional quality
  • Multi-agent pipeline - Concept analysis, scene planning, code generation, and code review
  • Self-learning - Stores error patterns and fixes for continuous improvement
  • Multi-provider LLM - Supports Google Gemini, Anthropic Claude, and DeepSeek
  • Audio narration - Parallel audio generation with automatic sync:
    • Video code generated first (no narration constraint)
    • TTS runs in parallel with video rendering
    • Audio automatically paced to match video duration
  • Parameter validation - API signatures prevent invalid method calls

Quick Start

pip install -e ".[rag]"

Prerequisites

  • Python 3.11+
  • manimgl installed: pip install manimgl
  • A Google Gemini API key set as MANIM_MCP_GEMINI_API_KEY
  • Optional: ChromaDB (for RAG), ffmpeg (for audio mixing), LaTeX (for math text), S3/MinIO (for cloud storage)
  • Optional: Probe for AST-aware code search (install via cargo install probe-search)

Environment Variables

Copy .env.example to .env and fill in your values:

# LLM Provider
MANIM_MCP_GEMINI_API_KEY=your-gemini-api-key
MANIM_MCP_GEMINI_MODEL=gemini-3-flash-preview  # default

# Alternative: Claude
# MANIM_MCP_LLM_PROVIDER=claude
# MANIM_MCP_CLAUDE_API_KEY=your-claude-api-key
# MANIM_MCP_CLAUDE_MODEL=claude-sonnet-4-20250514

# Alternative: DeepSeek
在 GitHub 查看完整 README

安装

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

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