Skip to main content

MCP server for generating algorithm explanation videos

Project description

AI Video Pipeline โ€” MCP Server

This pipeline helps you make algorithm-explanation videos with minimal manual work. Claude Desktop calls these tools automatically โ€” you just describe your video idea and follow the steps.


๐Ÿ—บ๏ธ How the Pipeline Works

Your Idea (topic + gist)
       โ”‚
       โ–ผ
  [Tool 1] Script Generator       โ† Claude writes your full narration script
       โ”‚
       โ–ผ
  You record the voiceover
  Premiere Pro โ†’ export timestamped transcript
       โ”‚
       โ–ผ
  [Tool 2] Scene Planner          โ† splits transcript into visual scenes
       โ”‚
       โ”œโ”€โ”€ for image scenes โ†’
       โ”‚   [Tool 3] Image Prompt Generator  โ† paste into Whisk / Midjourney
       โ”‚
       โ””โ”€โ”€ for animation scenes โ†’
           [Tool 4] Animation Generator     โ† generates Manim Python code

๐Ÿ“‹ Prerequisites

Before starting, you need:

Requirement How to get it
Python 3.10+ python.org/downloads
Claude Desktop claude.ai/download
Free Gemini API key aistudio.google.com/apikey โ€” no credit card
Premiere Pro (for transcripts) Any version with SRT caption export
(Optional) Manim Only if you want equation animations โ€” install separately

๐Ÿš€ Setup (Step by Step)

Step 1 โ€” Clone / Download the Project

Put the mcp_video_pipeline folder somewhere easy to find.
Example location: C:\Proj\DD\mcp_video_pipeline\


Step 2 โ€” Install Python Dependencies

Open Command Prompt or PowerShell, then run:

cd C:\Proj\DD\mcp_video_pipeline
pip install -r requirements.txt

You should see packages being downloaded. This takes 1-2 minutes.


Step 3 โ€” Get Your Free Gemini API Key

  1. Go to: https://aistudio.google.com/apikey
  2. Sign in with your Google account.
  3. Click "Create API Key".
  4. Copy the key (it looks like: AIzaSy...).

Free limits: 15 requests/minute, 1 million tokens/day. More than enough for video production.


Step 4 โ€” Set Up Your API Key

In the mcp_video_pipeline folder:

  1. Find the file called .env.example
  2. Make a copy of it and name the copy exactly: .env (just dot-env, no .example)
  3. Open .env in Notepad and replace your_free_gemini_api_key_here with your actual key
GEMINI_API_KEY=AIzaSyYOUR_ACTUAL_KEY_HERE

Save the file.


Step 5 โ€” Configure Claude Desktop

  1. Open the file claude_desktop_config.json (in this project folder) โ€” it shows you what to copy.

  2. Find Claude Desktop's config file:

    • Windows: Press Win+R, type %APPDATA%\Claude\, press Enter
    • Open claude_desktop_config.json in Notepad (create it if missing)
  3. Your config file should look like this โ€” add the mcpServers block:

{
  "mcpServers": {
    "ai-video-pipeline": {
      "command": "python",
      "args": ["C:\\Proj\\DD\\mcp_video_pipeline\\server.py"]
    }
  }
}

โš ๏ธ Important: Update the path if your project is in a different location.
Use double backslashes \\ in the path (this is a Windows JSON requirement).

  1. Save the file.

  2. Fully quit and restart Claude Desktop (right-click the tray icon โ†’ Quit, then reopen).


Step 6 โ€” Verify It's Working

In Claude Desktop, look for a ๐Ÿ”ง tools icon (hammer icon) in the chat bar.
Clicking it should show 4 tools:

  • generate_script
  • plan_scenes
  • generate_image_prompt
  • generate_animation_code

If you don't see them: see the Troubleshooting section below.


๐ŸŽฌ Using the Pipeline

Stage 1: Generate Your Script

Tell Claude something like:

"I want to make a video about Dijkstra's shortest path algorithm. The tagline is 'How GPS knows the fastest route.' The gist is: Dijkstra's finds the cheapest path in a weighted graph. It's used in GPS and internet routing. Make it 10 minutes."

Claude will call the generate_script tool and return:

  • Full narration script
  • Key equations used
  • Metaphors used

Review the script. Make edits if needed.


Stage 2: Record & Transcribe (You Do This)

  1. Record yourself reading the script naturally.
  2. In Premiere Pro:
    • Go to Window โ†’ Text โ†’ Transcript
    • Click "Transcribe Sequence"
    • Once done, export as SRT or copy the text with timestamps
  3. Format: [HH:MM:SS] spoken words... per line

Stage 3: Plan Your Scenes

Paste the transcript and tell Claude:

"Here is my transcript: [paste transcript here]. Plan the scenes for me."

Claude calls plan_scenes and returns a table of scenes with timestamps, descriptions, and types (image or animation).


Stage 4: Generate Visuals

For each image scene, Claude automatically calls generate_image_prompt.
You get a ready-to-paste prompt for Whisk, Midjourney, Firefly, or any image AI.

For each animation scene, Claude calls generate_animation_code.
You get a Python file. To render:

pip install manim
manim -pql animation_scene.py YourSceneName

๐Ÿ”ง Troubleshooting

Problem Fix
Tools not showing in Claude Desktop Check the path in claude_desktop_config.json is correct. Fully restart Claude (not just close window).
GEMINI_API_KEY is not set error Make sure your .env file exists (not .env.example) and the key is correct.
pip: command not found Install Python from python.org and check "Add to PATH" during install.
429 Rate Limit error You've sent 15 requests in under a minute. Wait 60 seconds and retry.
Manim LaTeX error Install MiKTeX from miktex.org (Windows). Required for equation rendering.
JSON parse error in tools Retry โ€” occasionally Gemini may return slightly malformed JSON. Rare.

๐Ÿ“ Project File Map

mcp_video_pipeline/
โ”œโ”€โ”€ server.py                    โ† MCP server entry-point (start here to understand the project)
โ”œโ”€โ”€ requirements.txt             โ† Python packages
โ”œโ”€โ”€ .env.example                 โ† Copy โ†’ .env and add your Gemini key
โ”œโ”€โ”€ claude_desktop_config.json   โ† Snippet for Claude Desktop setup
โ”œโ”€โ”€ README.md                    โ† This file
โ”œโ”€โ”€ tools/
โ”‚   โ”œโ”€โ”€ script_generator.py      โ† Tool 1: Video script generation
โ”‚   โ”œโ”€โ”€ scene_planner.py         โ† Tool 2: Transcript โ†’ scene list
โ”‚   โ”œโ”€โ”€ image_prompt_generator.py โ† Tool 3: Scene โ†’ AI image prompt
โ”‚   โ””โ”€โ”€ animation_generator.py   โ† Tool 4: Scene โ†’ Manim Python code
โ””โ”€โ”€ utils/
    โ”œโ”€โ”€ model_client.py          โ† Gemini API calls (shared by all tools)
    โ””โ”€โ”€ schemas.py               โ† Data validation models

๐Ÿค– Free Model Details

Detail Value
Model gemini-2.0-flash
Provider Google AI Studio
Cost Free
Rate limit 15 requests/minute
Daily limit 1,000,000 tokens/day
Context window 1,000,000 tokens
API key required Yes (free, no credit card)

To switch models, edit the GEMINI_MODEL line in your .env file.


โœ… Testing Without Claude Desktop (Developer Mode)

cd C:\Proj\DD\mcp_video_pipeline
mcp dev server.py

Open http://localhost:5173 in your browser. You'll see the MCP Inspector โ€” a UI to test each tool individually with sample inputs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_video_pipeline_2-0.1.1.tar.gz (24.6 kB view details)

Uploaded Source

File details

Details for the file mcp_video_pipeline_2-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_video_pipeline_2-0.1.1.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_video_pipeline_2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 46ef17e7f171937b0f80044157071300e9c2504a2467abba55eb265851d83fc9
MD5 14ad261bdee2958b7ab1fbdfe98f2583
BLAKE2b-256 46a32b8b1744a30eae8bf03e125255ed56ea776ac5ce894c460f30dd23f7462e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page