ViewMax Studio MCP
Enables Claude to generate AI videos using ViewMax Studio's video generation tools, including prompt and script creation, smart model selection, cost preview, and task status tracking.
README
ViewMax Studio MCP Server
An MCP (Model Context Protocol) server that enables Claude and other LLM clients to generate AI video prompts with narrative scripts using the ViewMax Studio API.
Features
- 7 Video Formats: Shoppable Video, Viral Hook, Trending, Meme, POV & Roleplay, Reaction, Storytelling
- 11 AI Models: Seedance, Kling, Grok, Runway, Gemini, Veo with automatic model selection
- Prompt Generation: Create engaging video prompts tailored to your format
- Script Generation: Generate narrative scripts aligned with your prompt
- Task Tracking: Monitor video generation progress with task IDs
- Character Validation: Enforce 2000-character limits for prompts and scripts
- HTTP Deployment: Built with FastMCP for remote HTTP access
Quick Start
1. Setup
# Clone the repository
git clone <your-repo-url>
cd viewmax-mcp
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create .env file
cp .env.example .env
# Edit .env and add your ViewMax API key
2. Local Development
# Make sure you're in the virtual environment with dependencies installed
python app.py
The server will start at http://localhost:8000 and be accessible at http://localhost:8000/mcp
3. Using in Claude Desktop
-
Create/update your
claude_desktop_config.json:- macOS/Linux:
~/.config/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS/Linux:
-
Add the MCP server configuration:
{
"mcpServers": {
"viewmax": {
"command": "python",
"args": ["<path-to>/app.py"],
"env": {
"VIEWMAX_API_KEY": "your-api-key-here"
}
}
}
}
- Restart Claude Desktop and the tools should be available
4. Using in Cowork
- In Cowork settings, go to Connectors
- Add a new connector with type "MCP"
- Point it to your running server at
http://localhost:8000(for local testing) - Or use the deployed URL for remote access
Deployment to Railway
Prerequisites
- Railway account (free tier available at railway.app)
- GitHub repository with your code
- ViewMax API key set as environment variable
Steps
-
Push to GitHub
git add . git commit -m "Initial ViewMax MCP server" git push origin main -
Deploy on Railway
- Connect your GitHub account to Railway
- Create new project → Deploy from GitHub
- Select your repository
- Railway will auto-detect the
Procfileand run the server
-
Set Environment Variables
- In Railway dashboard, go to Variables
- Add
VIEWMAX_API_KEYwith your actual API key - Railway automatically provides
PORTenvironment variable
-
Access Your Server
- Railway provides a public domain like:
https://viexmaxmcp-production.up.railway.app - MCP endpoint:
https://viexmaxmcp-production.up.railway.app/mcp
- Railway provides a public domain like:
Adding to Claude via Connector
In Cowork Connectors, use the deployed URL:
https://viexmaxmcp-production.up.railway.app
API Tools
1. viewmax_generate_prompt_and_script
Generates both a video prompt and narrative script based on your topic and format.
Inputs:
topic: The subject matter for the videoformat: One of 7 video formats (shoppable_video, viral_hook, trending, meme, pov_roleplay, reaction, storytelling)duration: Video length in seconds (15-120, default: 30)style: Optional style/mood (e.g., "cinematic", "casual")tone: Optional voice tone (e.g., "professional", "energetic")
Outputs:
- Generated prompt (max 2000 characters)
- Generated script (max 2000 characters)
- Selected model and its cost
- Character counts and ready-to-submit status
2. viewmax_submit_video
Submits a video generation request to ViewMax API.
Inputs:
prompt: Your video prompt textscript: Narrative script for the videoformat: Video format typemodel: AI model to use (from the 11 available)
Outputs:
- Task ID for tracking
- Submission status
- Model used and format
3. viewmax_check_task_status
Checks the progress of a submitted video generation task.
Inputs:
task_id: The ID returned from video submission
Outputs:
- Current status (generating, completed, failed, etc.)
- Progress percentage
- Estimated completion time
- Video URL (when ready)
Available Models
| Model | Cost (credits/min) | Quality | Best For |
|---|---|---|---|
| Seedance 1.5 Pro | 8.0 | High | General purpose |
| Seedance 2.0 | 10.0 | Very High | Premium quality |
| Seedance 2.0 Fast | 6.0 | High | Quick turnaround |
| Kling 2.6 | 9.0 | Very High | Complex scenes |
| Grok Imagine | 7.0 | High | Creative content |
| Runway | 8.5 | Very High | Professional videos |
| Gemini Omni Flash | 5.0 | Medium-High | Budget-friendly |
| Veo 3.1 | 12.0 | Excellent | Premium production |
| Veo 3.1 Fast | 9.0 | Very High | Fast premium |
| Veo 3.1 Lite | 4.5 | Medium-High | Quick generation |
Architecture
- Framework: FastMCP - Python framework for building MCP servers
- Transport: HTTP with ASGI (Starlette/Uvicorn)
- API Client: httpx (async HTTP client)
- Validation: Pydantic models for type safety
- Deployment: Railway with Procfile automation
Key Implementation Details
- HTTP Transport: Uses
mcp.http_app()to expose the server as an ASGI application, accessible via HTTP endpoints - Automatic Model Selection: Recommends optimal model based on video format
- Progress Reporting: Tools report progress in real-time using MCP context
- Error Handling: Comprehensive error messages for validation and API failures
- Async/Await: Non-blocking operations for API calls and progress updates
Troubleshooting
"Connection refused" when running locally
- Ensure the server is running:
python app.py - Check that port 8000 is not already in use
- Try accessing
http://localhost:8000/mcpin your browser
"API Key invalid" error
- Verify your VIEWMAX_API_KEY in the .env file
- Ensure the key hasn't expired
- Check the .env file is being loaded
MCP server not appearing in Claude
- Restart Claude Desktop after updating configuration
- Check the MCP server logs for startup errors
- Verify the endpoint URL is accessible
Development
Testing Locally
# Run the server
python app.py
# In another terminal, test with curl
curl -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "resources/list",
"params": {}
}'
Building on the Existing Code
To extend this MCP server:
- Add new tools by using the
@mcp.tooldecorator - Define new Pydantic models for tool inputs
- Use
ctx.report_progress()for long-running tasks - Add API calls to ViewMax endpoints as needed
License
MIT License - See LICENSE file for details
Support
For issues or questions:
- Check the README troubleshooting section
- Review the FastMCP documentation: https://gofastmcp.com
- Check ViewMax API documentation for API-specific issues
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。