Skip to main content
Glama
hrishi0102

Spotify MCP Server

by hrishi0102

Spotify MCP Server

A simple Model Context Protocol (MCP) server that lets you interact with Spotify through Claude. This server enables Claude to search for songs, create playlists, get recommendations, and more using your Spotify account.

Features

  • Search for tracks on Spotify

  • View your Spotify profile

  • Create playlists

  • Add tracks to playlists

  • Get personalized music recommendations

Related MCP server: Spotify MCP Server

Tools Available

Tool Name

Description

set-spotify-credentials

Set your Spotify authentication credentials

check-credentials-status

Check if your credentials are valid and who is logged in

search-tracks

Search for tracks by name, artist, or keywords

get-current-user

Get your Spotify profile information

create-playlist

Create a new playlist on your account

add-tracks-to-playlist

Add tracks to an existing playlist

get-recommendations

Get recommendations based on seed tracks

Setup Instructions

Plug and Play - HTTP Spotify MCP Server

  1. Go to Claude AI

  2. Click on Add Connectors

  3. Click on Manage Connectors

  4. Add custom connector

  5. Add the https server link

  6. Mail hrishi0102business@gmail.com to whitelist your spotify ID/mail

  7. That's it. Your claude is ready to use Spotify. You will be prompted to sign-in using spotify OAuth.

Run Spotify MCP locally

1. Prerequisites

  • Node.js v16 or higher

  • npm

  • A Spotify account

  • A registered Spotify Developer application

2. Create a Spotify Developer App

  1. Go to Spotify Developer Dashboard

  2. Log in with your Spotify account

  3. Click "Create an App"

  4. Fill in the app name and description

  5. Add http://localhost:8888/callback as a Redirect URI

  6. Note your Client ID and Client Secret

3. Install the Project

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

# Install dependencies
npm install

4. Get Your Spotify Tokens

Edit the spotify-auth.js file to include your Client ID and Client Secret:

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

Then run the authentication script:

node spotify-auth.js

This will:

  1. Open a URL in your browser

  2. Prompt you to log in to Spotify

  3. Ask for your permission to access your account

  4. Save the tokens to secrets.json

5. Build the MCP Server

npm run build

6. Configure Claude Desktop

Edit your Claude Desktop configuration file:

  • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • On Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the following configuration:

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

Replace /full/path/to/spotify-mcp-server with the actual path to your project directory.

7. Restart Claude Desktop

Close and reopen Claude Desktop to load the new configuration.

Usage

When you start a conversation with Claude, you'll first need to set your Spotify credentials:

  1. Look at your secrets.json file to get your credentials

  2. Use the set-spotify-credentials tool to authenticate

  3. Then use any of the other Spotify tools

Example Prompts

Setting Up Credentials

I want to connect to my Spotify account. Here are my credentials from secrets.json:

Tool: set-spotify-credentials
Parameters:
{
  "clientId": "your_client_id",
  "clientSecret": "your_client_secret",
  "accessToken": "your_access_token",
  "refreshToken": "your_refresh_token"
}

Basic Commands

Check your account:

Can you check who I'm logged in as on Spotify?

Tool: get-current-user
Parameters: {}

Search for tracks:

Search for songs by Weekend

Tool: search-tracks
Parameters:
{
  "query": "Taylor Swift",
  "limit": 5
}

Create a playlist:

Create a new playlist called "My Pretty pretty girlfriend"

Tool: create-playlist
Parameters:
{
  "name": "My Pretty pretty girlfriend",
  "description": "For my girlfriend. Created with Claude and the Spotify MCP server"
}

Multi-Step Tasks

Creating a playlist with songs:

I want to create a workout playlist with energetic songs. First, search for some high-energy songs. Then create a playlist called "Workout Mix" and add those songs to it.

Getting recommendations based on favorites:

I like the song "Blinding Lights" by The Weeknd. Can you search for it, then find similar songs, and create a playlist with those recommendations?

Troubleshooting

  • Error: No access token available: You need to set your credentials first using the set-spotify-credentials tool

  • Authentication failures: Your tokens may have expired. Run the auth script again to get fresh tokens

  • Invalid credentials: Double check that you're using the correct Client ID and Client Secret

Notes

  • The server stores credentials in memory only

  • You'll need to set credentials each time you start a new conversation

  • If Claude Desktop restarts, you'll need to set credentials again

Available Tools

7 tools
add-tracks-to-playlistD
ParametersJSON Schema
NameRequiredDescriptionDefault
playlistIdYesThe Spotify playlist ID
trackUrisYesArray of Spotify track URIs to add

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

check-credentials-statusD
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

create-playlistD
ParametersJSON Schema
NameRequiredDescriptionDefault
descriptionNoDescription of the playlist
nameYesName of the playlist

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-current-userD
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-recommendationsD
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of recommendations to return
seedTracksYesSpotify track IDs to use as seeds (max 5)

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search-tracksD
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of results to return
queryYesSearch query for tracks

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

set-spotify-credentialsD
ParametersJSON Schema
NameRequiredDescriptionDefault
accessTokenYesThe Spotify Access Token
clientIdYesThe Spotify Client ID
clientSecretYesThe Spotify Client Secret
refreshTokenYesThe Spotify Refresh Token

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 7 tool updatesv1.0.0
    • First observedadd-tracks-to-playlist
    • First observedcheck-credentials-status
    • First observedcreate-playlist
    • First observedget-current-user
    • First observedget-recommendations
    • First observedsearch-tracks
    • First observedset-spotify-credentials

TDQS

D1.8/5.0

Scored across 7 tools

Disambiguation4/5

Most tools have distinct purposes targeting different Spotify resources like playlists, user info, recommendations, and tracks, but 'add-tracks-to-playlist' and 'create-playlist' could be confused if an agent needs to both create and populate a playlist in one operation. The lack of descriptions increases minor ambiguity.

Naming Consistency3/5

The naming uses a mix of verb-noun patterns (e.g., 'create-playlist', 'search-tracks') and more descriptive phrases (e.g., 'check-credentials-status', 'set-spotify-credentials'), with all tools using kebab-case. This is readable but lacks a strict, predictable convention across all tools.

Tool Count5/5

With 7 tools, this server is well-scoped for a Spotify integration, covering core functionalities like user management, playlist operations, search, and recommendations without being overwhelming or too sparse.

Completeness3/5

The toolset covers key Spotify operations like user info, search, recommendations, and playlist management, but lacks update or delete operations for playlists and tracks, and missing tools for managing playback or albums creates notable gaps in a full music streaming workflow.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Connects Claude to Spotify for music discovery, playlist creation, and collection analysis through natural language. Enables searching songs, analyzing music diversity, creating playlists, and getting recommendations using Spotify's API.
    -