Spotify MCP Server
Control Spotify from Claude Desktop using the Model Context Protocol. Search tracks, manage playback, and handle playlists — all through natural language.
Features
Eight tools covering the full Spotify playback lifecycle.
Search Tracks
Query Spotify's entire catalog by track name, artist, album, or keywords.
Playback Control
Play, pause, skip, seek, and set volume from Claude Desktop.
Playlist Management
List your playlists and browse their tracks without leaving the chat.
Device Control
Discover and switch between all active Spotify-connected devices.
OAuth 2.0 Auth
Secure authentication using Spotify's official authorization code flow.
95%+ Test Coverage
113 tests across Node 18, 20 & 22 on Linux, macOS, and Windows.
Quick Start
-
Create a Spotify Developer App
Go to developer.spotify.com/dashboard, create an app, and save your Client ID and Client Secret.
-
Clone the repo and generate a Refresh Token
# Clone the repo git clone https://github.com/yennanliu/SpotifyMCP2.git cd SpotifyMCP2 # Install dependencies and run the token generator npm install node get-refresh-token.js
-
Configure Claude Desktop
Add the server to your
claude_desktop_config.json:{ "mcpServers": { "spotify": { "command": "node", "args": ["/path/to/SpotifyMCP2/dist/index.js"], "env": { "SPOTIFY_CLIENT_ID": "your_client_id", "SPOTIFY_CLIENT_SECRET": "your_client_secret", "SPOTIFY_REFRESH_TOKEN": "your_refresh_token" } } } } -
Restart Claude Desktop & start using Spotify
Fully quit and reopen Claude Desktop. Try: "Play some jazz", "Pause the music", or "Show my playlists".
MCP Tools Reference
Eight tools are registered with the MCP server.
| Tool | Description | Key Parameters |
|---|---|---|
| search_tracks | Search Spotify catalog | query, limit |
| play_track | Play a specific track by URI | uri, device_id |
| playback_control | Play, pause, next, previous, seek, volume | action, value |
| get_current_playback | Get current playback state | — |
| get_user_playlists | List current user's playlists | limit, offset |
| get_playlist_tracks | Get tracks in a playlist | playlist_id |
| add_to_queue | Add a track to the playback queue | uri |
| get_available_devices | List all active Spotify devices | — |
Development
# Install dependencies npm install # Compile TypeScript npm run build # Run all tests npm test # Run integration tests npm run test:integration # Start MCP server npm run start:mcp
Project Stats
Documentation
README
Quick start overview and project introduction
SETUP
Spotify Developer App configuration guide
Claude Desktop Setup
Step-by-step MCP integration guide
Architecture
Technical design and module structure
Test Results
Full test suite and coverage report
CI/CD Pipeline
Automated build and deployment details