Metadata-Version: 2.4
Name: vidmcp
Version: 1.1.0
Summary: AI video editing MCP server — SAM 3.1 segmentation, behind-the-subject VFX, education scenes
Project-URL: Homepage, https://vidmcp.com
Project-URL: Documentation, https://github.com/dhirajlochib/VidMcp#readme
Project-URL: Repository, https://github.com/dhirajlochib/VidMcp
Project-URL: Issues, https://github.com/dhirajlochib/VidMcp/issues
Author-email: Dhiraj Lochib <dhirajch145@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: ai,education,mcp,sam3,segmentation,vfx,video
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Requires-Dist: av>=12.0
Requires-Dist: fastmcp>=2.0.0
Requires-Dist: ffmpeg-python>=0.2.0
Requires-Dist: filelock>=3.15
Requires-Dist: httpx>=0.27
Requires-Dist: mcp>=1.6.0
Requires-Dist: numpy>=1.26
Requires-Dist: opencv-python-headless>=4.9
Requires-Dist: orjson>=3.10
Requires-Dist: pillow>=10.3
Requires-Dist: pydantic-settings>=2.3
Requires-Dist: pydantic>=2.7
Requires-Dist: rich>=13.7
Requires-Dist: structlog>=24.1
Requires-Dist: tenacity>=8.3
Requires-Dist: typing-extensions>=4.12
Requires-Dist: uuid6>=2024.7.10
Provides-Extra: all
Requires-Dist: build>=1.2; extra == 'all'
Requires-Dist: faster-whisper>=1.0.0; extra == 'all'
Requires-Dist: huggingface-hub>=0.24; extra == 'all'
Requires-Dist: manim>=0.18.0; extra == 'all'
Requires-Dist: mediapipe>=0.10.0; extra == 'all'
Requires-Dist: mlx-vlm==0.4.3; extra == 'all'
Requires-Dist: mlx>=0.20; extra == 'all'
Requires-Dist: pytest-asyncio>=0.23; extra == 'all'
Requires-Dist: pytest-cov>=5.0; extra == 'all'
Requires-Dist: pytest>=8.2; extra == 'all'
Requires-Dist: ruff>=0.5; extra == 'all'
Requires-Dist: torch>=2.2; extra == 'all'
Requires-Dist: torchvision>=0.17; extra == 'all'
Requires-Dist: twine>=5.0; extra == 'all'
Requires-Dist: ultralytics>=8.3.237; extra == 'all'
Provides-Extra: asr
Requires-Dist: faster-whisper>=1.0.0; extra == 'asr'
Provides-Extra: creator
Requires-Dist: faster-whisper>=1.0.0; extra == 'creator'
Requires-Dist: mediapipe>=0.10.0; extra == 'creator'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.2; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Provides-Extra: mlx
Requires-Dist: huggingface-hub>=0.24; extra == 'mlx'
Requires-Dist: mlx-vlm==0.4.3; extra == 'mlx'
Requires-Dist: mlx>=0.20; extra == 'mlx'
Provides-Extra: sam
Requires-Dist: huggingface-hub>=0.24; extra == 'sam'
Requires-Dist: torch>=2.2; extra == 'sam'
Requires-Dist: torchvision>=0.17; extra == 'sam'
Requires-Dist: ultralytics>=8.3.237; extra == 'sam'
Provides-Extra: scenes
Requires-Dist: manim>=0.18.0; extra == 'scenes'
Description-Content-Type: text/markdown

<p align="center">
  <img src="https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/07_creator_polish.gif" width="640" alt="VidMCP 1.1 Creator polish" />
</p>

<h1 align="center">VidMCP</h1>

<p align="center">
  <em>Agents don’t describe video. They cut it.</em>
</p>

<p align="center">
  <a href="https://vidmcp.com"><img alt="Website" src="https://img.shields.io/badge/vidmcp.com-d4ff2a?style=flat-square&labelColor=050507&color=d4ff2a" /></a>
  <a href="https://pypi.org/project/vidmcp/"><img alt="PyPI" src="https://img.shields.io/badge/PyPI-2affd1?style=flat-square&labelColor=050507" /></a>
  <a href="https://dhirajlochib.com/"><img alt="Author" src="https://img.shields.io/badge/Dhiraj%20Lochib-b18cff?style=flat-square&labelColor=050507" /></a>
  <img alt="Python" src="https://img.shields.io/badge/Python_3.11+-ffa24e?style=flat-square&labelColor=050507" />
  <img alt="License" src="https://img.shields.io/badge/MIT-efefeb?style=flat-square&labelColor=050507" />
</p>

<p align="center">
  <b>MCP server</b> for agent video editing — mattes · behind-the-subject VFX · audio polish · captions · export<br/>
  Built by <a href="https://dhirajlochib.com/">Dhiraj Lochib</a> · <a href="https://vidmcp.com">vidmcp.com</a> · <code>uv tool install vidmcp</code>
</p>

---

## Creator polish pipeline

One call for a publish-ready talk-head:

```text
orient → denoise → BGM → captions → optional BG replace → export preset
```

| Tool | What it does |
|------|----------------|
| `run_talking_head_polish` | Full recipe in one shot |
| `process_audio` | Denoise · gate · EQ · loudnorm |
| `mix_bgm` | Ambient pad under voice (ducking) |
| `transcribe_and_caption` | Whisper words + brand burn-in |
| `replace_background` | Matte + space / blur / solid plate |
| `smart_cut_hesitations` | Dead air & filler removal |
| `export_render` | `youtube_16x9` · `reels_9x16` · `square_1x1` |
| `import_video` | **Bakes portrait rotation** upright by default |

```python
from vidmcp.tools.creator import run_talking_head_polish

print(run_talking_head_polish(
    "talk.mov",
    preset="reels_9x16",
    bg_mode="space",   # none | space | blur | solid
    strength=0.75,
    bgm_volume=0.35,
))
```

MCP agents can also call `apply_recipe(..., recipe_name="talking_head_polish")` or free-text `run_intent(...)`.

### Agent context (tool packs + compact results)

Agents drown when MCP hosts load **~90 tool schemas** and fat JSON. VidMCP defaults to a small surface:

| Setting | Default | Purpose |
|---------|---------|---------|
| `VIDMCP_TOOL_PACK` | `talking_head` | Expose only the tools for that product path |
| `VIDMCP_COMPACT` | `1` | Drop heavy keys / truncate long payloads |
| `VIDMCP_MAX_RESULT_CHARS` | `4000` | Hard cap on serialized tool results |

**Packs:** `talking_head` · `education` · `vfx` · `admin` · `all`

```text
run_intent("polish talk head for reels, space bg, cut fillers", video_path="talk.mov")
project_brief(project_id)          # prefer over full get_project
list_tool_packs() / set_tool_pack("vfx")
get_project(id, detail=true)       # full manifest only when needed
```

Recipes: `talking_head_polish` · `talking_head_reels` · `talking_head_space` · `talking_head_tight` · `talking_head_infographics`.

For full surface (debug): `VIDMCP_TOOL_PACK=all`.

---

## Gallery

<p align="center">
  <img src="https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/07_creator_polish.gif" width="560" alt="Creator 1.1" /><br/>
  <sub><b>1.1 Creator polish</b> — orient · denoise · BGM · captions · export</sub>
</p>

<table>
  <tr>
    <td align="center" width="50%">
      <img src="https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/03_behind_subject.gif" width="100%" alt="Behind subject" /><br/>
      <sub><b>Behind the subject</b></sub>
    </td>
    <td align="center" width="50%">
      <img src="https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/02_tesseract.gif" width="100%" alt="Tesseract" /><br/>
      <sub><b>Tesseract</b> · 4D trails</sub>
    </td>
  </tr>
  <tr>
    <td align="center" width="50%">
      <img src="https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/01_flowfield.gif" width="100%" alt="Flow" /><br/>
      <sub><b>Flow field</b></sub>
    </td>
    <td align="center" width="50%">
      <img src="https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/05_unit_circle.gif" width="100%" alt="Unit circle" /><br/>
      <sub><b>Unit circle</b></sub>
    </td>
  </tr>
</table>

| Sample | GIF | MP4 |
|--------|-----|-----|
| **Creator polish** | [gif](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/07_creator_polish.gif) | [mp4](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/07_creator_polish.mp4) |
| Flow field | [gif](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/01_flowfield.gif) | [mp4](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/01_flowfield.mp4) |
| Tesseract | [gif](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/02_tesseract.gif) | [mp4](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/02_tesseract.mp4) |
| Behind the subject | [gif](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/03_behind_subject.gif) | [mp4](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/03_behind_subject.mp4) |
| Kinetic | [gif](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/04_kinetic.gif) | [mp4](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/04_kinetic.mp4) |
| Unit circle | [gif](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/05_unit_circle.gif) | [mp4](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/05_unit_circle.mp4) |
| Pipeline | [gif](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/06_pipeline.gif) | [mp4](https://raw.githubusercontent.com/dhirajlochib/VidMcp/main/demos/samples/06_pipeline.mp4) |

---

## Install

**Needs:** Python 3.11+, [ffmpeg](https://ffmpeg.org/), [uv](https://docs.astral.sh/uv/) recommended

```bash
uv tool install vidmcp
vidmcp --doctor

# or
pip install 'vidmcp[creator]'   # + faster-whisper + mediapipe
```

### MCP (Grok / Claude / Cursor)

```bash
# Grok
grok mcp add vidmcp \
  -e VIDMCP_SAM_BACKEND=mock \
  -e VIDMCP_WORKSPACE_ROOT=$HOME/vidmcp-workspaces \
  -e VIDMCP_TOOL_PACK=talking_head \
  -e VIDMCP_COMPACT=1 \
  -- uvx vidmcp
```

```json
{
  "mcpServers": {
    "vidmcp": {
      "command": "uvx",
      "args": ["vidmcp"],
      "env": {
        "VIDMCP_SAM_BACKEND": "mock",
        "VIDMCP_WORKSPACE_ROOT": "/path/to/workspaces",
        "VIDMCP_TOOL_PACK": "talking_head",
        "VIDMCP_COMPACT": "1"
      }
    }
  }
}
```

Optional real matte on Apple Silicon:

```bash
pip install 'vidmcp[mlx]'
export VIDMCP_SAM_BACKEND=mlx
export VIDMCP_MLX_MODEL_ID=mlx-community/sam3.1-bf16
```

---

## Core product

| | |
|---|---|
| **Segment** | Text-prompt subject matte (SAM / MLX / MediaPipe / mock) |
| **Compose** | Effects *behind* the subject |
| **Audio** | Denoise, enhance, BGM duck, loudnorm |
| **Captions** | Whisper timeline + brand burn-in |
| **Educate** | Math plates + speech-locked scenes |
| **Export** | 16:9 · 9:16 · 1:1 without stretch |

```text
create_project → import_video (orient)
  → process_audio → mix_bgm
  → segment_subject | replace_background
  → transcribe_and_caption → export_render
```

Prefer high-level paths: `run_talking_head_polish` · `apply_recipe` · `run_quality_gated_pipeline`.

---

## Project layout

```text
src/vidmcp/     MCP server, creator tools, perception, effects
demos/samples/  GIFs · MP4s for README & site
site/           vidmcp.com (static Hostinger)
configs/        Claude / Cursor snippets
```

---

## Author

**Dhiraj Lochib** — Full-Stack, Blockchain, AI  
[dhirajlochib.com](https://dhirajlochib.com/) · [GitHub](https://github.com/dhirajlochib) · [LinkedIn](https://www.linkedin.com/in/dhirajlochib-dev/) · dhirajch145@gmail.com

---

## License

[MIT](LICENSE)
