Spotify MCP Server
Controls Spotify playback, retrieves current track and playback state, manages queue, searches for tracks/albums/artists/playlists, and manages playlists and saved tracks. Also includes local favorites feature not requiring Spotify API permissions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Spotify MCP ServerPause the music"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Spotify MCP Server
Control Spotify playback through Claude using the Model Context Protocol (MCP).
Uses PKCE authentication - just install and authorize your Spotify account.
Note: The bundled client ID works for playback control and reading data. For write operations (adding to playlists, saving to library), you'll need to set up your own Spotify app.
Quick Start
1. Install
git clone https://github.com/panuhen/spotify-mcp.git ~/spotify-mcp
cd ~/spotify-mcp
python -m venv .venv
.venv/bin/pip install -e .2. First Run - Authenticate
Run once to authorize with your Spotify account:
~/spotify-mcp/.venv/bin/spotify-mcpThis opens your browser for Spotify login. After authorizing, the token is cached at ~/.spotify-mcp-token.
3. Add to Claude Code
Add to ~/.mcp.json:
{
"mcpServers": {
"spotify": {
"command": "/home/YOUR_USER/spotify-mcp/.venv/bin/spotify-mcp"
}
}
}Then enable in ~/.claude/settings.local.json:
{
"enabledMcpjsonServers": ["spotify"]
}Restart Claude Code and you're ready!
Related MCP server: Spotify MCP Server
Available Tools
Playback Control
play- Resume or play specific track/album/playlistpause- Pause playbacknext- Skip to next trackprevious- Go to previous trackseek- Seek to position in trackset_volume- Set volume (0-100)shuffle- Toggle shuffle moderepeat- Set repeat mode (off/track/context)
Information
get_current_track- Get currently playing track infoget_playback_state- Get full playback stateget_queue- Get upcoming tracksget_devices- List available devices
Search & Library
search- Search for tracks, albums, artists, playlistsadd_to_queue- Add track to queueget_playlists- List your playlistsget_playlist_tracks- Get tracks from a playlistadd_to_playlist- Add tracks to a playlist (requires own app)save_tracks- Save tracks to your library (requires own app)remove_saved_tracks- Remove tracks from library (requires own app)get_saved_tracks- Get your liked tracks
Local Favorites
No Spotify API permissions needed - stored locally in ~/.spotify-mcp-favorites.json:
favorite_current- Add currently playing track to favoritesget_favorites- List all favorited tracksremove_favorite- Remove a track from favoritesplay_favorites- Play random favorite or queue all favoritesclear_favorites- Clear all favorites
Usage Examples
Once configured, you can ask Claude:
"What song is currently playing?"
"Pause the music"
"Play the next track"
"Search for 'Bohemian Rhapsody' and add it to the queue"
"Set the volume to 50%"
"Turn on shuffle"
"Show my playlists"
Setup Your Own Spotify App
Required for: add_to_playlist, save_tracks, remove_saved_tracks
The bundled client ID is in Spotify's Development Mode, which restricts write operations. To use all features:
Create an app at https://developer.spotify.com/dashboard
In your app settings, add redirect URI:
http://127.0.0.1:8888/callbackCopy your Client ID and add to
~/spotify-mcp/.env:SPOTIPY_CLIENT_ID=your_client_id_hereDelete cached token and re-auth:
rm ~/.spotify-mcp-tokenRestart the MCP server
Troubleshooting
"No active device" error
Make sure Spotify is open on at least one device (phone, desktop app, web player).
Authentication issues
Delete ~/.spotify-mcp-token and run spotify-mcp again to re-authenticate.
Token expired
The token auto-refreshes, but if issues persist, delete ~/.spotify-mcp-token and re-auth.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/panuhen/spotify-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server