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
- Go to: https://aistudio.google.com/apikey
- Sign in with your Google account.
- Click "Create API Key".
- 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:
- Find the file called
.env.example - Make a copy of it and name the copy exactly:
.env(just dot-env, no .example) - Open
.envin Notepad and replaceyour_free_gemini_api_key_herewith your actual key
GEMINI_API_KEY=AIzaSyYOUR_ACTUAL_KEY_HERE
Save the file.
Step 5 โ Configure Claude Desktop
-
Open the file
claude_desktop_config.json(in this project folder) โ it shows you what to copy. -
Find Claude Desktop's config file:
- Windows: Press
Win+R, type%APPDATA%\Claude\, press Enter - Open
claude_desktop_config.jsonin Notepad (create it if missing)
- Windows: Press
-
Your config file should look like this โ add the
mcpServersblock:
{
"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).
-
Save the file.
-
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_scriptplan_scenesgenerate_image_promptgenerate_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)
- Record yourself reading the script naturally.
- In Premiere Pro:
- Go to Window โ Text โ Transcript
- Click "Transcribe Sequence"
- Once done, export as SRT or copy the text with timestamps
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46ef17e7f171937b0f80044157071300e9c2504a2467abba55eb265851d83fc9
|
|
| MD5 |
14ad261bdee2958b7ab1fbdfe98f2583
|
|
| BLAKE2b-256 |
46a32b8b1744a30eae8bf03e125255ed56ea776ac5ce894c460f30dd23f7462e
|