ai-video-mcp
Turns text scripts into complete videos with stock footage, AI narration, and subtitles via MCP tools for AI assistants.
README
π¬ AI Video MCP Server
Turn text scripts into complete videos with stock footage, AI narration, and subtitles. Standard MCP tool β works with Claude, OpenClaw, Cursor, and any MCP-compatible AI assistant.
β¨ Features
- π Script-driven β Just provide text, auto-split into chapters
- π₯ Smart footage β Auto-matches stock videos from Pexels per chapter
- π£οΈ TTS narration β Minimax voice synthesis, 6 voice options
- πΊ Auto subtitles β Generates SRT subtitles from narration
- π¬ One-click compose β ffmpeg auto-merges into final video
- π MCP standard β Compatible with all MCP-enabled AI assistants
π Quick Start
1. Install
pip install ai-video-mcp
Or from source:
git clone https://github.com/yqyqstart-crypto/ai-video-mcp.git
cd ai-video-mcp
pip install -e .
2. Set API Keys
export MINIMAX_API_KEY="your-minimax-key"
export PEXELS_API_KEY="your-pexels-key"
| Key | Get it from | Purpose |
|---|---|---|
| MINIMAX_API_KEY | platform.minimaxi.com | TTS voice synthesis |
| PEXELS_API_KEY | pexels.com/api | Stock video search |
3. Use
Command Line
ai-video-mcp
MCP Config (Claude Desktop / OpenClaw / Cursor)
{
"mcpServers": {
"ai-video": {
"command": "ai-video-mcp",
"env": {
"MINIMAX_API_KEY": "your-key",
"PEXELS_API_KEY": "your-key"
}
}
}
}
Once configured, just tell the AI:
"Generate a video from this script: /path/to/script.txt"
The AI will call the generate_video tool automatically.
π Tools
generate_video
Generate a complete video from a text script.
Parameters:
| Param | Type | Default | Description |
|---|---|---|---|
script_path |
string | required | Path to script file |
output_dir |
string | out |
Output directory |
voice |
string | male-qn-qingse |
TTS voice ID |
speed |
float | 1.05 |
Speech speed (0.5-2.0) |
resolution |
string | 1920x1080 |
Output resolution |
video_duration |
int | 10 |
Pexels clip duration per chapter (sec) |
Returns:
{
"success": true,
"final_video": "out/final_video.mp4",
"chapters": 3,
"details": [
{
"chapter": 0,
"title": "Chapter 1",
"query": "search keywords",
"video": "out/chapter_00/chapter.mp4",
"tts": true
}
]
}
list_voices
List available TTS voice IDs.
list_styles
List available video styles (planned).
π Script Format
Plain text (.txt) β Split with ---
Artificial intelligence is changing our lives. From smartphones to self-driving cars, AI is everywhere.
---
In healthcare, AI helps doctors diagnose diseases more accurately.
---
In the future, AI will continue to drive social progress.
Markdown (.md) β Split with ##
## The Rise of AI
Artificial intelligence is changing our lives...
## Healthcare Revolution
In healthcare, AI helps doctors...
## Future Outlook
In the future, AI will continue...
ποΈ Available Voices
| ID | Name | Gender |
|---|---|---|
male-qn-qingse |
Youth | Male |
female-shaonv |
Girl | Female |
male-qn-jingying |
Elite Male | Male |
female-yujie |
Elegant Lady | Female |
presenter male |
Male Host | Male |
presenter female |
Female Host | Female |
π Output Structure
out/
βββ final_video.mp4 # β Final complete video
βββ concat.txt # ffmpeg merge list
βββ chapter_00/
β βββ source.mp4 # Pexels raw footage
β βββ audio.mp3 # TTS narration audio
β βββ audio.srt # Subtitle file
β βββ chapter.mp4 # Composed chapter video
βββ chapter_01/
β βββ ...
βββ chapter_02/
βββ ...
ποΈ Workflow
βββββββββββββββ
β Text Script β
β .txt / .md β
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
βParse Chaptersβ
ββββββββ¬βββββββ
β
ββββββββββββββΌβββββββββββββ
β β β
ββββββββΌβββββββ ββββΌβββββ βββββββΌββββββ
β Pexels Searchβ β TTS β β Subtitles β
β Stock Videos β β Voice β β SRT β
ββββββββ¬βββββββ ββββ¬βββββ βββββββ¬ββββββ
β β β
ββββββββββββββΌβββββββββββββ
β
ββββββββΌβββββββ
βffmpeg Composeβ
βVideo+Audio+Subβ
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
β final.mp4 β
βββββββββββββββ
π§ Requirements
- Python 3.8+
- ffmpeg (system install)
- requests
- fastmcp
π‘ Why MCP?
MCP (Model Context Protocol) lets AI assistants call external tools directly. With this MCP Server installed:
- β Claude Desktop can generate videos
- β OpenClaw can generate videos
- β Cursor can generate videos
- β Any MCP-enabled AI assistant works
No coding needed. No command line. Just tell the AI.
π License
MIT
π€ Contributing
PRs welcome! Especially:
- More TTS engines (Edge TTS, Azure TTS)
- More video sources (Pixabay, Coverr)
- AI image generation (DALL-E, Stable Diffusion)
- Custom subtitle styles
- Background music mixing
β Star this repo
If you find this useful, give it a β to help others discover it!
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.
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.
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.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
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.