跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Spotify,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 使用你的 Spotify 账号:搜索音乐和播客,读取你的播放列表、已点赞的歌曲、最常听的艺人和最近播放的曲目,查看正在播放的内容,并在你确认后创建播放列表、添加或移除曲目,以及在 Premium 账号上控制播放。通过你自己的 Spotify 开发者应用登录。
试试这样问
Spotify 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Spotify、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Spotify + Gemini
让你的 AI 使用你的 Spotify 账号:搜索音乐和播客,读取你的播放列表、已点赞的歌曲、最常听的艺人和最近播放的曲目,查看正在播放的内容,并在你确认后创建播放列表、添加或移除曲目,以及在 Premium 账号上控制播放。通过你自己的 Spotify 开发者应用登录。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET
步骤 1 — 获取凭证
- 用将成为应用所有者的 Spotify Premium 账号登录 developer.spotify.com/dashboard,点击 Create app。
- 输入名称和描述。在 Redirect URIs 中添加
https://cloud.anythingmcp.com/api/mcp-oauth/callback。如果你自行托管 AnythingMCP,请使用https://your-anythingmcp-host/api/mcp-oauth/callback。勾选 Web API,接受条款并点击 Save。 - 打开应用的 Settings:把 Client ID 复制到
SPOTIFY_CLIENT_ID,点击 View client secret,把密钥复制到SPOTIFY_CLIENT_SECRET。 - 在 User Management 中添加每一个要登录的 Spotify 账号,填写名称和该 Spotify 账号的邮箱。最多 5 个账号。
- 安装连接器,在连接器页面点击 Authorize with Provider,登录 Spotify 并同意授权。
- 用
spotify_get_me检查设置:它会显示你登录的账号。
按 Spotify 的规则,这是一个个人连接器:Spotify 让每个新的开发者应用都在开发模式下运行。自 2026 年 2 月起,应用所有者需要有效的 Spotify Premium 订阅,否则应用会停止工作,直到 Premium 续订。一个应用最多服务 5 个 Spotify 用户,每个都要在 User Management 中手动添加;其他人可以登录,但每次调用都会被 403 拒绝。更多用户需要 Spotify 的 extended quota,而只有已上线服务、月活跃用户至少 25 万的注册企业才能申请。实际上,这个连接器适用于你自己的账号和你添加的几个人。
重定向 URI 的规则:Spotify 只接受 HTTPS 地址,或用于本地测试的带端口的 http://127.0.0.1。localhost 会被拒绝。应用中的 URI 必须与 AnythingMCP 使用的 URI 完全一致。
可以读取的内容:你的个人资料;在曲库中搜索歌曲、艺人、专辑、播放列表、播客、单集和有声书;单首歌曲、专辑或艺人的详情以及艺人的作品;你的播放列表,以及你拥有或参与协作的播放列表中的曲目;已点赞的歌曲;4 周、6 个月或约一年内最常听的艺人和歌曲;最近播放的曲目;正在播放的内容、你的设备和播放队列。
每次更改前都会询问:spotify_create_playlist、spotify_add_playlist_items 和 spotify_remove_playlist_items 会更改你的播放列表,spotify_start_playback、spotify_pause_playback、spotify_skip_to_next、spotify_skip_to_previous 和 spotify_add_to_queue 会改变正在播放的内容。每次调用前,AI 都会告诉你将发生什么,并等你同意。新建的播放列表默认公开,除非你要求设为私密。
播放控制需要 Premium:要控制播放,登录的账号需要 Spotify Premium,并且手机、电脑或音箱上要开着 Spotify 应用。没有活动设备时,Spotify 会返回 NO_ACTIVE_DEVICE:在某个设备上打开 Spotify,或让 AI 从 spotify_list_devices 中选择一个设备。免费账号会收到 PREMIUM_REQUIRED。查看正在播放的内容在免费账号上也可以。连接器只是远程控制你的 Spotify 应用,本身不会播放音频。
安装时默认关闭:spotify_save_to_library 和 spotify_remove_from_library(保存或移除已点赞的歌曲,关注或取消关注)。如需使用,请在连接器的 OAuth 设置中添加 scope user-library-modify 和 user-follow-modify,重新授权后启用这些工具。它们同样会先询问你。
开发模式下不可用的功能:推荐、音频特征、相关艺人、艺人的热门歌曲、新发行、精选和分类播放列表,以及其他用户的资料和播放列表。Spotify 自己的编辑推荐和算法生成的播放列表无法打开。搜索每次调用每种类型最多返回 10 条结果,并且不再返回热度、粉丝数和流派。
常见错误:401:登录已过期或被撤销;请再次点击 Authorize with Provider。403:该账号不在 User Management 中、所有者的 Premium 已过期,或者这个播放列表不属于你,你也不是协作者。429:开发模式的配额按开发者账号计算;请稍后再试。
连接器不会下载或试听音频,不会更改播放列表封面,也不使用 Spotify 留给 extended quota 的接口。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Gemini 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Gemini CLI 从 ~/.gemini/settings.json(Windows 上为 %USERPROFILE%\.gemini\settings.json)读取 MCP 服务器。添加:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换
YOUR_MCP_API_KEY。 - 保存文件并重启
gemini。 - 在 Gemini CLI 中运行
/mcp(或在终端运行gemini mcp list),anythingmcp应显示为已连接。 - 开始输入提示,Gemini CLI 现在可以调用
Spotify的工具。
可用工具
| Tool | What it does |
|---|---|
spotify_get_me | Read the signed-in Spotify account: user id, account_id, display name, profile link and Spotify URI |
spotify_search | Search the Spotify catalog for tracks, artists, albums, playlists, shows, episodes or audiobooks |
spotify_get_track | Read one track by its Spotify id: name, artists, album, release date, duration, explicit flag, track and disc number, playability, ISRC… |
spotify_get_album | Read one album by its Spotify id: name, type, artists, release date, total tracks, copyrights, link, and its first tracks (up to 50; total… |
spotify_get_artist | Read one artist by Spotify id: name, uri, link and image |
spotify_get_artist_albums | List an artist's albums, singles and compilations: id, name, type, release date, track count and link |
spotify_get_playlist | Read a playlist's details: name, description, owner, public and collaborative flags, snapshot_id, number of items and link |
spotify_get_playlist_items | List the tracks and episodes of a playlist the user owns or collaborates on: when and by whom each was added, type, id, name, uri, artists… |
spotify_list_my_playlists | List the playlists the signed-in user owns or follows: id, name, owner, public and collaborative flags, number of items, snapshot_id and… |
spotify_get_top_items | List the signed-in user's most played artists or tracks over about 4 weeks (short_term), 6 months (medium_term, default) or about a year… |
spotify_get_recently_played | List the tracks the signed-in user played most recently (up to 50; podcast episodes are not included): when, track, artists, album and the… |
spotify_get_playback_state | Read what is playing right now and where: playing or paused, progress, shuffle and repeat state, the device (name, type, volume) and the… |
spotify_get_currently_playing | Read the track or episode currently playing on the user's account: playing or paused, progress, the item and the context it plays from |
spotify_list_devices | List the user's available Spotify Connect devices (phone, computer, speaker): id, name, type, whether active, volume |
spotify_get_queue | Read the user's playback queue: the item playing now and the items queued after it (name, uri, artists or show) |
spotify_list_saved_tracks | List the songs saved in the user's library (Liked Songs), newest first: when saved, track, artists, album, duration |
spotify_check_library | Check whether tracks, albums, episodes, shows, audiobooks, artists, users or playlists are saved or followed by the user |
spotify_create_playlist | Create a new, empty playlist in the signed-in user's account |
spotify_add_playlist_items | Add tracks or episodes to a playlist the user owns or collaborates on (up to 100 per call) |
spotify_remove_playlist_items | Remove tracks or episodes from a playlist the user owns or collaborates on (every occurrence of each URI, up to 100 per call) |
spotify_start_playback | Start or resume playback: without arguments it resumes; context_uri plays an album, artist or playlist; uris plays specific tracks |
spotify_pause_playback | Pause playback on the user's active device (or the given device) |
spotify_skip_to_next | Skip to the next item in the user's queue |
spotify_skip_to_previous | Go back to the previous item in the user's queue |
spotify_add_to_queue | Add a track or episode to the end of the user's playback queue |
spotify_save_to_library | Save items to the user's library or follow them: tracks, albums, episodes, shows and audiobooks are saved; users and playlists are followed… |
spotify_remove_from_library | Remove items from the user's library or unfollow them (up to 40 URIs): tracks, albums, episodes, shows, audiobooks, users and playlists |
示例提示
- “过去四周我听得最多的是什么?列出我的前 10 首歌和前 5 位艺人。”
- “用我最近点赞的 20 首歌创建一个名为 Road Trip 的私密播放列表。创建前先给我看看歌单。”
- “现在正在播放什么?在哪个设备上?”
- “找到 Miles Davis 的专辑 Kind of Blue,把第一首歌加入我的播放队列。”
- “我昨天晚上听了哪些歌?做成一张包含艺人和专辑的表格。”
FAQ
Gemini CLI 从哪里读取 MCP 服务器? 用户级配置位于 ~/.gemini/settings.json,项目级配置位于项目内的 .gemini/settings.json。gemini mcp list 会列出每个服务器及其连接状态。
下一步
这份指南对你有帮助吗?