Setup Guide
Get the Spotify MCP Server running in under 5 minutes.
Create a Spotify App
- Go to the Spotify Developer Dashboard
- Click Create App
- Set the Redirect URI to
http://127.0.0.1:8888/callback - Copy your Client ID (you don't need the client secret — we use PKCE)
Install the Server
Option A: Clone from GitHub
git clone https://github.com/WisetechySolutions/spotify-mcp-server.git
cd spotify-mcp-server
npm install
npm run build Option B: Install from npm
npm install -g spotify-mcp-server Option C: Run directly with npx (no install)
npx spotify-mcp-server Configure Environment
cp .env.example .env Edit .env with your values:
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_REDIRECT_URI=http://127.0.0.1:8888/callback
TOKEN_ENCRYPTION_KEY=<generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))">
TOKEN_STORAGE_PATH=~/.spotify-mcp/tokens.enc Add to Claude
Claude Code
Add to your project's .mcp.json or global ~/.claude.json:
{
"mcpServers": {
"spotify": {
"command": "node",
"args": ["/path/to/spotify-mcp-server/dist/index.js"],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id",
"SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8888/callback",
"TOKEN_ENCRYPTION_KEY": "your_64_char_hex_key",
"TOKEN_STORAGE_PATH": "~/.spotify-mcp/tokens.enc"
}
}
}
} Claude Desktop
Open Settings → Developer → Edit Config and add to claude_desktop_config.json:
{
"mcpServers": {
"spotify": {
"command": "node",
"args": ["/absolute/path/to/spotify-mcp-server/dist/index.js"],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id",
"SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8888/callback",
"TOKEN_ENCRYPTION_KEY": "your_64_char_hex_key",
"TOKEN_STORAGE_PATH": "/absolute/path/to/.spotify-mcp/tokens.enc"
}
}
}
} Authenticate & Create
Start Claude and ask it to create a playlist. On first use, it will open your browser for Spotify OAuth login. After authenticating, your tokens are encrypted and stored locally — you won't need to log in again unless you explicitly disconnect.
"Make me a playlist of songs that feel like 3am in a diner —
lonely but not sad, warm coffee and neon lights" Claude will search Spotify, create the playlist, and add tracks — all automatically.
Troubleshooting
OAuth callback isn't working
Make sure your Redirect URI in the Spotify Dashboard exactly matches http://127.0.0.1:8888/callback (not localhost). Port 8888 must be available on your machine.
Search returns no results
Spotify Dev Mode caps search to 10 results. Claude may need to try multiple queries with different phrasing. This is expected behavior in Dev Mode.
Token errors after restart
Ensure your TOKEN_ENCRYPTION_KEY hasn't changed. If it has, delete the token file and re-authenticate.