
Spotify Mcp
io.github.XavierFabregat由 GitHub 账号 XavierFabregat 发布v0.1.2更新于 Oct 24, 2026
Conversational Spotify control from AI clients: play, queue, devices, playlists, and library.
概览
本地 MCP 服务器,让 AI 助手控制 Spotify:播放音乐、管理队列、设备、播放列表和音乐库。
- 可以做什么
- 按自然语言描述或 Spotify URI 播放音乐,并控制播放(暂停、继续、下一首、上一首、跳转、音量、随机、循环)
- 查看当前播放内容,包括进度、设备和播放模式
- 把曲目加入队列并查看接下来播放的内容
- 列出设备并在设备之间转移播放
- 搜索曲目、专辑、艺人和播放列表,列出自己的播放列表及其曲目
- 创建播放列表、添加曲目,以及保存、移除或检查音乐库条目
- 适用场景
- 适合在 Claude Desktop、Claude Code、Cursor 或其他 MCP 客户端中用对话方式操作 Spotify,例如用描述点歌、把整张专辑加入队列或收藏曲目,而无需切换应用。
- 运行要求
- 通过 npx 在本机运行,需要 Node.js 20 或更高版本。需要 Spotify Premium 账户,并通过 init 向导创建自己的 Spotify 开发者应用(Client ID);登录使用 OAuth PKCE,不涉及客户端密钥。应用的 Redirect URI 必须精确为 8888 端口需空闲。令牌保存在 ~/.spotify-mcp/ 目录。
安装
在 SourceWeft 中
- 打开 控制台中的 Spotify Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[图片] spotify-mcp
Control Spotify by talking to your AI. An MCP server for Claude Desktop, Claude Code, Cursor, and any other MCP client.
You: play something like early Bill Evans AI: ▶ Now playing: "Peace Piece" — Bill Evans · Everybody Digs Bill Evans
You: perfect, queue the whole album and save this one AI: ➕ Queued Everybody Digs Bill Evans · ❤️ Saved "Peace Piece" to your library
Built against the current (post-February-2026) Spotify Web API — many older Spotify MCP servers predate those changes and are partially broken.
Requirements
- Spotify Premium — Spotify requires it for playback control and (since Feb 2026) for creating the developer app you'll use.
- Node.js ≥ 20
Quick start
The wizard walks you through creating your own (free) Spotify developer app, asks for its Client ID, and opens a browser to connect your account — about 2 minutes total.
Why your own app? Spotify caps third-party apps at a handful of users, so every user
brings their own; the wizard makes that painless. No client secret is involved (PKCE).
Tokens stay in ~/.spotify-mcp/ on your machine and refresh silently.
The one detail that must be exact — your app's Redirect URI:
Add to your MCP client
Claude Code
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json)
or Cursor (~/.cursor/mcp.json):
Restart the client and start talking.
Claude Desktop extension (one-click)
Prefer not to edit config files? Install the .mcpb bundle instead: download
spotify-mcp.mcpb from the latest release,
open it (or drag it into Claude Desktop → Settings → Extensions), and paste your Spotify
app's Client ID when prompted. Then ask Claude to connect Spotify — the authenticate
tool opens the browser login. You still need the developer app and Redirect URI from
the quick start, but not the init wizard.
Tools
Design
- Tools are intents, not endpoints. "Play some Radiohead" is one tool call — the server searches, picks the best match, starts playback, and reports what it chose so you can correct it. No search → choose → play round trips.
- Small surface. 11 tools instead of one per API endpoint keeps tool selection accurate across different AI clients and context lean.
- Responses are compact text with Spotify URIs, so follow-ups ("queue that") chain without re-searching. Raw API payloads never reach the model.
- Errors are instructions. No active device? The response lists your devices and
says how to pick one. Not logged in? It points at the
authenticatetool. The model relays the fix instead of a stack trace.
Troubleshooting
- "No active Spotify device" — Spotify's API can only steer a running app. Open Spotify anywhere; if it just woke up, tap play/pause once. With exactly one device online, the tools target it automatically.
INVALID_CLIENT: Invalid redirect URIduring login — the Redirect URI in your app settings isn't exactlyhttp://127.0.0.1:8888/callback(localhostis rejected by Spotify).- Port 8888 in use during login — set
SPOTIFY_REDIRECT_PORTto a free port and register the matching redirect URI. - "Token refresh failed" — run
npx -y @xavifabregat/spotify-mcp authto log in again (e.g. after changing the Client ID). - Config precedence — the
SPOTIFY_CLIENT_IDenv var overrides~/.spotify-mcp/config.json(written byinit).
Development
Layout: src/auth.ts (OAuth PKCE + token store) · src/spotify.ts (typed API
client) · src/tools/ (tool implementations) · src/format.ts (compact output).
License
MIT © Xavi Fabregat
来源:README.md,提交 05b1c5d
工具
0版本历史
1- v0.1.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分