Spotify API MCP
Enables interaction with the Spotify API for searching tracks, artists, albums, and playlists, managing user playlists (creating playlists, adding tracks), and accessing user profile information through OAuth 2.0 authentication.
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 API MCPsearch for 'Daft Punk' tracks"
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 API MCP
A Model Context Protocol (MCP) server that enables MCP-compatible applications (like Claude Desktop, IDEs, and other AI tools) to interact with the Spotify API, including authenticated endpoints for playlist management.
Features
Search: Search for tracks, artists, albums, and playlists
Authentication: OAuth 2.0 flow with PKCE for secure authentication
User Profile: Get current user information
Playlist Management: Create playlists and add tracks
Token Management: Automatic token refresh
Related MCP server: MCP Spotify Server
Setup
1. Install Dependencies
npm install2. Create a Spotify App
Create a new app
Add
http://127.0.0.1:3000/callbackas a redirect URINote your Client ID and Client Secret
3. Set Up Authentication (Optional)
You can provide your Spotify credentials in several ways:
Option A: Environment Variables
export SPOTIFY_CLIENT_ID="your_client_id_here"
export SPOTIFY_CLIENT_SECRET="your_client_secret_here"Option B: Configuration File
Create a .env file in the project root:
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_hereOption C: Manual Authentication
If no credentials are pre-configured, you can use the spotify_authenticate tool to provide them when needed.
4. Build the Project
npm run build5. Configure Your MCP Client
Add the following to your MCP client settings (example for Claude Desktop):
{
"mcpServers": {
"spotify": {
"command": "node",
"args": ["/path/to/spotify-api-mcp/dist/index.js"]
}
}
}For other MCP clients, consult your client's documentation for the appropriate configuration format.
Note for Claude Desktop users: When you first try to use any Spotify functionality, Claude will automatically prompt you to authenticate by asking for your Spotify app's client ID and client secret. You don't need to provide these credentials in the configuration above.
Available Tools
spotify_authenticate
Authenticate with Spotify using OAuth 2.0. Required before using authenticated endpoints.
Parameters:
client_id(string, optional): Your Spotify app's client ID (can be set via environment variable)client_secret(string, optional): Your Spotify app's client secret (can be set via environment variable)
spotify_search
Search for content on Spotify.
Parameters:
query(string): Search querytype(string): Type of content (track,artist,album,playlist)limit(number, optional): Number of results (1-50, default: 10)
spotify_get_user_profile
Get the authenticated user's profile information.
spotify_create_playlist
Create a new playlist for the authenticated user.
Parameters:
name(string): Playlist namedescription(string, optional): Playlist descriptionpublic(boolean, optional): Whether playlist is public (default: false)
spotify_add_tracks_to_playlist
Add tracks to a playlist.
Parameters:
playlist_id(string): Playlist IDtrack_uris(array): Array of Spotify track URIs
spotify_get_user_playlists
Get the authenticated user's playlists.
Parameters:
limit(number, optional): Number of playlists to return (1-50, default: 20)
Usage Example
First, authenticate with Spotify:
Use the spotify_authenticate tool with your client ID and secretFor Claude Desktop users: Simply ask Claude to search for music or create a playlist. Claude will automatically handle the authentication process and ask you for your Spotify credentials when needed.
Search for tracks:
Use spotify_search with query "Bohemian Rhapsody" and type "track"Create a playlist:
Use spotify_create_playlist with name "My New Playlist"Add tracks to the playlist:
Use spotify_add_tracks_to_playlist with the playlist ID and track URIs from search resultsNote: The exact syntax for using these tools depends on your MCP client. The examples above show the general approach.
Development
Run in development mode:
npm run devBuild for production:
npm run buildSecurity Notes
Client secrets are handled securely and not logged
OAuth 2.0 with PKCE is used for authentication
Tokens are automatically refreshed when needed
Local server runs temporarily only during authentication
License
MIT
Available Tools
6 toolsspotify_add_tracks_to_playlistC
Add tracks to a playlist
| Name | Required | Description | Default |
|---|---|---|---|
| playlist_id | Yes | ID of the playlist | |
| track_uris | Yes | Array of Spotify track URIs to add |
TDQS
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. 'Add tracks to a playlist' implies a write/mutation operation, but it doesn't disclose important behavioral traits like authentication requirements, rate limits, whether duplicate tracks are allowed, ordering behavior, or what happens on success/failure. This leaves significant gaps for an agent to understand how to use it safely.
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 a single, efficient sentence with zero wasted words. It's appropriately sized for a straightforward tool and gets directly to the point without unnecessary elaboration.
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 is insufficiently complete. It doesn't address authentication requirements, success/failure behavior, rate limits, or what the tool returns. Given the complexity of a write operation in an API context, more contextual information would be needed 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.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so both parameters are documented in the schema. The description doesn't add any meaningful parameter semantics beyond what the schema already provides about 'playlist_id' and 'track_uris'. The baseline score of 3 reflects adequate but minimal value addition from the description.
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 action ('Add tracks') and resource ('to a playlist'), making the tool's purpose immediately understandable. It doesn't specifically differentiate from siblings like 'spotify_create_playlist' or 'spotify_search', but the verb+resource combination is unambiguous in context.
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. It doesn't mention prerequisites (like authentication), when not to use it, or how it relates to sibling tools like 'spotify_create_playlist' for creating new playlists versus adding to existing ones.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
spotify_authenticateC
Authenticate with Spotify using OAuth 2.0
| Name | Required | Description | Default |
|---|---|---|---|
| client_id | Yes | Spotify client ID | |
| client_secret | Yes | Spotify client secret |
TDQS
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 mentions OAuth 2.0, which implies a standard authentication flow, but fails to detail critical aspects like whether this initiates a user consent flow, returns tokens, handles token storage, or has rate limits. This leaves significant gaps in understanding the tool's behavior.
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 a single, efficient sentence that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy for an agent to quickly grasp the core function.
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 complexity of an OAuth authentication tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns (e.g., access tokens, error handling), how it integrates with sibling tools, or the authentication flow details, making it incomplete for effective agent 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 100% description coverage, clearly documenting both parameters (client_id and client_secret). The description adds no additional meaning beyond what the schema provides, such as explaining where to obtain these credentials or their format. With high schema coverage, the baseline score of 3 is appropriate.
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 action ('Authenticate') and the service ('with Spotify'), and specifies the authentication method ('using OAuth 2.0'), which provides a specific verb+resource combination. However, it doesn't explicitly distinguish this authentication tool from potential sibling tools that might also involve authentication or authorization processes, keeping it from a perfect score.
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, such as whether it's for initial setup, token refresh, or specific API calls. It lacks context about prerequisites or exclusions, leaving the agent to infer usage based on the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
spotify_create_playlistC
Create a new playlist for the authenticated user
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the playlist | |
| description | No | Description of the playlist | |
| public | No | Whether the playlist should be public |
TDQS
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 this creates a playlist but doesn't mention any behavioral traits: no information on permissions required, rate limits, whether the operation is idempotent, what happens on duplicate names, or what the response contains (e.g., playlist ID). For a mutation tool with zero annotation coverage, this is a significant gap.
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 a single, efficient sentence that directly states the tool's purpose without any fluff or redundant information. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly. Every word earns its place.
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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a playlist object or ID), error conditions, or behavioral constraints. While the schema covers inputs well, the overall context for safe and effective use is lacking, especially compared to siblings that might handle related operations.
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?
Schema description coverage is 100%, so the schema already documents all three parameters (name, description, public) with clear descriptions. The description adds no additional meaning about parameters beyond implying they relate to playlist creation. This meets the baseline of 3 when the schema does the heavy lifting, but no extra value is provided.
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 action ('Create') and resource ('new playlist for the authenticated user'), making the purpose immediately understandable. It distinguishes from siblings like spotify_add_tracks_to_playlist (modification) and spotify_get_user_playlists (retrieval). However, it doesn't specify what type of playlist (e.g., music, podcast) or platform context, which prevents a perfect score.
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. It doesn't mention prerequisites (e.g., authentication via spotify_authenticate), when not to use it (e.g., for modifying existing playlists), or how it relates to siblings like spotify_get_user_playlists for listing playlists first. This leaves the agent to infer usage from context alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
spotify_get_user_playlistsC
Get the current user's playlists
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of playlists to return (1-50) |
TDQS
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 what the tool does but doesn't describe how it behaves: no information about authentication requirements, rate limits, pagination (beyond the limit parameter), error conditions, or what the return format looks like. For a read operation with zero annotation coverage, this leaves significant gaps in understanding the tool's behavior.
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 extremely concise at just 5 words, front-loading the core purpose without any wasted words. Every element ('Get', 'current user's', 'playlists') contributes directly to understanding. It's appropriately sized for a simple retrieval tool with one optional parameter.
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 simplicity (1 optional parameter, no output schema, no annotations), the description is incomplete. It doesn't address authentication requirements (critical for Spotify API), return format, pagination behavior beyond the limit parameter, or error handling. For a tool that likely requires authentication and returns structured data, the description should provide more context about these aspects.
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 no parameter semantics beyond what the input schema provides. The schema has 100% description coverage with clear documentation for the 'limit' parameter (range, default). Since the description doesn't mention parameters at all, it doesn't compensate but doesn't detract either. With high schema coverage, the baseline score of 3 is appropriate.
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 action ('Get') and resource ('current user's playlists'), making the purpose immediately understandable. It distinguishes from siblings like spotify_get_user_profile (which gets user profile) and spotify_search (which searches content), though it doesn't explicitly mention these distinctions. The description is specific but could be more precise about scope.
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. It doesn't mention prerequisites (like authentication), when it's appropriate versus other playlist-related tools (spotify_create_playlist, spotify_add_tracks_to_playlist), or any constraints beyond what's in the schema. The agent must infer usage from context alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
spotify_get_user_profileB
Get the current user's profile information
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
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 what the tool does without behavioral details. It doesn't disclose whether this requires authentication, rate limits, error conditions, or the format of returned profile data (e.g., JSON structure).
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 a single, clear sentence with zero wasted words. It's front-loaded with the core purpose and efficiently communicates the essential action without redundancy or fluff.
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 tool with no annotations and no output schema, the description is insufficient. It doesn't explain what profile information is returned (e.g., username, email, subscription type) or behavioral aspects like authentication requirements, leaving significant gaps for an AI agent to use it 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 tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for not adding unnecessary information.
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 action ('Get') and resource ('current user's profile information'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like spotify_get_user_playlists, which also retrieves user data but for playlists instead of profile information.
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. It doesn't mention prerequisites (e.g., authentication status), compare to siblings like spotify_get_user_playlists for different user data, or specify use cases for profile versus playlist retrieval.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
spotify_searchC
Search for tracks, artists, albums, or playlists on Spotify
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query | |
| type | Yes | Type of content to search for | |
| limit | No | Maximum number of results (1-50) |
TDQS
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 search functionality but lacks critical details: it doesn't mention authentication requirements, rate limits, pagination behavior, or the format of search results. For a tool that interacts with an external API, this omission is significant.
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 a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part of the sentence ('Search for tracks, artists, albums, or playlists on Spotify') directly contributes to understanding the tool's function, making it highly concise and well-structured.
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 lack of annotations and output schema, the description is incomplete for a search tool. It doesn't cover authentication needs, result formatting, error handling, or usage constraints. While the schema covers parameters well, the overall context for safe and effective use is insufficient.
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 schema description coverage is 100%, with clear documentation for all parameters (query, type with enum, limit with range). The description adds no additional parameter semantics beyond what the schema provides, such as search syntax examples or type-specific nuances. This meets the baseline for high schema coverage.
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 action ('Search for') and resources ('tracks, artists, albums, or playlists on Spotify'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'spotify_get_user_playlists' (which retrieves existing user playlists rather than searching the catalog), leaving room for minor ambiguity.
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. It doesn't mention prerequisites (e.g., authentication), compare to sibling tools like 'spotify_get_user_playlists' for accessing user-specific content, or indicate scenarios where searching is preferred over direct retrieval operations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: authentication, user profile retrieval, playlist creation, playlist listing, track addition to playlists, and general search. There is no overlap in functionality, making tool selection straightforward for an agent.
All tools follow a consistent 'spotify_verb_noun' pattern with snake_case, such as spotify_authenticate and spotify_add_tracks_to_playlist. This predictability enhances usability and reduces confusion.
With 6 tools, the server is well-scoped for basic Spotify API interactions, covering authentication, user data, playlist management, and search. Each tool serves a clear purpose without being excessive or insufficient.
The toolset covers core Spotify workflows like authentication, user profile access, playlist creation/listing, and search, but lacks update or delete operations for playlists or tracks, which are minor gaps that agents can work around.
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
Full Spotify Web API coverage - albums, artists, playlists, player controls, and more.
Spotify MCP — Web API via client_credentials OAuth
Spotify: Spotify Data API for Millions of songs & podcasts, artists, albums, playlists and more.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with Spotify's music catalog via the Spotify Web API, supporting searches, artist information retrieval, playlist management, and automatic token handling.263323MIT
- AlicenseAqualityDmaintenanceEnables interaction with Spotify through LLMs using OAuth2 authentication. Supports music search, playback control, playlist management, and device management through natural language commands.142MIT
- FlicenseNot gradedqualityDmaintenanceEnables control of Spotify playback through OAuth authentication, including play/pause, track navigation, volume control, device management, and searching/playing songs by artist or track name.1
- AlicenseAqualityBmaintenanceEnables searching and managing Spotify playlists, tracks, and user information through the Spotify Web API.10MIT
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/fisknils/spotify-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server