
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 分
請在儲存庫或註冊中心條目中宣告授權條款。