ken-api-mcp
Provides LLMs with full access to the Ken Video API for professional video processing, including adding audio, captions, and job management.
README
🎬 Ken Video API MCP Server
A comprehensive Model Context Protocol (MCP) server that provides LLMs with full access to the Ken Video API's professional video processing capabilities. Perfect for automation workflows, especially n8n integrations.
🚀 Quick Start
Installation
npm install -g ken-api-mcp
Claude Desktop Integration
Add to your Claude Desktop MCP configuration:
{
"mcpServers": {
"ken-video-api": {
"command": "ken-api-mcp"
}
}
}
n8n Integration
Use with the MCP node in n8n for powerful video automation workflows.
🎯 Perfect For n8n Workflows
AI Video Generation Pipeline
Stable Diffusion → RunwayML → Ken Video API MCP
(image) → (video) → (voice + captions)
Workflow Steps:
- Generate image with Stable Diffusion
- Convert to video with RunwayML/Stable Video
- Generate voice-over with ElevenLabs
- Use
ken_add_audio_from_urlsto combine video + audio - Use
ken_auto_caption_from_urlto add captions - Use
ken_process_and_downloadto get final video
🛠️ Available Tools
🔥 Priority Tools (Most Used in n8n)
ken_add_audio_from_urls
Add voice-over or background audio to videos using URLs.
{
"video_url": "https://runwayml.com/output.mp4",
"audio_url": "https://elevenlabs.com/voice.mp3",
"volume": 0.8
}
ken_auto_caption_from_url
Generate automatic captions with AI transcription.
{
"video_url": "https://your-video.mp4",
"language": "en",
"font_size": 16,
"position": "bottom"
}
ken_check_job_status
Monitor job progress and completion.
{
"job_id": "12345-abcd-5678"
}
ken_process_and_download
Wait for job completion and download the result in one step.
{
"job_id": "12345-abcd-5678",
"max_wait_time": 600
}
⚙️ Management Tools
ken_check_api_health- Verify API availabilityken_api_info- Get comprehensive API informationken_wait_for_job- Poll until job completionken_download_video- Download processed videosken_cancel_job- Cancel running jobs
🎬 Advanced Processing
ken_process_batch_operations- Execute multiple operationsken_create_video_with_audio_and_captions- High-level automation tool- File upload tools (require file system access)
🔗 Webhook Management
ken_create_webhook- Set up job notificationsken_list_webhooks- View webhook configurationsken_delete_webhook- Remove webhooks
📊 Configuration
Environment Variables
# Optional configuration
export KEN_API_BASE_URL="https://ken-video-api-production.up.railway.app"
export KEN_API_TIMEOUT="120000" # 2 minutes
export KEN_API_RETRIES="3"
export KEN_API_LOGGING="true" # Enable debug logs
Default Configuration
- Base URL:
ken-video-api-production.up.railway.app - Timeout: 2 minutes for requests
- Retries: 3 attempts with exponential backoff
- Job Polling: 5-second intervals with intelligent backoff
- Max Poll Time: 10 minutes for job completion
🎬 Example n8n Workflow
Complete Video Creation Automation
# n8n Workflow: AI Video with Voice-over and Captions
1. HTTP Request (Stable Diffusion)
→ Generate image from text prompt
2. HTTP Request (RunwayML)
→ Convert image to video
3. HTTP Request (ElevenLabs)
→ Generate voice-over from script
4. MCP Tool: ken_add_audio_from_urls
→ Combine video + voice-over
→ Returns: job_id
5. MCP Tool: ken_wait_for_job
→ Wait for audio overlay completion
→ Returns: completed job status
6. MCP Tool: ken_auto_caption_from_url
→ Add captions to video with audio
→ Returns: job_id
7. MCP Tool: ken_process_and_download
→ Download final video with voice + captions
→ Returns: video binary data
8. Upload to Social Media
→ Post to Twitter, YouTube, etc.
🔧 API Coverage
Supported Ken Video API Endpoints:
- ✅ Health checking (2 endpoints)
- ✅ URL-based processing (2 endpoints) - Primary for n8n
- ✅ Job management (3 endpoints) - Essential for automation
- ✅ Webhook management (4 endpoints)
- ✅ Batch processing (1 endpoint)
- ⚠️ File upload endpoints (7 endpoints) - Limited by MCP file access
Total: 19 tools covering 18 API endpoints
🛡️ Error Handling
Intelligent Error Recovery
- Automatic retries with exponential backoff
- Rate limit handling with wait suggestions
- Connection error recovery with health checks
- Job timeout management with manual status checks
LLM-Friendly Error Messages
{
"success": false,
"error": "RATE_LIMIT_EXCEEDED",
"message": "API rate limit reached. Please wait 60 seconds before retry.",
"suggestion": "Consider using batch operations for multiple videos",
"retry_after": 60
}
📈 Performance
Optimized for Automation
- Smart job polling with adaptive intervals
- Concurrent operation support
- Memory-efficient file handling
- Graceful error fallbacks
Railway Production Ready
- 2GB file size limit (Railway optimized)
- Sub-5 second response times for job creation
- 99%+ uptime on Railway infrastructure
- Global CDN delivery for fast downloads
🔒 Security
Built-in Protection
- URL validation prevents SSRF attacks
- Input sanitization for all parameters
- Rate limit awareness prevents API abuse
- Error masking prevents information disclosure
📚 Development
Local Development
git clone https://github.com/ken/ken-api-mcp.git
cd ken-api-mcp
npm install
npm run dev
Building
npm run build
npm run typecheck
npm run lint
Publishing
npm run prepublishOnly
npm publish
🆘 Troubleshooting
Common Issues
"Connection Error"
- Check API health: Use
ken_check_api_health - Verify base URL configuration
- Confirm internet connectivity
"Job Not Found"
- Jobs are cleaned up after completion
- Use job status immediately after creation
- Check job ID format is correct
"Rate Limit Exceeded"
- Wait 60 seconds before retry
- Consider batch operations for multiple requests
- Monitor usage patterns
"File Not Found"
- Files are temporary and cleaned up quickly
- Download immediately after job completion
- Use
ken_process_and_downloadfor automatic download
Debug Mode
Enable detailed logging:
export KEN_API_LOGGING=true
🎉 Success Stories
Perfect for:
- 🎬 AI video generation pipelines
- 🗣️ Voice-over automation workflows
- 📝 Automatic captioning systems
- 🎞️ Video format conversion services
- 🔄 Batch video processing operations
Used in production for:
- Social media content automation
- Educational video creation
- Marketing video pipelines
- Accessibility compliance
- Multi-language video localization
📞 Support
- Issues: GitHub Issues
- API Documentation: Ken Video API Docs
- MCP Protocol: MCP Documentation
Make your video automation workflows incredibly powerful with Ken Video API MCP! 🚀
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。