MCP server for Spotify integration using PKCE authentication.
- PKCE authentication (no client secret needed)
- Automatic token caching and refresh
- 14 Spotify tools for search, user data, and more
cd spotify-mcp-py
pip install -e .
-
Create Spotify App at https://developer.spotify.com/dashboard:
- Add redirect URI:
http://127.0.0.1:8888/callback
- Copy your Client ID
- Add redirect URI:
-
Configure Claude Desktop at
~/Library/Application Support/Claude/claude_desktop_config.json
:
{
"mcpServers": {
"spotify": {
"command": "python",
"args": [
"-m",
"spotify_mcp.server"
],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id_here"
}
}
}
}
- Restart Claude Desktop - browser will open for Spotify login on first use
search_tracks
- Search for tracksget_track
- Get track detailssearch_artists
- Search for artistsget_artist
- Get artist detailsget_artist_top_tracks
- Get artist's top trackssearch_albums
- Search for albumsget_album
- Get album detailssearch_playlists
- Search for playlistsget_playlist
- Get playlist detailsget_current_user
- Get user profileget_user_playlists
- Get user's playlistsget_user_top_tracks
- Get user's top tracksget_user_top_artists
- Get user's top artistsget_recently_played
- Get recently played tracks
Tokens are cached in ~/.spotify-mcp/token-cache.json
and automatically refreshed.