Dastaan MCP Server
README.md
# Dastaan for agents
Short videos for founders, made by an agent from the founder's own words: a `dastaan` CLI and MCP server, five
task skills and the `dastaan-director` agent, packaged as a Claude Code plugin and a Codex plugin.
**Local mode** renders on your machine with the same engine the Dastaan app uses. There is no account and no cost,
and nothing is uploaded. Hosted mode (a Dastaan account, a link that opens a video in the app, your library) comes
in phase 2.
## What is in it
| Part | What it does |
|---|---|
| `dastaan` CLI (`bin/dastaan.mjs`) | Every tool as a command, plus `mcp`, `doctor`, `guide`, `list` |
| MCP server (`dastaan mcp`, stdio) | `dastaan_brief`, `_look`, `_edit`, `_hooks`, `_style`, `_check`, `_render`, `_open`, `_brand` |
| `skills/dastaan-video` | A brief becomes a finished video |
| `skills/dastaan-edit` | Change a video with one patch, re-render |
| `skills/dastaan-look` | Design a look (scene package), or dress a video in one of six |
| `skills/dastaan-hooks` | Alternative openings by hook type, previewed side by side |
| `skills/dastaan-brand` | Brand colour and logo from a site or logo file, confirmed with the founder |
| `agents/dastaan-director.md` (`codex/agents/*.toml`) | The agent that does the whole job and hands back the MP4s |
## The tool contract
- **The model writes; Dastaan does the rest.** The connected model writes a script: words, and what each scene is
for. Dastaan lays it out, solves readable colours from one brand colour, times it, and renders every size
(9:16, 4:5, 1:1, 16:9) in English and Arabic.
- **Only the founder's facts.** Every word, number and name on screen is held to the brief, the numbers the founder
gave, and their CSV. Anything else is refused by scene and field.
- **Refusals carry the repair.** Each one is `{ok: false, code, ..., repair}`, and names what to change.
- **A session folder** (`DASTAAN_SESSION`, default `~/Dastaan`) holds each video's `video.json`, pictures, frame
sheets and MP4s. The CLI and the MCP server share it.
- **Gates.** These are the app's gates: the format, the composition of every frame, contrast and length. A look's
slots fit or are refused by name.
## Requirements
Node 20+, `ffmpeg` and `rsvg-convert` (librsvg). `dastaan doctor` checks all three and the engine pin.
## The engine
`engine/` is the motion engine: the wasm core, the motion tools and director, and the scene-pack kit with its six
looks. It is copied unchanged from one siliq-rotor commit and pinned by SHA-256 in `engine/SOURCES.sha256`.
Refresh it with `./vendor.sh <siliq-rotor checkout>`. Until the engine is published as a package, this pinned copy is
the dependency. Licence: Apache-2.0.
## Tests
```bash
npm test # unit, plugin and skill happy-path tests
node --test test/dastaan.test.mjs
node --test test/skills.test.mjs # DA-104: each SKILL.md happy path to a frame sheet and an MP4
```
Install: see `INSTALL.md`. The plugin installs from git as plain files, with the server and engine bundled and no npm. `npm pack` is an optional extra channel.