spotify-mcp
Provides tools for searching Spotify and reading playlists, saved tracks, artist catalogs, recommendations, and recently played tracks, as well as creating playlists and adding tracks to them.
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-mcprecommend songs similar to 'Blinding Lights'"
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
An MCP server that wraps spotipy so Claude (or any MCP client) can search Spotify and read playlists, saved tracks, artist catalogs, and discovery signals.
Built specifically as re-com's Spotify backend — read-heavy by design, not a playback-control server. It does support creating playlists and adding tracks to them (so a re-com recommendation list can become a real playlist), but there's no play/pause/queue control; look at one of the several playback-focused Spotify MCP servers already out there for that.
Tools
Tool | Description |
| Search Spotify. |
| List the current user's playlists. Omit |
| Get the tracks in a playlist. Local files/episodes are skipped. |
| Get the user's saved ("Liked Songs") tracks. |
| Get a single track's metadata. |
| Spotify's algorithmic recommendations from one seed track — the closest analog to YouTube Music's radio. |
| Get an artist's profile. |
| An artist's top tracks (Spotify caps this at ~10 — there's no full-catalog endpoint). |
| Artists related to the given one. |
| The user's recently played tracks. |
| Create a new playlist owned by the current user. |
| Add tracks (by ID or URI) to a playlist, chunked in batches of 100. |
| Delete the cached OAuth token. |
A real limitation, stated plainly: Spotify restricts /recommendations and artist_related_artists for API apps created after November 2024 that don't have "Extended Quota Mode" (a manual approval Spotify grants sparingly). If your app doesn't have it, get_recommendations and get_related_artists will 403 — handle_errors turns that into a clear message rather than a raw traceback, and re-com's spotify_client.py treats it as one signal being unavailable, not a fatal error. search_music, playlists, saved tracks, and artist top tracks are unaffected.
Other Claude Code projects on this machine (e.g. re-com) call these tools by spawning this server over MCP rather than talking to spotipy/Spotify themselves — this is the only place Spotify credentials live.
Setup
1. Register a Spotify app
Go to the Spotify Developer Dashboard, create an app.
Add a redirect URI matching
SPOTIFY_REDIRECT_URI(defaulthttp://127.0.0.1:8888/callback— you don't need anything actually listening on that port; see step 3).Note the app's Client ID and Client Secret.
2. Install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -e .3. Authenticate
export SPOTIFY_CLIENT_ID="..."
export SPOTIFY_CLIENT_SECRET="..."
python scripts/setup_auth_spotify.pyThis prints an authorization URL, waits for you to log in and paste back the URL you're redirected to (works fine over SSH/headless — nothing needs to bind the redirect port), and writes the resulting token to .spotify_cache (path configurable via SPOTIFY_CACHE_PATH).
.spotify_cache is equivalent to your logged-in session — never commit it or share it. It's already gitignored. Tokens refresh automatically once cached; re-run this script only if refresh itself starts failing (e.g. the app's client secret was rotated, or you revoked access from your Spotify account settings), or if SCOPE in server.py gains new permissions (delete .spotify_cache first so the auth flow re-prompts for consent — a stale cached token won't pick up new scopes on its own).
4. Add to Claude Code
claude mcp add spotify -s user \
-e SPOTIFY_CLIENT_ID="..." \
-e SPOTIFY_CLIENT_SECRET="..." \
-e SPOTIFY_CACHE_PATH="$(pwd)/.spotify_cache" \
-- "$(pwd)/.venv/bin/python" "$(pwd)/server.py"-s user makes it available in any Claude Code session, not just this directory. Use absolute paths for the python interpreter, server.py, and SPOTIFY_CACHE_PATH since the server can be launched from any working directory.
For other MCP clients (Claude Desktop, etc.), point them at the same command and env vars using their respective config format.
Testing
The unit test suite (tests/) runs against a hand-rolled fake spotipy.Spotify client — no network access or Spotify credentials needed:
pip install -e ".[dev]"
pytestError handling
Tool calls translate common failure modes into clear messages instead of raw tracebacks:
Missing/expired auth (401) → tells you to redo authenticate step.
Restricted/forbidden (403) → tells you it's likely a Spotify API access restriction (see the recommendations/related-artists caveat above) or a missing OAuth scope.
Rate limiting (429) → tells you to wait, including the
Retry-Afterhint if Spotify sent one.Any other API or OAuth error is reported directly rather than as a raw traceback.
License
MIT — see LICENSE.
This server cannot be installed
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
Spotify MCP — Web API via client_credentials OAuth
MCP server for Suno AI music generation, lyrics, and covers
MCP server for Producer/Riffusion AI music generation
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/umsachde/spotify-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server