Spotify Model Context Protocol
Enables creation of Spotify playlists based on text descriptions, with OAuth authentication handling for accessing Spotify's API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Spotify Model Context Protocolcreate a chill study playlist with lo-fi beats and ambient sounds"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Spotify Model Context Protocol (MCP)
A Spotify MCP for creating playlists based on a description.
Prerequisites
Python 3.6 or higher
Spotify Developer credentials (Client ID and Client Secret)
Related MCP server: Spotify MCP Node Server
Setup
Clone this repository:
git clone https://github.com/yourusername/spotify-mcp.git cd spotify-mcpInstall the required dependencies:
pip install -r requirements.txtSet up your Spotify Developer credentials:
Create a new application
Set up your environment variables:
echo SPOTIFY_CLIENT_ID='your_client_id' >> .env echo SPOTIFY_CLIENT_SECRET='your_client_secret' >> .env
Usage
Starting the Authentication Server
Set up your redirect URI in the Spotify Developer Dashboard:
Go to your app in the Spotify Developer Dashboard
Click "Edit Settings"
Add
http://localhost:5000/callbackto the Redirect URIsSave the changes
Start the authentication server:
python main.pyThis will start a local server on port 5000 that handles Spotify OAuth authentication.
Visit
http://localhost:5000in your browser to authenticate with Spotify. After successful authentication, your access token will be saved for use with the MCP.
Integrating with Cursor
Open Cursor and go to Settings
Navigate to the "Model Context Protocols" section
Click "Add MCP"
Enter the following details in your mcp.json, replacing PATH-TO-BASE-DIR:
{
"mcpServers": {
"spotify": {
"command": "uv",
"args": [
"--directory",
"PATH-TO-BASE-DIR/spotify-mcp",
"run",
"spotify.py"
]
}
}
}Now you can use the Spotify MCP commands in Cursor to create and manage playlists directly from your editor!
Available Tools
3 toolscreate_playlistB
Create a new playlist on Spotify and add tracks to it.
Args:
name: Name of the playlist
track_uris: List of Spotify track URIs to add to the playlist
description: Optional description for the playlist
public: Whether the playlist should be public (default: False)
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| track_uris | Yes | ||
| description | No | ||
| public | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but only states it 'creates a new playlist and adds tracks'. It lacks behavioral details such as authentication requirements, rate limits, error handling, or whether the operation is idempotent, which are critical 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose in the first sentence, followed by a structured 'Args' list that efficiently details parameters. Every sentence adds value without redundancy, making it easy to scan and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with no annotations and no output schema, the description covers the basic operation and parameters adequately but lacks critical context like return values, error cases, or side effects. It's minimally viable but has clear gaps in behavioral transparency.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description includes an 'Args' section that explains each parameter's purpose (e.g., 'name: Name of the playlist', 'public: Whether the playlist should be public'), adding meaningful context beyond the schema's 0% description coverage. It clarifies defaults and optionality, compensating well for the schema gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Create' and resource 'new playlist on Spotify', specifying that tracks are added to it. It distinguishes from siblings like 'update_playlist' by focusing on creation rather than modification, though it doesn't explicitly contrast with 'get_track_uris'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 'update_playlist' or 'get_track_uris'. It mentions adding tracks but doesn't specify prerequisites (e.g., needing track URIs first) or contextual constraints, leaving usage decisions ambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_track_urisA
Look up Spotify track URIs for a list of songs.
Args:
songs: List of dictionaries containing song information.
Each dictionary should have 'name' and 'artist' keys.
Example: [{"name": "Yesterday", "artist": "The Beatles"}]
Returns:
List of Spotify track URIs for the found songs.
Songs that couldn't be found will be skipped.
| Name | Required | Description | Default |
|---|---|---|---|
| songs | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it performs a lookup operation (implied read-only), handles multiple songs via a list, skips unfound songs (partial success behavior), and returns a list of URIs. It doesn't mention rate limits, authentication needs, or error handling details, but covers core functionality adequately.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded: the first sentence states the purpose, followed by clear sections for Args and Returns with bullet-point-like formatting. Every sentence adds value, with no wasted words, making it easy to scan and understand.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 1 parameter with no schema coverage and no output schema, the description is mostly complete: it explains the input format, output format, and behavior (skipping unfound songs). It could improve by mentioning authentication requirements or rate limits, but for a lookup tool with simple parameters, it provides sufficient context for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, so the description fully compensates by detailing the 'songs' parameter: it's a list of dictionaries with required 'name' and 'artist' keys, includes an example, and explains the structure. This adds significant meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
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 ('look up') and resource ('Spotify track URIs'), and distinguishes it from sibling tools (create_playlist, update_playlist) by focusing on retrieval rather than playlist manipulation. It explicitly mentions what it does: converting song information into Spotify URIs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by specifying it's for 'a list of songs' and provides an example, but doesn't explicitly state when to use this tool versus alternatives like search or when not to use it. It differentiates from siblings by function, though not with explicit 'use this when...' guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_playlistB
Update an existing Spotify playlist's details and/or tracks.
Args:
playlist_id: The Spotify ID of the playlist to update
name: New name for the playlist (optional)
track_uris: New list of track URIs to replace the playlist's tracks (optional)
description: New description for the playlist (optional)
public: New public/private status for the playlist (optional)
| Name | Required | Description | Default |
|---|---|---|---|
| playlist_id | Yes | ||
| name | No | ||
| track_uris | No | ||
| description | No | ||
| public | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies mutation ('update') but doesn't disclose critical traits like authentication requirements, rate limits, whether changes are reversible, or what happens to unspecified fields. This is inadequate 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded with a clear purpose statement. The parameter explanations are structured in a list format, making it easy to scan, though it could be slightly more concise by integrating the parameter details into the opening sentence.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (mutation with 5 parameters), lack of annotations, and no output schema, the description is incomplete. It misses critical context like authentication needs, error handling, return values, and usage scenarios, leaving significant gaps for an AI agent to operate effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds significant value beyond the input schema, which has 0% description coverage. It explains the meaning of all 5 parameters (e.g., 'playlist_id' as Spotify ID, 'track_uris' as replacement list) and clarifies optionality, compensating well for the schema's lack of descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'update' and resource 'Spotify playlist's details and/or tracks', making the purpose explicit. However, it doesn't distinguish this tool from its sibling 'create_playlist' beyond the obvious 'existing' vs 'new' difference, missing explicit differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like 'create_playlist' or 'get_track_uris'. The description lacks context about prerequisites, such as needing playlist ownership or specific permissions, and doesn't mention any exclusions or best practices.
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. Dates show when Glama detected each change.
3 tool updates
- First observed
create_playlist - First observed
get_track_uris - First observed
update_playlist
TDQS
Each tool has a clearly distinct purpose with no overlap: create_playlist makes new playlists, get_track_uris looks up song metadata, and update_playlist modifies existing playlists. The descriptions clearly differentiate their functions, eliminating any ambiguity.
All tools follow a consistent verb_noun pattern (create_playlist, get_track_uris, update_playlist) with clear, descriptive names. There are no deviations in style or convention across the set.
With only 3 tools, the set feels thin for a Spotify integration, lacking operations like searching for playlists, deleting playlists, or managing user profiles. While the tools cover basic playlist creation and updating, the scope is limited compared to typical music service APIs.
There are significant gaps in the tool surface for a Spotify domain. Missing are tools for reading or listing existing playlists, deleting playlists, searching for tracks or artists beyond URI lookup, and user-related operations. This incompleteness will likely cause agent failures when trying to perform common Spotify tasks.
Maintenance
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
Build and supervise fleets of agents from Claude Code, Codex or Cursor. Connects over OAuth.
Connect AI agents to Filepad workspaces through OAuth MCP.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
OAuth 2.1 short-link tools for AI agents with scoped tokens, approvals, audit logs, and revocation.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables interaction with Spotify through LLMs using OAuth2 authentication. Supports music search, playback control, playlist management, and device management through natural language commands.142MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to control Spotify playback, manage playlists, search music, and access listening history. Requires Spotify Premium and uses secure OAuth 2.0 with PKCE authentication.13109MIT
- FlicenseAqualityDmaintenanceEnables interaction with Spotify through OAuth 2.0 authentication, supporting search for tracks/artists/albums/playlists, user profile access, and playlist management including creation and adding tracks.6-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to create, manage, and populate Spotify playlists using the Spotify Web API.3MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/belljustin/spotify-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server