Git Commit Video Walkthrough Generator
Generates narrated video walkthroughs of git commits, staged/unstaged changes, or entire codebases with AI-powered analysis, syntax-highlighted code visualization, and text-to-speech narration.
README
Git Commit Video Walkthrough Generator
An MCP (Model Context Protocol) server that generates narrated video walkthroughs of git commits, staged/unstaged changes, or entire codebases with AI-powered analysis and explanations.
Features
- š„ Automatic video generation from git commits, diffs, or codebases
- š¤ AI-powered code analysis and script generation
- š£ļø Natural text-to-speech narration using system TTS
- šØ Syntax-highlighted code visualization
- š Multiple presentation styles (beginner, technical, overview)
- šÆ Works with or without MCP sampling support
Installation
Prerequisites
-
FFmpeg: Required for video compilation
- macOS:
brew install ffmpeg - Linux:
apt install ffmpeg - Windows: Download from ffmpeg.org
- macOS:
-
Node.js/Bun: For running the MCP server
- Recommended: Bun 1.0+ (
curl -fsSL https://bun.sh/install | bash) - Or Node.js 20+
- Recommended: Bun 1.0+ (
Build from Source
# Install dependencies
bun install
# Build TypeScript
bun run build
Usage
This tool can be used in two ways, depending on whether your MCP client supports sampling:
Option 1: With MCP Sampling Support (Automatic)
If your MCP client supports the sampling capability, use the generate_walkthrough tool:
{
"tool": "generate_walkthrough",
"arguments": {
"repoPath": "/path/to/repository",
"target": {
"type": "codebase"
},
"style": "technical",
"theme": "dark",
"outputPath": "./walkthrough.mp4"
}
}
Target types:
"codebase"- Analyze entire codebase"commit"- Analyze specific commit (requirescommitHash)"staged"- Analyze staged changes"unstaged"- Analyze unstaged changes
Option 2: Without MCP Sampling Support (Manual)
If your MCP client doesn't support sampling (like Claude Code), use the two-step approach:
Step 1: Generate Analysis and Script
Ask your LLM to analyze the code:
Please analyze this codebase and provide a JSON response with the following structure:
{
"summary": {
"achievement": "What this codebase accomplishes",
"approach": "How it accomplishes it"
},
"files": [
{
"path": "path/to/file.ts",
"status": "added" | "modified" | "deleted",
"explanation": "What this file does",
"impact": "Why it's important"
}
],
"totalStats": {
"additions": 0,
"deletions": 0,
"filesChanged": 5
}
}
Analyze the following project: [project name/path]
Focus on: [specific files or areas to analyze]
Then ask for a script:
Based on this analysis, create a video script with the following JSON structure:
{
"intro": "Introduction text for the video",
"sections": [
{
"title": "Section title",
"narration": "What to say in this section",
"codeSnippet": "optional code to display",
"duration": 5
}
],
"conclusion": "Concluding remarks",
"estimatedDuration": 30
}
Style: technical|beginner|overview
Target audience: [describe your audience]
Analysis:
[paste the analysis JSON you received from the previous step]
Step 2: Generate Video
Call the generate_video_from_script tool with both JSONs:
{
"tool": "generate_video_from_script",
"arguments": {
"analysis": { /* paste analysis JSON */ },
"script": { /* paste script JSON */ },
"style": "technical",
"theme": "dark",
"outputPath": "./walkthrough.mp4"
}
}
See USAGE_WITHOUT_SAMPLING.md for detailed examples.
MCP Server Configuration
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"walkthrough": {
"command": "node",
"args": ["/path/to/code-walkthrough-mcp/dist/src/index.js"]
}
}
}
Or with Bun:
{
"mcpServers": {
"walkthrough": {
"command": "bun",
"args": ["run", "/path/to/code-walkthrough-mcp/dist/src/index.js"]
}
}
}
Available Tools
generate_walkthrough
Requires: MCP sampling support
Fully automatic video generation from code analysis to final video.
Parameters:
repoPath(required): Path to git repositorytarget(required): What to analyzetype: "commit" | "staged" | "unstaged" | "codebase"commitHash: Required if type is "commit"
style: "beginner" | "technical" | "overview" (default: "technical")theme: "dark" | "light" | "github" (default: "dark")outputPath: Where to save video (default: "./walkthrough.mp4")
generate_video_from_script
Requires: No special capabilities (works with any MCP client)
Generate video from pre-provided analysis and script.
Parameters:
analysis(required): Analysis JSON objectscript(required): Script JSON objectstyle: "beginner" | "technical" | "overview" (default: "technical")theme: "dark" | "light" | "github" (default: "dark")outputPath: Where to save video (default: "./walkthrough.mp4")
Project Structure
.
āāā src/
ā āāā index.ts # MCP server implementation
ā āāā stages/
ā ā āāā analysis.ts # Code analysis via sampling
ā ā āāā script.ts # Script generation via sampling
ā ā āāā video.ts # Video generation pipeline
ā āāā extractors/
ā ā āāā commit.ts # Extract commit info
ā ā āāā staged.ts # Extract staged changes
ā ā āāā unstaged.ts # Extract unstaged changes
ā ā āāā codebase.ts # Extract codebase info
ā āāā types/
ā ā āāā state.ts # Type definitions
ā ā āāā analysis.ts # Analysis types
ā āāā utils/
ā āāā prompts.ts # LLM prompts for analysis
āāā dist/ # Compiled JavaScript
āāā video_output/ # Generated videos (default)
Development
# Watch mode (auto-rebuild on changes)
bun run watch
# Run MCP server
bun run dev
# Build TypeScript
bun run build
Architecture
This MCP server implements an inverted conversation flow using MCP's sampling capability:
- Client calls
generate_walkthroughtool - Server extracts code/commits from git
- Server calls back to client via sampling: "analyze this code"
- Client processes with LLM, returns analysis
- Server calls back again: "generate script from analysis"
- Client generates script, returns it
- Server creates video frames, audio, and compiles final video
For clients without sampling, the generate_video_from_script tool allows manual completion of steps 3-5.
Video Generation Pipeline
- Analysis: Code is analyzed to understand what it does
- Script: A narrated script is generated based on analysis
- Frames: HTML frames are created with syntax-highlighted code
- Screenshots: Puppeteer captures PNG screenshots of each frame
- Audio: Text-to-speech generates narration audio
- Compilation: FFmpeg combines frames and audio into MP4
Output
The generated video includes:
- Introduction with project overview
- Section-by-section code walkthrough
- Syntax-highlighted code snippets
- Professional narration
- Conclusion summary
Example output structure:
walkthrough.mp4 # Final video
temp_frames/ # Temporary frame images (auto-deleted)
temp_audio.mp3 # Temporary audio (auto-deleted)
Troubleshooting
"Method not found -32601" Error
Your MCP client doesn't support sampling. Use the generate_video_from_script tool instead (see Option 2 above).
FFmpeg Not Found
Install FFmpeg:
- macOS:
brew install ffmpeg - Linux:
apt install ffmpeg - Windows: Download from ffmpeg.org and add to PATH
No Audio in Video
The tool uses system text-to-speech. If TTS fails, video will be generated without audio (silent).
Puppeteer Issues
Puppeteer downloads Chromium automatically. If it fails:
# Reinstall dependencies
rm -rf node_modules
bun install
License
MIT
Contributing
Contributions welcome! Please ensure:
- TypeScript code compiles without errors
- Follow existing code style
- Update documentation for new features
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.