Spotify MCP
This server acts as an MCP interface to the Spotify Web API, enabling you to search, browse, and manage Spotify content via an AI assistant.
Authentication & Status — Sign in via OAuth (browser-based PKCE flow) and check your current login/configuration status.
User Profile — Retrieve your Spotify profile info (ID, display name, country, etc.).
Search — Search the Spotify catalog for tracks, albums, artists, or playlists using text queries or field filters (e.g.
artist:radiohead,year:2020 genre:jazz).Track Details — Fetch detailed information about a specific song by ID, URI, or URL.
Audio Features — Retrieve tempo/BPM, key, energy, danceability, and other metrics for a track (via ReccoBeats, since Spotify deprecated their own endpoint).
Playlist Management
List playlists you own or follow (paginated).
Get a specific playlist's metadata and tracks.
Create a new playlist with optional public/private, collaborative, description, and initial track settings.
Add one or more tracks to an existing playlist at a specific position or at the end.
Now Playing — See the track currently playing on your Spotify account.
Provides tools for searching Spotify, viewing song and playlist details, listing playlists, creating playlists, and managing playback.
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 MCPsearch for 'Bohemian Rhapsody'"
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 MCP
A local Model Context Protocol server for the Spotify Web API. Runs on your machine and lets an MCP client — Claude Code, the Coworker desktop app, or anything else that speaks MCP — search Spotify, view song and playlist details, list your playlists, and create new ones on your behalf.
Features
Tool | What it does |
| Sign in to Spotify via OAuth (opens a browser). Run once. |
| Check whether the server is authenticated and how it's configured. |
| Your Spotify profile (id, display name, country, …). |
| Search the catalog for tracks, albums, artists, or playlists. |
| Detailed info for a single song. |
| Tempo/BPM, key, energy, danceability, etc. for songs (see note below). |
| List the playlists you own or follow (paginated). |
| A playlist's details and its tracks. |
| Create a new playlist (optionally seeded with tracks). |
| Add songs to an existing playlist. |
| The track currently playing on your account, if any. |
Related MCP server: Spotify Streamable MCP Server
How it works
Authentication uses the Authorization Code with PKCE flow — Spotify's
recommended flow for locally-run apps, because it needs only a Client ID and no
client secret. On first use the server opens your browser, you approve access,
and the resulting tokens are cached at ~/.spotify-mcp/token.json and refreshed
automatically. You typically authenticate just once per machine.
Audio features (tempo/BPM, key, energy, danceability)
Spotify deprecated
its own audio-features and audio-analysis endpoints on 2024-11-27. Apps
created after that date get 403 Forbidden, and there is no official
replacement.
So get_audio_features instead uses ReccoBeats — a
free third-party service that mirrors the same metrics and accepts Spotify track
IDs. Two things to be aware of:
Track IDs you look up are sent to ReccoBeats (not Spotify).
The returned values are ReccoBeats' estimates, not Spotify's original numbers.
No API key is required. You can point the tool at a different base URL with the
RECCOBEATS_BASE_URL environment variable.
Prerequisites
Python 3.10+
A free Spotify account
A Spotify app (for the Client ID):
Go to the Spotify Developer Dashboard and Create app.
Under Redirect URIs, add exactly:
http://127.0.0.1:8888/callbackSpotify requires loopback redirect URIs to use
127.0.0.1(notlocalhost). If you change the port, updateSPOTIFY_REDIRECT_URIto match.Copy the Client ID. (The Client Secret is not required.)
Installation
git clone <this-repo> spotify-mcp
cd spotify-mcp
# with uv (recommended)
uv sync
# or with pip
python -m venv .venv && source .venv/bin/activate
pip install -e .Configuration
Set your Client ID (and optionally the redirect URI) as environment variables.
For local testing you can copy .env.example to .env, but MCP clients pass
these via their config env block (shown below).
Variable | Required | Default | Notes |
| ✅ | — | From your Spotify app dashboard. |
| — | — | Optional. If set, uses the classic Authorization Code flow instead of PKCE. |
| — |
| Must exactly match a redirect URI on your app. |
| — |
| Where OAuth tokens are cached. |
| — |
| Base URL for the |
Authenticate first (recommended)
Sign in once from the terminal before wiring it into a client — this makes the first-run browser flow easier to see:
spotify-mcp auth # opens a browser to sign in
spotify-mcp status # confirm you're authenticatedYou can also trigger this later from within any MCP client by calling the
authenticate tool.
Using with Claude Code
Register the server (adjust the command/path for your install):
claude mcp add spotify \
--env SPOTIFY_CLIENT_ID=your_client_id_here \
-- spotify-mcpOr add it to your MCP config JSON directly:
{
"mcpServers": {
"spotify": {
"command": "spotify-mcp",
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id_here"
}
}
}
}If spotify-mcp isn't on your PATH, use the full interpreter path instead,
e.g. "command": "/path/to/spotify-mcp/.venv/bin/spotify-mcp", or
"command": "uv" with "args": ["run", "spotify-mcp"] and a cwd.
Using with Coworker (or other MCP clients)
Any MCP client that launches a stdio server works. Point it at the spotify-mcp
command (or python -m spotify_mcp) with SPOTIFY_CLIENT_ID in the environment:
{
"mcpServers": {
"spotify": {
"command": "spotify-mcp",
"env": { "SPOTIFY_CLIENT_ID": "your_client_id_here" }
}
}
}Then just ask, e.g.:
"Search Spotify for upbeat indie tracks from 2019."
"Show me the songs in my Focus playlist."
"Create a private playlist called Roadtrip and add these five songs."
Scopes requested
The server requests the scopes needed for its tools:
user-read-private, user-read-email, playlist-read-private,
playlist-read-collaborative, playlist-modify-private,
playlist-modify-public.
Security notes
OAuth tokens are stored locally at
SPOTIFY_MCP_CACHEwith0600permissions and are git-ignored. Never commit them.PKCE means no client secret is stored on disk or passed around.
The server only calls Spotify's official API endpoints over HTTPS.
Development
# Run the server over stdio (what MCP clients invoke)
spotify-mcp
# Or as a module
python -m spotify_mcpProject layout:
src/spotify_mcp/
auth.py # OAuth (PKCE) flow, token cache & refresh
client.py # Spotify Web API wrapper + response trimming
audio_features.py # Tempo/key/energy via ReccoBeats (Spotify's is deprecated)
server.py # FastMCP server and tool definitions
__main__.py # CLI: run server / auth / statusLicense
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/abenke/spotify-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server