
Kdenlive MCP Server
io.github.Va1bhav512Published by GitHub account Va1bhav512v0.1.3Updated Oct 24, 2026
Kdenlive video editing MCP - 36 tools for project, timeline, filters and melt rendering
Overview
Local MCP server that lets an assistant build and edit Kdenlive video projects — bin, timeline, filters, transitions, guides and melt rendering.
- What you can do
- Create, open, save and inspect Kdenlive projects and list output profiles
- Import, list, inspect and remove media clips in the project bin
- Add, remove, move, trim and split clips and tracks on the timeline, including batch placement of keep-segments
- Add, remove and tune filters and transitions, and add or list timeline guides and chapter markers
- Export Kdenlive/MLT XML, list render presets and render to video via melt
- Undo, redo and inspect session state and history; reframe landscape clips to vertical 9:16
- When to use it
- Useful when you want an assistant to assemble or revise a Kdenlive project programmatically — cutting a long take into segments, applying effects, adding chapters, or producing a vertical Shorts version — and then render or export it. It targets Kdenlive project files rather than an open GUI session.
- Requirements
- Runs locally over stdio as a PyPI package (kdenlive-mcp-server) with Python 3.10+ and uv; the README also expects the melt CLI for rendering and pulls the cli-anything-kdenlive dependency from a GitHub repository. No authentication, environment variables or headers are declared. Desktop only.
Installation
In SourceWeft
- Open Kdenlive MCP Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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
Source: README.md at commit f1ce009
Tools
0Version history
1- v0.1.3LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.