
Spotify MCP
io.github.NovaLux12由 GitHub 帳號 NovaLux12 發布v3.1.1更新於 Oct 24, 2026
Spotify Web API MCP: playback, library, playlists, search, podcasts. Not affiliated with Spotify.
概覽
在本機執行的 Spotify Web API MCP 伺服器,讓助理在使用者的 Spotify 帳號中搜尋、控制播放、管理播放清單與音樂庫,並瀏覽播客。
- 可以做什麼
- 搜尋 Spotify 目錄,查詢曲目、專輯、藝人、節目與單集
- 控制裝置播放:播放、暫停、跳過、定位、音量與佇列
- 建立、編輯、合併、相減與去除重複的播放清單,支援 dry_run 預覽與回執
- 管理收藏庫與追蹤,並檢查已儲存的內容
- 瀏覽播客與有聲書內容,並提供收聽分析與選用的 stats.fm 品味讀取
- 以唯讀的 doctor 工具診斷權杖、授權範圍與限流狀態
- 適用情境
- 適合希望助理直接操作真實 Spotify 帳號的情境,例如建立或整理播放清單、排入播放佇列、查看已收藏內容或回顧收聽習慣,而不只是回答音樂相關問題。
- 執行需求
- 透過 npx 在本機執行,需要 Node 22.9 以上版本。需要一個已登記重新導向 URI 的 Spotify 開發者應用程式、SPOTIFY_CLIENT_ID 環境變數,以及一次瀏覽器登入(權杖會存在本機)。播放控制需要 Spotify Premium;部分端點在應用程式註冊層級受到限制。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Spotify MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
SpotifyMCP
[CI] [npm version] [License: MIT] [Node]
Spotify Web API MCP: playback, library, playlists, search, podcasts. Not affiliated with Spotify.
A broad Spotify Web API tool surface, plus extras most servers skip. Registration-gated wrappers are explained rather than hidden; see Registration-gated endpoints for the generated list.
What you get by default, and what to do about the rest. A server started with no environment registers a curated surface — search, playback, playlists, library, following — sized so the tool list does not dominate the context window before you have typed anything. SPOTIFY_MCP_TOOLSETS=all registers the entire registry instead, and the stats.fm tools are opt-in with SPOTIFY_MCP_STATSFM=1. Both are one line in docs/configuration.md.
A server started with no SPOTIFY_MCP_TOOLSETS registers 131 tools (150,111 bytes of schema) — the curated default surface (#889). SPOTIFY_MCP_TOOLSETS=all registers all 562 tools, along with 17 fixed resources, 28 resource templates, and 14 prompts. Toolsets and production gates can trim a configured host further; both figures describe a real production tools/list after finalizers.
3.0 and later
3.0 was the release where the open issue list went to zero — every epic, every issue under it, every contradiction we turned up auditing ourselves. Most of that backlog was never "bugs" in the crashing sense; it was places where this server reported a value it had not actually checked, which is the only kind of wrong that is genuinely dangerous.
It also removed tools, because Spotify deleted the endpoints underneath them in February 2026 — including artist follows, which have no migration target at all.
🤖 Paste this to your agent
Copy the block below into Claude Code, Cursor, OpenClaw, or any coding agent — it will set SpotifyMCP up for you.
⚠️ Never paste your Spotify credentials into a chat. Spotify's Developer Terms treat the Client ID as a credential: §VI.1.1 groups "I.D.s, client I.D.s, keys, passwords, security codes, or tokens" together as Security Codes, §VI.1.3 forbids disclosing them to any other party, and §VI.1.4 makes you responsible for their confidentiality. Anything you type into a conversation is retained by the model provider, written to shell history, and carried in the agent's context window. The Client ID is the only credential this server needs, and it is a Security Code rather than a public identifier — treat it like a password.
Why this one
Quick start
1. Create a Spotify app
Spotify Developer Dashboard → Create app → add this Redirect URI exactly:
Copy the Client ID.
2. Authenticate
Opens a browser, saves tokens to ~/.spotify-mcp/tokens.json, auto-refreshes after.
Windows & headless
Windows (Command Prompt):
Windows (PowerShell):
Windows is supported for install and everyday use, and is not covered by CI. The commands above are the supported path, but the test suite runs on Linux only, so a Windows-specific regression would not be caught before release. See docs/platform-support.md for exactly what is and is not verified there, and what the known gaps are.
Headless / remote host:
Check: npx -y @novalux12/spotify-mcp@latest doctor — exit 0 means you're good.
3. Add to your MCP host
Restart the host. A hammer icon in the chat input means it's connected.
Claude Code · OpenClaw · other hosts
Claude Code (no JSON editing):
OpenClaw — ~/.openclaw/openclaw.json → mcp.servers:
Any spec-compliant host works — same command/args/env shape under mcpServers or servers. If the host can't pass env vars, authenticate once beforehand; the token cache persists.
What you can ask
- "What are my top tracks this month?"
- "Make a late-night driving playlist"
- "Add Blinding Lights to my workout playlist"
- "What podcasts have new episodes?"
- "Clean duplicates across all my playlists"
- "What does my taste look like? Build a playlist from it"
- "Do my stats.fm lifetime genres match what I've played this month?"
Configuration
All via env vars — no config file. Only SPOTIFY_CLIENT_ID is required.
Full reference: docs/configuration.md
spotify_doctor (CLI + in-server tool) diagnoses token state, scope gaps, Premium gating, rate-limit cooldowns, request/quota usage (cumulative + rolling-window counts, #904), and read-cache pressure (entries held, bytes retained, responses too large to cache, #894) without extra setup.
Upgrading to 2.0
2.0 is a contract release. One tool name is gone, four things moved, and one guarantee tightened:
-
get_show_episodesis removed. Uselist_show_episodes(same endpoint, same arguments, minus the drifted alias). It was the only name that changed; everything else in the surface keeps its name. The exact registry totals are generated at the top of this file, so this sentence deliberately carries no count of its own to fall behind. -
Destructive writes fail closed. Any confirmation-gated bulk write now refuses when the client cannot elicit, instead of proceeding unprompted.
archive_played_episodes'sconfirm: trueno longer authorises the delete (it is still accepted, and every result says it was ignored). For headless automation, setSPOTIFY_MCP_CONFIRM=neverdeliberately. -
Playlist set-operation inputs are canonical. A/B pairs are
playlist_a/playlist_b; ordered lists areplaylists;playlist_subtracttakes the base asbase_playlist_id. This was the 2.0 contract; the old spellings it was allowed to keep alongside it were withdrawn in 3.0 (#1287). They are no longer in any tool's schema, and a call that still sends one is refused before any Spotify request with avalidationerror whosereasonisretired_input, naming both what was sent and what to send instead. Each tool declared exactly one alias pair or one alias list, so the table below is a per-tool migration map rather than a bundle:base_playlist_idis required again: with the positional form gone there is no longer a base for a caller to omit. A name the tool does not declare, and is not a retired spelling, is anunknown_paramerror — a different claim fromretired_input, which says the server published that name until 3.0. -
Numeric caps have canonical names.
max_resultscaps what is returned;limitandscan_capcap how much of each source is read. -
Unknown arguments are rejected with a typed
unknown_paramerror rather than ignored, so a renamed parameter fails loudly instead of silently doing nothing.
Run spotify_doctor after upgrading: it reports the registered surface, the
gates that hid modules, and the granted scopes in one call.
Docs
- docs/v3-roadmap.md — what's coming in 3.0, and the one bug underneath all of it
- docs/migration-v3.md — every retired name in 3.0 and what replaced it, including the one operation with no replacement
- SPEC.md — every tool, resource & prompt
- ARCHITECTURE.md — how it's built
- docs/configuration.md — all env vars
- docs/cli.md —
tools,call,watch,export,init: the CLI as an MCP client - docs/schema-budgets.md — per-module schema budgets and registration order
- docs/statsfm.md — stats.fm second source: setup, tool cheat sheet, gotchas
- docs/cookbook.md — copy-paste agent recipes
- docs/non-goals.md — what v2 will not do, why, and what it offers instead
- docs/taste.md — anonymized taste showcase driving a playlist
- docs/wave2-composites.md — read-only taste composites
- docs/distribution.md — distribution and release notes
- docs/faq.md — auth, Premium, 403s, headless, tokens
- docs/compliance.md — brand marks, attribution & the outbound
User-Agent - CONTRIBUTING.md — dev setup & conventions
- CHANGELOG.md — release history
Requirements
- Premium for playback control (play/pause/skip/seek/volume/queue). Free accounts can still use search, library & playlists.
- Node 22.9+, Spotify app in dev mode (5 users until extended quota).
- Audiobooks gated by Spotify to US/UK/CA/IE/NZ/AU.
- A subset of endpoints is registration-gated — 403 on current app registrations regardless of scopes or Premium. Whether a grandfathered registration still answers
200is unverified (#1338). This is a property of your app registration, not of the tool. See Registration-gated endpoints.
Registration-gated endpoints
Some Web API endpoints are denied at the app-registration level: on current Spotify app registrations they return 403 Forbidden no matter which OAuth scopes you grant or whether the account is Premium. This is Spotify-side gating, not a misconfiguration on your end.
Nothing here is simply "removed". Three sources describe this class and they do not agree, which is why the table below states the runtime behaviour instead of a verdict:
- Spotify's February 2026 changelog marks a batch of operations
[REMOVED]. - The live OpenAPI schema still publishes most of those same paths, carrying
deprecated: truerather than deleting them —/artists/{id}/top-tracksand all sevenGet Severalbatch paths among them. - The runtime truth is neither document: it is what your app registration is allowed to read. A registration without the grant answers
403/404/410. Whether a grandfathered registration still answers200is unverified (#1338): no probe in this repository shows it, and the one probe artefact that was once cited for it records403on every such path.
So a 403 here is a property of the registration, not of the tool. No tool is hidden for being gated, no gated tool is a zombie: each one either reads a documented replacement and answers, or makes the call and explains the 403 in plain English. The authoritative list is the GATED_FAMILIES array in src/gating.ts — GATED_PATH_PATTERNS is derived from it, so the classifier and this table cannot drift apart.
All 8 families above are operations Spotify's February 2026 changelog marks [REMOVED].
Confirm the list yourself against the source of truth:
Notes:
- A family in that list is a runtime classifier, not a promise that a tool calls it. Three families (
browse-new-releases,me-type-contains,playlist-followers-contains) have no live call site left — the tools that used them were migrated onto replacements — and their patterns are retained so a future caller is still covered by the 403 contract rather than silently losing it. GET /me/library/containsis not gated (it returned 200 on the same probe) and backs the saved-state reads behindcheck_playlist_following,restore_library_snapshotand receipt verification. Thecontainsfamilies above are the documented per-type checks, which the changelog marks removed in favour of this one. (The playlist duplicate-cleanup tools are not in that set — they page/playlists/{id}/items.)- Batch fallback (#725). When a
Get Severalbatch endpoint answers 403,fetchSeveralretries through per-idGET /<kind>/{id}calls on the client's existing queue/backoff. Per-id paths are not in the gated class, so the read still succeeds. The response carriesdegraded: trueand a[degraded: batch endpoint returned 403; … fetched individually]footer in prose, plusdegraded_reasoninstructuredContent, so a caller can tell a per-item round-trip from a clean batch read. - Endpoints Spotify lists as removed that this server does not wrap at all (no shipped tool, so nothing to explain):
/recommendations,/recommendations/available-genre-seeds,/me/apps,/me/chapters, the/artists/{id}/related-artists,/audio-features,/audio-analysisand/browse/featured-playlistsreads, and the/playlists/{id}/tracksfamily (superseded by/playlists/{id}/items). These are absent from the table above because absence of a tool is the honest answer for them — there is no 403 to explain.
Troubleshooting
- "Not authenticated" → re-run
auth; check~/.spotify-mcp/tokens.jsonexists and the redirect URI matches exactly (no trailing slash). - Auth loop / S256 error → open a private window, log into spotify.com first, then retry the auth URL there.
- Port in use (8888) → free the port, set
SPOTIFY_REDIRECT_URIto another port, or useSPOTIFY_HEADLESS=1. The message namesEADDRINUSEand the port because the usual cause is a previousauthstill holding it. - Timed out waiting for the browser callback → not a port conflict; the listener bound and has been closed. Retry, and check the redirect URI is registered exactly. Bound it with
SPOTIFY_AUTH_TIMEOUT_MS(default 5 min). - "Premium required" on playback → expected on Free accounts; no workaround.
Forbiddenon lookup tools (categories, markets, top-tracks, user profiles, the per-typecontainschecks) → these endpoints are registration-gated by Spotify; see Registration-gated endpoints. (GET /me/library/containsis not one of them, so a 403 there is a real problem, not a gated registration.)- Still stuck?
npx -y @novalux12/spotify-mcp@latest doctoror ask your agent to run the spotify-mcp-doctor skill.
What this server is not
v2 has a written non-goals list, so a request for something outside it gets an answer rather than a maybe. Each entry below carries its reasoning in SPEC §1, and docs/non-goals.md is the record behind both: what each one rules out, the source it rests on, and what the server offers instead.
- Audio streaming, audio analysis, and offline playback
- A web UI, a dashboard, or an MCP UI surface
- Multi-tenant or hosted operation
- Sharing one user's credentials across users
- Lyrics
- The Spotify Connect SDK and native client integration
- Voice control
- Training a model on Spotify data, or exporting derived profiles
- A second third-party upstream, ad-tech, or monetization egress
- Working around Spotify's own controls
Development
Not affiliated with Spotify. Use per the Spotify Developer Terms.
MIT © Carme99 and NovaLux12 contributors · Acknowledges calebWei/SpotifyMCP and varunneal/spotify-mcp.
來源:README.md,提交 7b634c7
工具
0版本歷史
9- v3.1.1最新Oct 18, 2026
- v3.1.0Oct 9, 2026
- v3.0.1Oct 2, 2026
- v3.0.0Oct 1, 2026
- v2.1.2Sep 26, 2026
- v2.1.1Sep 26, 2026
- v2.0.0Sep 25, 2026
- v1.31.0Sep 25, 2026
- v1.30.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分