Used as a secondary data source for ISRC lookups to enhance audio feature analysis and track identification capabilities.
Enables comprehensive Spotify playlist management and music curation, including creating/editing playlists, searching tracks, adding/removing songs, getting personalized recommendations, analyzing audio features (BPM, key, energy, danceability), discovering top tracks, finding duplicates, and performing artist research with discography and related artist lookups.
Spotify-mcp-Overload
A Model Context Protocol (MCP) server that enables Claude Code CLI or Desktop to interact with Spotify for playlist curation and management, among other goodies.
Rock Out with The Following Features:
๐ง Smart playlist curation
๐ค๏ธ Deep track identification
๐บ Song analysis (bpm, danceability, etc.)
๐ Discovery & Recommendation (w/ seed validation)
Features
๐ฆCore Playlist Management
Create playlists
Search for tracks
Add tracks to playlists (with automatic rate limit handling)
Remove tracks from playlists (with automatic rate limit handling)
Get user playlists
Get playlist tracks
๐ง Smart Curation & Discovery
Get your top tracks - See what you listen to most (by time period)
Get track recommendations (with seed validation)
Create curated playlists - Automated playlist based on your top tracks + recommendations
Find duplicate tracks in playlists
๐ Audio Analysis
Get audio features - BPM, musical key, energy, danceability, valence, acousticness
Multi-source data - GetSongBPM API + MusicBrainz/AcousticBrainz waterfall
Smart caching - 30-day TTL, positive/negative caching to reduce API calls
No preview required - Works with ISRC lookups, not dependent on 30s previews
Coverage: ~70-90% for popular/older tracks, ~20-40% for recent releases (2020+)
๐ ๏ธ Reliability Features
Automatic retry on Spotify API rate limits (HTTP 429)
Batch processing for large operations (100+ tracks)
Async execution - Audio analysis runs in thread pool (no blocking)
Prerequisites
Python 3.10 or higher
Spotify account
Spotify Developer App (for API credentials)
Setup
1. Get Spotify API Credentials
Click "Create app"
Fill in:
App name: "spotify-mcp-enhanced-music-overload"
App description: "MCP server for Claude integration"
Redirect URI:
http://127.0.0.1:8888/callbackAPIs used: Check "Web API"
Accept terms and click "Save"
Click "Settings" to view your Client ID and Client Secret
2. Install Dependencies
This installs all required dependencies including audio features support.
3. Get Your Free GetSongBPM API Key (Optional but Recommended)
For enhanced audio features coverage:
Go to GetSongBPM API
Sign up for a free API key
4. Configure Environment
5. First Run Authentication
The first time you run the server, it will:
Open your browser automatically
Ask you to authorize the application
Redirect to
http://127.0.0.1:8888/callbackSave the authentication token locally in
.spotify_cache
Note: The redirect URL will show an error in your browser (this is normal). The authentication token is extracted from the URL automatically.
After the first run, the token is cached and you won't need to authenticate again unless it expires.
Usage
With Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Important:
Use absolute path to Python (e.g.,
/opt/miniconda3/bin/pythonor/usr/bin/python3) - find it withwhich pythonUse absolute paths for all file paths, not relative paths
Replace
/absolute/path/to/spotify-mcpwith your actual pathReplace
your_client_idandyour_client_secretwith your actual credentials
Restart Claude Desktop after adding the configuration.
Tip: See TESTING_GUIDE.md for comprehensive Claude Desktop setup instructions.
With Claude Code CLI
Recommended for large playlists and complex workflows! Claude Code CLI has a much larger context window than Claude Desktop, making it ideal for:
Creating playlists with 100+ tracks
Multi-step curation workflows
Batch operations across multiple playlists
Add to your settings file:
Location: ~/.claude/settings.json
Important:
Use absolute path to Python - find it with
which pythonUse absolute paths for all file paths
Restart Claude Code CLI after adding configuration
See
CLAUDE_CODE_CLI_SETUP.mdfor detailed setup guide
Example Conversations with Claude
Once configured, you can ask Claude things like:
Create a Playlist
Search and Add Tracks
Get Recommendations
List Your Playlists
Remove Tracks
Find Duplicates
Get Your Top Tracks
Create Curated Playlist
Get Audio Features ๐ต
Use Cases:
Find tracks with similar BPM for DJ mixes and workout playlists
Detect musical key for harmonic mixing (DJs)
Filter tracks by energy/danceability for themed playlists
Analyze mood (valence) and acousticness for curation
Build setlists with consistent tempo/energy flow
Available Tools
Tool | Description | Features |
| Create a new Spotify playlist | - |
| Search for tracks by name, artist, album, etc. | - |
| Add tracks to an existing playlist | Auto-batching (100 tracks/batch), Rate limit retry |
| Remove tracks from a playlist | Auto-batching (100 tracks/batch), Rate limit retry |
| List all user playlists | - |
| Get all tracks from a playlist | Pagination handling |
| Get track recommendations based on seeds | Seed validation (requires at least one seed) |
| Find duplicate tracks in a playlist | Case-insensitive matching |
| Get user's most-played tracks | Time periods: 4 weeks, 6 months, all time |
| Auto-create playlist from top tracks + recommendations | One-command automation |
๐ต | Analyze track audio (BPM, key, energy, etc.) | Multi-source (GetSongBPM, MusicBrainz, AcousticBrainz), 30-day cache, ~70-90% coverage |
| Get comprehensive playlist statistics | Duration, genre breakdown, avg release year |
| Merge multiple playlists with deduplication | Auto-dedup, custom descriptions |
| Find shared and unique tracks | Venn diagram analysis |
| Toggle playlist collaborative status | Enable/disable collaboration |
| Get artist's complete discography | Albums, singles, compilations |
| Find similar artists | Spotify similarity algorithm |
| Get artist's most popular tracks | Country-specific results |
Total: 18 tools available
Reliability Features
Automatic Rate Limit Handling
The server automatically handles Spotify API rate limits (HTTP 429):
Reads the
Retry-Afterheader from SpotifyWaits the specified time
Retries the operation once
Logs rate limit events to stderr
This makes bulk operations (adding/removing 100+ tracks) reliable and resilient.
Batch Processing
Operations that modify playlists automatically batch requests:
Max 100 tracks per API call (Spotify's limit)
Handles playlists of any size
Maintains operation atomicity within batches
Input Validation
get_recommendationsvalidates that at least one seed is provided before making API callsPrevents unnecessary API requests with clear error messages
Troubleshooting
"Authentication failed" error
Verify your Client ID and Client Secret are correct
Make sure the Redirect URI in your Spotify app settings matches exactly:
http://127.0.0.1:8888/callbackDelete
.spotify_cacheand try authenticating again
"No module named 'mcp'" error
Run
pip install -e .from the project directoryMake sure you're using Python 3.10+
"spawn python ENOENT" error in Claude Desktop
Use the full path to your Python interpreter in the config
Find it with:
which pythonorwhich python3Example:
"command": "/opt/miniconda3/bin/python"instead of"command": "python"
Claude Desktop doesn't show Spotify tools
Verify the JSON configuration syntax is correct
Check that all paths are absolute (not relative)
Use full Python path (see "spawn python ENOENT" above)
Restart Claude Desktop after configuration changes
Check Claude Desktop logs for errors
Browser doesn't open for authentication
The first run requires a browser. Run the server manually once:
cd spotify-mcp/src python server.pyAfter authentication succeeds, the token is cached for Claude Desktop/CLI
"No audio features available" message
Track may be too recent (post-2020 has ~20-40% coverage)
Older/classic tracks have better coverage (~70-90%)
GetSongBPM API key improves coverage significantly
MusicBrainz/AcousticBrainz stopped collecting data in 2022
Features are cached for 30 days after lookup
Security Notes
Never commit your
.envfile or.spotify_cachefile to version controlThe
.spotify_cachefile contains your access and refresh tokensClient Secret should be kept private
This server is designed for personal use on your local machine
Development
Running Tests
Project Structure
Credits
Access from https://getsongbpm.com/ via their free API provides song-analysis including beats-per-minute. Thanks, GetSongBPM.com
License
MIT License - feel free to modify and distribute. Make it better. Make it cooler.
Contributing
Issues and pull requests welcome! This implementation includes core features and can be extended with:
More Spotify API endpoints
Advanced playlist curation algorithms
User library management
Collaborative filtering
Setlist generators (DJ sets, concert setlists)
Additional audio analysis sources
Credits
This project is built on top of excellent open-source tools and APIs:
Core Dependencies
MCP (Model Context Protocol) - Anthropic's protocol for LLM integrations
Spotipy - Python library for Spotify Web API
Pydantic - Data validation using Python type annotations
Audio Features Data Sources
GetSongBPM API - Primary source for tempo, key, and audio features - mucho gracias
MusicBrainz - Open music encyclopedia for ISRC lookups - killer
AcousticBrainz - Crowd-sourced acoustic analysis database (archived 2022) - very cool
Development Tools
httpx - Modern async HTTP client
tenacity - Retry logic with exponential backoff
python-dotenv - Environment variable management
Special Thanks
My mom and Dad. Claude in all his different clothes
Resources
This server cannot be installed
MCP server for Spotify playlist curation and management. 18 tools for song analysis, smart playlist creation, top tracks analysis, and automated recommendations.
Related MCP Servers
- Asecurity-licenseAqualityA FastMCP tool that enables control of Spotify through natural language commands in Cursor Composer, allowing users to manage playback, search for content, and interact with playlists.Last updated -5
- AsecurityAlicenseAqualityEnables creating and managing Spotify playlists using natural language with advanced similarity matching across 8 different algorithms. Supports finding similar tracks based on audio features, mood, energy, genre, and custom weighted parameters to build personalized playlists automatically.Last updated -91MIT License