ShotNode Studio MCP Server
by naveen6768
README.md
<p align="center">
<img src="branding/shotnode-logo-full.png" alt="ShotNode Studio" width="480">
</p>
<h1 align="center">ShotNode Studio</h1>
<p align="center"><b>Agent-first video framework — describe a video, get a deterministic MP4 you can still edit.</b></p>
ShotNode Studio is the desktop/agent companion to the [ShotNode](../neo_cut_studio) mobile editor.
An AI agent builds the video as a **declarative ShotNode project** (plain JSON), ShotNode Studio
validates it, previews it frame-exactly, and renders it to MP4 **deterministically** — same project,
same assets, same output, every time. No cloud, no per-render fees, no account.
```
agent writes project.json → shotnode check → preview frames → (you approve) → shotnode render
```
## Why it looks like this
| Principle | What it means here |
|---|---|
| **Deterministic** | Every input is seeked/trimmed explicitly; `-bitexact`; fixed encoder presets. Randomness and wall-clock sources are forbidden by the validator. |
| **Editable by humans and agents** | The project is plain JSON with stable ids. Agents edit through a validated JSON Patch protocol — a bad patch is refused atomically, the file never corrupts. |
| **Human approval loop** | `check` → preview PNGs → you look → only then `render`. Preview and render never skip the gate. |
| **Local-first** | Everything runs on your machine with Node 22+ and FFmpeg. Nothing is uploaded, nothing phones home. |
| **Mobile twin** | The patch protocol mirrors the ShotNode mobile editor's timeline patch applier, so agent-authored projects translate to the app world model. |
## Quickstart
```bash
# prerequisites: Node 22+, FFmpeg on PATH (any build; drawtext/freetype NOT required)
npm install -g shotnode-studio
bash "$(npm root -g)/shotnode-studio/tools/setup_text_tool.sh" # one-time text renderer setup
shotnode doctor # verify the environment
bash examples/demo/make_demo.sh # builds + renders the demo project (fully synthetic media)
shotnode inspect demo
open ~/ShotNodeProjects/demo/renders/demo-good.mp4
node examples/mcp_motion_graphics.mjs # full motion-graphics teaser produced THROUGH the MCP tools end to end
```
The CLI and local MCP server are also available from the public npm registry.
## CLI
| Job | Commands |
|---|---|
| Start | `init <name> --width 1080 --height 1920` (vertical), `add-asset <project> <file>` |
| Read | `inspect <project>`, `projects`, `check <project> --json` |
| Edit | `apply <project> <patch.json>` (JSON Patch, validated atomically) |
| Look | `preview <project> --at 1.0,3.5` → PNGs in `frames/` |
| Ship | `render <project> --quality draft\|good\|delivery` → MP4 in `renders/`, ffprobe-verified summary |
| Operate | `doctor`, `version`, `mcp` (MCP server on stdio) |
Failure contract: every failure prints `✗ <what>` and a `Fix: <how>` hint, exits non-zero
(2 = validation, 1 = runtime). All commands accept `--json`.
## MCP server (ZCode / Claude / Codex / Cursor / Grok / any MCP client)
```bash
shotnode mcp # newline-delimited JSON-RPC 2.0 over stdio (also: node bin/shotnode.js mcp)
```
Registration snippets for every client (Claude Desktop, Codex, Cursor, ZCode, and the generic
stdio pattern for others): [docs/MCP_CLIENTS.md](docs/MCP_CLIENTS.md).
## Desktop app
`npm run app` launches ShotNode Studio Desktop — a two-engine shell:
- **Home** (paper/night chrome, accent packs) — start cards for new projects and a card grid of every
project under `~/ShotNodeProjects`, with kind chips, meta, and the generation prompt (`topic`) for
JSON-engine projects. Delete/reveal per card; handover via `open -b pro.shotnode.studio <dir>`.
- **Studio compositions** — new `composition` projects are HTML compositions opened in the **embedded
Studio editor** (visual timeline, live preview, code editor, catalog, renders) served by a local
studio server the app owns; the window loads it directly. First render downloads a managed Chrome
for Rendering into `~/.cache` (deterministic capture + ffmpeg encode).
- **Legacy JSON projects** — open in the built-in editor (sidebar, three-lane timeline, one-pass
filmstrip, inspector, check/assets tabs, Render MP4 with live progress). Same engine as the CLI
and MCP server — literally the same modules (`src/*`), mutations through the same validated tool
implementations, so desktop, agent and CLI edits are one document and one render.
- **Settings** — appearance (paper/night/system + green/sunset/ocean/mono accents), engine doctor
(ffmpeg, ffprobe, text tool, render browser), agent/MCP guide, about.
Shell patterns (bootstrap guards, `<domain>:<action` bridge, refusal envelope, theme boot, single
instance) follow the harvested desktop blueprint in `../KwaiCut_Editor_Harvest/captures/hyperframes_desktop/`.
Embedded editor attribution: see [NOTICE](NOTICE) (Apache-2.0 upstream stack, pinned 0.9.75).
```bash
npm run app # run the desktop app from source
npx electron . --screenshot out.png [--shot-view settings] [--shot-chrome paper] [--project name] [--shot-legacy]
npx electron-builder --dir # build the unpacked macOS .app into dist/ (npm run dist:dir)
```
12 tools: `shotnode_create_project`, `shotnode_list_projects`, `shotnode_get_project`,
`shotnode_add_asset`, `shotnode_apply_patch`, `shotnode_add_clip`, `shotnode_add_text`,
`shotnode_check_project`, `shotnode_preview_frame`, `shotnode_render_project`,
`shotnode_inspect_project`, `shotnode_probe_media`.
Agent registration (ZCode / Claude / Codex / Cursor / others): [docs/MCP_CLIENTS.md](docs/MCP_CLIENTS.md).
ZCode-specific setup: [docs/ZCODE_MCP_SETUP.md](docs/ZCODE_MCP_SETUP.md).
Full protocol notes: [docs/MCP.md](docs/MCP.md).
## Project format
A ShotNode project is a directory:
```
<project>/
├── project.json # the timeline document (the only source of truth)
├── assets/ # media copied in via add-asset
├── renders/ # MP4 outputs
└── frames/ # preview PNGs + text cache
```
`project.json` (v1) — one **visual** track (contiguous video/image chain joined by transitions),
N **overlay** tracks (text/image with enable windows and alpha fades), N **audio** tracks:
```json
{
"format": "shotnode-project",
"formatVersion": 1,
"name": "launch_teaser",
"resolution": { "width": 1920, "height": 1080 },
"fps": 30,
"background": "#000000",
"tracks": [
{ "id": "t_visual", "kind": "visual", "clips": [
{ "id": "c_a", "type": "video", "src": "assets/a.mp4", "start": 0, "duration": 4,
"transitionOut": { "type": "fadeblack", "duration": 0.5 } },
{ "id": "c_b", "type": "video", "src": "assets/b.mp4", "start": 3.5, "duration": 3 }
]},
{ "id": "t_overlay", "kind": "overlay", "clips": [
{ "id": "c_title", "type": "text", "text": "ShotNode", "start": 0.3, "duration": 2,
"style": { "position": "center", "fontSize": 140, "fadeIn": 0.4, "fadeOut": 0.5 } }
]},
{ "id": "t_audio", "kind": "audio", "clips": [
{ "id": "c_music", "type": "audio", "src": "assets/music.m4a", "start": 0, "duration": 6.5,
"volume": 0.35, "fadeOut": 1.2 }
]}
]
}
```
Transitions consume overlap: with a 0.5s `transitionOut`, the next visual clip starts at
`prev.start + prev.duration - 0.5`. Full schema, styles and the 27-transition catalog:
[docs/PROJECT_FORMAT.md](docs/PROJECT_FORMAT.md).
## Agent skills
Shipped in [.agents/skills/](.agents/skills) — the same skill structure the ShotNode agents
use everywhere: [`/shotnode`](.agents/skills/shotnode/SKILL.md) (orchestrator + work loop +
determinism contract), [`/shotnode-cli`](.agents/skills/shotnode-cli/SKILL.md),
[`/shotnode-registry`](.agents/skills/shotnode-registry/SKILL.md) (transitions, text presets,
recipes), [`/shotnode-mcp`](.agents/skills/shotnode-mcp/SKILL.md).
## Tests
```bash
bash test/e2e.sh # CLI end-to-end: synthetic assets → patch → check → preview → render → ffprobe
node test/mcp_smoke.mjs # MCP: handshake → tools → create/patch/check/preview/render
```
## Layout
```
bin/shotnode.js CLI entry
src/cli.js command dispatcher (failure contract, --json)
src/project.js project model, registry, assets
src/patch.js RFC 6901 JSON Patch subset (the agent edit protocol)
src/validate.js the `check` gate (schema, contiguity, transitions, assets)
src/render.js deterministic FFmpeg filtergraph compiler
src/text.js text → PNG (Pillow) bridge
src/mcp.js local MCP server (12 tools)
tools/ setup_text_tool.sh, text_to_png.py
branding/ logo (SVG + PNG)
docs/ format, MCP, ZCode setup
```
## Documentation
Full documentation lives in [docs/](docs) — start at the [documentation index](docs/index.md)
(agent-facing machine index: [docs/llms.txt](docs/llms.txt)):
- **Start here** — [What is ShotNode Studio?](docs/introduction.md) ·
[Make your first video](docs/quickstart.md) · [FAQ](docs/faq.md)
- **Guides** — the [work loop](docs/guides/work-loop.md), [vertical video](docs/guides/vertical-video.md),
[recipes](docs/guides/recipes.md), [transitions](docs/guides/transitions.md),
[text & captions](docs/guides/text-and-captions.md), [audio](docs/guides/audio.md),
[media](docs/guides/media.md), [determinism](docs/guides/determinism.md)
- **Agents** — [MCP setup for Claude/Codex/Cursor/Grok/ZCode](docs/MCP_CLIENTS.md) ·
[MCP protocol](docs/MCP.md) · [tool reference](docs/reference/mcp-tools.md) ·
[skills](docs/agents/skills.md)
- **Desktop** — [ShotNode Studio Desktop](docs/desktop/studio-app.md)
- **Reference** — [CLI](docs/reference/cli.md) · [project format](docs/PROJECT_FORMAT.md) ·
[patch protocol](docs/reference/patch-protocol.md) · [check gate](docs/reference/validation.md) ·
[render engine](docs/reference/render-engine.md) · [transitions catalog](docs/reference/transitions.md) ·
[text tool](docs/reference/text-tool.md) · [environment](docs/reference/environment.md)
- **Developers** — [architecture](docs/developers/architecture.md) · [testing](docs/developers/testing.md) ·
[contributing](docs/developers/contributing.md) · [deployment runbook](docs/DEPLOYMENT.md) ·
[MCP registry manifest](server.json)
- **Help** — [troubleshooting](docs/help.md)
## License
Apache-2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues