Skip to main content
Glama

spotify-llm-mcp

Control Spotify and build LLM-reasoned playlists from any MCP client (Claude Code, Claude Desktop, Cursor, …).

It wraps the spotify_player CLI as the control plane, so it needs no Spotify Developer app and no OAuth of its own — it reuses the session you already logged into. The recommendation engine is the calling LLM itself: it reasons over your real playlist tracks and the server resolves its picks to Spotify tracks via search. (Spotify removed its audio-features/recommendations endpoints for new apps in Nov 2024 — this design sidesteps that entirely.)

Why this design

  • Zero new credentials. spotify_player already holds your session; this server just shells out to it.

  • Immune to Spotify Web-API deprecations. Control flows through librespot, not api.spotify.com.

  • The LLM is the recsys. Its music knowledge replaces Spotify's dead recommendation endpoints; the server turns song names into playable Spotify tracks.

  • Portable. One MCP server, usable by every MCP-speaking client.

Related MCP server: Spotify MCP Server

Requirements

  • spotify_player installed, authenticated once, and running as an active device. Spotify Premium is required for playback control.

  • Python ≥ 3.10.

Install

git clone https://github.com/rachittshah/spotify-llm-mcp
cd spotify-llm-mcp
uv pip install -e .

Register with Claude Code:

claude mcp add spotify -- spotify-llm-mcp

Or in settings.json / claude_desktop_config.json:

{ "mcpServers": { "spotify": { "command": "spotify-llm-mcp" } } }

Tools

Control: now_playing · control (play/pause/next/previous/shuffle/repeat/volume/seek) · play · search · list_devices · switch_device · get_queue

Recsys inputs & delivery: list_playlists · get_playlist_tracks · taste_profile · resolve_tracks · create_playlist_from_tracks · append_to_playlist

Features (MCP prompts / slash-commands)

  • /recommend-from-playlist <name> — read a playlist, let the LLM extend it in-vibe, build & play the result.

  • /vibe-playlist <description> — "late-night coding, downtempo instrumental" → a fresh playlist.

  • /more-like-this — recommendations seeded from what's playing now.

  • /my-taste — a summary of your listening profile.

How the recsys works

LLM client ──► get_playlist_tracks("On Repeat")      # real tracks, via spotify_player
   │  (LLM reasons over them using its music knowledge)
   └─► create_playlist_from_tracks(name, [{title, artist}, ...])
          │  server resolves each name → Spotify track via search
          └─► play(new_playlist_uri)                 # on your spotify_player device

Claude Code skill

This repo also ships a Claude Code skill (skill/spotify-dj/) that teaches Claude the recsys workflows on top of the MCP tools. Install it:

cp -r skill/spotify-dj ~/.claude/skills/spotify-dj

Then in Claude Code: "recommend music like my On Repeat playlist" or /spotify-dj.

Known limitations

  • Playback control needs Spotify Premium. Free accounts can read state but not control it.

  • spotify_player's search errors on some queries (an upstream JSON-deserialization bug — exit 0 but non-JSON output). The recsys is resilient to this: an unresolvable pick is skipped and reported under unresolved, never aborting the batch.

  • Delivery is a playlist, not an ephemeral queue — spotify_player's CLI has no "add to queue" verb, so recommendations are delivered as a (revisitable) playlist.

Development

uv pip install -e ".[dev]"
.venv/bin/python -m pytest            # unit tests (no Spotify needed)
.venv/bin/python scripts/smoke_live.py  # end-to-end against a live spotify_player
.venv/bin/python scripts/smoke_mcp.py    # MCP-protocol smoke over stdio

License

MIT © Rachitt Shah

Available Tools

14 tools
append_to_playlistA

Append LLM-proposed {title, artist} picks to an existing playlist by id.

Inputs: tracks (required), playlist_id (required). Returns: object

controlB

Control playback. action ∈ {play, pause, play_pause, next, previous, shuffle, repeat, volume, seek}. For 'volume' pass 0-100; for 'seek' pass milliseconds.

Inputs: action (required), value. Returns: object

create_playlist_from_tracksA

Create a playlist from LLM-proposed {title, artist} picks. The server searches each on Spotify, adds the confident matches, and reports any it couldn't find under 'unresolved'. Returns the new playlist_id + uri.

Inputs: name (required), tracks (required), public, description. Returns: object

get_playlist_tracksA

Get a playlist's tracks by name (case-insensitive) or by Spotify id. Use this to read a playlist before recommending music in its vibe.

Inputs: playlist (required).

get_queueB

Get the current playback queue.

Inputs: no named parameters.

list_devicesA

List available Spotify Connect devices.

Inputs: no named parameters.

list_playlistsA

List the user's playlists (id, name, description, owner).

Inputs: no named parameters.

now_playingA

Get the current playback state: track, artist, device, progress, shuffle/repeat.

Inputs: no named parameters. Returns: object

playA

Search Spotify and play the top matching track. query is free text, e.g. 'redbone childish gambino'.

Inputs: query (required). Returns: object

play_playlistB

Start playback of a playlist by its Spotify id (optionally shuffled).

Inputs: playlist_id (required), shuffle. Returns: object

resolve_tracksA

Resolve a list of {title, artist} picks to real Spotify tracks. Returns {resolved: [...], unresolved: [...]}. Use to preview before building.

Inputs: tracks (required). Returns: object

switch_deviceB

Transfer playback to the device with the given name.

Inputs: name (required). Returns: object

taste_profileA

Get the user's top tracks, to reason about their taste.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 14 tools

    Disambiguation4/5

    Most tools have a clear resource+action distinction, but search, play, and resolve_tracks overlap in their underlying lookup/resolution behavior, and the playlist creation/append tools both resolve track picks. Descriptions are usually enough to pick the right one.

    Naming Consistency3/5

    Names are mostly readable but inconsistent: verb_noun forms like play_playlist and list_devices coexist with bare verbs like play and control, plus noun phrases like now_playing and taste_profile. The generic name control is particularly vague.

    Tool Count4/5

    14 tools is a reasonable size for a Spotify assistant covering playback, queue, devices, search, and playlist management. Some search/resolve and playback-control functionality could be consolidated, but the count is not excessive.

    Completeness3/5

    Core workflows are covered: playback control, queue, devices, search, taste profile, and creating/appending playlists. However, there is no way to remove tracks or delete/replace playlists, nor any queue editing or recommendation tool, leaving notable playlist-lifecycle gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers