MCP Hub
Back to servers

spotify-mcp

This is a 93-tool Spotify MCP server for Claude, Cursor, and any MCP client. Smart shuffle, vibe analysis, natural language search, artist networks, and more.

glama
Stars
1
Updated
Mar 21, 2026
Validated
May 8, 2026

Spotify MCP Server

PyPI Tests 93 Tools License: MIT Python 3.10+

Control Spotify from Claude, Cursor, or any MCP client. 93 tools -- not just play/pause, but smart shuffling, vibe analysis, natural language song search, artist network mapping, taste evolution tracking, and way more. Built for Spotify's post-February 2026 API where most other servers broke.

Why this one?

There are 30+ Spotify MCP servers out there. Most give you 10-15 tools covering play, pause, search, done. This one goes deeper:

spotify-mcpTypical server
Tools935-15
Smart shuffle (6 strategies including energy arcs)YesNo
Vibe engine -- mood analysis without audio-features APIYesNo
"Find that sad piano song from the 2000s"YesNo
Map an artist's network of 100 related artistsYesNo
"How has my taste changed?" -- evolution trackingYesNo
Merge / diff / deduplicate playlistsYesNo
Works after Spotify's Feb 2026 API changesYesMost broke
PKCE auth -- no client secret neededYesRare

Quick Start

1. Install

uvx spotify-mcp

Or with pip:

pip install spotify-mcp

2. Get Spotify Credentials

  1. Go to the Spotify Developer Dashboard
  2. Click Create App
  3. Set the Redirect URI to http://127.0.0.1:8888/callback
  4. Check Web API and click Save
  5. Copy your Client ID (Client Secret is optional -- PKCE auth works without it)

3. Configure Your Client

Claude Desktop -- add to claude_desktop_config.json:

{
  "mcpServers": {
    "spotify": {
      "command": "uvx",
      "args": ["spotify-mcp"],
      "env": {
        "SPOTIFY_CLIENT_ID": "your_client_id"
      }
    }
  }
}

Cursor / VS Code -- use the same config, but load only core tools to stay under the 40-tool limit:

{
  "mcpServers": {
    "spotify": {
      "command": "uvx",
      "args": ["spotify-mcp", "--toolsets=core"],
      "env": {
        "SPOTIFY_CLIENT_ID": "your_client_id"
      }
    }
  }
}

4. First Run

The first time you use a Spotify tool, your browser opens for OAuth authorization. Grant access and the token is cached locally.

What can you do with it?

Just talk to your AI assistant like you'd talk to a friend who has access to your Spotify:

  • "Play Bohemian Rhapsody"
  • "Make my playlist start chill and build to high energy" -- smart shuffle reorders it with an energy arc
  • "Find that sad song with strings by Pink Floyd from the 90s" -- natural language, not exact titles
  • "How has my music taste changed over time?" -- compares your short/medium/long term listening
  • "Map Radiohead's related artist network" -- explores up to 100 connected artists
  • "Create a 90s era playlist"
  • "Compare my Gym and Running playlists" -- side-by-side genre and artist breakdown
  • "Clean up my old playlist" -- finds and removes unavailable tracks and duplicates
  • "What's the vibe of my Summer playlist?" -- genre-based energy and mood analysis
  • "Create a radio playlist based on Radiohead" -- samples related artists' catalogs
  • "When do I listen to music the most?" -- hour-of-day and day-of-week patterns

Toolsets

By default, all 93 tools are loaded. For clients with tool limits (Cursor: 40 max), use --toolsets to load only what you need:

spotify-mcp --toolsets=core              # ~27 tools: playback, playlists, search, library, browse, stats
spotify-mcp --toolsets=core,discovery    # Add music discovery
spotify-mcp --toolsets=core,power        # Add power tools (smart shuffle, vibe engine, etc.)
spotify-mcp --toolsets=all               # All 93 tools (default)

Or via environment variable: SPOTIFY_MCP_TOOLSETS=core,power

Available toolsets: core, social, discovery, power, all

Tool Reference

Playback (15 tools)
ToolDescription
spotify_statusConnection status and current playback
spotify_now_playingCurrently playing track details
spotify_playStart playback (track, album, or playlist)
spotify_pausePause playback
spotify_resumeResume playback
spotify_skip_nextSkip to next track
spotify_skip_previousSkip to previous track
spotify_add_to_queueAdd a track to the queue
spotify_get_queueView the playback queue
spotify_get_devicesList available Spotify Connect devices
spotify_set_volumeSet volume (0-100)
spotify_seekSeek to a position in the current track
spotify_set_repeatSet repeat mode (off/context/track)
spotify_toggle_shuffleToggle shuffle on or off
spotify_transfer_playbackTransfer playback to another device
Playlists (12 tools)
ToolDescription
spotify_get_my_playlistsList your playlists
spotify_get_playlistGet playlist details and tracks
spotify_get_playlist_tracksGet playlist tracks with pagination
spotify_create_playlistCreate a new playlist
spotify_add_to_playlistAdd tracks to a playlist
spotify_remove_from_playlistRemove tracks from a playlist
spotify_reorder_playlistMove tracks within a playlist
spotify_update_playlistUpdate name, description, or visibility
spotify_follow_playlistFollow a playlist
spotify_unfollow_playlistUnfollow a playlist
spotify_get_playlist_coverGet the playlist's cover image URL
spotify_check_playlist_followersCheck if users follow a playlist
Search & Discovery (6 tools)
ToolDescription
spotify_searchSearch for tracks, artists, albums, or playlists
spotify_related_artistsFind artists similar to a given artist
spotify_discover_by_artistDiscover tracks via related artists
spotify_discover_by_moodFind tracks matching a mood
spotify_genre_explorerExplore tracks and artists in a genre
spotify_discover_deep_cutsFind album-only tracks (not singles)
Stats & Insights (6 tools)
ToolDescription
spotify_top_tracksYour top tracks by time range
spotify_top_artistsYour top artists by time range
spotify_recently_playedRecent listening history
spotify_listening_patternsWhen you listen -- hour and day distributions
spotify_taste_profileGenre diversity and niche artist analysis
spotify_playlist_compareCompare multiple playlists side by side
Library (9 tools)
ToolDescription
spotify_get_saved_tracksYour liked/saved tracks
spotify_save_tracksSave tracks to Liked Songs
spotify_remove_saved_tracksRemove tracks from Liked Songs
spotify_get_saved_albumsYour saved albums
spotify_save_albumsSave albums to library
spotify_remove_saved_albumsRemove albums from library
spotify_check_saved_tracksCheck if tracks are in Liked Songs
spotify_check_saved_albumsCheck if albums are in your library
spotify_get_saved_episodesYour saved podcast episodes
Follow & Social (7 tools)
ToolDescription
spotify_follow_artistsFollow artists
spotify_unfollow_artistsUnfollow artists
spotify_get_followed_artistsList your followed artists
spotify_check_following_artistsCheck if you follow specific artists
spotify_check_following_usersCheck if you follow specific users
spotify_follow_usersFollow Spotify users
spotify_unfollow_usersUnfollow Spotify users
Shows & Podcasts (8 tools)
ToolDescription
spotify_get_saved_showsYour saved podcasts and shows
spotify_get_showGet show details
spotify_get_show_episodesList episodes of a show
spotify_save_showsSave shows to your library
spotify_remove_saved_showsRemove shows from your library
spotify_check_saved_showsCheck if shows are in your library
spotify_save_episodesSave individual episodes
spotify_get_episodeGet episode details (duration, resume point)
Browse (4 tools)
ToolDescription
spotify_get_trackFull track details (popularity, ISRC, preview URL)
spotify_get_albumAlbum details with full tracklist
spotify_get_artistArtist profile (followers, popularity, genres)
spotify_get_userUser profile with public playlists
Playlist Power Tools (6 tools)
ToolDescription
spotify_merge_playlistsMerge multiple playlists into one
spotify_split_playlist_by_artistSplit a playlist by artist
spotify_deduplicate_playlistRemove duplicate tracks
spotify_export_playlistExport playlist data
spotify_playlist_diffCompare track differences between playlists
spotify_find_playlist_overlapsScan all playlists for shared tracks
Reports & Analytics (3 tools)
ToolDescription
spotify_listening_reportFull listening profile with genres and stats
spotify_playlist_analysisAnalyze playlist composition
spotify_taste_evolutionHow your taste has changed over time
Smart Shuffle (1 tool, 6 strategies)
ToolDescription
spotify_smart_shuffleReorder a playlist: variety, alphabetical_artist, chronological, genre_variety, energy_arc, reverse_chronological
Playlist Generators (4 tools)
ToolDescription
spotify_create_radioCreate a radio playlist from a seed track or artist
spotify_time_capsuleSnapshot your current top tracks into a playlist
spotify_vibe_playlistCreate a mood-based playlist
spotify_era_playlistCreate a decade-themed playlist
Playlist Curator (4 tools)
ToolDescription
spotify_sort_playlistSort by track name, artist, album, duration, or date added
spotify_cleanup_playlistRemove unavailable tracks and duplicates
spotify_interleave_playlistsInterleave tracks from multiple playlists
spotify_playlist_radioCreate a radio playlist from a playlist's top artists
Queue Builder (2 tools)
ToolDescription
spotify_build_queueAdd multiple tracks to the queue in order
spotify_queue_from_playlistQueue tracks from a playlist
Vibe Engine (2 tools)
ToolDescription
spotify_playlist_vibeAnalyze a playlist's genre vibe and energy
spotify_find_vibe_matchesFind tracks that match a playlist's vibe
Artist Explorer (3 tools)
ToolDescription
spotify_artist_deep_diveComprehensive artist deep dive report
spotify_artist_timelineArtist's career timeline with all releases
spotify_artist_networkMap an artist's related artist network
Find Song (1 tool)
ToolDescription
spotify_find_songFind a song using natural language description

Setup Options

Option A: Environment Variables (Recommended)

Set SPOTIFY_CLIENT_ID (and optionally SPOTIFY_CLIENT_SECRET) in your MCP client config's env field. This is the simplest approach.

Option B: Interactive Setup

spotify-mcp-setup

Walks you through entering credentials and saves them to ~/.config/spotify-mcp/.env (Linux/Mac) or %APPDATA%\spotify-mcp\.env (Windows).

Option C: Manual .env File

Create .env in ~/.config/spotify-mcp/ (or %APPDATA%\spotify-mcp\ on Windows):

SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_REDIRECT_URI=http://127.0.0.1:8888/callback

Add SPOTIFY_CLIENT_SECRET=your_secret if you prefer the traditional OAuth flow over PKCE.

Authentication Modes

  • PKCE (default): Only needs SPOTIFY_CLIENT_ID. No client secret required. Recommended for most users.
  • OAuth: If SPOTIFY_CLIENT_SECRET is also set, uses the traditional OAuth flow. Backward-compatible with existing setups.

Finding Spotify IDs

Most tools accept Spotify IDs, URIs, or URLs interchangeably:

  • Search first: Use spotify_search to find anything by name
  • Copy from Spotify: Right-click any item -> Share -> Copy Spotify URI
  • From URLs: https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC -> 4uLU6hMCjMI75M1A2tKUQC

A note on Spotify's Feb 2026 API changes

Spotify removed a bunch of endpoints in February 2026: audio-features, audio-analysis, recommendations, artist/top-tracks, all batch endpoints, and browse/categories. Search is now capped at 10 results per page. Most Spotify MCP servers just... broke.

This server was built with those constraints in mind. Discovery uses search + related artists + genre mapping instead of the old recommendations API. The vibe engine estimates energy from artist genre data rather than the now-dead audio-features endpoint. It's not perfect, but it works.

Architecture

spotify_mcp/
├── server.py                      # FastMCP entry + toolset loading
├── auth.py                        # OAuth / PKCE auth singleton
├── config.py                      # Constants, genre maps, toolset definitions
├── tools/                         # Core tools (playback, playlists, search, etc.)
├── power/                         # Power tools (smart shuffle, vibe engine, etc.)
└── utils/                         # Shared utilities (client, errors, formatting)

Troubleshooting

"No active device found"

Open Spotify on any device before using playback commands.

OAuth redirect fails

Ensure the redirect URI in your config exactly matches the Spotify Developer Dashboard. Default: http://127.0.0.1:8888/callback (not https).

Token expired or corrupted

Delete .spotify_token_cache from ~/.cache/spotify-mcp/ (or %LOCALAPPDATA%\spotify-mcp\) and restart.

Premium-only features

Volume, seek, transfer, shuffle, and repeat require Spotify Premium.

Contributing

See CONTRIBUTING.md for development setup, code conventions, and how to add new tools.

License

MIT


If this is useful to you, a star on the repo goes a long way. It helps other people find it.

Reviews

No reviews yet

Sign in to write a review