Spotify

io.github.markswendsen-code由 GitHub 账号 markswendsen-code 发布v0.1.0更新于 Oct 24, 2026

MCP server for Spotify - let AI agents control playback, search music, and manage playlists

已验证STDIO仅桌面效率与工作流媒体与设计

概览

AI 生成的概览

一个本地 MCP 服务器,让 AI 助手搜索 Spotify、管理播放列表,并在 Spotify Connect 设备上控制播放。

可以做什么
在 Spotify 中搜索歌曲、艺人、专辑和播放列表,并查看当前播放内容、进度与设备。控制播放:播放、暂停、下一首、上一首以及调节音量。列出 Spotify Connect 设备并在设备间切换播放。查看自己的播放列表,创建新列表,添加或移除曲目。检查连接状态、通过浏览器授权以及退出登录。
适用场景
适合希望用对话让助手查找音乐、创建或编辑播放列表,或直接控制自己 Spotify 账号播放的场景,而无需打开 Spotify 应用。
运行要求
通过 npx 或全局 npm 安装后在本地运行,需要 Node.js 18 或更高版本。需要 Spotify 账号(免费或 Premium;音量和播放控制需要 Premium),并通过环境变量 SPOTIFY_CLIENT_ID 提供 Spotify 应用的 Client ID。首次使用需在浏览器中完成 OAuth 授权,重定向地址设为 localhost:8888/callback。
安装前请注意
助手可以更改你的账号:创建和编辑播放列表,并在你的设备上开始、停止、跳过曲目和调节音量。授权会打开浏览器,并将令牌保存在本地磁盘并自动刷新;退出登录工具可清除令牌。播放控制需要 Spotify Premium。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Spotify,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@striderlabs/mcp-spotify

MCP server for Spotify — let AI agents search music, control playback, and manage playlists via the Spotify Web API.

Built by Strider Labs.

Features

  • Search — Find tracks, artists, albums, and playlists
  • Playlists — View, create, and edit your playlists
  • Playback Control — Play, pause, skip, go back, set volume
  • Multi-device — List and switch between Spotify Connect devices
  • OAuth 2.0 — Secure authorization with PKCE (no client secret needed)
  • Token persistence — Tokens stored locally, auto-refreshed

Setup

1. Create a Spotify App

  1. Go to the Spotify Developer Dashboard
  2. Click Create App
  3. Set Redirect URI to: http://localhost:8888/callback
  4. Copy your Client ID

2. Install

bash
npx @striderlabs/mcp-spotify

Or install globally:

bash
npm install -g @striderlabs/mcp-spotify

3. Configure Claude Desktop

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "spotify": {      "command": "npx",      "args": ["-y", "@striderlabs/mcp-spotify"],      "env": {        "SPOTIFY_CLIENT_ID": "your_client_id_here"      }    }  }}

4. Authenticate

In Claude, call the auth tool once:

spotify_auth

A browser window will open for you to authorize access. After approving, tokens are saved locally at ~/.striderlabs/spotify/tokens.json and auto-refreshed.

Environment Variables

VariableRequiredDescription
SPOTIFY_CLIENT_IDYesYour Spotify app's Client ID

Tools

Authentication

ToolDescription
spotify_statusCheck connection status and logged-in account
spotify_authAuthorize via browser (OAuth 2.0 PKCE)
spotify_logoutClear stored tokens

Search

ToolParametersDescription
search_tracksquery, limit?Search for songs
search_artistsquery, limit?Search for artists
search_albumsquery, limit?Search for albums
search_playlistsquery, limit?Search for playlists

Playlists

ToolParametersDescription
get_playlistslimit?Get your playlists
create_playlistname, description?, public?Create a new playlist
add_to_playlistplaylistId, uris[], position?Add tracks
remove_from_playlistplaylistId, uris[]Remove tracks

Playback

ToolParametersDescription
get_currently_playing—Current track, progress, device
playdeviceId?, contextUri?, uris?[], offsetPosition?, positionMs?Start/resume playback
pausedeviceId?Pause playback
next_trackdeviceId?Skip to next track
previous_trackdeviceId?Go to previous track
set_volumevolumePercent, deviceId?Set volume (0–100)
get_devices—List Spotify Connect devices
transfer_playbackdeviceId, play?Switch playback device

Example Workflow

1. spotify_status            → check if authenticated2. spotify_auth              → open browser to authorize (first time)3. search_tracks query="Bohemian Rhapsody"4. get_devices               → list available devices5. play uris=["spotify:track:..."] deviceId="..."6. get_currently_playing     → see what's playing7. set_volume volumePercent=708. next_track                → skip to next9. get_playlists             → see your playlists10. create_playlist name="AI Picks"11. add_to_playlist playlistId="..." uris=["spotify:track:..."]

Requirements

  • Node.js 18+
  • Spotify account (Free or Premium)
  • Spotify Premium required for: volume control, playback control

Technical Details

  • Protocol: Model Context Protocol (MCP) over stdio
  • Auth: OAuth 2.0 Authorization Code with PKCE
  • API: Spotify Web API v1
  • Token storage: ~/.striderlabs/spotify/tokens.json
  • Browser automation: Playwright (for OAuth browser launch)

License

MIT — Strider Labs

来源:README.md,提交 7974597

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。