deezer-mcp
# deezer-mcp
[](https://github.com/mihajloS/deezer-mcp/actions/workflows/tests.yml)
An [MCP](https://modelcontextprotocol.io) server for [Deezer](https://www.deezer.com), built with
[FastMCP](https://gofastmcp.com). It lets Claude search tracks and build playlists in your Deezer library.
> **Status: early skeleton.** The tools and their contract (inputs, outputs, tests) are in place;
> the Deezer calls inside them are still `TODO`. See [Development](#development).
## Tools
| Tool | Deezer API | Token | Returns |
| --- | --- | --- | --- |
| `search_track(query, limit=10)` | `GET /search` | no | list of tracks: `id`, `title`, `artist`, `album`, `duration`, `link` |
| `create_playlist(title)` | `POST /user/me/playlists` | yes | new playlist ID |
| `add_tracks(playlist_id, track_ids)` | `POST /playlist/{id}/tracks` | yes | `true` when Deezer confirms |
Typical flow: `search_track` → pick track IDs → `create_playlist` → `add_tracks`.
```
Claude ──MCP (stdio)──► deezer-mcp (FastMCP) ──HTTPS──► api.deezer.com
```
## Requirements
- [uv](https://docs.astral.sh/uv/) (it installs Python 3.12+ for you)
- For the write tools: a Deezer OAuth access token in `DEEZER_TOKEN`, with
`basic_access,manage_library,offline_access` permissions (`offline_access` makes it non-expiring).
`search_track` works without a token.
Getting a token needs a Deezer developer app (App ID + secret). Note that Deezer
[stopped accepting new apps](https://en.deezercommunity.com/features-feedback-44/api-auth-impossible-80857)
in 2025, so this currently works only if you already have one. A small `deezer-mcp login`
helper is planned.
## Use it in Claude Code (stdio)
Straight from GitHub with `uvx`, no clone needed:
```bash
claude mcp add deezer -e DEEZER_TOKEN=your-token -- uvx --from git+https://github.com/mihajloS/deezer-mcp deezer-mcp
```
Search only (no token):
```bash
claude mcp add deezer -- uvx --from git+https://github.com/mihajloS/deezer-mcp deezer-mcp
```
From a local checkout, with the token kept in a git-ignored `.env`:
```bash
git clone https://github.com/mihajloS/deezer-mcp
```
```bash
cd deezer-mcp && cp .env.example .env
```
Put your token in `.env`, then:
```bash
claude mcp add deezer -- uv run --directory "$PWD" --env-file .env deezer-mcp
```
Check it with `/mcp` inside Claude Code. The same command and arguments work in any MCP client
that runs stdio servers (e.g. Claude Desktop's `claude_desktop_config.json`).
## Development
```bash
uv sync
```
```bash
uv run pytest
```
- `src/deezer_mcp/server.py` – the FastMCP app and the three tools. Each tool's signature,
docstring and return type are its MCP contract; the body is where the Deezer call goes.
- `tests/` – the contract, tested through a real in-memory MCP client. Deezer is faked with
[respx](https://lundberg.github.io/respx/), so tests never touch the network; use
[httpx](https://www.python-httpx.org) for HTTP calls so respx can intercept them.
- Tests for unimplemented tool bodies are marked `@todo` (an `xfail`). `xfail_strict` is on, so
when your implementation makes one pass, pytest reports `XPASS(strict)` and fails: delete
that `@todo` line and the test becomes a regular one.
Deezer quirk worth knowing: errors come back as **HTTP 200** with a body like
`{"error": {"type": "OAuthException", "message": "Invalid OAuth access token.", "code": 300}}`,
so checking the status code is not enough.
## Related
[Benitoow/mcp-deezer](https://github.com/Benitoow/mcp-deezer) takes a different route: Deezer's
internal API with an `arl` cookie instead of OAuth, and many more tools.
## License
[MIT](LICENSE)
TDQS
Scored across 3 tools
Each tool covers a distinct action on a distinct object: searching the catalog, creating a playlist, and appending tracks. There is no plausible way to confuse them, and the descriptions even cross-reference each other (playlist ID passed to add_tracks).
All three names follow the same snake_case verb_noun pattern (search_track, create_playlist, add_tracks). The convention is predictable and readable.
Three tools is on the lean side, but each is clearly load-bearing for the search -> create -> populate workflow. Nothing feels redundant or padded, though the surface is minimal.
The core flow is covered, but there is no way to list or inspect the user's existing playlists, remove/reorder tracks, or delete a playlist. These are notable gaps for a playlist-management server, though an agent can still accomplish the primary build-a-playlist task.