JSON2Video MCP Server for Programmatic Video Generation
Generate programmatic videos with the JSON2Video MCP server, offering API-driven creation and status checks for LLMs, agents, and MCP clients.
npx -y @omergocmen/json2video-mcp-serverOverview
The JSON2Video MCP Server is a lightweight Model Context Protocol (MCP) compatible backend that exposes an API for programmatic video generation. It accepts structured JSON instructions describing scenes, assets, voice-over, subtitles and other layout information, forwards those instructions to a configured video-rendering provider, and tracks rendering status until final media is available.
The server is useful when you want to integrate automated or on-demand video production into an application, agent, or LLM workflow. Instead of manual video editing, you can generate dynamic videos from templates or LLM outputs, check progress programmatically, and receive callbacks when rendering completes — making it suitable for bots, content pipelines, and automated marketing/education tooling.
Features
- Simple HTTP API for creating and tracking programmatic video jobs
- Accepts JSON “programmatic video” instructions (scenes, assets, audio, captions)
- Status and progress endpoints for polling job state
- Optional callback/webhook support for completion notifications
- Configurable provider integration (forward instructions to JSON2Video or other renderers)
- Docker-friendly, runs locally or in cloud containers
- Logging and basic configuration via environment variables
Installation / Configuration
Prerequisites: Node.js (>=14), npm or Docker.
Clone and install:
Create a .env file (example):
PORT=3000
JSON2VIDEO_API_KEY=your-json2video-api-key
JSON2VIDEO_ENDPOINT=https://api.json2video.example.com/v1/render
CALLBACK_SECRET=replace-with-secret
LOG_LEVEL=info
Run locally:
# development
# production
Docker usage:
Configuration notes:
- JSON2VIDEO_API_KEY and JSON2VIDEO_ENDPOINT: credentials/URL for your chosen video rendering provider.
- CALLBACK_SECRET: used to validate incoming webhook callbacks if you expose a callback endpoint.
Available Resources
Common HTTP endpoints (typical names — check your local server routes after install):
- POST /mcp/videos — create a new video job
- GET /mcp/videos/:id — get job status and metadata
- POST /mcp/webhook — (optional) endpoint to receive provider callbacks
- GET /health — basic health check
Create request fields (common schema):
| Field | Type | Description |
|---|---|---|
| client_id | string | Optional client identifier |
| instructions | object | Programmatic video instructions (scenes, assets, audio, captions) |
| callback_url | string | Optional URL to call when job completes |
| metadata | object | Arbitrary metadata for tracing |
Status response fields:
| Field | Type | Description |
|---|---|---|
| id | string | Server-assigned job id |
| status | string | queued |
| progress | number | 0–100 approximate progress |
| result_url | string | URL to final video (when succeeded) |
| error | string | Error message (when failed) |
Example POST payload (simplified):
Example curl to create a job:
Check status:
Use Cases
- LLM-driven content generation: An LLM produces a script and scene breakdown, then calls the MCP server to render a narrated explainer video automatically.
- Agent workflows: Autonomous agents can create status updates as short videos (e.g., progress summaries, visual reports) and receive the finished URLs for sharing.
- Dynamic marketing creatives: Generate multiple personalized product demo videos from a template and customer data, then surface the results in an ad platform.
- Educational microvideos: Produce short instructional clips from structured lesson content, including captions and TTS voice-overs, ready for LMS ingestion.
- A/B testing creatives: Spawn variations of a base template with different text, voice, or images to evaluate engagement and performance.
Tips for Developers
- Start by defining a minimal instruction schema (title, scenes[], voice) and iterate as you integrate the renderer.
- Use callbacks to avoid polling — provide a callback_url to get a single POST when the job transitions to succeeded/failed.
- Keep assets (images, audio) on publicly reachable URLs so the renderer can fetch them.
- Implement idempotency for create calls if your clients may retry requests.
For implementation specifics (routes, provider adapters, and request/response formats), inspect the repository code after cloning to match the exact endpoint names and environment variables your version expects.