Google Veo 3.1 MCP Server
MCP server for Google Veo 3.1 video generation. Supports text/video/image-based generation, extension, and interpolation with cost estimation and batch processing.
README
Google Veo 3.1 MCP Server
MCP Server and CLI batch tool for Google Veo 3.1 Video Generation API.
Features
- MCP Server for integration with Claude Desktop and other MCP clients
- Batch CLI Tool for processing multiple video generation jobs
- Text-to-Video: Generate videos from text prompts
- Image-to-Video: Animate static images
- Reference Images: Use up to 3 images for character/style consistency
- Video Extension: Extend existing videos by 7 seconds
- Frame Interpolation: Generate video between two keyframes
- Cost Estimation: Calculate costs before execution
Installation
npm install
npm run build
Setup
-
Get your Google API key from Google AI Studio
-
Create a
.envfile:
GOOGLE_API_KEY=your_api_key_here
Or set the environment variable directly:
export GOOGLE_API_KEY=your_api_key_here
MCP Server Usage
Claude Desktop Configuration
Add to your Claude Desktop configuration (%APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"veo3": {
"command": "node",
"args": ["C:/path/to/google-veo3-1-mcp-server/dist/index.js"],
"env": {
"GOOGLE_API_KEY": "your_api_key_here"
}
}
}
}
Or using npx after publishing:
{
"mcpServers": {
"veo3": {
"command": "npx",
"args": ["google-veo3-1-mcp-server"],
"env": {
"GOOGLE_API_KEY": "your_api_key_here"
}
}
}
}
Available Tools
generate_video
Generate video from text prompt or image.
{
"prompt": "A golden retriever running through autumn leaves",
"model": "veo-3.1-generate-preview",
"resolution": "1080p",
"duration_seconds": 8,
"generate_audio": true,
"output_path": "./output/video.mp4"
}
Parameters:
prompt: Text description of the video (required unless image provided)model:veo-3.1-generate-preview(default) orveo-3.1-fast-generate-previewaspect_ratio:16:9(default) or9:16resolution:720p(default),1080p, or4k(4k only for standard model)duration_seconds:4,6, or8(default: 8)generate_audio: Whether to generate audio (default: true)negative_prompt: Elements to avoidimage: Image for Image-to-Video modereference_images: Array of reference images for consistencyoutput_path: Path to save the video
extend_video
Extend an existing video by 7 seconds.
{
"video": "./input/video.mp4",
"prompt": "Continue with the character walking forward",
"output_path": "./output/extended.mp4"
}
Requirements:
- Input video: 1-30 seconds, 24fps, 720p or 1080p
- Output: 7 seconds at 720p
interpolate_frames
Generate video transitioning between two keyframes.
{
"first_frame": "./images/start.jpg",
"last_frame": "./images/end.jpg",
"prompt": "Smooth camera pan",
"duration_seconds": 8,
"generate_audio": true,
"output_path": "./output/interpolated.mp4"
}
get_video_status
Check the status of a video generation operation.
{
"operation_name": "models/veo-3.1-generate-preview/operations/abc123"
}
Batch CLI Usage
# Estimate costs only
veo3-batch config.json --estimate-only
# Execute batch
veo3-batch config.json --output-dir ./output
# With options
veo3-batch config.json --max-concurrent 3 --no-audio --format json
CLI Options
| Option | Description |
|---|---|
-o, --output-dir <path> |
Output directory for videos |
-f, --format <text|json> |
Output format (default: text) |
-c, --max-concurrent <n> |
Parallel jobs (1-5, default: 2) |
-p, --poll-interval <ms> |
Polling interval |
-t, --timeout <ms> |
Total batch timeout |
-e, --estimate-only |
Only estimate costs |
--no-audio |
Generate without audio (reduces cost) |
--allow-any-path |
Allow absolute output paths |
Batch Configuration Format
{
"jobs": [
{
"prompt": "A cat playing piano",
"duration_seconds": 8,
"resolution": "1080p",
"generate_audio": true
},
{
"type": "extend",
"video": "./videos/source.mp4",
"prompt": "Continue the scene"
},
{
"type": "interpolate",
"first_frame": "./images/start.jpg",
"last_frame": "./images/end.jpg"
}
],
"output_dir": "./output",
"max_concurrent": 2,
"default_model": "veo-3.1-generate-preview"
}
Pricing
| Feature | Resolution | With Audio | Video Only |
|---|---|---|---|
| Standard Model | 720p/1080p | $0.40/sec | $0.20/sec |
| Standard Model | 4K | $0.60/sec | $0.40/sec |
| Fast Model | 720p/1080p | $0.20/sec | $0.10/sec |
Note: Gemini API preview models always generate audio. The
generate_audioparameter is not currently supported. Use Vertex AI for audio control.
Cost Examples
| Video Type | Resolution | Duration | Audio | Cost |
|---|---|---|---|---|
| Text-to-Video | 1080p | 8 sec | Yes | $3.20 |
| Text-to-Video | 1080p | 8 sec | No | $1.60 |
| Image-to-Video (Fast) | 720p | 4 sec | Yes | $0.80 |
| Video Extension | 720p | 7 sec | No | $1.40 |
| Frame Interpolation | 1080p | 8 sec | Yes | $3.20 |
Models
| Model | Description | Resolutions | Speed |
|---|---|---|---|
veo-3.1-generate-preview |
High quality | 720p, 1080p, 4K | Standard |
veo-3.1-fast-generate-preview |
Faster generation | 720p, 1080p | Fast |
Reference Images
Use reference images to maintain consistency:
{
"prompt": "The character walks through a forest",
"reference_images": [
{
"image": "./character.jpg",
"reference_type": "asset"
}
]
}
asset: For characters/objects (max 3 images)style: For visual style (max 1 image)
Environment Variables
| Variable | Description | Default |
|---|---|---|
GOOGLE_API_KEY |
Google API key (required) | - |
OUTPUT_DIR |
Default output directory | ./output |
DEBUG |
Enable debug logging | false |
VIDEO_POLL_INTERVAL |
Polling interval (ms) | 15000 |
VIDEO_MAX_POLL_ATTEMPTS |
Max polling attempts | 120 |
API Documentation
For detailed API specifications, see:
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。