MCP server group wrapping FFmpeg/OTIO. Provides primitives to manipulate video editing workflows from AI agents.
Project description
Clipwright
For Japanese, see README.ja.md.
MCP server group wrapping FFmpeg/OTIO. Provides primitives to manipulate video editing workflows from AI agents.
Prerequisite: FFmpeg
Clipwright requires ffprobe (runtime) and ffmpeg (test fixture generation) on PATH. Binaries are not included.
Installation (Windows / WinGet)
winget install Gyan.FFmpeg
PATH takes effect after shell restart. When using with Claude Code, restart the app for PATH to become active.
If you cannot wait for a restart, specify environment variables directly:
# runtime: ffprobe only
export CLIPWRIGHT_FFPROBE="C:/Users/<user>/AppData/Local/Microsoft/WinGet/Packages/Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe/ffmpeg-8.1.1-full_build/bin/ffprobe.exe"
# test: both ffmpeg + ffprobe (for test fixture generation)
export CLIPWRIGHT_FFMPEG="C:/Users/<user>/AppData/Local/Microsoft/WinGet/Packages/Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe/ffmpeg-8.1.1-full_build/bin/ffmpeg.exe"
Environment Variable Usage
| Variable | Purpose |
|---|---|
CLIPWRIGHT_FFPROBE |
Runtime only. Used by the clipwright_inspect_media tool |
CLIPWRIGHT_FFMPEG |
Test only. Used by the sample_media fixture in conftest.py |
Runtime depends only on ffprobe. ffmpeg is used only for test fixture generation (design: [DC-AM-008]).
Development Environment Setup
# Install dependencies
uv sync --dev
# Run tests (with coverage)
uv run pytest --cov=clipwright --cov-report=term-missing
# lint / format
uv run ruff check src tests
uv run ruff format src tests
# Type checking
uv run mypy src
Integration Test Prerequisites
To run integration tests (tests that actually invoke ffprobe/ffmpeg), ffmpeg / ffprobe must exist on PATH or the following environment variables must be set:
# Specify path to ffprobe (used by runtime and integration tests)
export CLIPWRIGHT_FFPROBE="/path/to/ffprobe"
# Specify path to ffmpeg (used for test fixture generation)
export CLIPWRIGHT_FFMPEG="/path/to/ffmpeg"
If ffmpeg / ffprobe are already registered in PATH, setting environment variables is not required. If neither is found, integration tests are automatically skipped.
Development Notes: MCP Package
Adopted Package
Official MCP Python SDK (mcp[cli]) is adopted (ADR-5 confirmed).
mcp[cli]>=1.27.2
Importable via from mcp.server.fastmcp import FastMCP. Verified to work on Python 3.11 / Windows.
Annotation Syntax (Adopted Version)
from mcp.server.fastmcp import FastMCP
from mcp.types import ToolAnnotations
mcp = FastMCP("clipwright")
@mcp.tool(
annotations=ToolAnnotations(
readOnlyHint=True,
destructiveHint=False,
idempotentHint=True,
openWorldHint=False,
)
)
def clipwright_inspect_media(path: str) -> dict:
"""Probe a media file and return its information."""
...
ToolAnnotations fields: title, readOnlyHint, destructiveHint, idempotentHint, openWorldHint
outputSchema / structured_output
When mcp.tool(structured_output=True) is specified, Pydantic model return values are reflected in outputSchema as JSON Schema.
from pydantic import BaseModel
class MediaResult(BaseModel):
ok: bool
summary: str
@mcp.tool(structured_output=True)
def clipwright_inspect_media(path: str) -> MediaResult:
...
MCP Inspector Communication Procedure
How to manually verify the server using MCP Inspector (@modelcontextprotocol/inspector).
Setup (Node.js Required)
# Verify Node.js is installed
node --version
npx --version
Starting the Server and Connecting
# Start MCP Inspector and connect the server via stdio
npx @modelcontextprotocol/inspector uv run python -m clipwright.server
Browser opens automatically at http://localhost:5173 (or access manually).
The tool list (clipwright_init_project / clipwright_inspect_media / clipwright_read_timeline / clipwright_write_timeline) appears in Inspector, and you can manually execute each tool.
Expected Behavior
- 4 tools appear in the tool list
- Passing a non-existent path to
clipwright_inspect_mediareturns an error envelope withok=false - If ffprobe is not set in PATH / environment variables, a
DEPENDENCY_MISSINGerror is returned
Architecture Overview
src/clipwright/
__init__.py # Version definition
schemas.py # Shared Pydantic types (contract surface)
envelope.py # Return value envelope + error formatting
errors.py # Error codes + ClipwrightError exception
process.py # Subprocess runner (shell=False / timeout required)
media.py # ffprobe wrapper
otio_utils.py # OTIO helpers
operations.py # Declarative edit operation types + application logic
project.py # Project directory management
server.py # FastMCP server (4 tools exposed)
Dependency direction: schemas / envelope / errors (contract surface) → process / media / otio_utils / project → operations → server
For details, see docs/clipwright-spec.md.
MCP Client Registration
Each clipwright tool is a standalone MCP server. Register them in your MCP client configuration (.mcp.json / claude_desktop_config.json):
{
"mcpServers": {
"clipwright": {
"command": "clipwright-mcp",
"env": {
"CLIPWRIGHT_FFMPEG": "/path/to/ffmpeg",
"CLIPWRIGHT_FFPROBE": "/path/to/ffprobe"
}
},
"clipwright-render": {
"command": "clipwright-render",
"env": {
"CLIPWRIGHT_FFMPEG": "/path/to/ffmpeg"
}
}
}
}
Set CLIPWRIGHT_FFMPEG and CLIPWRIGHT_FFPROBE environment variables if ffmpeg is not in PATH.
License
MIT — See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clipwright-0.2.0.tar.gz.
File metadata
- Download URL: clipwright-0.2.0.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59c9c391f2dc5d3e6a924540e4dfc4c7b4e188e8e9362cc43fb994ceff44eeff
|
|
| MD5 |
e8c8fa826c1cd36b6729e579341ce0f3
|
|
| BLAKE2b-256 |
c588512abcebe72b998353b496ce1fb401bf47794e9204bed3f7a1c70e0d8534
|
Provenance
The following attestation bundles were made for clipwright-0.2.0.tar.gz:
Publisher:
publish.yml on satoh-y-0323/clipwright
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clipwright-0.2.0.tar.gz -
Subject digest:
59c9c391f2dc5d3e6a924540e4dfc4c7b4e188e8e9362cc43fb994ceff44eeff - Sigstore transparency entry: 1811267073
- Sigstore integration time:
-
Permalink:
satoh-y-0323/clipwright@73178896331134a14fe392f83347393b74aecd90 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/satoh-y-0323
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@73178896331134a14fe392f83347393b74aecd90 -
Trigger Event:
push
-
Statement type:
File details
Details for the file clipwright-0.2.0-py3-none-any.whl.
File metadata
- Download URL: clipwright-0.2.0-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
081535e772a6b4812c725dad8abf915d9ebe1e9bdba1e1fb3cebe286ad8f5d43
|
|
| MD5 |
8c5bf097706c1997bc309e0b4f53cb4f
|
|
| BLAKE2b-256 |
8c53d02ae253f6727ad7825dccbfaae31d6cbd27c29bdfc97ac10b91958f463b
|
Provenance
The following attestation bundles were made for clipwright-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on satoh-y-0323/clipwright
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clipwright-0.2.0-py3-none-any.whl -
Subject digest:
081535e772a6b4812c725dad8abf915d9ebe1e9bdba1e1fb3cebe286ad8f5d43 - Sigstore transparency entry: 1811267193
- Sigstore integration time:
-
Permalink:
satoh-y-0323/clipwright@73178896331134a14fe392f83347393b74aecd90 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/satoh-y-0323
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@73178896331134a14fe392f83347393b74aecd90 -
Trigger Event:
push
-
Statement type: