MCP Server

Let your AI assistant control Spotify. 12 tools, 2 resources, one concept: it plays your music.

What is this?

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.

Prerequisites

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).

Available Tools

ToolDescription
playSearch and play a track, artist, album, or playlist
pausePause playback
resumeResume playback
skipSkip to next or previous track
currentGet current track, artist, progress, and playback state
volumeGet or set volume (0-100)
queue_addSearch and add a track to queue
queue_showShow upcoming tracks in queue
searchSearch Spotify catalog (tracks, artists, albums, playlists)
devicesList available playback devices
shuffleToggle or set shuffle mode
repeatSet repeat mode (off, track, context)

Resources

URIDescription
spotify://now-playingCurrent playback state as JSON
spotify://devicesAvailable devices as JSON

Setup

Add the MCP server to your AI client's configuration. The server communicates over stdio.

Claude Desktop

Edit ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "spotify": {
      "command": "php",
      "args": ["/absolute/path/to/spotify", "mcp:start", "spotify"]
    }
  }
}

Claude Code

Edit ~/.claude/settings.json (global) or .claude/settings.json (project):

{
  "mcpServers": {
    "spotify": {
      "command": "php",
      "args": ["/absolute/path/to/spotify", "mcp:start", "spotify"]
    }
  }
}

OpenCode

Edit opencode.json or settings:

{
  "mcpServers": {
    "spotify": {
      "command": "php",
      "args": ["/absolute/path/to/spotify", "mcp:start", "spotify"]
    }
  }
}
Tip: If you installed globally via Composer, replace the command with just "command": "spotify" and "args": ["mcp:start", "spotify"]. Find the path with which spotify.