Skip to main content
Glama
boristopalov

Spotify MCP Server

by boristopalov

spotify-mcp MCP server

MCP project to connect Claude with Spotify. Built on top of spotipy-dev's API.

Features

  • Start, pause, and skip playback

  • Search for tracks/albums/artists/playlists

  • Get info about a track/album/artist/playlist

  • Manage the Spotify queue

Related MCP server: Spotify MCP Server

Demo

Make sure to turn on audio

Configuration

Getting Spotify API Keys

Create an account on developer.spotify.com. Navigate to the dashboard. Create an app with redirect_uri as http://localhost:8888. (You can choose any port you want but you must use http and localhost). I set "APIs used" to "Web Playback SDK".

Run this project locally

This project is not yet set up for ephemeral environments (e.g. uvx usage). Run this project locally by cloning this repo

git clone https://github.com/varunneal/spotify-mcp.git

Add this tool as a mcp server.

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

"spotify": {
    "command": "uv",
    "args": [
      "--directory",
      "/path/to/spotify_mcp",
      "run",
      "spotify-mcp"
    ],
    "env": {
      "SPOTIFY_CLIENT_ID": YOUR_CLIENT_ID,
      "SPOTIFY_CLIENT_SECRET": YOUR_CLIENT_SECRET,
      "SPOTIFY_REDIRECT_URI": "http://localhost:8888"
    }
  }

Troubleshooting

Please open an issue if you can't get this MCP working. Here are some tips:

  1. Make sure uv is updated. I recommend version >=0.54.

  2. Make sure claude has execution permisisons for the project: chmod -R 755.

  3. Ensure you have Spotify premium (needed for running developer API).

TODO

Unfortunately, a bunch of cool features have now been deprecated from the Spotify API. Most new features will be relatively minor or for the health of the project:

  • tests.

  • adding API support for managing playlists.

  • adding API support for paginated search results/playlists/albums.

Deployment

(todo)

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:

uv sync
  1. Build package distributions:

uv build

This will create source and wheel distributions in the dist/ directory.

  1. Publish to PyPI:

uv publish

Note: You'll need to set PyPI credentials via environment variables or command flags:

  • Token: --token or UV_PUBLISH_TOKEN

  • Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

npx @modelcontextprotocol/inspector uv --directory /Users/varun/Documents/Python/spotify_mcp run spotify-mcp

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

Available Tools

4 tools
SpotifyGetInfoC

Get detailed information about a Spotify item (track, album, artist, or playlist).

ParametersJSON Schema
NameRequiredDescriptionDefault
item_idYesID of the item to get information about
qtypeNoType of item: 'track', 'album', 'artist', or 'playlist'. If 'playlist' or 'album', returns its tracks. If 'artist',returns albums and top tracks.track

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Get detailed information') but doesn't cover critical aspects like authentication requirements, rate limits, error handling, or what 'detailed information' entails (e.g., fields returned, pagination). This leaves significant gaps for an agent to understand operational constraints.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without redundancy. It's front-loaded with the core action and resource, making it easy to parse quickly. There's no wasted verbiage or unnecessary elaboration.

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

Completeness2/5

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

Given the complexity of retrieving varied Spotify item types and the lack of annotations and output schema, the description is insufficient. It doesn't explain what 'detailed information' includes (e.g., track metadata, artist albums), how results are structured, or any behavioral traits like authentication needs. For a tool with no structured safety or output guidance, more context is needed.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents both parameters thoroughly (item_id and qtype with default and effects). The description doesn't add any meaningful semantic details beyond what's in the schema, such as format examples for item_id or nuances in qtype behavior. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('detailed information about a Spotify item'), specifying the item types (track, album, artist, or playlist). However, it doesn't explicitly differentiate from sibling tools like SpotifySearch, which might also retrieve information but through search queries rather than direct ID lookup.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like SpotifySearch or other siblings. It lacks context about prerequisites (e.g., authentication), exclusions, or specific scenarios where this direct ID lookup is preferred over search-based methods.

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

SpotifyPlaybackB

Manages the current playback with the following actions: - get: Get information about user's current track. - start: Starts of resumes playback. - pause: Pauses current playback. - skip: Skips current track.

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform: 'get', 'start', 'pause' or 'skip'.
track_idNoSpecifies track to play for 'start' action. If omitted, resumes current playback.
num_skipsNoNumber of tracks to skip for `skip` action.

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it describes what each action does at a basic level, it lacks important behavioral details like authentication requirements, rate limits, error conditions, or what happens during concurrent playback management. The description doesn't contradict any annotations since none exist.

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

Conciseness4/5

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

The description is efficiently structured with a clear opening statement followed by bullet points for each action. Each bullet is concise and directly relevant. However, the repetition of the opening sentence in the schema description suggests some redundancy that could be eliminated.

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

Completeness3/5

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

For a playback management tool with 3 parameters and no output schema, the description provides adequate basic information but lacks completeness. Without annotations or output schema, it should ideally cover more behavioral aspects like response format, error handling, or prerequisites. The description meets minimum requirements but leaves gaps.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description lists the four action types but doesn't add meaningful parameter semantics beyond what's in the schema. The baseline of 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the tool's purpose as managing current playback with four specific actions (get, start, pause, skip), providing a verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like SpotifyQueue or SpotifySearch, which likely handle different aspects of Spotify functionality.

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

Usage Guidelines3/5

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

The description implies usage context through action descriptions (e.g., 'get' for track information, 'skip' for skipping tracks), but doesn't provide explicit guidance on when to use this tool versus alternatives like SpotifyQueue or SpotifySearch. No when-not scenarios or clear alternatives are mentioned.

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

SpotifyQueueB

Manage the playback queue - get the queue or add tracks.

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform: 'add' or 'get'.
track_idNoTrack ID to add to queue (required for add action)

TDQS

B3.4/5.0
Behavior2/5

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

No annotations exist, so the description bears full responsibility. It fails to disclose behavior such as whether adding a track requires an active device, if the queue is appended or overwritten, or what errors occur. Minimal behavioral detail beyond the schema.

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

Conciseness5/5

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

Single, concise sentence that immediately communicates the tool's purpose. No superfluous words, front-loads the resource and actions.

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

Completeness4/5

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

For a simple tool with two parameters and two actions, the description adequately covers purpose. It lacks details on return values or error cases but is sufficient for basic usage given no output schema and limited complexity.

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

Parameters3/5

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

Schema coverage is 100% with parameter descriptions. The description adds marginal value by linking 'add tracks' to the action parameter and implying track_id for add. Baseline score is appropriate as schema handles semantics.

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

Purpose5/5

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

The description clearly states the tool manages the playback queue with two specific actions: get or add tracks. It distinguishes itself from sibling tools like SpotifyPlayback by focusing on queue management.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like SpotifyPlayback for control operations. The description simply lists actions without context on prerequisites or typical use cases.

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

SpotifySearchB

Search for tracks, albums, artists, or playlists on Spotify.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesquery term
qtypeNoType of items to search for (track, album, artist, playlist, or comma-separated combination)track
limitNoMaximum number of items to return

TDQS

B3.4/5.0
Behavior2/5

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

No annotations provided, so description carries burden. It mentions search types and parameters but omits behavior like response structure, pagination, error handling, auth needs, or rate limits.

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

Conciseness5/5

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

Single clear sentence, front-loaded with action verb. No wasted words.

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

Completeness2/5

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

Given 3 parameters, no output schema, and no annotations, the description is too brief. Lacks guidance on output format, pagination, or effective usage compared to sibling tools.

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

Parameters3/5

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

Schema has 100% coverage with descriptions for all 3 parameters. Description adds minimal context beyond schema (e.g., hinting at qtype values already documented). Baseline score of 3 is appropriate.

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

Purpose5/5

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

Description clearly states it searches for tracks, albums, artists, or playlists on Spotify. Distinct from sibling tools like SpotifyGetInfo (specific item info), SpotifyPlayback (playback control), SpotifyQueue (queue management).

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

Usage Guidelines3/5

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

Description implies usage for searching Spotify content, but no explicit when-to-use vs alternatives, no when-not or exclusions provided.

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. 4 tool updatesv1.0.0
    • ChangedSpotifyGetInfo2 fields changed
      • addedInput schema / description
        Added value: +"Get detailed information about a Spotify item (track, album, artist, or playlist)."
      • addedInput schema / title
        Added value: +"GetInfo"
    • ChangedSpotifyPlayback2 fields changed
      • addedInput schema / description
        Added value: +"Manages the current playback with the following actions:\n- get: Get information about user's current track.\n- start: Starts of resumes playback.\n- pause: Pauses current playback.\n- skip: Skips current track."
      • addedInput schema / title
        Added value: +"Playback"
    • ChangedSpotifyQueue2 fields changed
      • addedInput schema / description
        Added value: +"Manage the playback queue - get the queue or add tracks."
      • addedInput schema / title
        Added value: +"Queue"
    • ChangedSpotifySearch2 fields changed
      • addedInput schema / description
        Added value: +"Search for tracks, albums, artists, or playlists on Spotify."
      • addedInput schema / title
        Added value: +"Search"
  2. 4 tool updates
    • First observedSpotifyGetInfo
    • First observedSpotifyPlayback
    • First observedSpotifyQueue
    • First observedSpotifySearch

TDQS

A3.5/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: GetInfo retrieves metadata, Playback controls active listening, Queue manages upcoming tracks, and Search finds new content. The separation between Playback (current track control) and Queue (future track management) is particularly well-defined.

Naming Consistency5/5

All tools follow a perfect 'Spotify[Action]' naming pattern with consistent PascalCase throughout. The pattern is immediately recognizable and predictable across all four tools.

Tool Count5/5

Four tools is ideal for this music streaming domain - it covers the essential workflows (discovery, playback control, queue management, and information lookup) without being overwhelming or sparse. Each tool earns its place in the set.

Completeness4/5

The toolset covers core Spotify functionality well with only minor gaps. Notable missing operations include playlist/library management (saving/removing tracks), volume control, and seeking within tracks, but the provided tools enable basic listening workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers