Skip to content

Instantly share code, notes, and snippets.

@redaphid
Created February 13, 2026 23:47
Show Gist options
  • Select an option

  • Save redaphid/a8822651cccf33d9ff40ce67ad2bb236 to your computer and use it in GitHub Desktop.

Select an option

Save redaphid/a8822651cccf33d9ff40ce67ad2bb236 to your computer and use it in GitHub Desktop.
Spotify MCP Server Setup Guide for Claude Code

Spotify MCP Setup

MCP server for controlling Spotify from Claude Code. Uses marcelmarais/spotify-mcp-server.

Prerequisites

  • Node.js v16+
  • Spotify Premium account

Setup

1. Clone and build

cd spotify-mcp-server
npm install
npm run build

2. Create a Spotify Developer App

  1. Go to https://developer.spotify.com/dashboard/
  2. Create a new app
  3. Set the redirect URI to http://127.0.0.1:8888/callback
  4. Copy your Client ID and Client Secret

3. Configure credentials

cp spotify-mcp-server/spotify-config.example.json spotify-mcp-server/spotify-config.json

Edit spotify-config.json:

{
  "clientId": "your-client-id",
  "clientSecret": "your-client-secret",
  "redirectUri": "http://127.0.0.1:8888/callback"
}

4. Authenticate

cd spotify-mcp-server
npm run auth

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

5. Claude Code integration

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.

Common Issues

"Insecure redirect URI" when saving in Spotify Dashboard

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.

"Invalid redirect URI" during OAuth

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.

"Something went wrong" on the Spotify authorization page

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.

Token expiration

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment