MCP tool for explicit keep/drop range selection and OTIO timeline generation. Accepts time ranges in seconds and produces a kept-range OTIO timeline compatible with clipwright-render.
Project description
clipwright-trim
MCP tool for explicit keep/drop range selection and OTIO timeline generation. Accepts user-defined time ranges in seconds and produces a kept-range OTIO timeline that clipwright-render can use for precise, non-destructive video editing.
Overview
- Input: Media file (video or audio), output OTIO path, optional keep/drop range specification
- Process: Validates ranges against media duration (via ffprobe), applies padding, builds a kept-range OTIO timeline using the same structure as clipwright-silence output
- Output: New OTIO file with KEEP intervals; input media is never modified (non-destructive, readOnly)
MCP Tool
clipwright_trim
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
media |
string |
required | Input media file path (video or audio) |
output |
string |
required | Output OTIO timeline file path (.otio extension) |
options |
object |
null |
TrimOptions (see below) |
TrimOptions
| Field | Type | Default | Description |
|---|---|---|---|
keep |
array[TrimRange] |
[] |
Ranges to retain, in enumeration order. Mutually exclusive with drop. |
drop |
array[TrimRange] |
[] |
Ranges to remove; complement becomes the kept region. Mutually exclusive with keep. |
padding_sec |
float |
0.0 |
Non-negative padding (seconds) applied to each range boundary. In keep mode, expands outward; in drop mode, shrinks inward. |
TrimRange
| Field | Type | Constraints | Description |
|---|---|---|---|
start_sec |
float |
>= 0 |
Range start time in seconds from media start |
end_sec |
float |
> start_sec |
Range end time in seconds from media start |
Return Value
{
"ok": true,
"summary": "Kept 2 clip(s) totalling 45.0 s out of 120.0 s source duration (mode: keep).",
"data": {
"clip_count": 2,
"kept_duration_sec": 45.0,
"source_duration_sec": 120.0,
"mode": "keep"
},
"artifacts": [
{"role": "timeline", "path": "/path/to/output.otio", "format": "otio"}
],
"warnings": []
}
Requirements
- Python 3.11+
- ffprobe (path resolved via
CLIPWRIGHT_FFPROBEenvironment variable orPATH) - ffmpeg is not required (this tool produces OTIO only; rendering is
clipwright-render's responsibility)
Usage with MCP
Register in your MCP client configuration:
{
"mcpServers": {
"clipwright-trim": {
"command": "clipwright-trim",
"env": {
"CLIPWRIGHT_FFPROBE": "/path/to/ffprobe"
}
}
}
}
License
MIT
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_trim-0.1.0.tar.gz.
File metadata
- Download URL: clipwright_trim-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b86d5bf66c49459204dd330d9c26df7cfdb27ddafd097d635c9855d2176bfc0
|
|
| MD5 |
e44e71c41f5d2293bf54bbb6ffa89a0a
|
|
| BLAKE2b-256 |
9626ccf2fe7e2d5ec356eb2d33240d80d3a3953067562cc3cffeade37b53d651
|
Provenance
The following attestation bundles were made for clipwright_trim-0.1.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_trim-0.1.0.tar.gz -
Subject digest:
6b86d5bf66c49459204dd330d9c26df7cfdb27ddafd097d635c9855d2176bfc0 - Sigstore transparency entry: 1872263583
- Sigstore integration time:
-
Permalink:
satoh-y-0323/clipwright@fd2cf980d895dddc2eff9210f87c4d89a56b078a -
Branch / Tag:
refs/tags/v0.9.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@fd2cf980d895dddc2eff9210f87c4d89a56b078a -
Trigger Event:
push
-
Statement type:
File details
Details for the file clipwright_trim-0.1.0-py3-none-any.whl.
File metadata
- Download URL: clipwright_trim-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 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 |
d67593233959196aa36369aaef01358daab8bdd9437be17b0b1fd76866e317b1
|
|
| MD5 |
047b6739d6ec3b409870a9a2117b8cd2
|
|
| BLAKE2b-256 |
5b5ec766fe4ece3dcac1d525fa8e7e44c77eba45d2bc0def779bb7c182c0d1f7
|
Provenance
The following attestation bundles were made for clipwright_trim-0.1.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_trim-0.1.0-py3-none-any.whl -
Subject digest:
d67593233959196aa36369aaef01358daab8bdd9437be17b0b1fd76866e317b1 - Sigstore transparency entry: 1872263835
- Sigstore integration time:
-
Permalink:
satoh-y-0323/clipwright@fd2cf980d895dddc2eff9210f87c4d89a56b078a -
Branch / Tag:
refs/tags/v0.9.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@fd2cf980d895dddc2eff9210f87c4d89a56b078a -
Trigger Event:
push
-
Statement type: