m2ai-mcp-videogen-advisor 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- m2ai_mcp_videogen_advisor-1.0.0/.env.example +10 -0
- m2ai_mcp_videogen_advisor-1.0.0/.gitignore +49 -0
- m2ai_mcp_videogen_advisor-1.0.0/LICENSE +21 -0
- m2ai_mcp_videogen_advisor-1.0.0/PKG-INFO +265 -0
- m2ai_mcp_videogen_advisor-1.0.0/README.md +235 -0
- m2ai_mcp_videogen_advisor-1.0.0/pyproject.toml +70 -0
- m2ai_mcp_videogen_advisor-1.0.0/server.json +88 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/__init__.py +9 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/clients/__init__.py +9 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/clients/heygen.py +352 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/clients/veo.py +231 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/router.py +189 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/server.py +174 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/__init__.py +4 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/create_avatar_video.py +163 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/download_video.py +168 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/generate_creative_video.py +163 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/generate_from_template.py +141 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/generate_video.py +174 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/generate_video_from_image.py +164 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/get_template_details.py +109 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/get_video_status.py +124 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/list_avatars.py +107 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/list_templates.py +89 -0
- m2ai_mcp_videogen_advisor-1.0.0/src/videogen_mcp/tools/list_voices.py +108 -0
- m2ai_mcp_videogen_advisor-1.0.0/tests/__init__.py +4 -0
- m2ai_mcp_videogen_advisor-1.0.0/tests/conftest.py +294 -0
- m2ai_mcp_videogen_advisor-1.0.0/tests/test_heygen_tools.py +315 -0
- m2ai_mcp_videogen_advisor-1.0.0/tests/test_router.py +165 -0
- m2ai_mcp_videogen_advisor-1.0.0/tests/test_server.py +135 -0
- m2ai_mcp_videogen_advisor-1.0.0/tests/test_unified_tools.py +371 -0
- m2ai_mcp_videogen_advisor-1.0.0/tests/test_veo_tools.py +202 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# videogen-mcp Environment Variables
|
|
2
|
+
# Copy this file to .env and fill in your API keys
|
|
3
|
+
|
|
4
|
+
# HeyGen API key from Space Settings > API
|
|
5
|
+
# Required for avatar-based video generation
|
|
6
|
+
HEYGEN_API_KEY=your_heygen_api_key_here
|
|
7
|
+
|
|
8
|
+
# Google AI Studio API key with Veo access
|
|
9
|
+
# Required for creative/cinematic video generation
|
|
10
|
+
GEMINI_API_KEY=your_gemini_api_key_here
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
.env
|
|
25
|
+
.venv
|
|
26
|
+
env/
|
|
27
|
+
venv/
|
|
28
|
+
ENV/
|
|
29
|
+
|
|
30
|
+
# IDE
|
|
31
|
+
.idea/
|
|
32
|
+
.vscode/
|
|
33
|
+
*.swp
|
|
34
|
+
*.swo
|
|
35
|
+
*~
|
|
36
|
+
|
|
37
|
+
# Testing
|
|
38
|
+
.coverage
|
|
39
|
+
.pytest_cache/
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
|
|
44
|
+
# Type checking
|
|
45
|
+
.mypy_cache/
|
|
46
|
+
|
|
47
|
+
# OS
|
|
48
|
+
.DS_Store
|
|
49
|
+
Thumbs.db
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Me, Myself Plus AI LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: m2ai-mcp-videogen-advisor
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Unified MCP server for video generation with intelligent HeyGen/Veo routing
|
|
5
|
+
Project-URL: Homepage, https://github.com/m2ai-mcp-servers/videogen-mcp
|
|
6
|
+
Project-URL: Documentation, https://github.com/m2ai-mcp-servers/videogen-mcp#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/m2ai-mcp-servers/videogen-mcp
|
|
8
|
+
Author: Me, Myself Plus AI LLC
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai,claude,gemini,heygen,mcp,model-context-protocol,veo,video
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Requires-Dist: httpx>=0.27.0
|
|
20
|
+
Requires-Dist: mcp>=1.0.0
|
|
21
|
+
Requires-Dist: pydantic>=2.0.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: mypy>=1.8.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: respx>=0.21.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# VideoGen Advisor
|
|
32
|
+
|
|
33
|
+
A unified MCP server for video generation that intelligently routes requests to either HeyGen (for avatar/presenter videos) or Google Veo (for creative/cinematic content).
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
- **Intelligent Routing**: Automatically selects the best service based on prompt content
|
|
38
|
+
- **HeyGen Integration**: Avatar-based videos, custom voices, templates
|
|
39
|
+
- **Google Veo Integration**: Cinematic content, image-to-video, creative visuals
|
|
40
|
+
- **Unified Interface**: Single `generate_video` tool with automatic service selection
|
|
41
|
+
- **Full Control**: Direct access to service-specific tools when needed
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install m2ai-mcp-videogen-advisor
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Configuration
|
|
50
|
+
|
|
51
|
+
Set your API keys as environment variables:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
export HEYGEN_API_KEY=your_heygen_api_key_here
|
|
55
|
+
export GEMINI_API_KEY=your_gemini_api_key_here
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Claude Desktop Configuration
|
|
59
|
+
|
|
60
|
+
Add to your `claude_desktop_config.json`:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"mcpServers": {
|
|
65
|
+
"videogen": {
|
|
66
|
+
"command": "videogen-advisor",
|
|
67
|
+
"env": {
|
|
68
|
+
"HEYGEN_API_KEY": "your_heygen_key",
|
|
69
|
+
"GEMINI_API_KEY": "your_gemini_key"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Or run directly with Python:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"mcpServers": {
|
|
81
|
+
"videogen": {
|
|
82
|
+
"command": "python",
|
|
83
|
+
"args": ["-m", "videogen_mcp.server"],
|
|
84
|
+
"env": {
|
|
85
|
+
"HEYGEN_API_KEY": "your_heygen_key",
|
|
86
|
+
"GEMINI_API_KEY": "your_gemini_key"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Available Tools
|
|
94
|
+
|
|
95
|
+
### Unified Interface (3 tools)
|
|
96
|
+
|
|
97
|
+
| Tool | Description |
|
|
98
|
+
|------|-------------|
|
|
99
|
+
| `generate_video` | Generate video with intelligent routing to HeyGen or Veo |
|
|
100
|
+
| `get_video_status` | Check job status (works for both services) |
|
|
101
|
+
| `download_video` | Get download URL for completed video |
|
|
102
|
+
|
|
103
|
+
### HeyGen-Specific (6 tools)
|
|
104
|
+
|
|
105
|
+
| Tool | Description |
|
|
106
|
+
|------|-------------|
|
|
107
|
+
| `list_avatars` | List available avatars (stock + custom) |
|
|
108
|
+
| `list_voices` | List available voices for avatar videos |
|
|
109
|
+
| `create_avatar_video` | Create video with specific avatar/voice |
|
|
110
|
+
| `list_templates` | List available video templates |
|
|
111
|
+
| `get_template_details` | Get template variables and details |
|
|
112
|
+
| `generate_from_template` | Generate video from template |
|
|
113
|
+
|
|
114
|
+
### Veo-Specific (2 tools)
|
|
115
|
+
|
|
116
|
+
| Tool | Description |
|
|
117
|
+
|------|-------------|
|
|
118
|
+
| `generate_creative_video` | Generate cinematic video with full Veo controls |
|
|
119
|
+
| `generate_video_from_image` | Animate a static image into video |
|
|
120
|
+
|
|
121
|
+
## Usage Examples
|
|
122
|
+
|
|
123
|
+
### Automatic Routing
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
"Create a video where someone presents our Q4 results"
|
|
127
|
+
→ Routes to HeyGen (presenter/speaking content)
|
|
128
|
+
|
|
129
|
+
"Cinematic aerial shot of mountains at sunset"
|
|
130
|
+
→ Routes to Veo (creative/visual content)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Explicit Service Selection
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
# Force HeyGen
|
|
137
|
+
generate_video(
|
|
138
|
+
prompt="Create any video",
|
|
139
|
+
service_hint="heygen"
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
# Force Veo
|
|
143
|
+
generate_video(
|
|
144
|
+
prompt="A tutorial video",
|
|
145
|
+
service_hint="veo"
|
|
146
|
+
)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### HeyGen Avatar Video
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
# 1. List avatars and voices
|
|
153
|
+
avatars = list_avatars(filter_gender="female")
|
|
154
|
+
voices = list_voices(filter_language="en")
|
|
155
|
+
|
|
156
|
+
# 2. Create video
|
|
157
|
+
job = create_avatar_video(
|
|
158
|
+
script="Hello! Welcome to our company.",
|
|
159
|
+
avatar_id="Angela-inblackskirt-20220820",
|
|
160
|
+
voice_id="1bd001e7e50f421d891986aad5158bc8",
|
|
161
|
+
background={"type": "color", "value": "#0066CC"},
|
|
162
|
+
aspect_ratio="16:9"
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
# 3. Poll for completion
|
|
166
|
+
status = get_video_status(job_id=job["job_id"], service="heygen")
|
|
167
|
+
|
|
168
|
+
# 4. Download when complete
|
|
169
|
+
result = download_video(job_id=job["job_id"], service="heygen")
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Veo Creative Video
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
# Generate cinematic content
|
|
176
|
+
job = generate_creative_video(
|
|
177
|
+
prompt="A slow dolly shot through a neon-lit Tokyo alley at night, rain reflections, cinematic color grading",
|
|
178
|
+
negative_prompt="blurry, low quality, text overlays",
|
|
179
|
+
aspect_ratio="16:9",
|
|
180
|
+
duration=8,
|
|
181
|
+
model="veo-3.1-generate-preview"
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
# Poll and download
|
|
185
|
+
status = get_video_status(job_id=job["job_id"], service="veo")
|
|
186
|
+
result = download_video(job_id=job["job_id"], service="veo")
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Image to Video
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
# Animate a still image
|
|
193
|
+
job = generate_video_from_image(
|
|
194
|
+
image_url="https://example.com/product-photo.jpg",
|
|
195
|
+
prompt="Slow zoom in with subtle product rotation",
|
|
196
|
+
duration=6
|
|
197
|
+
)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Routing Logic
|
|
201
|
+
|
|
202
|
+
The `generate_video` tool uses keyword detection to route requests:
|
|
203
|
+
|
|
204
|
+
**HeyGen triggers** (avatar/presenter content):
|
|
205
|
+
- speak, present, explain, tutorial, avatar, host, narrator
|
|
206
|
+
- talking, announce, introduce, walk through, demo, spokesperson
|
|
207
|
+
|
|
208
|
+
**Veo triggers** (creative/cinematic content):
|
|
209
|
+
- cinematic, scene, visual, b-roll, animation, shot, footage
|
|
210
|
+
- landscape, abstract, artistic, dramatic, aerial, timelapse
|
|
211
|
+
|
|
212
|
+
Ambiguous prompts default to Veo unless avatar/presenter language is detected.
|
|
213
|
+
|
|
214
|
+
## Video Wait Times
|
|
215
|
+
|
|
216
|
+
- **HeyGen**: 1-5 minutes (varies by content length)
|
|
217
|
+
- **Veo**: 2-10 minutes (varies by complexity)
|
|
218
|
+
|
|
219
|
+
Poll `get_video_status` until status is `completed` or `failed`.
|
|
220
|
+
|
|
221
|
+
## Error Handling
|
|
222
|
+
|
|
223
|
+
All tools return structured error objects:
|
|
224
|
+
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"error": true,
|
|
228
|
+
"code": "QUOTA_EXCEEDED",
|
|
229
|
+
"message": "API credits exhausted. Check your account."
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Common error codes:
|
|
234
|
+
- `AUTH_FAILED` - Invalid API key
|
|
235
|
+
- `QUOTA_EXCEEDED` - API credits exhausted
|
|
236
|
+
- `INVALID_AVATAR` / `INVALID_VOICE` - ID not found
|
|
237
|
+
- `CONTENT_BLOCKED` - Safety filter triggered
|
|
238
|
+
- `VIDEO_NOT_READY` - Generation still in progress
|
|
239
|
+
- `JOB_NOT_FOUND` - Invalid job ID
|
|
240
|
+
|
|
241
|
+
## Development
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Run tests
|
|
245
|
+
pytest
|
|
246
|
+
|
|
247
|
+
# Run tests with coverage
|
|
248
|
+
pytest --cov=videogen_mcp
|
|
249
|
+
|
|
250
|
+
# Type checking
|
|
251
|
+
mypy src/
|
|
252
|
+
|
|
253
|
+
# Linting
|
|
254
|
+
ruff check src/ tests/
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## License
|
|
258
|
+
|
|
259
|
+
MIT License
|
|
260
|
+
|
|
261
|
+
## Credits
|
|
262
|
+
|
|
263
|
+
- [HeyGen API](https://docs.heygen.com/reference)
|
|
264
|
+
- [Google Veo API](https://ai.google.dev/gemini-api/docs/video)
|
|
265
|
+
- Generated by GRIMLOCK MCP Factory
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# VideoGen Advisor
|
|
2
|
+
|
|
3
|
+
A unified MCP server for video generation that intelligently routes requests to either HeyGen (for avatar/presenter videos) or Google Veo (for creative/cinematic content).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Intelligent Routing**: Automatically selects the best service based on prompt content
|
|
8
|
+
- **HeyGen Integration**: Avatar-based videos, custom voices, templates
|
|
9
|
+
- **Google Veo Integration**: Cinematic content, image-to-video, creative visuals
|
|
10
|
+
- **Unified Interface**: Single `generate_video` tool with automatic service selection
|
|
11
|
+
- **Full Control**: Direct access to service-specific tools when needed
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install m2ai-mcp-videogen-advisor
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
Set your API keys as environment variables:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
export HEYGEN_API_KEY=your_heygen_api_key_here
|
|
25
|
+
export GEMINI_API_KEY=your_gemini_api_key_here
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Claude Desktop Configuration
|
|
29
|
+
|
|
30
|
+
Add to your `claude_desktop_config.json`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"videogen": {
|
|
36
|
+
"command": "videogen-advisor",
|
|
37
|
+
"env": {
|
|
38
|
+
"HEYGEN_API_KEY": "your_heygen_key",
|
|
39
|
+
"GEMINI_API_KEY": "your_gemini_key"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or run directly with Python:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"videogen": {
|
|
52
|
+
"command": "python",
|
|
53
|
+
"args": ["-m", "videogen_mcp.server"],
|
|
54
|
+
"env": {
|
|
55
|
+
"HEYGEN_API_KEY": "your_heygen_key",
|
|
56
|
+
"GEMINI_API_KEY": "your_gemini_key"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Available Tools
|
|
64
|
+
|
|
65
|
+
### Unified Interface (3 tools)
|
|
66
|
+
|
|
67
|
+
| Tool | Description |
|
|
68
|
+
|------|-------------|
|
|
69
|
+
| `generate_video` | Generate video with intelligent routing to HeyGen or Veo |
|
|
70
|
+
| `get_video_status` | Check job status (works for both services) |
|
|
71
|
+
| `download_video` | Get download URL for completed video |
|
|
72
|
+
|
|
73
|
+
### HeyGen-Specific (6 tools)
|
|
74
|
+
|
|
75
|
+
| Tool | Description |
|
|
76
|
+
|------|-------------|
|
|
77
|
+
| `list_avatars` | List available avatars (stock + custom) |
|
|
78
|
+
| `list_voices` | List available voices for avatar videos |
|
|
79
|
+
| `create_avatar_video` | Create video with specific avatar/voice |
|
|
80
|
+
| `list_templates` | List available video templates |
|
|
81
|
+
| `get_template_details` | Get template variables and details |
|
|
82
|
+
| `generate_from_template` | Generate video from template |
|
|
83
|
+
|
|
84
|
+
### Veo-Specific (2 tools)
|
|
85
|
+
|
|
86
|
+
| Tool | Description |
|
|
87
|
+
|------|-------------|
|
|
88
|
+
| `generate_creative_video` | Generate cinematic video with full Veo controls |
|
|
89
|
+
| `generate_video_from_image` | Animate a static image into video |
|
|
90
|
+
|
|
91
|
+
## Usage Examples
|
|
92
|
+
|
|
93
|
+
### Automatic Routing
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
"Create a video where someone presents our Q4 results"
|
|
97
|
+
→ Routes to HeyGen (presenter/speaking content)
|
|
98
|
+
|
|
99
|
+
"Cinematic aerial shot of mountains at sunset"
|
|
100
|
+
→ Routes to Veo (creative/visual content)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Explicit Service Selection
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
# Force HeyGen
|
|
107
|
+
generate_video(
|
|
108
|
+
prompt="Create any video",
|
|
109
|
+
service_hint="heygen"
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
# Force Veo
|
|
113
|
+
generate_video(
|
|
114
|
+
prompt="A tutorial video",
|
|
115
|
+
service_hint="veo"
|
|
116
|
+
)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### HeyGen Avatar Video
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
# 1. List avatars and voices
|
|
123
|
+
avatars = list_avatars(filter_gender="female")
|
|
124
|
+
voices = list_voices(filter_language="en")
|
|
125
|
+
|
|
126
|
+
# 2. Create video
|
|
127
|
+
job = create_avatar_video(
|
|
128
|
+
script="Hello! Welcome to our company.",
|
|
129
|
+
avatar_id="Angela-inblackskirt-20220820",
|
|
130
|
+
voice_id="1bd001e7e50f421d891986aad5158bc8",
|
|
131
|
+
background={"type": "color", "value": "#0066CC"},
|
|
132
|
+
aspect_ratio="16:9"
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
# 3. Poll for completion
|
|
136
|
+
status = get_video_status(job_id=job["job_id"], service="heygen")
|
|
137
|
+
|
|
138
|
+
# 4. Download when complete
|
|
139
|
+
result = download_video(job_id=job["job_id"], service="heygen")
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Veo Creative Video
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
# Generate cinematic content
|
|
146
|
+
job = generate_creative_video(
|
|
147
|
+
prompt="A slow dolly shot through a neon-lit Tokyo alley at night, rain reflections, cinematic color grading",
|
|
148
|
+
negative_prompt="blurry, low quality, text overlays",
|
|
149
|
+
aspect_ratio="16:9",
|
|
150
|
+
duration=8,
|
|
151
|
+
model="veo-3.1-generate-preview"
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
# Poll and download
|
|
155
|
+
status = get_video_status(job_id=job["job_id"], service="veo")
|
|
156
|
+
result = download_video(job_id=job["job_id"], service="veo")
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Image to Video
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
# Animate a still image
|
|
163
|
+
job = generate_video_from_image(
|
|
164
|
+
image_url="https://example.com/product-photo.jpg",
|
|
165
|
+
prompt="Slow zoom in with subtle product rotation",
|
|
166
|
+
duration=6
|
|
167
|
+
)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Routing Logic
|
|
171
|
+
|
|
172
|
+
The `generate_video` tool uses keyword detection to route requests:
|
|
173
|
+
|
|
174
|
+
**HeyGen triggers** (avatar/presenter content):
|
|
175
|
+
- speak, present, explain, tutorial, avatar, host, narrator
|
|
176
|
+
- talking, announce, introduce, walk through, demo, spokesperson
|
|
177
|
+
|
|
178
|
+
**Veo triggers** (creative/cinematic content):
|
|
179
|
+
- cinematic, scene, visual, b-roll, animation, shot, footage
|
|
180
|
+
- landscape, abstract, artistic, dramatic, aerial, timelapse
|
|
181
|
+
|
|
182
|
+
Ambiguous prompts default to Veo unless avatar/presenter language is detected.
|
|
183
|
+
|
|
184
|
+
## Video Wait Times
|
|
185
|
+
|
|
186
|
+
- **HeyGen**: 1-5 minutes (varies by content length)
|
|
187
|
+
- **Veo**: 2-10 minutes (varies by complexity)
|
|
188
|
+
|
|
189
|
+
Poll `get_video_status` until status is `completed` or `failed`.
|
|
190
|
+
|
|
191
|
+
## Error Handling
|
|
192
|
+
|
|
193
|
+
All tools return structured error objects:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"error": true,
|
|
198
|
+
"code": "QUOTA_EXCEEDED",
|
|
199
|
+
"message": "API credits exhausted. Check your account."
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Common error codes:
|
|
204
|
+
- `AUTH_FAILED` - Invalid API key
|
|
205
|
+
- `QUOTA_EXCEEDED` - API credits exhausted
|
|
206
|
+
- `INVALID_AVATAR` / `INVALID_VOICE` - ID not found
|
|
207
|
+
- `CONTENT_BLOCKED` - Safety filter triggered
|
|
208
|
+
- `VIDEO_NOT_READY` - Generation still in progress
|
|
209
|
+
- `JOB_NOT_FOUND` - Invalid job ID
|
|
210
|
+
|
|
211
|
+
## Development
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# Run tests
|
|
215
|
+
pytest
|
|
216
|
+
|
|
217
|
+
# Run tests with coverage
|
|
218
|
+
pytest --cov=videogen_mcp
|
|
219
|
+
|
|
220
|
+
# Type checking
|
|
221
|
+
mypy src/
|
|
222
|
+
|
|
223
|
+
# Linting
|
|
224
|
+
ruff check src/ tests/
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
MIT License
|
|
230
|
+
|
|
231
|
+
## Credits
|
|
232
|
+
|
|
233
|
+
- [HeyGen API](https://docs.heygen.com/reference)
|
|
234
|
+
- [Google Veo API](https://ai.google.dev/gemini-api/docs/video)
|
|
235
|
+
- Generated by GRIMLOCK MCP Factory
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "m2ai-mcp-videogen-advisor"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Unified MCP server for video generation with intelligent HeyGen/Veo routing"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Me, Myself Plus AI LLC"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["mcp", "model-context-protocol", "ai", "claude", "video", "heygen", "veo", "gemini"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
dependencies = [
|
|
26
|
+
"mcp>=1.0.0",
|
|
27
|
+
"httpx>=0.27.0",
|
|
28
|
+
"pydantic>=2.0.0",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.optional-dependencies]
|
|
32
|
+
dev = [
|
|
33
|
+
"pytest>=8.0.0",
|
|
34
|
+
"pytest-asyncio>=0.23.0",
|
|
35
|
+
"pytest-cov>=4.0.0",
|
|
36
|
+
"respx>=0.21.0",
|
|
37
|
+
"ruff>=0.1.0",
|
|
38
|
+
"mypy>=1.8.0",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.scripts]
|
|
42
|
+
videogen-advisor = "videogen_mcp.server:main"
|
|
43
|
+
|
|
44
|
+
[project.urls]
|
|
45
|
+
Homepage = "https://github.com/m2ai-mcp-servers/videogen-mcp"
|
|
46
|
+
Documentation = "https://github.com/m2ai-mcp-servers/videogen-mcp#readme"
|
|
47
|
+
Repository = "https://github.com/m2ai-mcp-servers/videogen-mcp"
|
|
48
|
+
|
|
49
|
+
[tool.hatch.build.targets.wheel]
|
|
50
|
+
packages = ["src/videogen_mcp"]
|
|
51
|
+
|
|
52
|
+
[tool.pytest.ini_options]
|
|
53
|
+
asyncio_mode = "auto"
|
|
54
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
55
|
+
testpaths = ["tests"]
|
|
56
|
+
addopts = "-v --tb=short"
|
|
57
|
+
|
|
58
|
+
[tool.ruff]
|
|
59
|
+
target-version = "py311"
|
|
60
|
+
line-length = 100
|
|
61
|
+
|
|
62
|
+
[tool.ruff.lint]
|
|
63
|
+
select = ["E", "F", "I", "N", "W", "UP"]
|
|
64
|
+
ignore = ["E501"]
|
|
65
|
+
|
|
66
|
+
[tool.mypy]
|
|
67
|
+
python_version = "3.11"
|
|
68
|
+
strict = true
|
|
69
|
+
warn_return_any = true
|
|
70
|
+
warn_unused_ignores = true
|