Skip to main content
Glama

๐ŸŽฌ Ken Video API MCP Server

npm version License: MIT

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.

Related MCP server: HeyGen MCP Server

๐ŸŽฏ Perfect For n8n Workflows

AI Video Generation Pipeline

Stable Diffusion โ†’ RunwayML โ†’ Ken Video API MCP
    (image)      โ†’  (video)  โ†’  (voice + captions)

Workflow Steps:

  1. Generate image with Stable Diffusion

  2. Convert to video with RunwayML/Stable Video

  3. Generate voice-over with ElevenLabs

  4. Use ken_add_audio_from_urls to combine video + audio

  5. Use ken_auto_caption_from_url to add captions

  6. Use ken_process_and_download to 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 availability

  • ken_api_info - Get comprehensive API information

  • ken_wait_for_job - Poll until job completion

  • ken_download_video - Download processed videos

  • ken_cancel_job - Cancel running jobs

๐ŸŽฌ Advanced Processing

  • ken_process_batch_operations - Execute multiple operations

  • ken_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 notifications

  • ken_list_webhooks - View webhook configurations

  • ken_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_download for 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


Make your video automation workflows incredibly powerful with Ken Video API MCP! ๐Ÿš€

Related MCP Connectors

Related MCP Servers