Home / MCP / Spotify MCP Server

Spotify MCP Server

Provides an MCP server to interact with Spotify via Claude, enabling search, profile access, playlist management, and recommendations.

javascript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "spotify": {
            "command": "node",
            "args": [
                "/full/path/to/spotify-mcp-server/build/spotify-mcp-server.js"
            ]
        }
    }
}

You can run a Spotify MCP Server to interact with Spotify through Claude, enabling you to search tracks, view your profile, create and populate playlists, and receive personalized recommendations directly from conversations with Claude. This server handles authentication and keeps credentials in memory for the duration of your session, so you can focus on building the music experience.

How to use

To use the Spotify MCP Server, you connect it to your MCP client (Claude) and then authenticate your Spotify account once per conversation. Start by setting your credentials, then perform actions like searching tracks, checking your profile, creating playlists, adding tracks to playlists, or getting recommendations. You can combine these actions in multi-step tasks to automate common listening workflows.

How to install

Prerequisites: Node.js v16 or higher, npm, a Spotify account, and a registered Spotify Developer application.

1. Create a Spotify Developer App.

2. Install the project dependencies.

# Clone or download the project first
cd spotify-mcp-server

# Install dependencies
npm install

3. Get your Spotify tokens by editing the credentials file with your app credentials and then running the authentication flow.

// Replace these with your Spotify app credentials
const CLIENT_ID = "your_client_id_here";
const CLIENT_SECRET = "your_client_secret_here";

node spotify-auth.js

The authentication flow will open a browser, prompt you to log in to Spotify, ask for permission to access your account, and save the tokens to a secrets file.

4. Build the MCP Server.

npm run build

5. Configure Claude Desktop to load the Spotify MCP Server. Add the following configuration under mcpServers, pointing to the built server file.

{
  "mcpServers": {
    "spotify": {
      "command": "node",
      "args": ["/full/path/to/spotify-mcp-server/build/spotify-mcp-server.js"]
    }
  }
}

Additional configuration and notes

Restart Claude Desktop to pick up the new MCP configuration after you save the config file.

Troubleshooting

If you encounter authentication issues, re-run the auth flow to refresh tokens. If an access token is missing, set your credentials before making any Spotify requests.

Tools and capabilities

You have access to a set of tools to manage and query your Spotify account: set-spotify-credentials, check-credentials-status, search-tracks, get-current-user, create-playlist, add-tracks-to-playlist, and get-recommendations.

Available tools

set-spotify-credentials

Set your Spotify authentication credentials so Claude can access your Spotify account.

check-credentials-status

Verify that your credentials are valid and identify who is logged in.

search-tracks

Search for tracks by name, artist, or keywords on Spotify.

get-current-user

Retrieve your Spotify profile information for the connected account.

create-playlist

Create a new playlist in your Spotify account.

add-tracks-to-playlist

Add tracks to an existing Spotify playlist.

get-recommendations

Get personalized recommendations based on seed tracks.