Spotify MCP logo

Spotify MCP

by XavierFabregat

MCP server enabling conversational control of Spotify playback, library, playlists, and devices via the updated post-Feb-2026 Spotify API.

Install Spotify MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "xavierfabregat-spotify-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@xavifabregat/spotify-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

This MCP server provides intent-based tools to control Spotify through natural language commands, supporting playback, queue management, device selection, playlist and library operations. It requires Spotify Premium and Node.js ≥ 20, and includes a setup wizard for creating a personal Spotify developer app with PKCE authentication. Designed for compatibility with the latest Spotify Web API changes, it integrates with MCP clients like Claude Desktop, Claude Code, and Cursor.

Use cases

  • Play tracks or albums by natural language description
  • Manage playback controls such as pause, resume, skip, and volume
  • Queue tracks and manage playback devices
  • Browse, create, and modify playlists
  • Save or remove tracks from the user’s Spotify library

Key features

  • Intent-shaped tools for play, playback, queue, devices, search, playlists, and library
  • PKCE-based OAuth authentication with a setup wizard
  • Supports the post-February-2026 Spotify Web API
  • Compact textual responses with Spotify URIs for follow-up commands
  • Error handling with actionable instructions
  • Token storage and silent refresh on the local machine

Tools11

What Spotify MCP lets your agent do. Expand a tool for its parameters.

Self-reported~155 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

3/4 checks healthy over the last 79d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 11d ago via OSV.dev · @xavifabregat/spotify-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads509Package downloads in the last 30 days.
Last commit1mo agoMost recent push to the default branch.
Tools exposed11Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

spotify-mcp

npm CI license node

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

Quick start

Terminal
npx -y @xavifabregat/spotify-mcp init

The 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:

Code
http://127.0.0.1:8888/callback

Add to your MCP client

Claude Code

Terminal
claude mcp add -s user spotify -- npx -y @xavifabregat/spotify-mcp

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json) or Cursor (~/.cursor/mcp.json):

config.json
{
  "mcpServers": {
    "spotify": {
      "command": "npx",
      "args": ["-y", "@xavifabregat/spotify-mcp"]
    }
  }
}

Restart the client and start talking.

Tools

ToolWhat it does
playPlay by free-text query (search → best match → play) or Spotify URI
playbackpause / resume / next / previous / seek / volume / shuffle / repeat
now_playingCurrent track, progress, device, mode
queueAdd a track to the queue; show up next
devicesList devices; transfer playback
searchBrowse tracks/albums/artists/playlists (max 10 per type — API cap)
get_playlistsList your playlists
get_playlist_itemsShow a playlist's tracks (own/collaborative only — API restriction)
modify_playlistCreate a playlist; add tracks
librarySave / remove / check items in your library
authenticateRun 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 authenticate tool. 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 URI during login — the Redirect URI in your app settings isn't exactly http://127.0.0.1:8888/callback (localhost is rejected by Spotify).
  • Port 8888 in use during login — set SPOTIFY_REDIRECT_PORT to a free port and register the matching redirect URI.
  • "Token refresh failed" — run npx -y @xavifabregat/spotify-mcp auth to log in again (e.g. after changing the Client ID).
  • Config precedence — the SPOTIFY_CLIENT_ID env var overrides ~/.spotify-mcp/config.json (written by init).

Development

sh
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

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

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Spotify MCP

Spotify Premium is required for playback control and developer app creation.

Uses OAuth PKCE flow with tokens stored locally; no client secret needed.

Ensure Spotify is running on a device and playback has been started at least once.

Set your Spotify app's Redirect URI exactly to http://127.0.0.1:8888/callback.

Yes, set SPOTIFY_REDIRECT_PORT to a free port and update your app's Redirect URI accordingly.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSpotify MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/xavierfabregat-spotify-mcp?style=directory)](https://allmcps.com/mcp/xavierfabregat-spotify-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/xavierfabregat-spotify-mcp"><img src="https://allmcps.com/api/badge/xavierfabregat-spotify-mcp?style=directory" alt="Spotify MCP on AllMCPs" /></a>