MCP server for controlling Spotify from Claude Code. Uses marcelmarais/spotify-mcp-server.
- Node.js v16+
- Spotify Premium account
cd spotify-mcp-server
npm install
npm run build- Go to https://developer.spotify.com/dashboard/
- Create a new app
- Set the redirect URI to
http://127.0.0.1:8888/callback - Copy your Client ID and Client Secret
cp spotify-mcp-server/spotify-config.example.json spotify-mcp-server/spotify-config.jsonEdit spotify-config.json:
{
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"redirectUri": "http://127.0.0.1:8888/callback"
}cd spotify-mcp-server
npm run authThis opens a browser for Spotify OAuth. After approving, tokens are saved to spotify-config.json automatically. Tokens auto-refresh, so you shouldn't need to re-auth.
The .mcp.json in this directory configures the server for Claude Code:
{
"mcpServers": {
"spotify": {
"command": "node",
"args": ["/path/to/spotify-mcp-server/build/index.js"]
}
}
}Restart Claude Code after setup.
As of November 2025, Spotify no longer accepts localhost in redirect URIs. You must use the loopback IP address instead:
http://127.0.0.1:8888/callback(works)http://localhost:8888/callback(rejected)
See Spotify's security migration guide.
The redirect URI in spotify-config.json must match exactly what's saved in the Spotify Developer Dashboard -- same scheme, host, port, and path. Even a trailing slash difference will cause this error.
Your app is in development mode by default. In dev mode, only explicitly authorized users can authenticate. Go to your app's settings in the Spotify Developer Dashboard and add your Spotify account under User Management.
The MCP server auto-refreshes tokens. If something goes wrong and you get auth errors, re-run npm run auth in the spotify-mcp-server directory.