animated-video-mcp
<div align="center">
<img src="https://raw.githubusercontent.com/sunilgentyala/animated-video-mcp/main/docs/assets/banner.svg" alt="Animated Video MCP: Plan. Animate. Verify. Deliver." width="100%" />
# Animated Video MCP
**Original Python motion graphics with owner approval, media verification, and MCP job tools.**
[](https://github.com/sunilgentyala/animated-video-mcp/actions/workflows/docker-tests.yml)
[](https://github.com/sunilgentyala/animated-video-mcp/actions/workflows/tests.yml)


<img src="https://raw.githubusercontent.com/sunilgentyala/animated-video-mcp/main/docs/assets/demo.gif" alt="Demo: six rendered scenes (Plan, Approve, Animate, Verify, Review, Deliver) produced by this renderer" width="560" />
<sub>Frames cut from a real 180 second render of this project, produced by the renderer itself.</sub>
Maintained by [Sunil Gentyala](https://github.com/sunilgentyala)
</div>
## Highlights
- **Explicit storyboards in, narrated MP4 out.** 180 to 240 seconds, 6 to 24 scenes, 640x360 at 12 fps, English narration.
- **Human in the loop.** Approval and final review are local owner CLI steps, deliberately not MCP tools.
- **Verified before delivery.** Full-file decode, duration check, audio and video track check. No job completes on metadata alone.
- **MCP over Streamable HTTP** with bearer authentication and short lived signed download links.
- **Durable jobs** in SQLite with an exclusive worker lock.
## Status
An early, constrained implementation. It creates narrated English 2D token-tile animations from a storyboard you write. It does not produce cinematic footage or research articles on its own, and it is not production ready.
| Area | Evidence |
| --- | --- |
| Unit, storage, security tests | 21 pass locally and in CI |
| MCP initialization and tool calls over live HTTP | Covered by the test suite |
| Linux container | Built and tested in CI (no network, read-only filesystem) |
| Windows and macOS | Test suite runs in CI on Python 3.11 and 3.13 |
| End-to-end render on Windows | 180.04 s H.264/AAC file, full-file decode passed |
| Claude Code as MCP client | Tested: created a job, read status, and fetched a signed download link over HTTP; the link served an MP4 that fully decodes |
| Human audiovisual review | Not performed |
## Architecture
```mermaid
flowchart TD
A[MCP client] --> B[Authenticated API]
B --> C[SQLite storyboard and job]
C --> D[Local owner approval]
D --> E[Exclusive rendering worker]
E --> F[Animation and narration]
F --> G[Media verification]
G --> H[Owner review]
H --> I[Signed MP4 delivery]
```
## Install and test
Requires Python 3.11+, FFmpeg with flite, libx264 and AAC, and a TrueType font.
From PyPI (provides the `video-tool` command and the server):
```sh
pipx install sunil-animated-video-mcp
```
From source:
| Platform | Font used by default |
| --- | --- |
| Linux | DejaVu Sans |
| macOS | Arial (system) |
| Windows | `C:/Windows/Fonts/arial.ttf` |
Set `VIDEO_FONT` to use another font.
```sh
python -m venv .venv
. .venv/bin/activate # Windows: .venv/Scripts/activate
pip install -e '.[test]'
python -m pytest -q
```
Dependencies are compatible ranges, not a resolved lockfile. Review and lock them before deployment. The server uses Python MCP SDK v1 APIs and deliberately excludes v2.
## Storyboard format
Create a JSON object with exactly `title`, `target_seconds`, and `scenes`. Target must be 180–240 seconds; provide 6–24 scenes. Each scene contains exactly `title`, `narration`, and `tokens` (1–3 short labels). Current text support is printable ASCII English. Narration may contain up to 280 characters, but measured speech must fit the equally allocated scene duration. All scenes use a slide-in/floating tile template at 640x360 and 12 fps.
## Local workflow
```sh
KEY=$(python -c 'import uuid; print(uuid.uuid4())')
video-tool create YOUR_STORYBOARD.json --key "$KEY"
video-tool status JOB_ID
video-tool approve JOB_ID --hash RETURNED_STORYBOARD_HASH
video-tool worker --once
video-tool status JOB_ID
```
Successful rendering leaves `data/artifacts/JOB_ID/final.mp4` and a verification report. It does not automatically complete the job. Watch/listen to the entire video, then:
```sh
video-tool review JOB_ID --accept
# or: video-tool review JOB_ID --reject
```
The CLI attestation is not independent proof that the video was watched. Protect administrative and filesystem access.
## MCP service
Generate two independent random secrets with `python -c 'import secrets; print(secrets.token_hex(32))'`. Export variables described in `.env.example`; creating that file does not automatically load it.
```sh
uvicorn video_tool.server:app --host 127.0.0.1 --port 8000 --workers 1
```
Run `video-tool worker` separately, using the same VIDEO_DATA directory. The intended deployed MCP URL is `https://YOUR_HOST/mcp`, behind your HTTPS proxy. Authenticate using `Authorization: Bearer VIDEO_TOKEN`. This is static bearer authentication, not OAuth discovery. MCP initialization and tool calls are tested over HTTP, including from Claude Code (see below).
### Use with Claude Code
```sh
claude mcp add --transport http animated-video http://127.0.0.1:8000/mcp \n --header "Authorization: Bearer $VIDEO_TOKEN"
```
Ask Claude Code to create a video job from a storyboard. Approve and review locally with `video-tool`, then ask it for the output link.
Tools: `create_video_job`, `get_video_status`, `get_video_output`. Approval and final review are local-owner CLI operations, deliberately not MCP tools. Signed download links expire after five minutes and are bearer capabilities.
## Configuration
| Setting | Meaning |
| --- | --- |
| VIDEO_DATA | Shared SQLite/artifact directory; defaults to ./data |
| VIDEO_TOKEN | API secret; at least 32 characters |
| VIDEO_SIGNING_KEY | Separate signing secret; at least 32 characters |
| VIDEO_PUBLIC_URL | External HTTPS origin with no path, query, or credentials |
| VIDEO_ALLOWED_ORIGINS | Optional comma-separated browser origins; empty by default. Claude Code sends no Origin header, so it needs none |
| VIDEO_FONT | Worker font path; defaults to a system font per platform |
## Docker
```sh
docker build -t sunil-video:local .
docker volume create sunil-video-data
docker run --rm --name sunil-video-api --env-file .env -e VIDEO_DATA=/data -p 127.0.0.1:8000:8000 -v sunil-video-data:/data sunil-video:local
docker run --rm -v sunil-video-data:/data sunil-video:local video-tool --root /data worker
```
Verify named-volume permissions for UID 10001. Approve/review using the CLI in the API container. The image builds and its tests pass in CI. Add TLS, proxy request/rate limits, CPU/memory/disk restrictions, and query-string redaction before public exposure.
## Limitations and release gates
No dashboard, checkpoint resume, render-time cancellation, automatic retention, multi-tenancy, OAuth, arbitrary choreography, multilingual narration, or cloud footage generation. Interrupted jobs are failed explicitly, not resumed. Generated motion and narration quality require human review. Filesystem checks and a pre-download hash do not eliminate races from a malicious local writer; trusted storage is required. Dependency locking, human audiovisual review, and a security review remain release gates.
`docs/ROADMAP.md`, `docs/GAPS.md`, and the earlier operating skill include historical planning text. Source-import items in them are superseded by this commit; reconcile the remaining roadmap as runtime validation proceeds.
## Attribution
Original application code maintained by Sunil Gentyala. No upstream application code is vendored. Dependencies retain their own applicable notices and licenses. Licensed under the Apache License 2.0 (see `LICENSE`). No AI co-author trailer is added; verify actual commit metadata separately.
TDQS
Scored across 3 tools
The three tools map to clearly distinct lifecycle stages: job creation/storyboard saving, status retrieval, and output download. Their descriptions make the boundaries explicit, so an agent should not confuse them.
All names use a consistent snake_case verb_noun pattern with the shared video domain: create_video_job, get_video_status, get_video_output. The minor variation between job/status/output is semantically appropriate rather than inconsistent.
Three tools is a lean but reasonable surface for a minimal job workflow, and each tool has a distinct role. It is slightly under-scoped because the workflow implies additional lifecycle operations, but the count itself is not excessive.
The surface has significant gaps: create_video_job saves a storyboard but does not start rendering, and get_video_output requires owner review without any tool to approve or trigger that review/rendering step. This creates a dead end in the apparent animated-video lifecycle.