Navidrome MCP Player
Controls a local mpv process via JSON IPC over a Unix domain socket or Windows named pipe to play Navidrome/Subsonic audio streams, manage the playback queue, pause/resume, skip tracks, and set volume.
Navidrome MCP Player
A lightweight, cross-platform Model Context Protocol (MCP) server and Web UI in Python that turns your Mac, Linux, or Windows machine into a remote-controlled music player backed by Navidrome (or any Subsonic-compatible server) using mpv.
Built for AI agents (n8n, Claude, Cursor, Telegram bots) over Tailscale or LAN, with an integrated dark-mode browser dashboard for manual playback control and runtime settings.
Architecture
flowchart LR
Agent["AI Agent / n8n / MCP Client"] -->|"Streamable HTTP (/mcp)\nBearer Token"| FastAPI["FastAPI + MCPServer"]
Browser["Web UI (/)"] -->|"HttpOnly Session Cookie\nREST (/api/*)"| FastAPI
FastAPI -->|"Subsonic REST API\n(Salted MD5 Auth)"| Navidrome["Navidrome Server"]
FastAPI -->|"JSON IPC\n(Unix Socket / Named Pipe)"| MPV["mpv Subprocess"]
Navidrome -->|"Direct Audio Stream\n(/rest/stream)"| MPV
MPV --> Speakers["Local Audio Output"]Related MCP server: navigravity
Features
MCP Streamable HTTP (
/mcp): Exposes 11 ready-to-use tools for searching, playing songs/playlists, managing the queue, and controlling playback and volume.Lightweight Web UI (
/): Clean, zero-build dark dashboard with Now Playing, queue view, search & play, playlists, volume slider, and runtime MCP settings.Cross-platform
mpvJSON IPC: Uses Unix domain sockets on Linux/macOS and named pipes on Windows — no external player daemon required.Direct Streaming & Auto-Scrobbling: Streams
/rest/streamdirectly from Navidrome without temporary files and optionally scrobbles finished tracks back to Navidrome.Secure by Default: Fail-closed Bearer token &
HttpOnlycookie authentication with constant-time comparison, strict Subsonic ID validation, CSP headers, and stream URLs kept strictly server-side.
Prerequisites
Python 3.11+
A running Navidrome (or Subsonic-compatible) server
mpvinstalled and available on yourPATH:macOS:
brew install mpvLinux (Debian/Ubuntu):
sudo apt install mpvWindows:
winget install mpv(orscoop install mpv)
Quick Start
git clone https://github.com/Rjtsahu/navidrome-mcp-player.git
cd navidrome-mcp-player
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
cp .env.example .env
# Generate a strong MCP_AUTH_TOKEN:
python3 -c "import secrets; print(secrets.token_urlsafe(32))"Edit .env with your Navidrome URL, credentials, and generated MCP_AUTH_TOKEN, then start the server:
navidrome-mcpOpen http://127.0.0.1:8765 in your browser and unlock the dashboard with your MCP_AUTH_TOKEN.
Note: If
MCP_AUTH_TOKENis left empty, an ephemeral token is generated per process and logged as a warning. Set a persistent token in.envfor production or agent integrations.
Configuration
All settings are loaded from environment variables or .env:
Variable | Default | Description |
|
| Base URL of your Navidrome/Subsonic server |
|
| Navidrome username |
|
| Navidrome password |
|
| Bearer token for |
|
| Bind address ( |
|
| HTTP server port ( |
|
| Executable name or full path to |
|
| Initial player volume ( |
|
| Scrobble finished tracks to Navidrome |
|
| Max search results returned ( |
|
| Queue all matched songs on |
The last four settings (DEFAULT_VOLUME, AUTO_SCROBBLE, SEARCH_LIMIT, QUEUE_SEARCH_MATCHES) can also be adjusted live at runtime from the Web UI MCP Settings panel.
MCP Tools Reference
All tools are exposed over Streamable HTTP at /mcp:
Tool | Parameters | Description |
|
| Search songs, albums, or artists ( |
|
| Play a song by ID or search query (queues matches if enabled) |
|
| Load a playlist by ID or name (exact match preferred) and play |
| — | Toggle pause/resume on the active track |
| — | Stop playback and clear the queue |
| — | Skip to the next track in the queue |
| — | Return to the previous track (or restart the first track) |
| — | Get current track, state, position, duration, volume, and remaining queue |
| — | List all playlists visible to the configured Navidrome user |
| — | Return the current playback queue and active index |
|
| Set playback volume ( |
REST API Reference
The Web UI communicates with these JSON endpoints (protected by Bearer token or mcp_session cookie):
GET /health— Unauthenticated liveness probe ({"status": "ok"})POST /auth/login— Exchange{"token": "..."}for anHttpOnlysession cookiePOST /auth/logout— Clear the session cookieGET /api/status— Current playback state, track, queue, position, and volumePOST /api/play— Play by{"query": "..."}or{"song_id": "..."}POST /api/play-playlist— Play a playlist by{"playlist_id": "...", "shuffle": false}POST /api/pause,POST /api/stop,POST /api/next,POST /api/prev— Transport controlsPOST /api/volume— Set volume ({"level": 80})GET /api/playlists— List playlistsGET /api/search?q=...— Search songsGET /api/settings,POST /api/settings— Read or update runtime MCP settings
Connecting Clients
n8n over Tailscale (e.g., Telegram AI Agent)
Set
HOSTin.envto your machine's Tailscale IP (e.g.,100.x.y.z).In n8n, add an MCP Client Tool node connected to your AI Agent:
Endpoint:
http://100.x.y.z:8765/mcpTransport: Streamable HTTP
Header Auth:
Authorization: Bearer <your_MCP_AUTH_TOKEN>
Generic MCP Streamable HTTP Client
Point any MCP-compatible client at http://<host>:8765/mcp with header:
Authorization: Bearer <your_MCP_AUTH_TOKEN>Security Model
Authentication: Every
/mcpand/api/*request requires a validAuthorization: Bearer <token>header ormcp_sessionHttpOnlycookie, verified withhmac.compare_digest.Credential Isolation: Subsonic API requests use salted MD5 tokens (
t = md5(password + salt)). Authenticated/rest/streamURLs are passed directly to the localmpvprocess and never returned in MCP or REST responses.Input Validation: Song and playlist IDs are validated against
^[A-Za-z0-9._-]+$before constructing Subsonic requests.HTTP Hardening: Responses include
X-Content-Type-Options: nosniff,X-Frame-Options: DENY,Referrer-Policy: no-referrer, and a strictContent-Security-Policy.
Development & Testing
# Run the test suite
pytest -vProject Structure
navidrome-mcp-player/
├── src/navidrome_mcp/
│ ├── config.py # Pydantic settings & runtime MCP options
│ ├── navidrome.py # Async Subsonic / Navidrome REST client
│ ├── player.py # Cross-platform mpv JSON IPC & queue manager
│ ├── mcp_server.py # FastMCP tool definitions
│ ├── web.py # FastAPI app, auth middleware, REST API & entrypoint
│ └── static/ # Zero-build Web UI (HTML, CSS, vanilla JS)
├── tests/ # Unit tests for Navidrome client, mpv player, MCP tools & web API
├── .env.example
└── pyproject.tomlContributing
Contributions are welcome! See CONTRIBUTING.md for guidelines on reporting issues, running tests, and submitting pull requests.
License
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate AI music via the Lacuna Music API from MCP clients like Claude Desktop & Code.
Generate full songs with vocals, instrumentals and sound effects from text. One server for Suno, Google Lyria, Mureka, MiniMax, ACE-Step, YuE and ElevenLabs. Your agent can quote the credit cost before generating, start a song, wait for it to finish and return download links. Sign in with OAuth; optional daily credit caps; retries never charge twice.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseAqualityDmaintenanceControl mpv media player through AI conversation. Play music and video, manage playlists — all via natural language. Works with opencode and any MCP-compatible AI tool.1613 npmMIT
- AlicenseAqualityDmaintenanceAn intelligent MCP server that enables AI agents to act as sophisticated music curators for self-hosted Navidrome libraries, focusing on quality, discovery, and non-destructive management.151MIT
- FlicenseAqualityDmaintenanceExposes Spotify controls as MCP tools for playback, playlist management, and AI playlist generation; includes a web app and supports multi-user profiles.14-
- AlicenseBqualityDmaintenanceMCP server that provides LLM tools to interact with Lyrion Music Server (LMS), enabling player control, playback management, playlist operations, and music library search.55MIT