TokenReel
TokenReel
Turn plain text and technical content into animated, narrated, captioned short videos. Offline-first. No watermark. No cloud TTS. Secure by default.
What it does
Give it Markdown or plain text. TokenReel plans the scenes with NLP, then draws, narrates and captions them for Shorts and Reels (1080x1920).
Your text | Scene it becomes |
Prose | Explainer card with keyword chips |
"First ... Then ... Finally ..." | Flow diagram with numbered steps and arrows |
Equations and numbers ( | Math card, spoken as words ("n over m") |
Fenced code blocks | Code panel with line numbers and syntax colors |
Related MCP server: short-video-maker
Why another video generator
The popular free tools compose stock footage from a topic. They do not animate code, flows or math, and caption tooling often defaults to cloud TTS that sends your script elsewhere. TokenReel keeps everything on your machine and is built for technical explainers.
Quick start
pip install -e ".[dev]"
tokenreel plan examples/demo.md # scene plan as JSON, no extras needed
tokenreel srt examples/demo.md # estimated captionsSilent preview video (needs ffmpeg on PATH and the render extra):
pip install -e ".[render]"
tokenreel render examples/demo.mdNarrated video with captions burned in, each word highlighted as it is spoken
(--plain-captions for static captions):
pip install -e ".[render,tts,align]"
# download kokoro-v1.0.onnx and voices-v1.0.bin (about 350 MB) from the
# kokoro-onnx "model-files-v1.0" release into ~/.tokenreel/models
tokenreel render examples/demo.md --audio --align --burnOutput goes to build/ as out.mp4 and captions.srt.
Use it from an AI agent (MCP)
TokenReel ships an MCP server, tokenreel-mcp, so an agent
can plan and render videos for you. It runs locally over stdio.
pip install -e ".[mcp,render]"
claude mcp add tokenreel -- tokenreel-mcp # Claude CodeOr in any MCP client config:
{ "mcpServers": { "tokenreel": { "command": "tokenreel-mcp" } } }Tool | What it does |
| Split text into scenes (text, flow, math, code) with keywords and flow steps |
| Estimated SRT captions |
| Render an mp4 plus captions, optionally narrated, aligned and burned in |
Safety: the client never passes file paths. Output goes to TOKENREEL_OUT (default
~/tokenreel-output), one new folder per render, with a restricted file name. Input size and
scene count are capped.
Sandboxed, fully offline (container)
Two images are published to GHCR:
Image | Can do |
| plan, captions, silent renders |
| everything, including narration, exact timings and burned captions (1.6 GB) |
The narration image has the small English recognizer baked in. The voice model
(kokoro-v1.0.onnx, voices-v1.0.bin, about 350 MB, see the quick start) is mounted, not baked:
claude mcp add tokenreel-sandbox -- docker run -i --rm --network none \
-v ~/.tokenreel/models:/home/reel/.tokenreel/models:ro \
-v ~/tokenreel-output:/home/reel/out \
ghcr.io/sunilgentyala/tokenreel:narrate--network none works: nothing needs the network at run time. Paths returned by
render_video are inside the container, so use video_relative and captions_relative
(relative to the mounted output folder).
How it works
text / Markdown
-> sentence + scene segmentation (code, math, flow, text) and keywords
-> spoken-form normalization (digits and symbols become words)
-> local TTS (kokoro-onnx)
-> word timings (faster-whisper, local; or a calibrated estimate)
-> frames (Pillow) -> hardened ffmpeg -> mp4 + srtWord-level timing matters because aligners give no time to bare digits or symbols, so narration text is normalized to spoken words before alignment. When the recognizer hears a different number of words than the script, its words are used for the captions as-is.
Security and privacy
Untrusted input is treated as hostile: paths are confined to a working directory, file types are allow-listed, ffmpeg runs with list arguments,
-protocol_whitelist fileand a timeout, and untrusted URLs never reach ffmpeg (see CVE-2023-6605 for why).Run rendering in a container, ideally with gVisor, with no network and resource limits.
Releases ship a CycloneDX SBOM, build provenance attestations and Sigstore signatures.
Telemetry is off by default and opt-in only. See TELEMETRY.md.
Report vulnerabilities privately. See SECURITY.md.
Design notes
Rendering is our own frame generator plus ffmpeg, not Remotion. Remotion's license requires a paid company license for larger organizations, which would burden operators of a self-hosted tool.
The core installs with zero dependencies. NLP, TTS, alignment and rendering are optional extras.
Status and roadmap
Early alpha. Done: scene planning, flow diagrams, offline narration, exact word timings, burned-in captions with per-word highlighting. Next: math typesetting, architecture diagrams, more voices and languages, a 16:9 layout.
License
Apache-2.0. See LICENSE.
Available Tools
3 toolsmake_captionsA
Return estimated SRT captions for the text. For exact timings render with narration.
Inputs: text (required). Returns: result
plan_scenesB
Split text or Markdown into scenes. Each scene has a kind (text, flow, math, code), its text, keywords and, for flow scenes, numbered steps. No files are written.
Inputs: text (required). Returns: result
render_videoA
Render text to an mp4 plus captions.srt inside the server's output folder.
narrate: offline Kokoro voiceover (needs the model files, see the README). exact_timings: align word times with a local recognizer (needs narrate). burn_captions: draw captions into the video. highlight_words: with burn_captions, fill each word with an accent colour as it is spoken. Returns the output paths. Requires ffmpeg and the render extra.
Inputs: text (required), name, narrate, burn_captions, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools map to distinct pipeline stages: planning scenes, generating captions, and rendering video. There is minor overlap because render_video also produces captions.srt, but the descriptions distinguish estimated captions from final rendered output.
All tool names use a consistent snake_case verb_noun pattern: plan_scenes, make_captions, render_video. The convention is predictable and easy to scan.
Three tools is well-scoped for a text-to-video pipeline, with each tool covering a clear stage. The optional features like narration and caption burning appear to be render options rather than separate tools.
The core workflow from text planning to captions to final video is covered, and render_video returns output paths. Minor gaps exist around previewing or validating intermediate outputs, but agents can work around them.
Maintenance
Related MCP Connectors
Turn documents and photos into narrated AI videos from Claude, ChatGPT, Codex or any MCP client.
Render an MP4 from your own images, clips, voice-over and timed captions. JSON to video.
MCP server for Clipkit — gives AI agents a video toolbox via the Clipkit schema.
AI video editor your agent can drive: plan scenes, edit a multi-track timeline, and render MP4s.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that turns a script into a Hyperplexed-style motion-graphics MP4. Plug the URL into Claude Desktop, Cursor, or any MCP-compatible agent and it gains a render_video tool.MIT
- AlicenseNot gradedqualityDmaintenanceAutomated short-form video creation from text prompts, combining text-to-speech, captions, background videos, and music, exposed as an MCP server for AI agents.MIT
- AlicenseNot gradedqualityCmaintenanceTurns a plain-language request into a narrated vertical motion graphics video with natural voice, word-by-word synced animation, music and sound effects, rendered locally as an MP4 ready for Reels, TikTok and Shorts. Validates scripts and estimates OpenAI API cost before spending credits, and works inside MCP-capable assistants like Claude Code, Claude Desktop or Cursor.MIT
- AlicenseAqualityBmaintenanceLocal-first MCP server that turns long videos into captioned vertical Shorts (face-tracked 9:16 clips, active-speaker cuts, animated captions) or generates Shorts from a topic. Tools: generate_short, extract_clips, generate_social_package, get_render_status, list_supported_modes.9834 PyPI18MIT