Skip to main content
Glama
README.md
<div align="center">

# ⚡ FrameForge

### The Universal AI Video Creation & Autonomous Editing Engine for Any Agent

**Enable ANY AI agent — terminal bots, autonomous swarms, scripts, cloud agents, or IDEs — to generate broadcast-quality videos and edit raw footage with a single npm command.**

[![npm version](https://img.shields.io/npm/v/@amg555/frameforge-mcp.svg?style=flat-square&color=007acc)](https://www.npmjs.com/package/@amg555/frameforge-mcp)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](LICENSE)
[![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org/)
[![MCP Spec](https://img.shields.io/badge/MCP-2024--11--05-blue.svg?style=flat-square)](https://modelcontextprotocol.io/)
[![Tests](https://img.shields.io/badge/tests-712%20passing-brightgreen.svg?style=flat-square)](docs/collaboration.md)
[![Structural Gates](https://img.shields.io/badge/validation-113%20passed-success.svg?style=flat-square)](docs/collaboration.md)

[Quickstart](#quickstart) • [Prompt Cheat Sheet](#prompts) • [100% Free / Ultra-Low-Token Workflow](#free-workflow) • [Three Superpowers](#superpowers) • [108 Motion Styles](#styles) • [Faceless Shorts](#shorts) • [Remote / Cloud Server](#remote-server) • [44 MCP Tools](#tools) • [Collaboration Guide](docs/collaboration.md)

</div>

---

<a id="what-is-frameforge"></a>
## 💡 What is FrameForge?

**FrameForge** is an open-source local video engine and **Model Context Protocol (MCP)** server that equips **any AI agent** with three complete superpowers:

1. **Autonomous Video Creation:** Generates full 1080p landscape videos and 9:16 vertical shorts from a single prompt or script.
2. **Autonomous Video Editing:** Ingests raw video/audio footage, automatically cuts silences, removes bad takes/mistakes, injects kinetic captions & B-roll, and exports polished videos or NLE timelines.
3. **Live Stream & Broadcast Clipping:** Ingests multi-hour livestreams and broadcast feeds (news channels, debates, podcasts, gaming), detects audio volume and live chat surges, reframes to 9:16 portrait (preserving chyrons) or 16:9 widescreen, burns word-accurate subtitles across Indian & world scripts, and validates before publishing.

**100% Free & Local:** Runs on your machine or cloud server with free offline neural voices and deterministic code-drawn graphics. Zero cloud render costs, zero GPU subscriptions, zero AI hallucinations. FrameForge defaults strictly to code-driven procedural animation — zero AI images generated unless explicitly requested.

**Dynamic Multi-Style Videos:** Videos never look flat or monotonous. FrameForge automatically assigns distinct procedural motion styles across scenes matching narrative pacing (hooks, concept breakdowns, data charts, and climaxes).

---

<a id="quickstart"></a>
## ⚡ Quickstart: Give This 1 Prompt to Your AI Agent

No manual downloading or complex configuration needed. FrameForge auto-provisions all runtime tools (FFmpeg, neural TTS voices, Chromium browser engine) automatically.

Simply copy and paste this single prompt to your agent (Claude Code, Cursor, Windsurf, or any terminal agent):

> **"Set up FrameForge MCP from npm package `@amg555/frameforge-mcp@latest` so you have video creation and editing tools, and verify dependencies are ready."**

Your agent configures MCP and verifies everything on its own.  
*(Want to configure JSON files manually? See the [Manual MCP Setup Guide](docs/mcp-setup.md).)*

---

<a id="prompts"></a>
## 📋 Essential Agent Prompts Cheat Sheet (Copy & Paste)

Copy and paste these exact prompts into any agent (Claude Code, Cursor, Windsurf, web agents, or cloud sandboxes):

| Category | Goal | Copy & Paste Prompt to Agent |
|---|---|---|
| ⚡ **1. Initial Setup** | Zero-config MCP install & verification | `Set up FrameForge MCP from npm package @amg555/frameforge-mcp@latest so you have video creation and editing tools, and verify dependencies are ready.` |
| 🔄 **2. Update Engine** | Fetch newest release & verify health | `Update FrameForge MCP to latest version: run npx -y @amg555/frameforge-mcp@latest frameforge doctor to pull newest package and verify video tools.` |
| ☁️ **3. Cloud Sandbox Agent** | Setup in cloud dev container / sandbox | `Install and configure FrameForge MCP using npx -y @amg555/frameforge-mcp@latest over stdio, and run frameforge doctor to confirm video creation tools are ready.` |
| 🌐 **4. Cloud Agent to Remote / VPS** | Connect cloud agent to local machine or VPS | `Connect to my remote FrameForge video engine via MCP SSE transport at URL: http://<YOUR_IP_OR_TUNNEL>:8000/sse. List the 44 video tools to verify connection.` |
| 🎬 **5. Video Creation** | 1080p / 9:16 dynamic multi-style video | `Create a 60-second video explaining <TOPIC>. Choose matching procedural motion styles from FrameForge for each scene, generate the voiceover with edge-tts, and render the final MP4.` |
| ✂️ **6. Raw Footage Editing** | Auto-cut silences & bad takes | `Edit my recording raw.mp4: cut all silences and retakes, add kinetic subtitle cards, normalize audio to -14 LUFS, and export the final video.` |
| 📡 **7. Stream & VOD Clipping** | Highlight detection & chyron-safe reframe | `Clip the top highlight from <STREAM_URL_OR_FILE>: detect volume and chat surges, reframe to 9:16 vertical with blurred backdrop for chyrons, burn word-level subtitles, and validate output.` |
| 🎨 **8. Motion Styles** | Browse & inspect style prompts | `List available motion styles using list_motion_styles and fetch the full prompt for style <STYLE_NAME> (e.g. map-explainer-3d, creator-motion, or product-commercial-3d).` |

> 💡 **Style Tip:** You can specify any of our [108 Motion Styles](plugins/motion-styles/LIBRARY.md) directly in your prompt (e.g. *"in `creator-motion` style"*, *"in `map-explainer-3d` style"*, or *"in `product-commercial-3d` style"*). If you don't name a style, your agent will automatically pick the best-fitting styles for each scene in your topic!

---

<a id="free-workflow"></a>
## 🆓 Pro-Tip: 100% Free / Ultra-Low-Token Video Generation (Zero Subscriptions)

### Make Broadcast-Quality AI Videos for $0 with Local or Web Agents

You do **NOT** need expensive AI video subscriptions ($20–$50/mo) or cloud GPU rentals to build stunning videos. Because FrameForge contains the complete compiled motion graphics math, spring physics, and rendering engine, any local agent (Ollama, LM Studio) or budget/free agent can generate the high-level semantic animation prompts for $0:

💻 **Flexible Agent-to-Engine Architecture:** You can brainstorm and generate video scripts with any AI agent (in your desktop IDE, via local LLMs like Ollama, or through web agent interfaces). The heavy lifting and broadcast video rendering executes on your local workstation, laptop, or VPS server with our single `npm` command!

```
 ┌───────────────────────────┐      ┌─────────────────────────────┐      ┌─────────────────────────────┐
 │   1. Pick Motion Style    │ ───► │   2. Prompt Any Agent       │ ───► │    3. Render Free with npm  │
 │   108 Procedural Styles   │      │   Local, IDE, or Web agent  │      │    npx @amg555/frameforge   │
 │   Ready-to-copy prompt    │      │   Pure standalone HTML5 code│      │    1080p MP4 master ($0)    │
 └───────────────────────────┘      └─────────────────────────────┘      └─────────────────────────────┘
```

#### The 4-Step $0 Workflow:
1. **Choose a Style:** Pick any look from our [108 Procedural Motion Styles](plugins/motion-styles/LIBRARY.md) (e.g. `creator-motion`, `map-explainer-3d`, `product-commercial-3d`, `arch-viz-isometric`, `fluid-particle-cinema`, `assembly-3d`).
2. **Grab the Prompt:** Open the style's prompt in [`plugins/motion-styles/prompts/`](plugins/motion-styles/prompts/) (e.g. [`creator-motion.md`](plugins/motion-styles/prompts/creator-motion.md)) and copy the prompt template.
3. **Generate Code with Your Agent:** Prompt your agent with the style template + your topic (e.g. *"Explain how GPS triangulation works"*). The agent only outputs the clean HTML5 canvas parameters or structured script.
4. **Render Free with Our Single npm Package:** Save as `animation.html` and render into a crisp 1080p broadcast MP4 with one command (runs locally on Windows, macOS, Linux, or on a VPS server):
   ```bash
   npx -y @amg555/frameforge-mcp frameforge-harness all --html ./animation.html --out final.mp4
   ```

> 📌 **Ultra-Low Token Footprint:** Because styles, 3D math, and audio mastering are pre-compiled into FrameForge, agents only generate high-level structured scripts rather than thousands of lines of fragile raw code. Even lightweight, fast models produce identical broadcast-grade visual fidelity at near-zero token cost.

#### Why Code-Based Video Beats Traditional AI Video:
* **Zero Cost ($0):** No subscriptions, no cloud rendering credits, no credit card required.
* **Native Workstation & VPS Support:** Full support for Windows, macOS, Linux, and cloud VPS instances (Ubuntu/Debian/Docker) with zero GPU rental requirements.
* **100% Deterministic & Glitch-Free:** Every frame is a mathematical function of time `t`. Zero melting fingers, zero flickering backgrounds, zero random AI hallucinations.
* **High-Speed Non-Blocking Rendering:** FrameForge harness uses asynchronous parallel disk frame writes (`fs.promises.writeFile`) preventing render buffer locks.
* **True Broadcast Quality:** EBU R128 (−14 LUFS) audio mastering, procedural Web Audio SFX kits, spring physics, and organic boil.
* **Universal Search Tags (SEO):** Free code based video generation • free agent video creation • local AI video renderer • free AI video creation without subscription • open-source text-to-video without API key • zero-subscription AI video editor • free alternative to Runway, Sora, HeyGen, Pika, and Remotion.

---

<a id="superpowers"></a>
## 🎬 Three Agent Superpowers: Creation, Editing & Stream Clipping

```
                                  Your AI Agent
                    (Claude Code / Cursor / Windsurf / Swarms / Cloud)
                                       │
                      npx -y @amg555/frameforge-mcp
                                       │
         ┌─────────────────────────────┼─────────────────────────────┐
         ▼                             ▼                             ▼
SUPERPOWER 1: CREATION       SUPERPOWER 2: EDITING       SUPERPOWER 3: STREAM CLIPPING
• Ideas/Scripts → Final MP4  • Raw Footage → Polished Cut• Long Streams/VODs → Polished Clips
• 108 Motion Styles          • Auto-cut pauses/silences  • Audio energy & chat spike detection
• Dynamic Per-Scene Styles   • Remove false starts       • 9:16 Blur chyron-safe / Crop / Stack
• 6 Faceless Shorts Engines  • Kinetic captions & B-roll • HarfBuzz Indic & World libass subs
• Pure-t Canvas Animation    • Export DaVinci/Premiere   • OBS ReplayBuffer & sliced downloads
• Free voices (edge-tts)     • Non-blocking async writes • 8s to 10 min flexible story arc
         │                             │                             │
         └─────────────────────────────┼─────────────────────────────┘
                                       ▼
                     Broadcast Master MP4 (EBU R128 −14 LUFS)
```

### Superpower 1: Autonomous Video Creation
* **Agent-Scripted Flow (`create_video_from_script`):** Agent writes scene cards; FrameForge synthesizes voice, renders kinetic vector cards, ducks background audio, and encodes 1080p MP4s. No API keys required.
* **Code-Driven Canvas Animation (`render_animation`):** Every frame is a mathematical function of time `t`. Zero random jitter inside the render loop, 12fps organic boil, spring camera physics, and word-accurate cue triggers (`cuePhrase()`).
* **Multi-Style Dynamic Pacing:** Assigns unique visual styles matching each scene's narrative purpose (hook, concept, stats, vs comparisons, deep-dive mechanisms, story recap).
* **Viral Short Automation:** Auto-generates 9:16 vertical reels with word-synced subtitles for TikTok, YouTube Shorts, and Instagram Reels.

### Superpower 2: Autonomous Video Editing
* **Silence & Pause Cutting:** Automatically detects audio lulls using local Whisper energy levels and slices dead air with configurable pacing (natural 0.3s vs tight 0.15s).
* **Mistake & Retake Removal:** Detects false starts, repeated lines, slips, and *"wait let me re-do that"* phrases via word-level transcripts and cleanly slices out bad takes.
* **Automated Motion Overlays:** Injects motion graphics cards, lower thirds, callouts, and browser mockups on top of raw footage.
* **J-Cuts / L-Cuts & Audio Mixing:** Automatically overlaps audio transitions for cinematic flow, normalizes to EBU R128 (−14 LUFS), and ducks background beds under spoken words.
* **Export to Professional Editors (`export_to_editor`):** Generates timeline files for **DaVinci Resolve** (FCPXML/EDL), **Premiere Pro**, **After Effects**, **Remotion**, or **CapCut**.

### Superpower 3: Live Stream & Broadcast Clipping
* **On-Demand Lightweight Provisioning:** Heavy clipping tools (`yt-dlp`, `streamlink`) are deferred from default installation and download automatically on demand only when stream clipping is requested, avoiding storage bloat and install delays.
* **Audio-First Ingestion (`clip_stream`, `capture_vod`):** Downloads stream audio first for fast and lightweight scanning, then downloads high-res video slices ONLY for the chosen 30-180 second moments, saving dozens of gigabytes of bandwidth.
* **Spike Detection (`score_stream_highlights`):** Detects rolling volume surges (debate clashes, breaking news declarations, cheering, laughter) and live chat message velocity bursts (3x baseline) with reaction keyword clustering (`LMAO`, `POG`, `W`, `🔥`).
* **Chyron-Safe Framing (`cut_and_reframe_clip`):** Fits 16:9 news feeds cleanly over a darkened, blurred 9:16 backdrop to preserve 100% of broadcaster lower thirds, tickers, and corner clocks without awkward cropping. Also supports face-tracking crop, vertical stack, and 16:9 widescreen for in-depth 2–10 minute news reports.
* **Complex Script Subtitles:** Renders word-by-word synchronized subtitles via libass + HarfBuzz shaping, fully preserving Indian scripts (Devanagari, Malayalam, Tamil, Telugu, Bengali) and Romanized transliteration.
* **OBS Replay Integration (`obs_command`):** Triggers `SaveReplayBuffer` over OBS WebSocket v5 to capture live desktop/stream highlights on demand.
* **Strict Quality Gate (`validate_clip`):** Asserts stream duration, audio loudness (mean > -35 dB), video dimensions, and checks test frames for black flashes.

---

<a id="styles"></a>
## 🎨 108 Procedural Motion-Graphics Styles

FrameForge bundles **108 code-drawn motion-graphics styles** covering every content genre. Every style runs entirely in code on HTML5 Canvas / Three.js r128 with synthesized Web Audio sound kits — zero AI image generation, zero diffusion artifacts.

Full catalog and ready-to-copy prompts in [`plugins/motion-styles/LIBRARY.md`](plugins/motion-styles/LIBRARY.md).

| Family | Count | Popular Styles | Best For |
|---|---|---|---|
| **Kinetic Type** | 3 | `creator-motion`, `clean-tech`, `swiss-grid` | Creator edits, business hooks, high-energy reels |
| **Hand-Drawn** | 5 | `chalk-talk`, `marker-board`, `blueprint`, `paper-collage-film`, `metamorphosis-specimen` | Stop-motion torn paper, whiteboard explainers, biology microscopy |
| **Screen & UI** | 3 | `software-walkthrough`, `aurora-glass`, `product-launch-ui` | SaaS app launches, Aurora Glass creator cards, mobile lockscreens |
| **Data & Explainer** | 6 | `data-story`, `timeline-rail`, `isotype`, `math-canvas` | Charts, market statistics, financial trends |
| **Talking Head** | 1 | `warm-canvas` | Editorial PiP cards over creator webcam footage |
| **Illustrated** | 7 | `pop-info`, `paper-craft`, `zine-collage`, `comic-panels` | Infographics, book summaries, narrative stories |
| **3D & Spatial** | 53 | `clay-diorama`, `bio-glow`, `map-explainer-3d`, `product-commercial-3d`, `arch-viz-isometric`, `fluid-particle-cinema`, `assembly-3d` | Procedural Three.js 3D terrain, studio hardware commercials, architectural cutaways, particle physics |
| **Retro & Tech** | 2 | `pixel-quest`, `terminal` | 8-bit gaming, developer logs, cyber consoles |
| **Shorts Formats** | 10 | `quiz-countdown`, `top-5-countdown`, `tier-list`, `versus-split` | Viral TikTok, Instagram Reels, YouTube Shorts |
| **Edit Overlays** | 11 | `punch-captions`, `karaoke-subs`, `callout-kit`, `lower-thirds`, `archival-explainer` | Archival documentary, blue highlighter boxes, subtitle pops |
| **Character Stories** | 5 | `shadow-puppets`, `visual-novel`, `rubber-hose-reel` | Vector character animation, lore, folklore |

### Newly Added Procedural Styles (#97 to #108):
* **#97 Paper Collage Film (`paper-collage-film`):** Torn paper stop-motion collage on twos, fibrous white borders, paper iris zoom, and paper foley.
* **#98 Aurora Glass (`aurora-glass`):** Premium dark creator canvas, cyan aurora bloom, floating frosted glassmorphism cards, and Plus Jakarta Sans typography.
* **#99 Archival Explainer (`archival-explainer`):** Warm newsprint, thick sticker cutouts, signature blue marker highlight box (`#37BDF8`), and stepped stop-motion.
* **#100 Product Launch UI (`product-launch-ui`):** Modern SaaS product launch, mobile lockscreen notifications, and 3D spinning gold coins.
* **#101 3D Assembly Guide (`assembly-3d`):** Step-by-step Three.js exploded assembly manual, parts gliding into interlocking slots, and rotating threaded screws.
* **#102 Metamorphosis Specimen (`metamorphosis-specimen`):** Dual navy blueprint microscopy alternating with warm colored-pencil biological drawings and circular loupe calipers.
* **#105 3D Map Explainer (`map-explainer-3d`):** Vox/Johnny Harris geospatial explainer with Three.js terrain elevation, procedural ocean water shader with Gerstner waves, glowing border ribbons, curved 3D trade arcs, and projected city cards.
* **#106 3D Studio Product Commercial (`product-commercial-3d`):** Apple-grade luxury hardware commercial with PBR metallic/glass materials, 3-point softbox studio lighting, soft contact shadows, and exploded slow-motion assembly.
* **#107 3D Architectural Cutaway (`arch-viz-isometric`):** Architectural Digest isometric building cutaway with interior timber/concrete materials, dynamic sun study shadows, and dimensional callouts.
* **#108 3D Fluid & Macro Particle Cinema (`fluid-particle-cinema`):** High-end physics simulation with 50,000 GPU curl-noise particles, volumetric lighting, and macro depth-of-field.

---

<a id="shorts"></a>
## 📱 Viral Faceless Shorts Engine

FrameForge includes specialized turnkey engines for vertical short-form automation (YouTube Shorts, TikTok, Instagram Reels) in [`plugins/faceless-shorts/`](plugins/faceless-shorts/):

* **Deep Dive 3D (`deep-dive`):** 3D science and anatomy explainers. Sculpted procedural human forms, glowing biological x-rays, and camera tracks.
* **Night File 3D (`night-file`):** Unsolved mysteries and true-crime cases. Noir lighting, typewriter evidence cards, and crimson subject highlights.
* **Inside Out (`inside-out`):** 2D x-ray biology and object cutaway explainers with high-contrast subtitle blocks.
* **Stick Story (`stick-story`):** Expressive stick-figure survival steps, obstacle navigation, and gold step cards.
* **Paper Atlas (`paper-atlas`):** Historical events mapped on weathered parchment, animated campaign routes, and wax seals.
* **Tall Tale 3D (`tall-tale`):** Humorous true stories with stylized 2D cartoon characters moving through a 3D procedural world.

---

<a id="remote-server"></a>
## 🌐 Remote / Cloud MCP Server

FrameForge can run locally over stdio or as a persistent HTTP/SSE server accessible to remote swarms, cloud agents, or containerized pipelines:

```bash
# Launch persistent HTTP MCP server on custom host and port
PORT=8000 HOST=0.0.0.0 npm run server
```

Any cloud agent or IDE across your network can connect via standard MCP HTTP/SSE transport (`http://<your-server-ip>:8000/sse` or `http://<your-server-ip>:8000/mcp`).

---

<a id="tools"></a>
## 🛠️ 44 MCP Tools Reference

FrameForge registers **44 tools** compliant with the Model Context Protocol (MCP 2024-11-05 spec):

| Category | Tools (All 44 Listed) | Capabilities |
|---|---|---|
| **Video Creation (7)** | `create_video_from_script`, `assemble_video`, `render_from_scenes`, `edit_scenes`, `ingest_media`, `publish_video`, `generate_scene_image` | Full video assembly, scenes manifest, caption burning, scene graphics export |
| **Autonomous Editing (5)** | `edit_video`, `plan_video_edit`, `export_to_editor`, `detect_viral_clips`, `karaoke_subtitles` | Silence & retake cutting, viral hook scoring, kinetic subs, NLE export (DaVinci/Premiere) |
| **Livestream & Clipping (7)** | `clip_stream`, `capture_vod`, `score_stream_highlights`, `cut_and_reframe_clip`, `validate_clip`, `discover_streams`, `obs_command` | Audio-first VOD slicing, volume & chat spike detection, chyron-safe blur/stack framing, libass captions, OBS replay |
| **Motion Styles (3)** | `list_motion_styles`, `get_motion_style_prompt`, `analyze_and_assign_scene_styles` | 5-layer analytic style selector (RST, prosody, Markov transition graph), catalog browse across 108 procedural styles |
| **Faceless Shorts (2)** | `list_short_styles`, `create_short` | 6 vertical formats (3D anatomy, true crime noir, stick figure, paper atlas) |
| **Code Animation (6)** | `scaffold_animation_project`, `validate_storyboard`, `generate_scene_code`, `preview_scene`, `render_animation`, `verify_scene_quality` | Playwright canvas rendering, 12fps organic boil, closed-loop visual QA |
| **Audio Mastering (3)** | `mix_audio_pro`, `render_tts`, `multi_voice_tts` | EBU R128 (−14 LUFS) broadcast mastering, ducking, 13-type SFX kit |
| **Media & Speech (2)** | `ingest_url`, `transcribe_media` | Fast yt-dlp downloader & local Whisper word-level transcription |
| **Research & Queue (4)** | `research_topic`, `write_script`, `queue_full_pipeline`, `get_job_status` | Deep claim extraction, fact-checking, script generation, async worker |
| **Upstream & Bridges (3)** | `sync_upstream_skills`, `check_upstream_updates`, `external_platform_call` | Technique sync from frontier video repos & cloud provider bridges |

---

## 💻 Direct CLI Usage (Optional)

You can also use FrameForge straight from your terminal without an agent:

```bash
# Ingest any media from the web
npx -y @amg555/frameforge-mcp frameforge download "https://youtube.com/watch?v=..." --subtitles

# Transcribe speech with word-level timestamps via local Whisper
npx -y @amg555/frameforge-mcp frameforge transcribe ./recording.mp3 --format all

# Run interactive diagnostics check
npx -y @amg555/frameforge-mcp frameforge doctor
```

---

## 🤝 Collaboration, Architecture & Security

Looking for system architecture diagrams, security invariants, contributor workflows, or quality assurance gates?

👉 **Read the [Collaboration & Engineering Guide](docs/collaboration.md)**:
* **Architecture & Deployment:** Stdio, HTTP server, and Cloudflare Remote Workers.
* **Security Invariants:** Constant-time auth comparisons, SSRF blocklists, path traversal protection, credential redaction.
* **7-Gate Broadcast QC Standard:** Audio LUFS discipline, peak ceilings, and stream validation.
* **Upstream Synchronization:** Continuous tracking of frontier video repositories.
* **Testing:** Automated test suite (712 tests, 153 suites) and structural validator (113 checks).

---

## 📄 License

Distributed under the **MIT License**. See [`LICENSE`](LICENSE) for details. Built for creators and autonomous agents pushing the frontier of video production.