Metadata-Version: 2.5
Name: video-generation-mcp
Version: 0.1.0
Summary: MCP server for automated video generation and tech reels
Author-email: salinda hulangamuwa <salindahulangamuwa3@gmail.com>
Requires-Python: >=3.10
Requires-Dist: fastmcp<3,>=2.10
Requires-Dist: httpx>=0.27
Requires-Dist: numpy>=1.26
Requires-Dist: pillow>=10
Requires-Dist: playwright>=1.40.0
Requires-Dist: pocketsphinx>=5.1
Description-Content-Type: text/markdown

# bitxbyte-studio MCP server

Makes BitXbyte "tech explained" reels end to end: script → Gemini voice → line timings → 3D (three.js) or 2D (phone-mockup) visuals → stills check → background render → music mix → final mp4.
Lives in `BitXbyteStudio/studio-mcp/` and works on the folders in `BitXbyteStudio/reels/`. Posting stays with the facebook MCP (`create_reel`).

## Tools
| Tool | Does |
|---|---|
| `list_reels`, `reel_status` | What exists, what is done, the next step |
| `create_reel(slug, title, engine='3d', template='blank'|'360-camera')` | New reel folder with starter code |
| `write_script(reel, lines, title, caption, comment)` | Save narration + caption; warns about long lines / digits |
| `generate_voice(reel, voice='Iapetus')` | Gemini TTS → `voice.wav` (key from `BitXbyteStudio/.env`) |
| `align_voice(reel)`, `set_line_times(reel, times)` | When each line is spoken → `vo_times.json` (+ `3d/timing.js`) |
| `list_files`, `read_file`, `write_file` | Read/write reel code (`3d/*.js`, `scenes.js`, `reel.json`) |
| `render_stills(reel, times)` | Contact sheet image of chosen frames — look before rendering |
| `start_render`, `render_status`, `cancel_render` | Full render in the background (+ music/voice mix) |
| `finish_reel(reel)` | Re-mix music + voice onto the rendered video |
| `preview_video(reel)`, `compress_video(reel, max_mb)` | Check the final mp4; make a smaller copy |

## 3D reel contract (files in `<reel>/3d/`, loaded in the order of `reel.json` → `files`)
- `world.js` — build the scene (`scene`, `R`, `ENV`, `cam` exist already).
- `pipeline.js` (optional) — `PANELS.<kind> = p => {...}` draws a panel inside its rectangle; `WARM.push(fn)` runs once before frame 0.
- `shots.js` — `const SHOTS=[{at:T(line, offset), f(lt){...}}]`; `RESET.push(fn)` clears per-frame state.
- Helpers: `look(pos, target, fov)`, `orbit(r, h, angle)`, `topLook(h)`, `W2S(point)`, `E()`/`O()` easing, `V(x,y,z)`,
  overlay `ov.callout / tag / frame / ring / cross / line / rect / big / brand`. `S.mainVP` = 3D viewport, `S.panels` = extra views.
- `templates/360-camera` is the full worked example (simulated fisheye cameras, top-down mapping, stitching).

## Install on the Mac (once)
1. `brew install ffmpeg` (skip if `ffmpeg -version` works).
2. Browser for rendering: `uv run --with playwright==1.56.0 playwright install chromium`
3. Add to `~/Library/Application Support/Claude/claude_desktop_config.json` under `mcpServers`
   (use the same `uv` path as your `bitxbyte-voice` entry):
   ```json
   "bitxbyte-studio": {
     "command": "uv",
     "args": ["run", "--script", "/Users/user/Movies/BitXbyteStudio/studio-mcp/server.py"]
   }
   ```
4. Quit Claude (Cmd+Q) and reopen. First start downloads Python packages (~1 min).

Env options: `BX_GL=gpu|swiftshader` (default: GPU on Mac, falls back to software), `BX_STUDIO=<path>` (default: parent folder).
