heristop/leclap

View on GitHub ↗

Deterministic video composition from one JSON template — renders on Node, in the browser via WebAssembly, and fully on-device on React Native. No server, no upload, no generative model. Agent-callable over MCP.

23 ★1 forksTypeScriptUpdated 18d ago

What you need to know

Deterministic, on-device, agent-callable video composition — one JSON template renders the same video on Node, in the browser (WebAssembly), and natively on React Native, with an MCP server that lets an AI agent author and render templates with no LLM in the output path (rendered, not sampled).

Install

mise install   # Node 24, pnpm 11, FFmpeg 8.1.1 + Rust
pnpm install
npx @leclap/cli init my-video

Usage

  • Describe a video in one Zod-validated JSON template: a global block plus sections, each with its own inputs, maps, filters pipeline and {{ variable }} placeholders.
  • Render on web (pnpm app:web, in-browser FFmpeg via WASM) or on-device (pnpm app:expo).
  • Starting from a creative-kit template, tweak text, colors, and media by prompt (MCP) or in the visual builder.
  • Drive it from an AI agent through the bundled @leclap/mcp server exposing schema, validate, compose, and probe tools.

Key features

  • Template-driven: one JSON descriptor to a complete video, no imperative FFmpeg wrangling.
  • Runs everywhere with a shared core: Node.js, browser (WASM), and React Native — reproducible per platform.
  • Capture, compose, render on-device (record from camera, trim/crop, mix music, add transitions).
  • Agent-callable MCP server with no LLM in the output path, so output is rendered, not sampled.
  • Bundled creative kit of polished on-device-safe templates; strict TypeScript and typed validation.

Best for

Teams and agents that want reproducible, server-free, programmatically authored video (prompt or hand-composed) that renders identically on phone and browser.

Caveats

  • Requires Node 24+ and pnpm 11 (use mise to pin the exact toolchain including FFmpeg 8.1.1).
  • Reproducibility is per platform, not across them — encoders differ (libx264 on Node/browser, libopenh264 on Android, h264_videotoolbox on iOS) and the on-device build drops boxblur and rewrites eq to lutyuv.
  • LeClap name and logo are trademarks (MIT covers code only) — forks must use a different name and not imply endorsement.
Platforms: Local · Web

Reviewed 2026-08-18

Topics

ai-agentsexpoffmpegffmpeg-wrapperleclapmcpmodel-context-protocolnodejson-devicereact-nativerusttypescriptvideo-compositionvideo-editingvideo-processingwasmwebassembly
Stars
23★
Forks
1
Language
TypeScript
License
MIT
Created
2023-12-26
Last push
2026-08-17