XavierFabregat/spotify-mcp

๐ŸŽจ Art & Culture
0 Views
0 Installs

๐Ÿ“‡ ๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - Conversational Spotify control with intent-shaped tools: play by description, queue, devices, playlists, and library, plus a 2-minute PKCE setup wizard. Built for the post-Feb-2026 Spotify Web API. npx -y @xavifabregat/spotify-mcp

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "xavierfabregat-spotify-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "xavierfabregat-spotify-mcp"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

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

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:

http://127.0.0.1:8888/callback

Add to your MCP client

Claude Code

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

{
  "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

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

Related MCP Servers

8enSmith/mcp-open-library

๐Ÿ“‡ โ˜๏ธ - A MCP server for the Open Library API that enables AI assistants to search for book information.

๐ŸŽจ Art & Culture0 views
abhiemj/manim-mcp-server

๐Ÿ ๐Ÿ  ๐ŸชŸ ๐Ÿง - A local MCP server that generates animations using Manim.

๐ŸŽจ Art & Culture0 views
AceDataCloud/MCPFlux

๐Ÿ โ˜๏ธ - Flux AI image generation and editing (Black Forest Labs) via Ace Data Cloud API.

๐ŸŽจ Art & Culture0 views
AceDataCloud/MCPNanoBanana

๐Ÿ โ˜๏ธ - NanoBanana AI image generation and editing with virtual try-on and product placement in realistic scenes.

๐ŸŽจ Art & Culture0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

No check timestamp yet.

Unclaimed listing (imported or pending owner verification). Claim it โ†’
โ˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.