Video-Director-MCP
by PHPSmoker
README.md
# 🎬 AI Video Director MCP (`Video-Director-MCP`) — EN / PL
Local **MCP (Model Context Protocol)** server + **AI Director Skill** that turns your AI coding/agent assistant (Antigravity, Claude Desktop, Cursor, etc.) into a **100% local AI video editor**.
Instead of cutting blindly, the AI **detects audio/scene highlights**, **generates timestamped JPG storyboards and visually inspects them**, **batch-trims the best moments**, adds **30+ `xfade` transitions, frame-accurate Impact FX + synthesized SFX, and beat-aligned background music**, and **visually verifies the rendered MP4** — all locally via FFmpeg with zero cloud uploads.
---
## đź§© Required Companion Apps (Ecosystem)
This MCP server orchestrates the local FFmpeg engines from two open-source companion apps. **Both repositories are required:**
| App | Repository | Role in the AI Pipeline |
| --- | --- | --- |
| ✂️ **EventCut Studio** | [PHPSmoker/Video-Trimmer](https://github.com/PHPSmoker/Video-Trimmer) | Video probing, keyframe inspection, frame-exact (`precise`, H.264 CRF 15) and `lossless` (`-c copy`) batch trimming, portable FFmpeg/FFprobe binaries |
| 🎞️ **Video Montage Studio** | [PHPSmoker/Video-Montage](https://github.com/PHPSmoker/Video-Montage) | Multi-clip compilation rendering, 30+ `xfade` transitions, **Impact FX & SFX** (lens flare, punch zoom/shake, shockwave, RGB glitch, micro slow-mo + stereo SFX), continuous background music, `16:9` / `9:16` / `1:1` aspect ratio fitting, auto-batching (>12 clips) |
> **Zero-config auto-discovery:** If you clone all three repositories into the same parent folder, `Video-Director-MCP` automatically finds `Video-Trimmer` and `Video-Montage` — no path tweaking needed!
```text
workspace/
├── Video-Trimmer/ # https://github.com/PHPSmoker/Video-Trimmer
├── Video-Montage/ # https://github.com/PHPSmoker/Video-Montage
└── Video-Director-MCP/ # https://github.com/PHPSmoker/Video-Director-MCP
```
---
## 🇬🇧 Quick Start (English)
### 1. Clone all 3 repositories side-by-side
```bash
git clone https://github.com/PHPSmoker/Video-Trimmer.git
git clone https://github.com/PHPSmoker/Video-Montage.git
git clone https://github.com/PHPSmoker/Video-Director-MCP.git
```
> Make sure FFmpeg/FFprobe is available (either in system `PATH`, or simply launch `Video-Trimmer` (`START.bat`) or `Video-Montage` (`start.bat` / `start.sh`) once so portable FFmpeg binaries are downloaded automatically).
### 2. Install MCP server dependencies (Python 3.10+)
```bash
cd Video-Director-MCP
python -m venv .venv
```
- **Windows (PowerShell):**
```powershell
.\.venv\Scripts\pip install -r requirements.txt
```
- **macOS / Linux:**
```bash
./.venv/bin/pip install -r requirements.txt
```
### 3. Verify everything with the end-to-end smoke test
```powershell
# Windows
.\.venv\Scripts\python.exe test_smoke.py
# macOS / Linux
./.venv/bin/python test_smoke.py
```
If your companion apps live in custom folders, set environment variables before running:
- `VIDEO_TRIMMER_DIR` — path to `Video-Trimmer` (EventCut Studio)
- `VIDEO_MONTAGE_DIR` — path to `Video-Montage` (Video Montage Studio)
- `VIDEO_MONTAGE_OUTPUT_DIR` — optional custom output folder (defaults to `<VIDEO_MONTAGE_DIR>/output`)
### 4. Connect to your AI Client (MCP)
#### Option A: Antigravity (Recommended — includes AI Director Skill)
This repository ships with a ready-to-use Antigravity plugin bundle in [`plugin/video-director/`](plugin/video-director/) (`plugin.json`, `assets/logo.svg`, and the full director workflow in `skills/video-director/SKILL.md`):
1. Copy `plugin/video-director/` to your Antigravity plugins folder (e.g. `~/.gemini/config/plugins/video-director`).
2. Copy `mcp_config.example.json` to `mcp_config.json` inside that plugin folder and update the paths to your `.venv` Python, `server.py`, `Video-Trimmer`, and `Video-Montage`.
#### Option B: Claude Desktop / Cursor / Any MCP Client
Add to your MCP config (`claude_desktop_config.json`, `.cursor/mcp.json`, etc.) — see [`mcp_config.example.json`](mcp_config.example.json):
```json
{
"mcpServers": {
"video-director-mcp": {
"command": "/ABSOLUTE/PATH/TO/Video-Director-MCP/.venv/Scripts/python.exe",
"args": ["/ABSOLUTE/PATH/TO/Video-Director-MCP/server.py"],
"env": {
"PYTHONUTF8": "1",
"VIDEO_TRIMMER_DIR": "/ABSOLUTE/PATH/TO/Video-Trimmer",
"VIDEO_MONTAGE_DIR": "/ABSOLUTE/PATH/TO/Video-Montage"
}
}
}
}
```
*(On macOS/Linux use `.venv/bin/python` instead of `.venv/Scripts/python.exe`.)*
### How the AI Director Workflow Works
1. **Long Video → Highlight Reel / Short Clip:**
- Scans metadata (`probe_media`) & runs `detect_highlights` (audio RMS spikes + FFmpeg scene changes + 12-zone energy map).
- Generates macro + zoomed-in timestamped JPG storyboards (`extract_storyboard`) and **visually inspects them** before choosing cuts.
- Plans a **Hook → Build-up → Climax** narrative, batch-trims segments (`batch_trim_clips`), finds the best music drop (`analyze_music`), adds Impact FX + SFX on key action frames, renders the final MP4 (`render_montage`), and verifies the output visually (`preview_montage_result`).
2. **Folder of Short Clips → TikTok / Reels / Shorts / YouTube Compilation:**
- Scans all videos & music (`scan_media_folder`) and generates a single contact sheet (`extract_clips_overview`, up to 16 clips per sheet).
- Trims dead intros/outros, orders the shots for maximum pacing, applies `xfade` transitions (including per-cut overrides) + continuous music, and renders in `9:16`, `16:9`, `1:1`, or `auto` (`blur` / `crop` / `pad`).
### MCP Tools (12)
| Tool | Description |
| --- | --- |
| `studio_health` | Checks both companion engines (`Video-Trimmer` & `Video-Montage`) and FFmpeg/FFprobe |
| `scan_media_folder` | Scans a folder for video & audio files with duration, resolution, orientation, FPS, and audio info |
| `probe_media` | Reads detailed metadata for a single video/audio file (optionally including I-frame keyframes) |
| `detect_highlights` | Detects high-energy moments via audio RMS peaks + FFmpeg scene detection + 12-zone energy map |
| `analyze_music` | Analyzes a music track and suggests best `music_start` drop/high-energy timestamps |
| `extract_storyboard` | Renders a JPG frame grid with burned-in timestamps (full video or zoomed-in window) |
| `extract_clips_overview` | Renders a multi-clip overview sheet (1 row = 1 clip with filenames & timestamps, up to 16 clips) |
| `batch_trim_clips` | Batch-trims selected segments via **EventCut Studio** (`precise` CRF 15 or `lossless` `-c copy`) |
| `list_montage_options` | Lists all 30+ `xfade` transitions, **Impact FX** presets, colors, SFX presets, resolutions, fit modes & quality presets |
| `render_montage` | Renders the final MP4 via **Video Montage Studio** (transitions, Impact FX + SFX, continuous music, auto-batching) |
| `preview_montage_result` | Generates a QA storyboard of the rendered MP4 so the AI can visually verify framing and pacing |
| `open_output_folder` | Opens the output folder / highlights the rendered MP4 in your OS file manager |
### Example Prompts
- *"Turn this 20-minute gameplay recording into a punchy 45-second 9:16 TikTok highlight clip with Impact FX on the best goals and my music track."*
- *"Scan my clips folder, show me a storyboard plan of the best moments first, then trim and render a 16:9 YouTube montage with smooth transitions."*
- *"Find the most energetic drop in `track.mp3` and sync my best 8 clips to it."*
### FAQ (English)
<details>
<summary><strong>Does this upload my videos to any cloud service?</strong></summary>
No. All video/audio processing, FFmpeg rendering, trimming, and storyboard generation run 100% locally on your machine. Only lightweight JPG storyboard contact sheets (small thumbnails) are inspected by your multimodal AI agent to pick the best timestamps.
</details>
<details>
<summary><strong>Why does the AI need both Video-Trimmer and Video-Montage?</strong></summary>
Each app has a focused, battle-tested local FFmpeg engine: [EventCut Studio (Video-Trimmer)](https://github.com/PHPSmoker/Video-Trimmer) handles keyframe analysis and fast `precise` / `lossless` batch cutting, while [Video Montage Studio (Video-Montage)](https://github.com/PHPSmoker/Video-Montage) handles multi-clip `xfade` timelines, Impact FX + synthesized SFX, continuous music mixing, and automatic batching for large compilations. Both can also be used standalone with their own desktop web UIs!
</details>
<details>
<summary><strong>Are my original video files ever modified or overwritten?</strong></summary>
Never. Trimmed intermediate clips are saved in a temporary session folder (`work/trimmed/`), and rendered compilations are written as new MP4 files in the output directory.
</details>
---
## 🇵🇱 Szybki start (Polski)
Lokalny serwer **MCP (Model Context Protocol)** + **Skill AI ReĹĽysera**, ktĂłry zamienia Twojego agenta AI (Antigravity, Claude Desktop, Cursor itp.) w **w 100% lokalnego montaĹĽystÄ™ wideo**.
AI nie tnie „na ślepo” — najpierw **wykrywa najmocniejsze momenty (skoki audio + zmiany scen)**, **generuje storyboardy JPG z timestampami i ogląda je oczami**, **masowo przycina ujęcia**, dokłada **30+ przejść `xfade`, punktowe efekty Impact FX + dźwięki SFX i dopasowany podkład muzyczny**, a na koniec **wizualnie sprawdza gotowy plik MP4**.
### Wymagane aplikacje (ekosystem 3 projektĂłw)
Serwer MCP korzysta bezpośrednio z lokalnych silników FFmpeg dwóch otwartych aplikacji — **obie są wymagane**:
1. ✂️ **[EventCut Studio (`Video-Trimmer`)](https://github.com/PHPSmoker/Video-Trimmer)** — odczyt metadanych, klatki kluczowe, masowe cięcie `precise` (co do klatki, CRF 15) i bezstratne `lossless` (`-c copy`) oraz przenośne binarki FFmpeg/FFprobe.
2. 🎞️ **[Video Montage Studio (`Video-Montage`)](https://github.com/PHPSmoker/Video-Montage)** — montaż z 30+ przejściami `xfade`, efekty punktowe **Impact FX & SFX** (lens flare, punch zoom + shake, shockwave, RGB glitch, micro slow-mo + dźwięki SFX), ciągły podkład muzyczny, formaty `16:9` / `9:16` / `1:1` (`blur` / `crop` / `pad`) i automatyczny batching powyżej 12 klipów.
### Instalacja krok po kroku
1. **Sklonuj wszystkie 3 repozytoria obok siebie w jednym folderze** (wtedy serwer wykryje je automatycznie bez ustawiania ścieżek):
```bash
git clone https://github.com/PHPSmoker/Video-Trimmer.git
git clone https://github.com/PHPSmoker/Video-Montage.git
git clone https://github.com/PHPSmoker/Video-Director-MCP.git
```
*(Upewnij się, że masz FFmpeg w `PATH` albo uruchom raz `START.bat` w `Video-Trimmer` / `start.bat` w `Video-Montage`, żeby przenośny FFmpeg pobrał się automatycznie).*
2. **Utwórz środowisko wirtualne i zainstaluj pakiety (`requirements.txt`):**
```powershell
cd Video-Director-MCP
python -m venv .venv
.\.venv\Scripts\pip install -r requirements.txt
```
3. **Uruchom test smoke (sprawdza oba silniki + cały pipeline end-to-end):**
```powershell
.\.venv\Scripts\python.exe test_smoke.py
```
4. **Podłącz do Antigravity / Claude Desktop / Cursor:**
- W folderze [`plugin/video-director/`](plugin/video-director/) znajdziesz gotowÄ… paczkÄ™ pluginu do **Antigravity** (z instrukcjÄ… reĹĽyserskÄ… `SKILL.md` i ikonÄ… `logo.svg`).
- Przykładową konfigurację MCP znajdziesz w [`mcp_config.example.json`](mcp_config.example.json).
- Jeśli trzymasz aplikacje w innych katalogach niż obok siebie, ustaw zmienne środowiskowe `VIDEO_TRIMMER_DIR`, `VIDEO_MONTAGE_DIR` oraz opcjonalnie `VIDEO_MONTAGE_OUTPUT_DIR`.
### Przykładowe polecenia do AI
- *„Zrób dynamiczny 45-sekundowy klip 9:16 z najlepszych momentów mojego długiego nagrania, dodaj Impact FX przy najmocniejszych akcjach i podkład z pliku `muzyka.mp3`.”*
- *„Przejrzyj folder z moimi krótkimi klipami, wytnij nudne wstępy i zmontuj kompilację na YouTube 16:9 z płynnymi przejściami.”*
- *„Wykryj najbardziej emocjonujące momenty w moim filmie i pokaż mi plan ze storyboardem do zatwierdzenia przed montażem.”*
### FAQ (Polski)
<details>
<summary><strong>Czy moje filmy są gdziekolwiek wysyłane do chmury?</strong></summary>
Nie. Całe przetwarzanie wideo, cięcie, efekty i renderowanie FFmpeg odbywa się w 100% lokalnie na Twoim komputerze. Agent AI ogląda jedynie lekkie, wygenerowane lokalnie arkusze miniatur JPG (storyboardy), żeby świadomie wybrać najlepsze sekundy cięcia i punkty uderzeń `(X, Y)`.
</details>
<details>
<summary><strong>Czy oryginalne nagrania mogą zostać nadpisane albo usunięte?</strong></summary>
Nigdy. Przycięte wycinki trafiają do roboczego folderu sesji (`work/trimmed/`), a gotowy film zapisuje się jako nowy plik MP4 w folderze `output/`.
</details>
<details>
<summary><strong>Czy mogę używać EventCut Studio i Video Montage Studio także ręcznie (z interfejsem)?</strong></summary>
Tak! Obie aplikacje ([Video-Trimmer](https://github.com/PHPSmoker/Video-Trimmer) oraz [Video-Montage](https://github.com/PHPSmoker/Video-Montage)) to pełnoprawne, samodzielne aplikacje z nowoczesnym interfejsem webowym PL/EN — ten serwer MCP pozwala dodatkowo oddać ich silniki pod kontrolę agenta AI.
</details>
---
## License
[MIT](LICENSE)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues