
Kdenlive MCP Server
io.github.Va1bhav512由 GitHub 账号 Va1bhav512 发布v0.1.3更新于 Oct 24, 2026
Kdenlive video editing MCP - 36 tools for project, timeline, filters and melt rendering
概览
本地 MCP 服务器,让助手构建和编辑 Kdenlive 视频项目:素材箱、时间线、滤镜、转场、标记以及 melt 渲染。
- 可以做什么
- 新建、打开、保存和查看 Kdenlive 项目,并列出可用的输出配置
- 导入、列出、查看和删除项目素材箱中的媒体片段
- 在时间线上增删轨道与片段,移动、裁剪、分割片段,并支持批量放置保留片段
- 添加、删除和调整滤镜与转场,添加或列出时间线标记与章节
- 导出 Kdenlive/MLT XML、列出渲染预设并通过 melt 渲染成视频
- 撤销、重做并查看会话状态与历史;将横屏片段重构为 9:16 竖屏
- 适用场景
- 适合让助手以程序化方式搭建或修改 Kdenlive 项目,例如把长镜头切成多段、添加特效、插入章节,或制作竖屏短视频版本后再导出或渲染。它操作的是 Kdenlive 项目文件,而不是已打开的图形界面会话。
- 运行要求
- 以 stdio 方式在本机运行,PyPI 包 kdenlive-mcp-server,需要 Python 3.10+ 和 uv;README 还要求渲染时使用 melt 命令行,并从 GitHub 仓库获取 cli-anything-kdenlive 依赖。未声明认证、环境变量或请求头。仅支持桌面环境。
安装
在 SourceWeft 中
- 打开 控制台中的 Kdenlive MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Kdenlive MCP Server
A Model Context Protocol (MCP) server wrapping cli-anything-kdenlive for LLM-driven video editing workflows via Kdenlive.
Overview
This FastMCP server enables AI models to perform complex video editing tasks on Kdenlive projects through a set of 75 tools. The server uses the Python API of cli-anything-kdenlive directly (not subprocess) to maintain a persistent session state, ensuring modifications are immediately available to subsequent tool calls.
Key Features
- Persistent Session State: Uses CLI's in-memory session API, auto-saves after every mutation
- Gen 5 XML Export: Kdenlive-compatible XML output with proper bin references and version metadata
- Robust Error Handling: All exceptions caught and returned as structured JSON payloads
- Auto-Project Tracking: Globally tracks project path; all tools automatically target the active project
- 75 MCP Tools: Comprehensive coverage of Kdenlive operations
Installation
Prerequisites
Install Dependencies
Usage
As an MCP Server
The server runs as a FastMCP server compatible with any LLM platform that supports MCP (e.g., Claude Code, Pi, OpenCode).
Command Line
Python Integration
Project Structure
Tools
Project (5 tools)
Bin (4 tools)
Timeline (8 tools)
Filters (5 tools)
Transitions (4 tools)
Guides (3 tools)
Export (3 tools)
Session (4 tools)
Batch Editing & Vertical Video (new in 0.2.0)
timeline_build_from_segments(clip_id, segments, track=0, start=0.0, gap=0.0, include_audio=True, audio_track=None)
Cutting a long take with timeline_split_clip / timeline_remove_clip is fragile because
every removal shifts the clip_index of the clips after it. Instead, compute the ranges you
want to keep and place them all at once:
segmentsis a list of{start, end}in source seconds, or a path to a JSON file containing{"segments": [...]}.- Segments are sorted, clamped to the clip's duration, merged where they overlap or touch, and dropped if shorter than 0.05 s. An empty result is an error.
- Segments are laid out from
start, separated bygapseconds. - Clips on a video track render without sound, so when the source has an audio stream the
same segments are mirrored onto an audio track (the first existing one, or a new
A1). Passinclude_audio=Falseto skip this, oraudio_track=<id>to choose the track. - The whole build, including any auto-created audio track, is one undo step:
a single
session_undo()reverts it.
clip_reframe_vertical(track_id, clip_index, x_offset=0.0)
For Shorts/Reels/TikTok, start the project with a vertical profile (vertical1080p30 or
vertical1080p60, both 1080x1920), then reframe each landscape clip:
The source is scaled so its height fills the frame, then shifted horizontally:
x_offset -1 shows the left edge, 0 the center, 1 the right edge. It adds an affine
filter (Kdenlive's Transform effect) with a transition.rect; calling it again on the same
clip updates that filter instead of stacking another. Center crop only, no face tracking.
Example Workflows
Create a Simple Video Project
Apply Effects to Clips
Add Chapter Markers
Error Handling
All tools return consistent response formats:
Configuration
pyproject.toml
uv.lock
Auto-generated by uv sync. Contains locked dependency versions.
Dependencies
- mcp>=1.28.0: FastMCP server framework for MCP protocol
- cli-anything-kdenlive @ git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=kdenlive/agent-harness:
- CLI harness for Kdenlive video editing via melt
- Includes Gen 5 MLT XML format rewrite (PR #216)
- Provides Python API for project management
Troubleshooting
Kdenlive XML Compatibility Issues
If Kdenlive reports "Version of the project file cannot be read" or "Timeline clip without bin reference found":
- Cause: Using PyPI v1.0.0 (Gen 4 format) which lacks proper Kdenlive metadata
- Fix: The package now installs from GitHub HEAD with Gen 5 format that includes:
kdenlive:docproperties.version="1.1"- Chain-based clip structure with
kdenlive:idlinking to main_bin - Proper bin reference handling
Project Not Saving
The server auto-saves to disk after every mutation. If changes aren't persisting:
- Verify the project path is set via
project_new()orproject_open() - Check that
session_status()showshas_project: true - Ensure the output directory is writable
FastMCP Server Not Starting
- Verify MCP version:
uv run python3 -c "import mcp; print(mcp.__version__)" - Check FastMCP:
uv run python3 -c "from mcp.server.fastmcp import FastMCP; print('FastMCP OK')" - Review logs for detailed error messages
Development
Testing
Run the test suite:
Code Style
The project follows PEP 8 style guidelines. Use uv run ruff check . to lint.
Adding New Tools
To add a new MCP tool:
- Add the tool function to
server.pydecorated with@server.tool() - Import the corresponding CLI API module if needed
- Include comprehensive docstrings with Args and Returns sections
- Implement error handling with try/except
- Call
_save()after mutations to persist changes
Example:
Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass:
uv run pytest - Submit a pull request
References
来源:README.md,提交 f1ce009
工具
0版本历史
1- v0.1.3最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。