Skip to main content
Glama
losslesscut-mcp
by bariswha

losslesscut-mcp

Let Claude and other AI assistants see your videos and cut them with LosslessCut.

An MCP server that looks at your media with FFmpeg (frames, scenes, silence, loudness, keyframes) and drives LosslessCut through its local HTTP API. Ask "keep the colour bars and the last 3 seconds and export them" and get the files, cut losslessly.

English · Türkçe

Demo: the assistant opens a video, looks at a contact sheet, finds the scene changes, loads two segments into LosslessCut and exports them

Real run against LosslessCut 3.70.2: every step is an MCP tool call, the screenshots are the LosslessCut window.

What it can do

See and analyse the media

These run locally with FFmpeg and work on any file, with or without LosslessCut open. They mirror what LosslessCut itself can show or detect.

Tool

What it does

media_info

Duration, container, streams (codec, resolution, fps, audio channels, language) and chapters

contact_sheet

One image with a grid of frames, to scan a whole video or a part of it

view_frames

Frames at exact times, or evenly spaced, as images the assistant can look at

detect_scenes

Scene changes and hard cuts

detect_silence

Silent parts, and the parts with sound between them

detect_black

Black parts, such as fades and breaks

audio_levels

Loudness over time (EBU R128) and the loudest moments

keyframes

Keyframes, and the ones around given times, to see where a lossless cut will land

check_tools

Shows which FFmpeg and FFprobe it uses

Control LosslessCut

Tool

What it does

check_connection

Checks that LosslessCut is running with its HTTP API on 127.0.0.1

open_files

Opens media or .llc project files (absolute paths only, checked to exist)

set_segments

Loads an exact list of segments (with names) in one step, through LosslessCut's own project file

add_segment / set_cut_points

Adds a segment, or moves the start/end of the current one

seek

Moves the playhead (75.5, 01:15.5, 00:01:15.500)

select_segments / jump_to_segment

Selection and navigation

export_file

Exports the selected segments, confirms the export dialog, returns the output paths

wait_for_export

Waits for a running export and returns its output paths

close_file

Closes the current file

list_actions / run_action

135 allowlisted LosslessCut keyboard actions, such as splitCurrentSegment or toggleStripAudio

The cutting itself is done by LosslessCut and FFmpeg without re-encoding, exactly as if you clicked the buttons.

Related MCP server: Video MCP

Requirements

  • LosslessCut 3.70 or newer (tested with 3.70.2 on Windows 11)

  • Node.js 20 or newer

  • FFmpeg and FFprobe on your PATH for the analysis tools (or set LOSSLESSCUT_MCP_FFMPEG / LOSSLESSCUT_MCP_FFPROBE; LosslessCut ships both in its resources folder)

  • An MCP client: Claude Desktop, Claude Code, or any other client that supports stdio servers

1. Start LosslessCut with the HTTP API

The API is off by default. Start LosslessCut from a terminal with --http-api:

# Windows
"C:\path\to\LosslessCut.exe" --http-api

# macOS
/Applications/LosslessCut.app/Contents/MacOS/LosslessCut --http-api

# Linux
./LosslessCut --http-api

It listens on 127.0.0.1:8080. To use another port, pass it: --http-api 8081, and set LOSSLESSCUT_PORT=8081 for this server too. See LosslessCut's HTTP API docs.

2. Add the server to your client

Claude Code

claude mcp add losslesscut -- npx -y github:bariswha/losslesscut-mcp

Claude Desktop

Open Settings → Developer → Edit Config and add this to claude_desktop_config.json, then restart Claude Desktop:

{
  "mcpServers": {
    "losslesscut": {
      "command": "npx",
      "args": ["-y", "github:bariswha/losslesscut-mcp"],
      "env": { "LOSSLESSCUT_PORT": "8080" }
    }
  }
}

Other MCP clients

Any client that can start a stdio server works. Use the command npx -y github:bariswha/losslesscut-mcp, or run it from a clone:

git clone https://github.com/bariswha/losslesscut-mcp.git
cd losslesscut-mcp
npm ci
node src/index.js --port 8080

3. Ask

  • "Open D:\Videos\talk.mp4 in LosslessCut."

  • "Look through this video and tell me where the scenes change."

  • "Cut out the silent pauses longer than a second and export the rest as one file."

  • "Find the loudest moments, make a 20 second segment around each and export them."

  • "Keep 0:02–0:05 and 0:07–0:09.5, name them intro and demo, and export."

Give the assistant full file paths. It is told never to guess them, and every tool rejects relative paths and files that don't exist.

Configuration

Setting

Default

--port <n> or LOSSLESSCUT_PORT

8080

Port of LosslessCut's HTTP API

--no-frames or LOSSLESSCUT_MCP_FRAMES=off

on

Turns off view_frames and contact_sheet, so the assistant never receives images of your videos

--disable-tools a,b or LOSSLESSCUT_MCP_DISABLE_TOOLS

none

Turns off any tools by name

LOSSLESSCUT_MCP_FFMPEG / LOSSLESSCUT_MCP_FFPROBE

ffmpeg / ffprobe

Paths to the FFmpeg binaries

For example, without frames in Claude Code:

claude mcp add losslesscut -e LOSSLESSCUT_MCP_FRAMES=off -- npx -y github:bariswha/losslesscut-mcp

Most clients can also switch single tools on and off in their own settings: for example the tools menu in Claude Desktop, or /mcp and permission rules in Claude Code.

Security

  • Talks only to LosslessCut on 127.0.0.1. No other network access, no telemetry. Analysis runs locally with FFmpeg.

  • Never sends an Origin header, so LosslessCut's browser protection stays meaningful for everything else.

  • FFmpeg and FFprobe are started directly with an argument list, never through a shell.

  • run_action only runs actions from a fixed allowlist. quit, cleanupFilesDialog (which can move source files to the trash), openSendReportDialog and the URL download action are blocked.

  • All inputs are validated: times are parsed and range-checked, paths must be absolute, existing files without control characters.

  • set_segments writes LosslessCut's project file next to the media (<name>-proj.llc) and renames an existing one to a .bak backup first. Nothing else is written, except the exports you ask for.

  • LosslessCut's HTTP API has no authentication: while it runs with --http-api, any program on your computer can control it. Only enable it while you use it.

See SECURITY.md.

Limitations

These come from LosslessCut's experimental HTTP API:

  • No read access. The API can't report the open file, the segments or the playhead, so the assistant keeps track of what it did. The analysis tools read the file itself, not the app.

  • No error feedback. An action that fails inside LosslessCut still returns success over HTTP.

  • Dialogs. If LosslessCut opens a dialog (for example when a file is already open), the action waits for you; the server reports that after 30 seconds. Actions in the dialog group of list_actions always open one.

  • Timecode format. seek sends hh:mm:ss.fff, which LosslessCut parses with its default timecode format. If you switched it to frames or seconds, use set_segments instead.

  • Lossless cuts snap to keyframes unless smart cut is on in LosslessCut, so exports can start a little earlier than asked. keyframes shows where.

Development

npm ci
npm test

Tests run against a fake LosslessCut HTTP server, and the analysis tests run real FFmpeg on a generated video when FFmpeg is installed.

Not affiliated

losslesscut-mcp is an independent project. It is not affiliated with, endorsed by or maintained by LosslessCut or its author. LosslessCut is © Mikael Finstad and licensed under GPL-2.0.

License

MIT. This server is a separate program that talks to LosslessCut over HTTP and runs FFmpeg as a separate process. It contains no LosslessCut or FFmpeg code, so their licences don't extend to it, and using it doesn't change how you may use them.

Available Tools

22 tools
add_segmentAdd segmentA

Adds a new segment from start to end. If the file only has its initial full-length segment, LosslessCut replaces it with this one. Call it several times to cut out several parts.

Inputs: end (required), start (required).

audio_levelsAudio levelsB
Read-only

Loudness over time (EBU R128, LUFS) in windows, the loudest moments (laughter, applause, shouting, drops) and the overall loudness.

Inputs: path (required), end, top, start, +1 more.

check_connectionCheck LosslessCut connectionB
Read-only

Checks that LosslessCut is running with its HTTP API enabled and reachable on 127.0.0.1.

Inputs: no named parameters.

check_toolsCheck analysis toolsA
Read-only

Reports whether FFmpeg and FFprobe, which the analysis tools use, are available.

Inputs: no named parameters.

close_fileClose fileA

Closes the current file in LosslessCut. If "ask before closing" is enabled in its settings, the user has to confirm in the app.

Inputs: no named parameters.

contact_sheetContact sheetA
Read-only

One image with a grid of evenly spaced frames, to scan a whole video (or a part) cheaply. Returns the time of each tile, left to right, top to bottom. Zoom in later with a smaller start/end or view_frames.

Inputs: path (required), end, rows, start, +2 more.

detect_blackDetect black framesB
Read-only

Finds black parts of the video, such as fades, breaks between programmes or ad breaks.

Inputs: path (required), end, start, minDuration, +1 more.

detect_scenesDetect scene changesB
Read-only

Finds cuts and scene changes in the video with FFmpeg. Lower threshold finds more changes.

Inputs: path (required), end, limit, start, +1 more.

detect_silenceDetect silenceA
Read-only

Finds silent parts and the parts with sound (speech, music) between them. Useful to remove pauses or split at gaps.

Inputs: path (required), end, start, noiseDb, +1 more.

export_fileExportA

Exports the selected segments of the open file with the current LosslessCut export settings. If the export options dialog is enabled, it is confirmed automatically. Returns the output paths when wait is true.

Inputs: wait, timeoutSeconds.

jump_to_segmentJump to segmentB

Makes another segment the current one and moves the playhead to its start.

Inputs: target (required).

keyframesKeyframesA
Read-only

Lists video keyframes. Lossless cuts start cleanly at keyframes, so use this to choose cut points or to see where a cut will snap. Pass "near" to get the keyframes around given times.

Inputs: path (required), end, near, limit, +1 more.

list_actionsList actionsA
Read-only

Lists the LosslessCut keyboard actions that run_action accepts, grouped by category.

Inputs: group.

media_infoMedia infoB
Read-only

Duration, container, streams (codecs, resolution, fps, audio channels, languages) and chapters of a media file.

Inputs: path (required).

open_filesOpen filesA

Opens one or more media files (or a .llc project file) in LosslessCut. Paths must be absolute paths the user gave you; never invent or guess paths. Several files are loaded into the batch list. If a file is already open, LosslessCut asks the user what to do, so call close_file first.

Inputs: paths (required).

run_actionRun actionA
Destructive

Runs one LosslessCut keyboard action by name, for example "togglePlayResetSpeed", "splitCurrentSegment" or "toggleStripAudio". Only actions from list_actions are allowed. Actions in the "dialog" group open a dialog the user must complete in the app.

Inputs: action (required).

seekSeek to timeB
Idempotent

Moves the playhead of the open file to a time. Works with the default "timecode with decimal fraction" timecode format in LosslessCut.

Inputs: time (required).

select_segmentsSelect segmentsB

Changes which segments are selected. Only selected segments are exported.

Inputs: mode (required).

set_cut_pointsSet cut start/endB

Sets the start and/or end of the current segment by seeking to each time and pressing "set cut start"/"set cut end". If the playhead is after the current segment, LosslessCut creates a new segment instead.

Inputs: end, start.

set_segmentsSet segmentsA

Loads an exact list of segments for a media file in one step and opens it in LosslessCut. It writes the LosslessCut project file next to the media ("-proj.llc"); an existing project file is first renamed to a .bak backup. The currently open file is closed first. Prefer this over add_segment for precise cuts.

Inputs: path (required), segments (required).

view_framesView framesA
Read-only

Returns video frames as images so you can see the content. Give exact times, or a count of evenly spaced frames within start/end.

Inputs: path (required), end, count, start, +2 more.

wait_for_exportWait for exportA
Read-only

Waits until the current or next export finishes and returns the exported file paths.

Inputs: timeoutSeconds.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 22 tools

    Disambiguation4/5

    Most tools target clearly distinct operations (analysis, navigation, editing, export, diagnostics). There is mild overlap among the segment tools (set_cut_points, add_segment, set_segments) and the two frame tools (view_frames, contact_sheet), but descriptions explicitly contrast them and explain when to prefer one over the other.

    Naming Consistency4/5

    The dominant pattern is verb_noun (open_files, add_segment, set_cut_points, export_file, run_action, view_frames, check_tools). A few tools are noun-only (audio_levels, media_info, contact_sheet, keyframes), which is a minor deviation but still readable and consistent with a stable snake_case convention.

    Tool Count4/5

    At 22 tools it sits on the higher end of the ideal range, but each tool maps to a concrete, non-redundant capability spanning analysis, navigation, segment editing, export, and diagnostics. Nothing appears padded or duplicative, so the count is justified for a full media-cutting workflow.

    Completeness4/5

    The surface covers the whole lossless-cutting lifecycle: open/close, analysis (silence, black, scenes, audio levels, keyframes, frames), segment creation and selection, export with waiting, and generic action/diagnostics escape hatches. Minor gaps remain, such as reading back the current segment list or a merge/concat operation, but core workflows have no dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers