Skip to main content

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_FFPROBE environment variable or PATH)
  • 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

Metadata

Release files for clipwright-trim 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clipwright-trim 0.3.0
File Size Uploaded
clipwright_trim-0.3.0.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clipwright-trim 0.3.0
File Interpreter ABI Platform
clipwright_trim-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.4 kB

Release files / clipwright_trim-0.3.0.tar.gz

Download URL clipwright_trim-0.3.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b6ed7047e370606b181801b3bee386db93bd5c577b200117ef576d972d48c317
BLAKE2b-256 checksum
How to use checksums
5c65d62a6b10bb76191d7b90f54c3f3a1076d9f0fe8295717e37a7d10eb17696
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / clipwright_trim-0.3.0-py3-none-any.whl

Download URL clipwright_trim-0.3.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
327596fd58094507e0a10ef55f1ae4ae0a32755dc3fd9f2b9942ced2740e4755
BLAKE2b-256 checksum
How to use checksums
4e7b29b76e8c84a9fa4f6822d3dcd14d2a199c3fca6f09fe88d9f24e9068ce74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page