spotify-mcp
Allows interaction with the Spotify Web API to retrieve a user's listening history, top artists and tracks, recently played items, playlists, artist profiles, and search the catalog.
Click on "Deploy 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-mcp How has my music taste changed this year?"
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 lets AI assistants answer questions about your Spotify listening history.
Ask "how has my taste changed this year?" in Claude and get a real answer, computed from your actual listening data — not a guess.
> How has my music taste changed over the past year?
# Taste evolution (top 30 artists per window)
## Rising — in the last 4 weeks but not the last year
Phoenix, Men I Trust, Jungle, Rex Orange County
## Fading — in the last year but not the last 4 weeks
Radiohead, Kendrick Lamar, Fleetwood Mac, Interpol, Portishead
## Constant — present in both
Tame Impala, Frank Ocean, Daft Punk, The Strokes
Overlap between the 4-week and 1-year windows: 11/30 artists.Example output. The tool reports whatever your own account contains.
Built on the Model Context Protocol, an open standard — so one server works in Claude Desktop, Claude Code, Cursor, or any other MCP client, with no integration code written per client.
Read-only. Every granted scope is a *-read scope: the server can observe
your account and cannot modify it. No playback control, no playlist edits.
Tools
Tool | Question it answers |
| "What am I into lately?" — top artists and tracks for a 4-week, 6-month, or 1-year window |
| "How has my taste changed?" — who's rising, fading, and constant across all three windows |
| "What have I had on?" — recent plays, repeat artists, time-of-day pattern |
| Your playlists, with track counts |
| "What is this playlist?" — dominant artists, how varied it is, release decades, runtime |
| An artist's albums and singles, newest first |
| Search tracks, artists, or albums |
| What's playing right now |
Tools are designed around questions rather than API endpoints. taste_evolution
makes three API calls and diffs them server-side, because Spotify exposes three
fixed windows and no history — returning an answer rather than three pages of
raw JSON for the model to reconcile itself.
Related MCP server: Your Spotify MCP Server
Requirements
Node.js 20.12 or newer
A Spotify account
A free Spotify developer app (below) — no paid tier needed
Setup
1. Install
git clone https://github.com/sjtan2302/spotify-mcp.git
cd spotify-mcp
npm install
npm run build2. Create a Spotify app
Go to the Spotify developer dashboard and click Create app.
Field | Value |
App name | Anything, e.g. |
App description | Required; anything, e.g. |
Website | Leave blank |
Redirect URI |
|
Which API/SDKs | Check Web API |
Two things that trip people up:
Click "Add" before "Save". The redirect URI is silently dropped otherwise, and the resulting error looks like an invalid client ID.
Use
127.0.0.1, notlocalhost. Spotify disallowedlocalhosthostnames in February 2025;http://localhost:8888/callbackis rejected withINVALID_CLIENT: Insecure redirect URI.
Then open the app's Settings and copy the Client ID.
3. Add your Client ID
cp .env.example .envPut the ID in .env:
SPOTIFY_CLIENT_ID=your_client_id_hereNo client secret is needed. This server uses OAuth 2.0 with PKCE, which exists precisely so that no secret has to be stored. The Client ID is not sensitive.
4. Authorize
npm run loginA browser opens; approve the request. Tokens are written to
~/.spotify-mcp/tokens.json with 0600 permissions, and refreshed
automatically from then on. You only do this once.
5. Verify
npm run smokeThis launches the server the way a real client does and exercises every tool against your account.
Connecting an AI assistant
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"spotify": {
"command": "/usr/local/bin/node",
"args": ["/absolute/path/to/spotify-mcp/dist/index.js"]
}
}
}Then fully quit and reopen Claude Desktop — it only reads this file at launch.
Use the absolute path to
node(which node). Claude Desktop does not inherit your shellPATH, and a bare"node"is the most common reason a server silently fails to start.
Claude Code
claude mcp add spotify -- node /absolute/path/to/spotify-mcp/dist/index.jsThe server locates .env relative to its own installed location, so it works
regardless of which directory the client launches it from.
Development
npm run build # compile
npm run dev # compile on change
npm run smoke # end-to-end test against a live account
npm run inspect # open the MCP Inspector UIsrc/
index.ts tool registration and transport wiring
auth.ts OAuth 2.0 PKCE flow, loopback callback, 0600 token store
api.ts API client: token refresh, pagination, 429/401 handling
analyze.ts aggregation: artist mix, decades, taste diff, listening clock
login.ts one-time authorization CLI
env.ts optional .env loading
tool.ts shared MCP result helpers
scripts/
smoke.mjs end-to-end test over a real stdio client connectionWhat this server cannot do, and why
Spotify has restricted its Web API substantially for apps created recently. These are not bugs here — the data no longer exists at this access tier:
November 2024 — restricted for apps without prior extended access: Audio Features (danceability, energy, tempo, valence), Audio Analysis, Recommendations, Related Artists, Featured Playlists, Category Playlists, 30-second preview URLs.
February 2026 — removed outright:
Removed | Effect |
| No batch artist lookup |
|
|
| Renamed |
Artist | No genre analysis is possible |
Track | No "mainstream vs deep cuts" measure |
Playlist | Track counts come from |
Search | Catalog endpoints cap pages at 10 |
Most Spotify tutorials are built on audio-features and recommendations.
They no longer run. Genre data is gone entirely — genres existed only on
artist objects, and both the batch endpoint and the field itself were removed.
This server uses artist concentration instead: what share of a track set's credits belong to its top few artists. It answers the same underlying question — is this varied or narrow? — from data that still exists.
License
MIT
Available Tools
8 toolsanalyze_playlistAnalyze a playlistA
Full breakdown of one playlist: dominant artists, how concentrated it is, release decades and total runtime. Accepts a playlist name (matched against the user's own playlists) or a Spotify playlist ID.
Inputs: playlist (required), max_tracks.
artist_profileArtist profileA
Look up an artist by name and return their catalogue - recent albums and singles - in one call.
Inputs: name (required).
my_listening_profileMy listening profileB
Top artists and tracks for a time window in one call - answers 'what am I into lately'.
Inputs: limit, time_range.
my_playlistsList my playlistsA
Playlists the user owns or follows, with track counts. Use this to find a name to pass to analyze_playlist.
Inputs: max.
now_playingNow playingA
What the user is listening to right now, if anything.
Inputs: no named parameters.
recently_playedRecently playedB
The most recent plays, with the artists repeated most and which parts of the day the listening clustered in. Spotify caps this at 50 items.
Inputs: limit.
search_catalogSearch SpotifyA
Search the public catalog for tracks, artists or albums.
Inputs: query (required), type, limit.
taste_evolutionHow my taste is changingA
Compares top artists across all three time windows to show who is rising, fading, and constant. Spotify exposes no listening history, so this diff is the only way to see direction of travel.
Inputs: limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Tools are mostly distinct, but artist_profile and search_catalog both handle lookups, and my_listening_profile vs taste_evolution both surface top artists. Descriptions clarify the differences well.
All names use snake_case and are readable, but the pattern mixes noun-phrases (my_playlists, now_playing) with verb-phrases (analyze_playlist, search_catalog). Minor inconsistency, no chaos.
8 tools is well-scoped for a personal music insights server. Each tool covers a distinct aspect of the user's listening data and catalog access without redundancy.
The set covers listening profile, taste trends, recent plays, playlists, playlist analysis, artist catalog, search, and current playback. Missing playback control or playlist editing, but those appear outside the server's analytics-focused purpose.
Maintenance
Related MCP Connectors
Personal context and preferences for AI via OAuth-approved profile sections and taste data.
Give any AI assistant real-time access to your phone's GPS and location history.
Query your Logspot analytics, companies, and revenue from any AI assistant, and run your actions.
Query your Twitch streams, events, supporters, raids & rankings from an AI assistant via OAuth.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables AI assistants to control Spotify playback, search for music, manage playlists, and interact with your Spotify library through natural language commands.19-
- AlicenseAqualityDmaintenanceConnects AI assistants to a self-hosted Your Spotify instance and Spotify's Web API for deep listening analytics and playback control. It enables users to query unlimited listening history, generate custom Wrapped summaries, and manage playlists through natural language.18Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to control Spotify playback, search music, manage playlists and library, and access user listening insights via the Spotify Web API.-
- AlicenseAqualityBmaintenanceEnables AI assistants to control Spotify playback, manage playlists, and plan DJ sets using BPM, key, and energy data.37MIT