spotify-mcp
Provides extensive tools for controlling Spotify playback, managing playlists (including merging and deduplicating), discovering music through artist network mapping and vibe analysis, and tracking personal listening statistics and taste evolution.
Spotify MCP Server
Control Spotify from Claude, Cursor, or any MCP client. 100+ tools for playback, search, playlist management, smart shuffle, vibe analysis, natural language song search, artist exploration, and library indexing. Just uvx spotify-mcp to get started.
Quick Start
1. Get a Spotify Client ID
Go to the Spotify Developer Dashboard, create an app, set the redirect URI to http://127.0.0.1:8888/callback, check Web API, and copy your Client ID. No client secret needed (PKCE auth).
2. Install and Configure
Claude Code (one command):
claude mcp add spotify -- uvx spotify-mcpThen set your client ID: claude mcp add spotify -e SPOTIFY_CLIENT_ID=your_client_id -- uvx spotify-mcp
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 (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"
}
}
}
}Or install with pip: pip install spotify-mcp
3. Authorize
The first time you use a Spotify tool, your browser opens for OAuth. Grant access and the token is cached locally.
Why this one?
There are 30+ Spotify MCP servers out there. Most have 10-15 tools covering play, pause, and search.
spotify-mcp | Typical server | |
Tools | 100+ | 5-15 |
Smart shuffle (6 strategies incl. energy arcs) | Yes | No |
Vibe engine (mood analysis without audio-features) | Yes | No |
Natural language song search | Yes | No |
Artist network mapping (100 related artists) | Yes | No |
Taste evolution tracking | Yes | No |
Library index (AI playlists from your own songs) | Yes | No |
Destructive tools stripped by default | Yes | No |
Merge / diff / deduplicate playlists | Yes | No |
Works after Feb 2026 API changes | Yes | Most broke |
PKCE auth (no client secret needed) | Yes | Rare |
What can you do with it?
Some things you can ask:
"Play Bohemian Rhapsody"
"Make my playlist start chill and build to high energy"
"Find that sad song with strings by Pink Floyd from the 90s"
"How has my music taste changed over time?"
"Map Radiohead's related artist network"
"Compare my Gym and Running playlists"
"Clean up my old playlist" (removes unavailable tracks and duplicates)
"What's the vibe of my Summer playlist?"
"Create a radio playlist based on Radiohead"
"When do I listen to music the most?"
Toolsets
All tools load by default, minus destructive tools (see Safety). For clients with tool limits, use --toolsets:
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 tools (default, destructive excluded)
spotify-mcp --toolsets=all,destructive # All tools including remove/unfollowOr via environment variable: SPOTIFY_MCP_TOOLSETS=core,power
Available toolsets: core, social, discovery, power, destructive, all
Safety
Destructive tools (remove tracks, unfollow artists, delete content) are not loaded unless you opt in with --toolsets=all,destructive. Safe for auto-accept mode since the AI cannot call tools that don't exist.
Affected tools: spotify_remove_from_playlist, spotify_remove_saved_tracks, spotify_remove_saved_albums, spotify_remove_saved_shows, spotify_unfollow_playlist, spotify_unfollow_artists, spotify_unfollow_users
Even when enabled, destructive tools default to dry_run=True, showing a preview without executing. Pass dry_run=False to perform the action.
Tool Reference
Tool | Description |
| Connection status and current playback |
| Currently playing track details |
| Start playback (track, album, or playlist) |
| Pause playback |
| Resume playback |
| Skip to next track |
| Skip to previous track |
| Add a track to the queue |
| View the playback queue |
| List available Spotify Connect devices |
| Set volume (0-100) |
| Seek to a position in the current track |
| Set repeat mode (off/context/track) |
| Toggle shuffle on or off |
| Transfer playback to another device |
Tool | Description |
| List your playlists |
| Get playlist details and tracks |
| Get playlist tracks with pagination |
| Create a new playlist |
| Add tracks to a playlist |
| Remove tracks from a playlist |
| Move tracks within a playlist |
| Update name, description, or visibility |
| Follow a playlist |
| Unfollow a playlist |
| Get the playlist's cover image URL |
| Check if users follow a playlist |
Tool | Description |
| Search for tracks, artists, albums, or playlists |
| Find artists similar to a given artist |
| Discover tracks via related artists |
| Find tracks matching a mood |
| Explore tracks and artists in a genre |
| Find album-only tracks (not singles) |
Tool | Description |
| Your top tracks by time range |
| Your top artists by time range |
| Recent listening history |
| When you listen (hour and day distributions) |
| Genre diversity and niche artist analysis |
| Compare multiple playlists side by side |
| When each playlist was last updated, sorted by staleness |
Tool | Description |
| Your liked/saved tracks |
| Save tracks to Liked Songs |
| Remove tracks from Liked Songs |
| Your saved albums |
| Save albums to library |
| Remove albums from library |
| Check if tracks are in Liked Songs |
| Check if albums are in your library |
| Your saved podcast episodes |
Tool | Description |
| Follow artists |
| Unfollow artists |
| List your followed artists |
| Check if you follow specific artists |
| Check if you follow specific users |
| Follow Spotify users |
| Unfollow Spotify users |
Tool | Description |
| Your saved podcasts and shows |
| Get show details |
| List episodes of a show |
| Save shows to your library |
| Remove shows from your library |
| Check if shows are in your library |
| Save individual episodes |
| Get episode details (duration, resume point) |
Tool | Description |
| Full track details (popularity, ISRC, preview URL) |
| Album details with full tracklist |
| Artist profile (followers, popularity, genres) |
| List an artist's albums, singles, and compilations |
| User profile with public playlists |
Tool | Description |
| Merge multiple playlists into one |
| Split a playlist by artist |
| Remove duplicate tracks |
| Export playlist data |
| Compare track differences between playlists |
| Scan all playlists for shared tracks |
| Find playlists that are subsets of others |
| Merge unique tracks from one playlist into another |
Tool | Description |
| Full listening profile with genres and stats |
| Analyze playlist composition |
| How your taste has changed over time |
Tool | Description |
| Reorder a playlist: variety, alphabetical_artist, chronological, genre_variety, energy_arc, reverse_chronological |
Tool | Description |
| Create a radio playlist from a seed track or artist |
| Snapshot your current top tracks into a playlist |
| Create a mood-based playlist |
| Create a decade-themed playlist |
Tool | Description |
| Sort by track name, artist, album, duration, or date added |
| Remove unavailable tracks and duplicates |
| Interleave tracks from multiple playlists |
| Create a radio playlist from a playlist's top artists |
Tool | Description |
| Add multiple tracks to the queue in order |
| Queue tracks from a playlist |
Tool | Description |
| Analyze a playlist's genre vibe and energy |
| Find tracks that match a playlist's vibe |
Tool | Description |
| Full artist profile with discography and stats |
| Artist's career timeline with all releases |
| Map an artist's related artist network |
Tool | Description |
| Find a song using natural language description |
Sync your Spotify library to a local index, then let your AI create playlists from songs you already know instead of random catalog tracks.
Tool | Description |
| Sync liked songs and your playlists to a local JSON index |
| Artist counts, playlist names, and dates (compact overview for AI reasoning) |
| Filter your library by artist, playlist, date range, track/album name |
Example: "Make a playlist with my favorite indie rock songs from this year." The AI checks your library stats, picks matching artists, queries by date range, and builds a playlist from songs you already have.
Data stored at %LOCALAPPDATA%\spotify-mcp\library.json (Windows) or ~/.cache/spotify-mcp/library.json (Linux/Mac). Only syncs playlists you created.
Setup Options
Environment Variables (Recommended)
Set SPOTIFY_CLIENT_ID (and optionally SPOTIFY_CLIENT_SECRET) in your MCP client config's env field.
Interactive Setup
spotify-mcp-setupWalks you through credentials and saves them to ~/.config/spotify-mcp/.env (Linux/Mac) or %APPDATA%\spotify-mcp\.env (Windows).
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/callbackAdd SPOTIFY_CLIENT_SECRET=your_secret if you prefer traditional OAuth over PKCE.
Finding Spotify IDs
Most tools accept IDs, URIs, or URLs interchangeably:
Search first: Use
spotify_searchto find anything by nameCopy from Spotify: Right-click any item -> Share -> Copy Spotify URI
From URLs:
https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC->4uLU6hMCjMI75M1A2tKUQC
Spotify's Feb 2026 API Changes
Spotify removed several endpoints in February 2026: audio-features, audio-analysis, recommendations, artist/top-tracks, all batch endpoints, and browse/categories. Search capped at 10 results per page. Most Spotify MCP servers 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 genre data rather than audio-features. 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 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
If you find this useful, a star helps others find it too.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gupta-kush/spotify-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server