Mediabot — MCP Server & Chatbot
The MCP server provides 13 tools wrapping the MediaManager API and qBittorrent, usable from Claude Code and Open WebUI.
Architecture
Claude Code ──→ MCP Server (stdio) ──→ MediaManager API (media.eva-00.network)
──→ qBittorrent API (192.168.1.113:8080)
Open WebUI ──→ Tool (Python) ──→ MediaManager API (192.168.1.113:8000)
──→ qBittorrent API (192.168.1.113:8080)
- Claude Code: MCP server runs locally via
run.sh, credentials from macOS keychain - Open WebUI: Tool class runs inside the Open WebUI container, credentials in Valves
MCP Tools (13 total)
| Tool | Description |
|---|---|
search_tv |
Search TV shows by name (TMDB) |
search_movies |
Search movies by name (TMDB) |
add_tv_show |
Add TV show to library by TMDB ID |
add_movie |
Add movie to library by TMDB ID |
search_tv_releases |
Browse torrent releases for a TV season |
search_movie_releases |
Browse torrent releases for a movie |
download_tv_release |
Start downloading a TV release |
download_movie_release |
Start downloading a movie release |
download_by_url |
Download torrent by direct URL/magnet (bypasses MM search, sends to qBittorrent) |
list_downloads |
List all active/completed downloads |
get_libraries |
Get configured TV and movie libraries |
set_tv_library |
Assign a TV show to a library |
set_movie_library |
Assign a movie to a library |
Claude Code Setup
Already configured in /Users/gabriel/git/.mcp.json. The run.sh launcher pulls credentials from macOS keychain.
Keychain entries
| Service | Account | Value |
|---|---|---|
media.eva-00.network |
email |
MediaManager login email |
media.eva-00.network |
password |
MediaManager login password |
qbit.eva-00.network |
username |
qBittorrent username |
qbit.eva-00.network |
password |
qBittorrent password |
Usage
You: search for Attack on Titan
Claude: [calls search_tv with query "Attack on Titan"]
Found "Attack on Titan" (2013) [TMDB: 1429] — Rating: 8.7
...
Open WebUI Setup
1. Create the Tool
- Open WebUI → Workspace → Tools → Create
- Name: MediaManager
- Paste contents of
services/mediabot-mcp/openwebui_tool.py - Set Valves:
mm_url:http://192.168.1.113:8000mm_email: your MediaManager emailmm_password: your MediaManager passwordqbit_url:http://192.168.1.113:8080qbit_username: your qBittorrent usernameqbit_password: your qBittorrent password- Save
2. Create the Custom Model
- Open WebUI → Workspace → Models → Create
- Name: Mediabot
- Base model:
mistral:latest(orllama3.2:3b) - System prompt: see
services/mediabot-mcp/openwebui_model_prompt.md - Enable the MediaManager tool
- Save
The Mediabot model appears as a dedicated assistant in the sidebar, scoped to media management only.
IaC
| Artifact | Path |
|---|---|
| MCP Server | services/mediabot-mcp/server.py |
| Open WebUI Tool | services/mediabot-mcp/openwebui_tool.py |
| Model Setup | services/mediabot-mcp/openwebui_model_prompt.md |
| Launcher | services/mediabot-mcp/run.sh |
| Dependencies | services/mediabot-mcp/pyproject.toml |
Credentials
- Claude Code: macOS keychain (
media.eva-00.network+qbit.eva-00.network) - Open WebUI: Valves (stored in Open WebUI's SQLite database)
- MediaManager auth: JWT bearer token, auto-refreshed on 401
- qBittorrent auth: SID cookie, auto-refreshed on 403