Spotify MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "SPOTIFY_CLIENT_ID=${SPOTIFY_CLIENT_ID}" -e "SPOTIFY_CLIENT_SECRET=${SPOTIFY_CLIENT_SECRET}" spotify-mcp-0d53 -- uvx --python 3.12 --from git+https://github.com/verIdyia/spotify-mcp spotify-mcp
Required:SPOTIFY_CLIENT_IDSPOTIFY_CLIENT_SECRET+ 2 optional
README.md

Control your Spotify playback, search music, and manage playlists via Claude.

spotify-mcp

A Model Context Protocol (MCP) server that connects Claude with Spotify. Control your Spotify playback, search music, manage playlists, and more -- all through natural conversation with Claude.

Fork Notice: This project is forked from varunneal/spotify-mcp and updated for the Spotify Web API February 2026 changes. Built and maintained with Claude Code.

What's Changed (v0.4.0)

Architecture Rewrite

  • Dropped spotipy -- uses httpx async directly (native async, no asyncio.to_thread wrapping)
  • Single module -- server.py, spotify_api.py, utils.py consolidated into one file
  • FastMCP -- clean @mcp.tool() decorators instead of manual ToolModel + match/case routing
  • 2 dependencies -- only mcp + httpx (was mcp + spotipy + python-dotenv)
  • Explicit OAuth -- spotify-mcp --auth for initial setup, auto-refresh on subsequent use

Features (preserved from v0.3.0)

  • Start, pause, and skip playback
  • Search for tracks, albums, artists, and playlists
  • Get detailed info about any Spotify item
  • Manage the playback queue
  • Full playlist CRUD (create, read, update, delete tracks)
  • Retrieve liked/saved songs with optional genre enrichment
  • Adapted for Spotify Feb 2026 API changes

How It Works

Claude <--MCP (stdio)--> spotify-mcp <--httpx async--> Spotify Web API
  1. Claude sends tool calls via the MCP protocol
  2. The server translates them into Spotify Web API requests using httpx
  3. OAuth tokens auto-refresh; initial auth via spotify-mcp --auth
  4. Results are parsed into concise JSON and returned to Claude

Available Tools

Tool Actions Description
spotify_playback get, start, pause, skip Control music playback
spotify_search -- Search tracks, albums, artists, playlists
spotify_queue get, add View and manage play queue
spotify_get_info -- Get detailed item info by Spotify URI
spotify_playlist get, get_tracks, add_tracks, remove_tracks, change_details, create, delete Full playlist management
spotify_liked_songs get, get_with_genres Retrieve saved songs with optional genres

Architecture

src/spotify_mcp/
  __init__.py   # Entry point (stdio / --auth)
  server.py     # FastMCP server, API client, parsers — all in one

Prerequisites

  • Python 3.12+
  • Spotify Premium account (required for Dev Mode API access since Feb 2026)
  • Spotify Developer App credentials

Configuration

1. Create Spotify Developer App

  1. Go to developer.spotify.com/dashboard
  2. Create a new app
  3. Set redirect URI to http://127.0.0.1:8080/callback
  4. Note your Client ID and Client Secret

Important (Feb 2026): Dev Mode apps are limited to 5 authorized users and require the app owner to have Spotify Premium.

2. Initial Authentication

Run the auth flow once to get your OAuth token:

SPOTIFY_CLIENT_ID=your_id SPOTIFY_CLIENT_SECRET=your_secret uv run spotify-mcp --auth

This opens a browser for Spotify login, then saves the token to ~/.spotify_mcp_cache.json.

3. Add to MCP Client

Run locally (recommended)
git clone https://github.com/verIdyia/spotify-mcp.git

Add to your MCP config (Claude Desktop, Cursor, etc.):

{
  "mcpServers": {
    "spotify": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/spotify-mcp",
        "run",
        "spotify-mcp"
      ],
      "env": {
        "SPOTIFY_CLIENT_ID": "your_client_id",
        "SPOTIFY_CLIENT_SECRET": "your_client_secret",
        "SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8080/callback"
      }
    }
  }
}
Run with uvx
{
  "mcpServers": {
    "spotify": {
      "command": "uvx",
      "args": [
        "--python", "3.12",
        "--from", "git+https://github.com/verIdyia/spotify-mcp",
        "spotify-mcp"
      ],
      "env": {
        "SPOTIFY_CLIENT_ID": "your_client_id",
        "SPOTIFY_CLIENT_SECRET": "your_client_secret",
        "SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8080/callback"
      }
    }
  }
}

Environment Variables

Variable Required Default Description
SPOTIFY_CLIENT_ID Yes -- Spotify app Client ID
SPOTIFY_CLIENT_SECRET Yes -- Spotify app Client Secret
SPOTIFY_REDIRECT_URI No http://127.0.0.1:8080/callback OAuth redirect URI
SPOTIFY_CACHE_PATH No ~/.spotify_mcp_cache.json Token cache file path

Troubleshooting

  1. First run: Run spotify-mcp --auth to complete the OAuth flow before using with an MCP client
  2. Token expired: Tokens auto-refresh. If issues persist, re-run --auth
  3. No active device: Make sure Spotify is o

Tools (6)

spotify_playbackControl music playback including get, start, pause, and skip actions.
spotify_searchSearch for tracks, albums, artists, and playlists.
spotify_queueView and manage the current play queue.
spotify_get_infoGet detailed item info by Spotify URI.
spotify_playlistFull playlist management including create, read, update, and delete tracks.
spotify_liked_songsRetrieve saved songs with optional genre enrichment.

Environment Variables

SPOTIFY_CLIENT_IDrequiredSpotify app Client ID
SPOTIFY_CLIENT_SECRETrequiredSpotify app Client Secret
SPOTIFY_REDIRECT_URIOAuth redirect URI
SPOTIFY_CACHE_PATHToken cache file path

Configuration

claude_desktop_config.json
{"mcpServers": {"spotify": {"command": "uvx", "args": ["--python", "3.12", "--from", "git+https://github.com/verIdyia/spotify-mcp", "spotify-mcp"], "env": {"SPOTIFY_CLIENT_ID": "your_client_id", "SPOTIFY_CLIENT_SECRET": "your_client_secret", "SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8080/callback"}}}}

Try it

Pause my current music playback.
Search for the latest album by Radiohead and add it to my queue.
Create a new playlist called 'Focus Music' and add my top 5 liked songs to it.
What is the current song playing and who is the artist?
Get my liked songs and tell me which ones are in the jazz genre.

Frequently Asked Questions

What are the key features of Spotify MCP?

Start, pause, and skip playback controls. Search functionality for tracks, albums, artists, and playlists. Full playlist CRUD operations. Retrieve liked songs with optional genre enrichment. Automatic OAuth token refresh.

What can I use Spotify MCP for?

Managing music playback while working in an IDE without switching windows. Automating the creation of playlists based on specific genres or liked songs. Quickly searching for and queuing up music tracks during a coding session. Retrieving detailed metadata about specific Spotify items for music analysis.

How do I install Spotify MCP?

Install Spotify MCP by running: git clone https://github.com/verIdyia/spotify-mcp.git

What MCP clients work with Spotify MCP?

Spotify MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Spotify MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare