opencut-mcp

opencut-mcp

MCP server that enables LLM agents to control the OpenCut classic video editor's timeline through a Playwright-controlled browser, allowing automated video editing tasks like adding media, inserting clips, splitting, trimming, and exporting.

Category
访问服务器

README

opencut-mcp

MCP (Model Context Protocol) server for the OpenCut classic video editor. Lets an LLM agent (Claude Code, Cline, etc.) drive the timeline via window.__editor in a Playwright-controlled browser.

Status: PoC for a kenimoto.dev article series.

Runs against a fork, not upstream

This server does not target opencut-app/opencut-classic (archived). It targets the kenimo49/opencut-classic fork, which carries a small patch series that exposes internals needed for automation. Point your docker compose / bun dev:web at the fork's main.

Patch What it exposes Used by which tools
eca73042 — Phase 1 window.__editor (the EditorCore singleton) every tool
a7443ec8 — Phase 1.1 window.__opencut.mediaTimeFromSeconds (+ TICKS_PER_SECOND, mediaTime, roundMediaTime) any tool that takes a time argument (insert_clip, split_at, move, trim)

The fork may drift further from upstream as we add hooks — e.g. data-testid anchors for wait/assertion, or a headless-export toggle. Track the two together; a version of this server may not work against an arbitrary snapshot of the fork. Compatibility is pinned at repo level, not by semver (yet). The current commit of this server was validated against kenimo49/opencut-classic@a7443ec8.

Demo

scripts/demo.ts runs a full end-to-end sequence: create a project, upload a video

  • audio file, place both on the timeline via auto-placement, split the video at 5s. The Playwright screencast below is that run recorded verbatim.

<video src="https://github.com/kenimo49/opencut-mcp/raw/main/docs/demo.mp4" controls poster="docs/demo-poster.png" width="800"></video>

<!-- Fallback for Markdown viewers that ignore <video>. GitHub renders <video> above; other viewers show the GIF. --> opencut-mcp demo (12 second GIF fallback)

Tools

tool description
opencut_get_state Timeline snapshot (tracks, elements, assets).
opencut_add_track ⚠ empty tracks are pruned by the reactor — prefer omitting trackId on insert_clip.
opencut_add_media Upload local file as MediaAsset.
opencut_insert_clip Add element referencing MediaAsset. mode: "auto" when trackId omitted.
opencut_split_at Split element(s) at a time (seconds).
opencut_move / opencut_trim / opencut_delete direct pass-through to TimelineManager.
opencut_undo / opencut_redo CommandManager history.
opencut_export RendererManager.exportProject.
opencut_screenshot debug: screenshot the editor viewport.

Running

# 1. Start the FORK of classic (docker + bun dev:web on 3000).
git clone https://github.com/kenimo49/opencut-classic.git
cd opencut-classic
# ... see that repo's README for docker compose + env.local setup
bun run dev:web   # http://localhost:3000

# 2. Install and run this MCP (in a separate shell):
cd ../opencut-mcp
bun install
bunx tsx src/index.ts   # stdio transport

# 3. Or the integration demo:
bunx tsx scripts/demo.ts

Env:

  • OPENCUT_BASE_URL — default http://localhost:3000
  • OPENCUT_HEADLESS — false to see the browser (WSLg / X11 required)
  • OPENCUT_VIDEO_DIR — set to record a webm screencast of the browser
  • OPENCUT_DEMO_PACE=slow — triples inter-step pauses in scripts/demo.ts

Notes discovered during PoC

  1. Empty tracks are pruned every command via CommandManager reactor (editor/index.ts:playback.bindTimelineScope). Two-step addTrack + insertElement loses the track before the second call. Prefer insertElement with placement: { mode: "auto", trackType } — the command creates the track on demand and it survives because it has an element.
  2. MediaTime is integer ticks, not seconds. TICKS_PER_SECOND is 120,000 at runtime. Convert via window.__opencut.mediaTimeFromSeconds({ seconds }) (Phase 1.1 exposure).
  3. AudioElement discriminated union — uploads must carry sourceType: "upload" in addition to mediaId.
  4. Editor page is /editor/[project_id]. Creating a project via the /projects UI is the boot path used by this server.

MIT.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选