Skip to main content
Glama
mfteloglu

Spotify MCP Server

by mfteloglu

Spotify MCP Server

A simple MCP server to control Spotify playback and manage your liked songs via LLM's.

Features

  • Play and pause Spotify playback

  • Get info about the current track

  • Add the current track to your Liked Songs

Related MCP server: MCP Spotify Server

Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/spotify-mcp-server.git
    cd spotify-mcp-server
  2. Create and activate a virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
  3. Install dependencies:

    pip install uv
    pip install -r requirements.txt
  4. Create a .env file:

    SPOTIPY_CLIENT_ID=your_spotify_client_id
    SPOTIPY_CLIENT_SECRET=your_spotify_client_secret
    SPOTIPY_REDIRECT_URI=http://localhost:8888/callback
  5. Run the server:

    python main.py

Integration with Claude Desktop (MCP Server)

To use this server as an MCP server with Claude, add the following entry to your Claude config file (usually located at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "spotify-mcp-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/PROJECT/spotify-mcp-server",
        "run",
        "main.py"
      ]
    }
  }
}
  • Replace /ABSOLUTE/PATH/TO/PROJECT/spotify-mcp-server with the actual path to your project

  • If command uv is not recognized, give the absolute path for uv executable (can be found with which uv on MacOS)

  • Make sure your environment variables are set either in the config or via a .env file.

  • Restart Claude after editing the config file.

Notes

Example Session

Below is an example session using Claude with the Spotify MCP server:

Example Conversation

Sample interaction:

User: Play the current track using Spotify MCP server
Claude: Playback started successfully

User: What song is playing?
Claude: Currently playing: Shape of You by Ed Sheeran

User: Like this song
Claude: Added 'Shape of You' to your Liked Songs.

Available Tools

4 tools
spotify_current_trackB

Get information about the currently playing track.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/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. It states it 'gets information,' implying a read-only operation, but doesn't clarify if it requires authentication, returns error states for no active track, or details response format (e.g., track metadata). This leaves significant gaps for a tool that interacts with external APIs.

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, clear sentence with zero wasted words, front-loading the core purpose ('Get information about the currently playing track'). It's appropriately sized for a no-parameter tool and efficiently communicates the essential action.

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 tool's external API nature, lack of annotations, and no output schema, the description is incomplete. It doesn't address authentication needs, error handling, or return value structure, which are critical for an agent to use this tool effectively in real-world scenarios.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description doesn't need to add parameter details, and it correctly implies no inputs are required, earning a baseline score above 3 for this simple case.

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 with a specific verb ('Get') and resource ('information about the currently playing track'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'spotify_like_current_track' or 'spotify_play', which would require a 5.

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. It doesn't mention prerequisites (e.g., requires an active playback session), exclusions, or comparisons to siblings like 'spotify_play' for controlling playback, leaving the agent to infer usage context.

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

spotify_like_current_trackA

Add the currently playing track to your Liked Songs.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. While it indicates a write operation ('Add'), it lacks details on permissions needed (e.g., Spotify account authorization), whether this action is reversible, or potential rate limits. This is a significant gap for a mutation tool with zero annotation coverage.

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 function without any wasted words. It's front-loaded with the core action, making it easy to parse and understand immediately.

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?

Given the tool's simplicity (0 parameters, no output schema) and lack of annotations, the description is adequate but has clear gaps. It explains what the tool does but misses behavioral details like authentication requirements or error conditions, which are important for a mutation tool in a music streaming context.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing on the action instead, which aligns with the baseline expectation for parameterless tools.

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 specific action ('Add') and resource ('currently playing track to your Liked Songs'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'spotify_current_track' (which retrieves info) and 'spotify_play/stop' (which control playback), as this performs a library modification operation.

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 when a track is currently playing and the user wants to save it to their library, but doesn't explicitly state when NOT to use it or mention alternatives. For example, it doesn't clarify if this works only with Spotify Premium or what happens if no track is playing, leaving some contextual gaps.

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

spotify_playB

Start playback on the user's active device.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action is to 'Start playback,' implying a write/mutation operation, but doesn't disclose behavioral traits such as required permissions, what happens if no active device exists, whether it resumes paused tracks, or rate limits. This leaves significant gaps for a mutation tool.

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 with no wasted words. It's front-loaded with the core action and target, making it easy to parse quickly.

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 tool is a mutation (starting playback) with no annotations and no output schema, the description is incomplete. It lacks details on success/failure conditions, error handling, or what the response might contain, which are crucial for an agent to use it effectively.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add param info, which is appropriate, but it implies context about the 'active device,' slightly enhancing understanding beyond the schema.

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 action ('Start playback') and target ('on the user's active device'), providing a specific verb+resource combination. It doesn't explicitly distinguish from sibling tools like spotify_stop, but the action is distinct enough to imply differentiation.

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 spotify_stop or spotify_current_track. It mentions the 'active device' but doesn't specify prerequisites (e.g., device must be available) or exclusions (e.g., not for paused playback).

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

spotify_stopB

Stop playback on the user's active device.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action ('Stop playback') which implies a mutation/write operation, but doesn't disclose behavioral traits like whether this requires user authentication, what happens if no device is active, if it's reversible, or any rate limits. The description is minimal and lacks essential context for safe invocation.

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, clear sentence with no wasted words. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration, making it highly efficient and easy to parse.

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 tool's complexity (a mutation with no parameters) and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects like authentication needs, error conditions, or what 'stop' entails (e.g., does it clear the queue?), leaving gaps that could hinder correct agent invocation.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100% (though empty). The description doesn't need to add parameter semantics beyond what's in the schema, as there are no parameters to document. This meets the baseline for zero parameters, but doesn't provide extra value since there's nothing to compensate for.

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 action ('Stop playback') and target ('on the user's active device'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'spotify_play' (which would start playback) or 'spotify_current_track' (which would retrieve information), missing full sibling distinction.

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 'on the user's active device,' suggesting this tool should be used when playback is active and needs stopping. However, it doesn't provide explicit guidance on when to use this versus alternatives (e.g., vs. pausing or other controls) or any exclusions, leaving usage somewhat implied rather than clearly defined.

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

TDQS

A3.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: getting track info, liking a track, starting playback, and stopping playback. There is no overlap in functionality, making it easy for an agent to select the correct tool without confusion.

Naming Consistency5/5

All tool names follow a consistent 'spotify_' prefix with descriptive verb_noun patterns (e.g., current_track, like_current_track, play, stop). This uniformity enhances readability and predictability across the toolset.

Tool Count4/5

With 4 tools, the count is reasonable for a basic Spotify control server, covering core playback and interaction functions. However, it feels slightly thin as it lacks tools for searching, playlists, or volume control, which are common in music APIs.

Completeness3/5

The toolset covers basic playback control and track interaction, but there are notable gaps for a Spotify domain, such as no search, playlist management, or device selection tools. Agents can perform simple tasks but may struggle with more complex music-related workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables interaction with Spotify through natural language for music discovery, playback control, library management, and playlist creation. Supports searching for music, controlling playback, managing saved tracks, and getting personalized recommendations based on mood and preferences.
    109
    5
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables interaction with Spotify through LLMs using OAuth2 authentication. Supports music search, playback control, playlist management, and device management through natural language commands.
    14
    2
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to control Spotify playback, search for music, manage playlists, and access library information through the Spotify API. Requires Spotify Premium for playback control features.
    4

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mfteloglu/spotify-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server