Spotify

io.github.jamiew由 GitHub 账号 jamiew 发布v0.9.2更新于 Nov 7, 2026

MCP server connecting LLMs to Spotify, with smart-batching and large-playlist tools

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

概览

AI 生成的概览

本地 MCP 服务器,让助手在你的 Spotify 账户上搜索音乐、控制播放,并管理播放列表、喜欢的歌曲和收藏内容。

可以做什么
  • 搜索与读取目录内容:曲目、专辑、艺人、播放列表、播客节目、单集、有声书、热门条目和最近播放
  • 控制播放:播放、暂停、跳过、定位、音量、随机、循环、队列,以及在 Spotify Connect 设备间切换
  • 管理播放列表:列出、读取曲目、创建、改名、修改可见性、添加、移除、重排、关注与取消关注
  • 管理资料库:保存、移除和检查喜欢的歌曲、专辑、艺人、节目、单集与有声书
  • 读取个人资料与当前播放状态
适用场景
适合希望助手直接操作自己 Spotify 账户的场景:找歌、创建或整理播放列表、维护喜欢的歌曲,或在聊天客户端中控制指定设备的播放。
运行要求
通过 uvx 以 stdio 在本地运行(需 Python 3.12+ 与 uv)。需要一个 Spotify 开发者应用,并注册重定向 URI SPOTIFY_CLIENT_ID、SPOTIFY_CLIENT_SECRET 和 SPOTIFY_REDIRECT_URI。首次使用会打开浏览器完成 OAuth 授权;播放需要 Spotify Premium 和可用的 Spotify Connect 设备。
安装前请注意
需要你的 Spotify 应用凭据(SPOTIFY_CLIENT_ID、SPOTIFY_CLIENT_SECRET),并在本地缓存 OAuth 令牌,请妥善保密且不要公开暴露该服务。许多工具会写入账户(播放列表编辑、点赞、关注、收藏),且分批写入并非原子操作,出错后可能残留部分改动。Spotify 开发者政策限制将内容用于 AI,开发模式还有用户数与配额限制。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Spotify MCP, Python local server]

spotify-mcp

mcp-name: io.github.jamiew/spotify-mcp

A local Python MCP server for searching Spotify, controlling playback, and managing playlists and Liked Songs from your MCP client. Runs over stdio with your Spotify account. This is a supported fork of varunneal/spotify-mcp.

The TypeScript edition supports local and hosted use, with a different MCP surface.

Setup

Requires Python 3.12+, uv, and Spotify Premium for playback.

  1. Create an app in the Spotify developer dashboard.
  2. Register http://127.0.0.1:8888 as its redirect URI, exactly as written.
  3. Copy the app's Client ID and Client Secret into your MCP client's configuration:
json
{  "mcpServers": {    "spotify": {      "command": "uvx",      "args": ["spotify-mcp-jamiew"],      "env": {        "SPOTIFY_CLIENT_ID": "your_client_id",        "SPOTIFY_CLIENT_SECRET": "your_client_secret",        "SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8888"      }    }  }}

Restart the client. On first use, a browser opens for Spotify authorization; the token is cached locally. Keep the client secret and token cache private. Playback needs an available Spotify Connect device, so open Spotify on the device you want to control.

Client-specific setup: Claude Desktop, Claude Code, and Codex. Use the same command and environment variables in each client's format.

Run from source

The package command above uses the published package, which may lag this README's source changes. To run the current checkout:

bash
git clone https://github.com/jamiew/spotify-mcp.gitcd spotify-mcpuv sync

In the config above, change command to uv and args to ["--directory", "/absolute/path/to/spotify-mcp", "run", "spotify-mcp"]. Keep the same environment variables. Without cloning, use uvx --from git+https://github.com/jamiew/spotify-mcp.git spotify-mcp.

Reauthorization: artist-follow checks need user-follow-read, and following or unfollowing artists and playlists needs user-follow-modify. Existing grants do not receive new scopes automatically. Restart and complete Spotify authorization when prompted; if access is still denied, review the app's grant in your Spotify account and reauthorize. Do not automatically delete the auth cache.

Features

48 tools, six resources (user, playback, track, playlist, artist, album), and five prompts. Tools provide typed outputs and behavior annotations; large playlist reads report progress. Playlist removal asks for confirmation where supported, reordering uses snapshot guards, and playback control attempts best-effort read-after-write confirmation, not guaranteed success.

Tools

ToolDoes
get_meRead your profile
search_musicSearch tracks, albums, artists, or playlists with filters and pagination
get_tracksRead up to 50 tracks; individual reads when batching is unavailable
get_artistRead up to 50 artists; top tracks for a single artist
get_albumRead up to 20 albums; track list for a single album
get_playback_stateRead current track or episode, device, progress, shuffle, and repeat
control_playbackPlay tracks, episodes or a context; pause, skip, seek, volume, shuffle, repeat
list_devicesList Spotify Connect devices
transfer_playbackMove playback to another device
get_queueRead now playing and upcoming tracks and episodes
add_to_queueQueue a track or podcast episode
list_playlistsList your playlists with pagination
get_playlistRead playlist metadata without tracks
get_playlist_tracksRead up to 1000 playlist tracks per call; continue from next_offset
create_playlistCreate a private playlist; set public=true to publish
update_playlist_detailsChange name, description, or visibility
add_tracks_to_playlistAdd up to 100 tracks or episodes
remove_tracks_from_playlistRemove tracks or episodes with confirmation where supported
reorder_playlistMove a block of tracks
follow_playlistFollow (save) a playlist
unfollow_playlistUnfollow a playlist, including your own
get_saved_tracksRead Liked Songs with pagination
save_tracksLike tracks
remove_saved_tracksUnlike tracks
check_saved_tracksCheck up to 50 tracks against Liked Songs
check_saved_albumsCheck up to 20 saved albums
check_following_artistsCheck up to 50 followed artists
get_saved_albumsRead saved albums with pagination
save_albumsSave up to 20 albums
remove_saved_albumsRemove up to 20 saved albums
get_followed_artistsRead followed artists with cursor pagination
follow_artistsFollow up to 50 artists
unfollow_artistsUnfollow up to 50 artists
get_saved_showsRead saved podcast shows with pagination
save_showsSave up to 50 podcast shows
remove_saved_showsRemove up to 50 saved podcast shows
check_saved_showsCheck up to 50 saved podcast shows
get_show_episodesRead a show's episodes with resume points and pagination
get_saved_episodesRead saved podcast episodes with pagination
check_saved_episodesCheck up to 50 saved podcast episodes
save_episodesSave up to 50 podcast episodes
remove_saved_episodesRemove up to 50 saved podcast episodes
get_saved_audiobooksRead saved audiobooks with pagination
check_saved_audiobooksCheck up to 50 saved audiobooks
save_audiobooksSave up to 50 audiobooks
remove_saved_audiobooksRemove up to 50 saved audiobooks
get_top_itemsRead top artists or tracks over a time range
get_recently_playedRead recently played tracks with timestamps

Behavior to know

  • New playlists default to private. Existing playlists are unchanged. Spotify can report unexpected visibility, so confirm sensitive playlists in the Spotify app.
  • Library writes (tracks, artists, shows, episodes, audiobooks) and membership checks accept 50 items, sent upstream in batches of 40. Album saves, removals and checks accept 20. Membership results preserve input alignment; incomplete chunks fail. Writes are not atomic across chunks: earlier changes may remain after an error. Check membership before retrying.
  • Restricted apps cap search pages at 10. Advance by the returned offset + limit, not the requested size. Individual-track fallback can make up to 50 Spotify requests.
  • Playlist pagination counts positions, including unresolved rows and local files with id: null. Local files also set is_local; positions remain valid for reordering.

Spotify access and policy

  • Permissions and app access mode determine available endpoints and playlist access. A 403 may mean missing permission, not a retired endpoint. Existing integrations' February restrictions were postponed; restricted apps use the February 2026 API routes.
  • Development Mode normally allows five allowlisted users and requires a Premium app owner; older larger allowlists may be grandfathered. Extended access is not routine hobby-project approval: criteria include an organization, a legal entity, a launched service, and 250,000 monthly active users. A public URL does not remove these limits.
  • All Development Mode apps on a developer account share one quota, even with the 25 permitted Client IDs. This server surfaces 429 errors without retries, including QUOTA_EXCEEDED and ordinary rate limits with Retry-After when provided. No guaranteed quota reset time is specified.
  • This server uses one local identity. Do not share its token cache or expose it as an unauthenticated public service. Other users should self-host and authorize their own accounts.
  • AI policy is a separate constraint. Spotify Developer Policy III.14 restricts training or otherwise ingesting Spotify Content into AI/ML models; "no training" or "metadata only" is not automatic clearance. III.13 restricts analysis and derived metrics; III.3 restricts voice-control assistants. Seek Spotify clarification or approval before public AI access. This is a risk notice, not legal advice or permission.

Moving between implementations

Shared versions and tool names do not imply drop-in compatibility with other implementations. Check arguments, limits, and result shapes before switching. Preserve any workflow that relies on this server's resources, five prompts, snapshot guards, removal confirmation, or playback confirmation; those behaviors are not universal.

Credits

MIT license, copyright 2025 Varun Neal Srivastava. Thanks to @varunneal for the original project, @jamiew, @jonico, @tedeuxx, and @karimStekelenburg.

Banner made with Glif.

来源:README.md,提交 c544333

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:软件包安装失败。

版本历史

6
  1. v0.9.2最新Nov 7, 2026
  2. v0.8.1Nov 3, 2026
  3. v0.7.0Sep 20, 2026
  4. v0.6.1Sep 18, 2026
  5. v0.6.0Sep 17, 2026
  6. v0.4.1Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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