@striderlabs/mcp-spotify
v0.1.0
Published
MCP server for Spotify - let AI agents control playback, search music, and manage playlists
Maintainers
Readme
@striderlabs/mcp-spotify
MCP server for Spotify — let AI agents control playback, search music, manage playlists, and view listening history.
By Strider Labs.
Setup
1. Create a Spotify App
- Go to the Spotify Developer Dashboard
- Click Create app
- Fill in the app name and description
- Add
http://localhost:8888/callbackto the Redirect URIs - Save and copy your Client ID
2. Configure Environment Variable
Set the SPOTIFY_CLIENT_ID environment variable to your app's Client ID:
export SPOTIFY_CLIENT_ID=your_client_id_hereOr add it to your MCP configuration (see below).
3. Add to MCP Configuration
{
"mcpServers": {
"spotify": {
"command": "npx",
"args": ["-y", "@striderlabs/mcp-spotify"],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id_here"
}
}
}
}4. Login
Ask your AI assistant to use the login tool. It will open your browser to authorize the Spotify app. Once you approve, your credentials are saved to ~/.strider/spotify/tokens.json and refreshed automatically.
Available Tools
| Tool | Description |
|------|-------------|
| status | Check authentication status |
| login | Authorize with Spotify (PKCE OAuth 2.0) |
| logout | Clear stored credentials |
| get_playback | Get current playback state, track info, device, volume |
| play | Start/resume playback, optionally with a Spotify URI |
| pause | Pause playback |
| skip_next | Skip to next track |
| skip_previous | Skip to previous track |
| seek | Seek to position in current track |
| set_volume | Set volume (0–100) |
| search | Search tracks, albums, artists, playlists |
| get_playlists | List user's playlists |
| play_playlist | Play a playlist by ID or URI |
| add_to_queue | Add a track to the queue |
| get_recently_played | Get recent listening history |
Usage Examples
"What's playing on Spotify?"
"Play some jazz music on Spotify"
"Skip this track"
"Turn the volume up to 80"
"Search for albums by Radiohead"
"Play my Discover Weekly playlist"
"Add this track to my queue: spotify:track:4iV5W9uYEdYUVa79Axb7Rh"
"What have I been listening to lately?"Authentication
This server uses the OAuth 2.0 Authorization Code with PKCE flow — the most secure method for user authentication without exposing a client secret.
- Your Client ID is not sensitive and can be shared
- No client secret is required
- Refresh tokens are stored locally at
~/.strider/spotify/tokens.jsonwith restricted permissions - Tokens are automatically refreshed when they expire
Requirements
- Node.js 18+
- An active Spotify account (Free or Premium)
- Spotify open on at least one device for playback controls
License
MIT — Strider Labs
