Spotify MCP Server
This server enables AI assistants to interact with the Spotify Web API for music discovery, playback control, playlist management, and library organization.
Search
Search for tracks, albums, artists, playlists, shows, episodes, or audiobooks with support for filters like
artist:,album:,genre:, andyear:
Albums
Get album details and retrieve tracks within an album
Artists
Get artist details and browse an artist's albums (filtered by type: album, single, appears_on, compilation)
Tracks
Get details about specific tracks
Playlists
Get playlist details and items
Create new playlists and update name, description, or visibility
Add, remove, or reorder tracks/episodes in a playlist
View the current user's playlists
Library
View saved tracks, albums, shows, episodes, and audiobooks
Save or remove items from the library
Check if specific items are saved
Shows & Podcasts
Get show/podcast details and browse episodes
Audiobooks
Get audiobook details, browse chapters, and get details of a specific chapter
Playback Control
Get current playback state or currently playing item
Play, pause, skip to next/previous track
Seek to a specific position, set volume (0–100), repeat mode, and shuffle
Transfer playback to a different device and get available devices
Add items to the queue, view the current queue, and get recently played tracks
User Profile
Get the current user's Spotify profile
Get top artists or tracks (short-term, medium-term, or long-term)
Additional Features
Subscribe to real-time resource updates (profile, playback, queue, top items)
Pre-built prompt workflows for playlist building, listening summaries, and library cleanup
Provides tools for searching music, controlling playback, managing playlists, and accessing user library via the Spotify Web API.
Spotify MCP Server
A Model Context Protocol (MCP) server that provides tools for interacting with the Spotify Web API. Enables AI assistants like Claude to search music, control playback, manage playlists, and more.
Features
Search - Find tracks, albums, artists, playlists, shows, episodes, and audiobooks
Playback Control - Play, pause, skip, seek, volume, shuffle, repeat, queue management
Playlists - Create, update, add/remove/reorder tracks (auto-chunks large batches)
Library - View and manage saved tracks, albums, shows, episodes, and audiobooks
Browse - Get details on tracks, albums, artists, episodes, chapters — single or batch
Podcasts & Audiobooks - Browse shows, episodes, audiobooks, and chapters
Follow - Follow/unfollow artists, users, and playlists
User Profile - View profile, top artists/tracks, diagnostic
whoamiResources - Subscribable snapshots of profile, playback, queue, top items
Prompts - Pre-baked workflows for playlist building, listening summaries, library cleanup
Transports -
stdio(default),sse, andstreamable-httpCovers all non-deprecated Spotify Web API endpoints
Related MCP server: Spotify MCP Server
Example interactions
"What am I listening to right now?"
"Play some Radiohead on my living room speaker."
"Skip this track and turn the volume down to 30."
"Build me a playlist of 25 chill tracks based on what I've been listening to this week."
"Add the last three songs I played to my 'Focus' playlist."
"Show me my top artists from the last six months."
"Search for live albums by Nils Frahm and save the best one to my library."
"Unfollow every playlist I haven't opened that wasn't made by me."
"Queue up the next episode of the show I was listening to yesterday."
Prerequisites
uv — install with
curl -LsSf https://astral.sh/uv/install.sh | shA Spotify Developer account
A Spotify app with Client ID and Client Secret
Getting Your Spotify Credentials
Go to the Spotify Developer Dashboard
Click Create App
Fill in the app details:
App name: Choose any name (e.g., "My MCP Server")
App description: Optional
Redirect URI:
http://127.0.0.1:8888/callbackWhich API/SDKs are you planning to use?: Select Web API
Click Save
On your app's page, find your Client ID
Click Show client secret to reveal your Client Secret
Important: The redirect URI must exactly match
http://127.0.0.1:8888/callback(or whatever you set inSPOTIFY_REDIRECT_URI). Do not uselocalhost— use127.0.0.1.
Installation
Pick your client below. All examples use uvx to fetch the server on demand — no clone, no manual install.
Claude Code
claude mcp add spotify \
-e SPOTIFY_CLIENT_ID=your_client_id \
-e SPOTIFY_CLIENT_SECRET=your_client_secret \
-- uvx mcp-server-spotifyOther MCP clients
Most MCP clients configure servers via a JSON file. Add this entry to your client's MCP config:
{
"mcpServers": {
"spotify": {
"command": "uvx",
"args": ["mcp-server-spotify"],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id",
"SPOTIFY_CLIENT_SECRET": "your_client_secret"
}
}
}
}Running from a local checkout
For development, or if you want to run a modified copy:
git clone https://github.com/llyfn/spotify-mcp.git
cd spotify-mcp && uv syncThen point your client at the local checkout instead of uvx:
"command": "uv",
"args": ["--directory", "/absolute/path/to/spotify-mcp", "run", "mcp-server-spotify"]Configuration
Variable | Required | Default | Description |
| Yes | — | Your Spotify app's Client ID |
| Yes | — | Your Spotify app's Client Secret |
| No |
| OAuth redirect URI |
| No |
| MCP transport: |
Authentication
The server uses Spotify's Authorization Code flow:
On first use, the server opens your browser to Spotify's login page
Spotify will ask you to approve access — the server requests all scopes needed for the full tool set (playback, library, playlists, and user data)
After you authorize, Spotify redirects to the local callback server
The server exchanges the authorization code for access/refresh tokens
Tokens are stored securely in
~/.spotify-mcp/credentials.jsonTokens are automatically refreshed when they expire
If running in a headless environment (SSH, Docker), the auth URL will be printed to stderr — copy and paste it into a browser manually.
Re-authenticating
To re-authenticate (e.g., after revoking access), delete the stored credentials:
rm ~/.spotify-mcp/credentials.jsonAvailable Tools
Search
Tool | Description |
| Search for tracks, albums, artists, playlists, shows, episodes, or audiobooks |
Albums
Tool | Description |
| Get album details by ID |
| Batch lookup — up to 20 album IDs in one call |
| Get tracks in an album |
Artists
Tool | Description |
| Get artist details by ID |
| Batch lookup — up to 50 artist IDs in one call |
| Get albums by an artist |
Tracks
Tool | Description |
| Get track details by ID |
| Batch lookup — up to 50 track IDs in one call |
Playlists
Tool | Description |
| Get playlist details |
| Update playlist name, description, or visibility |
| Get items in a playlist |
| Add tracks/episodes to a playlist |
| Remove items from a playlist |
| Reorder items in a playlist |
| Get the current user's playlists |
| Create a new playlist |
Library
Tool | Description |
| Get saved tracks |
| Get saved albums |
| Get saved shows |
| Get saved episodes |
| Get saved audiobooks |
| Save items to library |
| Remove items from library |
| Check if items are in library |
Player
Tool | Description |
| Get current playback state |
| Get the currently playing track |
| Start or resume playback |
| Pause playback |
| Skip to next track |
| Skip to previous track |
| Seek to position in track |
| Set repeat mode (track/context/off) |
| Set playback volume |
| Toggle shuffle mode |
| Transfer playback to another device |
| Get available devices |
| Add item to playback queue |
| Get the playback queue |
| Get recently played tracks |
Shows & Podcasts
Tool | Description |
| Get show details |
| Batch lookup — up to 50 show IDs in one call |
| Get episodes of a show |
| Get a single episode by ID |
| Batch lookup — up to 50 episode IDs in one call |
Audiobooks
Tool | Description |
| Get audiobook details |
| Batch lookup — up to 50 audiobook IDs in one call |
| Get chapters of an audiobook |
| Get chapter details |
| Batch lookup — up to 50 chapter IDs in one call |
Follow
Tool | Description |
| List artists the user follows (cursor-paginated) |
| Follow one or more artists or users by ID |
| Unfollow one or more artists or users by ID |
| Check whether the user follows given artist/user IDs |
| Follow a playlist (optionally publicly) |
| Unfollow a playlist |
Users
Tool | Description |
| Get current user's profile |
| Get top artists or tracks |
| Diagnostic — auth status, active device, configured scopes |
Resources
Snapshots of user state exposed under the spotify:// URI scheme. MCP clients can
include them as context or subscribe for updates without calling a tool.
URI | Description |
| Profile basics — name, country, plan, follower count |
| Current playback state (episode-aware) |
| Currently playing + next-up queue |
| Top tracks (last ~6 months) |
| Top artists (last ~6 months) |
Prompts
Canned workflows MCP clients can offer in their prompt picker. Each one walks the assistant through a multi-step task using the tools above.
Prompt | Description |
| Build a new playlist seeded by recent listening ( |
| Summarize the past week's listening grouped by artist/album |
| Build a playlist from a comma-separated list of artists ( |
| Scan saved tracks and propose cleanup candidates ( |
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT - see LICENSE for details.
Maintenance
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/llyfn/spotify-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server