capcut-mcp
Creates and edits CapCut desktop drafts locally by writing project files, enabling timeline manipulation through MCP tools.
README
capcut-mcp
MCP server that creates and edits CapCut desktop drafts locally. CapCut has no public API, so this server writes the project files CapCut reads from disk (draft_content.json + draft_meta_info.json). You build the timeline through MCP tools and then open the project in CapCut desktop to preview and export.
Tools
| Tool | Description |
|---|---|
create_draft |
Creates an empty draft (default canvas 1080x1920 @ 30fps) |
list_drafts |
Lists drafts in the drafts folder |
get_draft |
Returns the timeline: tracks, segments, timings |
add_video |
Adds a video clip (duration/dimensions detected via ffprobe) |
add_image |
Adds a still image (default 5s on screen) |
add_audio |
Adds music or voiceover to an audio track |
add_text |
Adds a text overlay with color, size and position |
Placement rules: segments append to the end of their track by default (atSeconds overrides). If a segment overlaps an existing one, a new track is created automatically, so overlays "just work".
Setup
pnpm install
pnpm build
Register in Claude Code:
claude mcp add --scope user capcut -- node /absolute/path/to/capcut-mcp/dist/index.js
Configuration
| Env var | Default | Purpose |
|---|---|---|
CAPCUT_DRAFT_ROOT |
~/Movies/CapCut/User Data/Projects/com.lveditor.draft |
Where drafts are read/written (CapCut's folder on macOS) |
Installing ffmpeg (brew install ffmpeg) is recommended: ffprobe detects media duration and dimensions automatically. Without it, image dimensions fall back to macOS sips, and video/audio clips require an explicit durationSeconds.
Architecture
Layered, dependency-injected design. CompositionRoot is the only place where concrete classes are instantiated; every collaborator is injected through constructor interfaces (ports & adapters).
classDiagram
class DraftToolController {
+registerOn(server)
}
class DraftService {
+createDraft()
+addVideo() / addImage() / addAudio() / addText()
+listDrafts() / getDraft()
}
class DraftDocument {
+insertSegment()
+addMaterial()
+summary()
}
class DraftRepository {
<<interface>>
}
class MediaProbe {
<<interface>>
}
class FileChecker {
<<interface>>
}
class FsDraftRepository
class ChainMediaProbe
class FfprobeMediaProbe
class SipsImageProbe
class MaterialFactory
class SegmentFactory
class DraftContentFactory
DraftToolController --> DraftService
DraftService --> DraftRepository
DraftService --> MediaProbe
DraftService --> FileChecker
DraftService --> MaterialFactory
DraftService --> SegmentFactory
DraftService --> DraftContentFactory
DraftRepository <|.. FsDraftRepository
MediaProbe <|.. ChainMediaProbe
ChainMediaProbe o--> FfprobeMediaProbe
ChainMediaProbe o--> SipsImageProbe
FsDraftRepository --> DraftDocument
Patterns in play:
- Facade —
DraftServiceexposes one use case per tool and owns the workflow. - Repository —
FsDraftRepositoryisolates all disk I/O and the meta-info bookkeeping. - Factory —
DraftContentFactory/MaterialFactory/SegmentFactoryencapsulate CapCut's JSON blocks. - Strategy + Chain of Responsibility —
MediaProbeimplementations try ffprobe first, thensips. - Dependency Injection — constructor injection everywhere;
IdGeneratorandClockare injected too, which keeps every unit test deterministic (seesrc/testing/fakes.ts).
DraftDocument wraps the raw draft JSON and only mutates the parts it understands, preserving any field CapCut adds on its own.
Validation
Verified end to end against CapCut desktop 3.3.0 (macOS): generated drafts show up in CapCut's project list with the right duration, open in the editor, and the full timeline loads — video, photo, audio (with volume) and text overlays with their exact timings. CapCut's own autosave round-trips the generated structure without dropping anything.
Limitations
- Media must live on a stable user path (e.g. under
~/Moviesor~/Documents). CapCut marks files under/tmpas "not accessible" and asks to relink them. - No effects, transitions, keyframes or exports yet — CapCut itself does the rendering/export.
- Drafts heavily edited inside CapCut can contain features this server does not model; it will preserve them on load/save, but it only manipulates video/image/audio/text segments.
Development
pnpm test # vitest unit tests
pnpm typecheck
pnpm dev # run from sources (tsx)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。