Let your AI assistant control Spotify. 12 tools, 2 resources, one concept: it plays your music.
The Spotify CLI exposes an MCP server so AI clients can search, play, pause, queue, and control Spotify directly. Built on laravel/mcp with stdio transport.
Once configured, ask your AI assistant to "play some chill music" or "what's currently playing?" and it just works.
Before configuring the MCP server, make sure you've completed initial setup:
# Install the CLI composer global require the-shit/music # Configure Spotify API credentials spotify setup # Authenticate with your Spotify account spotify login
You also need an active Spotify device — the desktop app, a phone, a browser tab, or the built-in daemon (spotify daemon start).
| Tool | Description |
|---|---|
play | Search and play a track, artist, album, or playlist |
pause | Pause playback |
resume | Resume playback |
skip | Skip to next or previous track |
current | Get current track, artist, progress, and playback state |
volume | Get or set volume (0-100) |
queue_add | Search and add a track to queue |
queue_show | Show upcoming tracks in queue |
search | Search Spotify catalog (tracks, artists, albums, playlists) |
devices | List available playback devices |
shuffle | Toggle or set shuffle mode |
repeat | Set repeat mode (off, track, context) |
| URI | Description |
|---|---|
spotify://now-playing | Current playback state as JSON |
spotify://devices | Available devices as JSON |
Add the MCP server to your AI client's configuration. The server communicates over stdio.
Edit ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"spotify": {
"command": "php",
"args": ["/absolute/path/to/spotify", "mcp:start", "spotify"]
}
}
}
Edit ~/.claude/settings.json (global) or .claude/settings.json (project):
{
"mcpServers": {
"spotify": {
"command": "php",
"args": ["/absolute/path/to/spotify", "mcp:start", "spotify"]
}
}
}
Edit opencode.json or settings:
{
"mcpServers": {
"spotify": {
"command": "php",
"args": ["/absolute/path/to/spotify", "mcp:start", "spotify"]
}
}
}
"command": "spotify" and "args": ["mcp:start", "spotify"]. Find the path with which spotify.