Spotify MCP
This MCP server lets you control Spotify conversationally: play music, manage playback and queues, search the catalog, and manage playlists and your library.
Authenticate with Spotify via OAuth/PKCE and store/refresh tokens locally.
Play music by free-text query or Spotify URI, choosing a best match and reporting what it picked.
Control playback: pause, resume, next, previous, seek, volume, shuffle, repeat.
View now playing details: track, artist, album, progress, device, shuffle/repeat state.
Manage the queue: add a track by query/URI or list what’s up next.
List Spotify devices and transfer playback to a device by name or id.
Search tracks, albums, artists, and playlists, up to 10 results per type.
List your playlists and show tracks in your own or collaborative playlists.
Create playlists and append track URIs to existing playlists.
Save, remove, or check items in your Spotify library, including tracks, albums, artists, shows, and episodes.
Return compact text responses with Spotify URIs and actionable error instructions.
Controls Spotify playback, search, queue, playlists, and library management through free-text queries or Spotify URIs.
spotify-mcp
Control Spotify by talking to your AI. An MCP server for Claude Desktop, Claude Code, Cursor, and any other MCP client.
You: play something like early Bill Evans AI: ▶ Now playing: "Peace Piece" — Bill Evans · Everybody Digs Bill Evans
You: perfect, queue the whole album and save this one AI: ➕ Queued Everybody Digs Bill Evans · ❤️ Saved "Peace Piece" to your library
Built against the current (post-February-2026) Spotify Web API — many older Spotify MCP servers predate those changes and are partially broken.
Requirements
Spotify Premium — Spotify requires it for playback control and (since Feb 2026) for creating the developer app you'll use.
Node.js ≥ 20
Related MCP server: Spotify MCP Server
Quick start
npx -y @xavifabregat/spotify-mcp initThe wizard walks you through creating your own (free) Spotify developer app, asks for its Client ID, and opens a browser to connect your account — about 2 minutes total.
Why your own app? Spotify caps third-party apps at a handful of users, so every user
brings their own; the wizard makes that painless. No client secret is involved (PKCE).
Tokens stay in ~/.spotify-mcp/ on your machine and refresh silently.
The one detail that must be exact — your app's Redirect URI:
http://127.0.0.1:8888/callbackAdd to your MCP client
Claude Code
claude mcp add -s user spotify -- npx -y @xavifabregat/spotify-mcpClaude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json)
or Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"spotify": {
"command": "npx",
"args": ["-y", "@xavifabregat/spotify-mcp"]
}
}
}Restart the client and start talking.
Claude Desktop extension (one-click)
Prefer not to edit config files? Install the .mcpb bundle instead: download
spotify-mcp.mcpb from the latest release,
open it (or drag it into Claude Desktop → Settings → Extensions), and paste your Spotify
app's Client ID when prompted. Then ask Claude to connect Spotify — the authenticate
tool opens the browser login. You still need the developer app and Redirect URI from
the quick start, but not the init wizard.
Tools
Tool | What it does |
| Play by free-text query (search → best match → play) or Spotify URI |
| pause / resume / next / previous / seek / volume / shuffle / repeat |
| Current track, progress, device, mode |
| Add a track to the queue; show up next |
| List devices; transfer playback |
| Browse tracks/albums/artists/playlists (max 10 per type — API cap) |
| List your playlists |
| Show a playlist's tracks (own/collaborative only — API restriction) |
| Create a playlist; add tracks |
| Save / remove / check items in your library |
| Run the Spotify login from inside a conversation |
Design
Tools are intents, not endpoints. "Play some Radiohead" is one tool call — the server searches, picks the best match, starts playback, and reports what it chose so you can correct it. No search → choose → play round trips.
Small surface. 11 tools instead of one per API endpoint keeps tool selection accurate across different AI clients and context lean.
Responses are compact text with Spotify URIs, so follow-ups ("queue that") chain without re-searching. Raw API payloads never reach the model.
Errors are instructions. No active device? The response lists your devices and says how to pick one. Not logged in? It points at the
authenticatetool. The model relays the fix instead of a stack trace.
Troubleshooting
"No active Spotify device" — Spotify's API can only steer a running app. Open Spotify anywhere; if it just woke up, tap play/pause once. With exactly one device online, the tools target it automatically.
INVALID_CLIENT: Invalid redirect URIduring login — the Redirect URI in your app settings isn't exactlyhttp://127.0.0.1:8888/callback(localhostis rejected by Spotify).Port 8888 in use during login — set
SPOTIFY_REDIRECT_PORTto a free port and register the matching redirect URI."Token refresh failed" — run
npx -y @xavifabregat/spotify-mcp authto log in again (e.g. after changing the Client ID).Config precedence — the
SPOTIFY_CLIENT_IDenv var overrides~/.spotify-mcp/config.json(written byinit).
Development
git clone https://github.com/XavierFabregat/spotify-mcp.git
cd spotify-mcp
npm install
npm run build
npm run inspect # MCP Inspector against the local build
npm run bundle # build/spotify-mcp.mcpb (Claude Desktop extension)Layout: src/auth.ts (OAuth PKCE + token store) · src/spotify.ts (typed API
client) · src/tools/ (tool implementations) · src/format.ts (compact output).
License
MIT © Xavi Fabregat
Available Tools
11 toolsauthenticateConnect Spotify accountA
Connects the user's Spotify account via OAuth. Opens a browser on this machine for approval and stores tokens locally. Use when other tools report you are not authenticated, or to switch accounts.
Inputs: no named parameters.
devicesSpotify devicesA
action=list shows available Spotify devices; action=transfer moves playback to a device by name or id.
Inputs: action (required), device.
get_playlist_itemsShow playlist contentsARead-only
Lists the tracks in one of the user's own or collaborative playlists (Spotify no longer exposes other users' playlist contents). Accepts a playlist id, URI, or URL.
Inputs: playlist (required), offset.
get_playlistsList my playlistsBRead-only
Lists the user's playlists with item counts and URIs.
Inputs: no named parameters.
libraryManage libraryA
Saves, removes, or checks items in the user's Spotify library ('liked'). Works with any content URI: tracks, albums, artists (follow), shows, episodes. To save the current song, get its URI from now_playing first.
Inputs: uris (required), action (required).
modify_playlistCreate playlist / add tracksA
action=create makes a new playlist (private by default); action=add_items appends track URIs to an existing playlist. Does not delete or remove anything.
Inputs: action (required), name, uris, public, +2 more.
now_playingWhat's playingARead-only
Current track, artist, album, progress, device, and shuffle/repeat state.
Inputs: no named parameters.
playPlay musicA
Plays music by free-text query (searches and starts the best match) or by Spotify URI. Handles "play some Radiohead", "play the album Kind of Blue", "play my Discover Weekly". Reports what it picked — relay that to the user so they can correct it.
Inputs: uri, type, query, device_id.
playbackControl playbackB
Transport controls for the active playback: pause, resume, next, previous, seek (value = seconds), volume (value = 0-100), shuffle (value = on/off), repeat (value = off/context/track).
Inputs: action (required), value.
queuePlayback queueC
action=add queues a track by query or URI; action=list shows what's playing and up next.
Inputs: action (required), uri, query.
searchSearch SpotifyARead-only
Searches the Spotify catalog. Use when the user wants options to choose from; for a direct 'play X' request, prefer the play tool. Results include URIs usable with play, queue, playlists, and library. Max 10 results per type (API limit).
Inputs: query (required), limit, types.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a clearly distinct purpose: authentication, device management, playlist operations, library management, playback control, queue management, and search. There is no overlap or ambiguity.
Names are a mix of single verbs (play, search), nouns (devices, library, queue), and verb_noun patterns (get_playlists, now_playing). While readable, the lack of a consistent pattern reduces predictability.
With 11 tools covering authentication, playback, library, playlists, queue, and search, the scope is well-balanced for a music streaming service. Each tool earns its place.
Most core workflows are covered: authentication, playback control, library management (save/remove/check), playlist creation and addition, queue, and search. Minor gaps include lack of playlist item removal or reordering.
Maintenance
Related MCP Connectors
MCP server for Producer/Riffusion AI music generation
Generate AI music via the Lacuna Music API from MCP clients like Claude Desktop & Code.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseBqualityCmaintenanceA lightweight Model Context Protocol server that enables AI assistants like Cursor & Claude to control Spotify playback and manage playlists.22513MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables controlling Spotify playback through natural language commands in MCP clients like Cursor or Claude for Desktop.1-
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI assistants like Claude Desktop to interact with Spotify's music streaming service, supporting playback control, playlist management, music search, and user profile access.412MIT
- AlicenseAqualityBmaintenanceMCP server for the Spotify Web API — gives Claude and other AI assistants tools to search music, control playback, manage playlists, library, and podcasts.475MIT