Skip to main content
Glama

Spotify MCP Server

by g2dgaming

spotify-mcp MCP 服务器

MCP 项目将 Claude 与 Spotify 连接起来。基于spotipy-dev 的 API构建。

特征

  • 开始、暂停和跳过播放
  • 搜索曲目/专辑/艺术家/播放列表
  • 获取有关曲目/专辑/艺术家/播放列表的信息
  • 管理 Spotify 队列
  • 管理、创建和更新播放列表

演示

确保打开音频

配置

获取 Spotify API 密钥

developer.spotify.com上创建一个帐户。导航到仪表板。创建一个应用程序,其redirect_uri为http://127.0.0.1:8080/callback 。您可以选择任何所需的端口,但必须使用http和显式的环回地址(IPv4或IPv6)。

更多信息/故障排除请参见此处。您可能需要重启 MCP 环境(例如 Claude Desktop)一到两次才能正常工作。

在本地运行此项目

该项目尚未设置临时环境(例如uvx使用)。请克隆此 repo 以在本地运行该项目。

git clone https://github.com/varunneal/spotify-mcp.git

将此工具添加为 mcp 服务器。

MacOS 上的 Claude 桌面: ~/Library/Application\ Support/Claude/claude_desktop_config.json

Windows 上的 Claude 桌面: %APPDATA%/Claude/claude_desktop_config.json

"spotify": { "command": "uv", "args": [ "--directory", "/path/to/spotify_mcp", "run", "spotify-mcp" ], "env": { "SPOTIFY_CLIENT_ID": YOUR_CLIENT_ID, "SPOTIFY_CLIENT_SECRET": YOUR_CLIENT_SECRET, "SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8080/callback" } }

故障排除

如果您无法使用此 MCP,请提交问题。以下是一些提示:

  1. 确保uv已更新。我推荐版本>=0.54
  2. 确保 claude 具有该项目的执行权限: chmod -R 755
  3. 确保您拥有 Spotify premium(运行开发人员 API 所需)。

此 MCP 会将日志发送到 std err(如 MCP 规范中所述)。在 Mac 上,Claude 桌面应用程序会将这些日志发送到~/Library/Logs/Claude 。在其他平台上,您可以在此处找到日志

您可以使用以下命令通过npm启动 MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory /path/to/spotify_mcp run spotify-mcp

启动后,检查器将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。

待办事项

遗憾的是,Spotify API 中许多很酷的功能现已弃用。大多数新功能都相对较小,或者是为了项目的健康发展:

  • 測試。
  • 添加用于管理播放列表的 API 支持。
  • 添加分页搜索结果/播放列表/专辑的 API 支持。

公关赞赏!感谢 @jamiew、@davidpadbury、@manncodes、@hyuma7、@aanurraj 和其他人的贡献。

部署

(待办事项)

构建和发布

准备分发包:

  1. 同步依赖项并更新锁文件:
uv sync
  1. 构建软件包分发版:
uv build

这将在dist/目录中创建源和轮子分布。

  1. 发布到 PyPI:
uv publish

注意:您需要通过环境变量或命令标志设置 PyPI 凭据:

  • 令牌: --tokenUV_PUBLISH_TOKEN
  • 或用户名/密码: --username / UV_PUBLISH_USERNAME--password / UV_PUBLISH_PASSWORD

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

将 Claude 与 Spotify 连接起来,允许用户通过 Spotify API 控制播放、搜索音乐、获取曲目/艺术家信息以及管理队列。

  1. 特征
    1. 演示
      1. 配置
        1. 获取 Spotify API 密钥
        2. 在本地运行此项目
        3. 故障排除
      2. 待办事项
        1. 部署
          1. 构建和发布

        Related MCP Servers

        • A
          security
          F
          license
          A
          quality
          A server that connects Claude with Spotify, allowing users to control playback, search content, get information about tracks/albums/artists/playlists, and manage the Spotify queue.
          Last updated -
          4
          273
          Python
          • Apple
        • A
          security
          F
          license
          A
          quality
          Connects Claude with Spotify, allowing users to control playback, search for content, get music information, and manage the Spotify queue.
          Last updated -
          8
          1
          Python
          • Apple
        • -
          security
          F
          license
          -
          quality
          Connects Claude with Spotify, enabling playback control, search functionality, and queue management through Spotify's API.
          Last updated -
          Python
          • Apple
        • -
          security
          F
          license
          -
          quality
          Connects Claude with Spotify to control playback, search music, get track information, and manage the queue through conversation.
          Last updated -
          Python

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/g2dgaming/spotify-mcp'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server