ai-video-mcp
README.md
# π¬ 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.**
[](https://smithery.ai/server/ai-video-mcp)
[](https://python.org)
[](LICENSE)
---
## β¨ 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
```bash
pip install ai-video-mcp
```
Or from source:
```bash
git clone https://github.com/yqyqstart-crypto/ai-video-mcp.git
cd ai-video-mcp
pip install -e .
```
### 2. Set API Keys
```bash
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](https://platform.minimaxi.com) | TTS voice synthesis |
| PEXELS_API_KEY | [pexels.com/api](https://www.pexels.com/api/) | Stock video search |
### 3. Use
#### Command Line
```bash
ai-video-mcp
```
#### MCP Config (Claude Desktop / OpenClaw / Cursor)
```json
{
"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:**
```json
{
"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 `---`
```text
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 `## `
```markdown
## 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!
This server cannot be deployed
Maintenance
ActivitySlowing
ResponsivenessNo issues