Provides comprehensive control over Kodi media center including player control (play, pause, stop, volume), navigation, library management, movie and TV show operations, and smart downloads management with intelligent search and playback capabilities
Enables integration with n8n workflows through MCP Client nodes, allowing automation of Kodi media center operations within n8n automation workflows
Kodi MCP Server
A Model Context Protocol (MCP) server for controlling Kodi media center. This server provides both REST API and MCP protocol support, allowing seamless integration with MCP clients like Claude Desktop, n8n, and other MCP-compatible tools.
Features
Core Kodi Controls
š® Player Control: Play, pause, stop, volume control
š§ Navigation: Menu navigation (up, down, left, right, select, back)
š Library Management: View library statistics, scan library
š¬ Movie Operations: Search movies, list recent movies, play by ID
šŗ TV Show Operations: List TV shows, play episodes
Smart Downloads Management
š List Downloads: Browse video files in download directory
š Search Downloads: Find files by name (case-insensitive)
šÆ Smart Find & Play: Intelligent search with automatic playback of best match
š Direct File Play: Play any video file by path
Protocol Support
š REST API: Direct HTTP endpoints for easy integration
š MCP Protocol: Full Model Context Protocol support
š” Server-Sent Events: Real-time event streaming
š WebSocket: Bidirectional communication support
Quick Start
Using Docker (Recommended)
Clone the repository
git clone https://github.com/your-username/kodi-mcp-server.git cd kodi-mcp-serverConfigure environment
cp .env.example .env # Edit .env with your Kodi configurationStart with Docker Compose
docker-compose up -dVerify installation
curl http://localhost:8080/health
Manual Installation
Requirements
Python 3.11+
Kodi with JSON-RPC enabled
Network access to Kodi instance
Install dependencies
pip install -r requirements.txtConfigure environment
export KODI_HOST=192.168.1.100 export KODI_PORT=8080 export KODI_USERNAME=kodi export KODI_PASSWORD=your_password export KODI_DOWNLOADS_PATH=/path/to/downloadsRun the server
python -m src.server
Configuration
Environment Variables
Variable | Description | Default | Required |
| Kodi server IP address |
| Yes |
| Kodi JSON-RPC port |
| Yes |
| Kodi username | - | Yes |
| Kodi password | - | Yes |
| Path to downloads folder | - | Yes |
| MCP server bind address |
| No |
| MCP server port |
| No |
| MCP server identifier |
| No |
| Logging level |
| No |
Kodi Setup
Enable JSON-RPC in Kodi
Settings ā Services ā Control
Enable "Allow remote control via HTTP"
Set username and password
Note the port (usually 8080)
Configure Downloads Path
Use the actual path as seen by Kodi
For Docker Kodi: usually
/storage/downloads/
or/var/media/
Test with
Files.GetDirectory
in Kodi JSON-RPC
Available Tools
Player Control
get_now_playing
- Get currently playing media informationplayer_play_pause
- Toggle play/pauseplayer_stop
- Stop playbookset_volume
- Set volume level (0-100)
Navigation
navigate_menu
- Navigate Kodi interface (up/down/left/right/select/back)
Library Operations
search_movies
- Search movies in Kodi librarylist_recent_movies
- List recently added movieslist_tv_shows
- List all TV showsplay_movie
- Play movie by library IDplay_episode
- Play TV show episodeget_library_stats
- Get library statisticsscan_library
- Trigger library scan
Downloads Management
list_downloads
- List video files in downloads directorysearch_downloads
- Search downloads by filenameplay_file
- Play video file by pathfind_and_play
- Smart search with automatic best-match playback
Usage Examples
With MCP Client (Claude Desktop, n8n)
REST API
MCP JSON-RPC Protocol
Integration
n8n MCP Client
Add MCP Client node in n8n
Configure connection:
Transport: Server-Sent Events
URL:
http://your-server:8080
Use available tools in your workflows
Claude Desktop
Add to your Claude Desktop MCP configuration:
Smart Search Algorithm
The find_and_play
tool uses an intelligent scoring algorithm:
šÆ Position Matching: Terms at the beginning get higher scores
š¤ Word Matching: Complete word matches vs partial matches
ā Quality Bonus: Higher quality formats (1080p, BluRay) get bonus points
ā ļø Suspicious File Detection: Samples, trailers get penalty points
š§ Fuzzy Matching: Works with partial terms like "batman" ā "The Dark Knight"
API Reference
Health Check
List Tools
Execute Tool (REST)
MCP Protocol Endpoints
Development
Running Tests
Project Structure
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
š Issues: GitHub Issues
š Documentation: MCP Protocol Specification
š¬ Discussions: GitHub Discussions
Acknowledgments
Model Context Protocol - The protocol specification
Kodi - The amazing media center software
FastAPI - Web framework for the hybrid server
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables control of Kodi media center through MCP protocol, supporting playback control, library management, navigation, and smart downloads search with automatic file playback.