Skip to main content
Glama
belljustin

Spotify Model Context Protocol

by belljustin

Spotify 模型上下文协议 (MCP)

用于根据描述创建播放列表的 Spotify MCP。

先决条件

  • Python 3.6 或更高版本

  • Spotify 开发者凭证(客户端 ID 和客户端密钥)

Related MCP server: Spotify MCP

设置

  1. 克隆此存储库:

    git clone https://github.com/yourusername/spotify-mcp.git
    cd spotify-mcp
  2. 安装所需的依赖项:

    pip install -r requirements.txt
  3. 设置您的 Spotify 开发者凭证:

    • 前往Spotify 开发者仪表板

    • 创建新应用程序

    • 设置环境变量:

      echo SPOTIFY_CLIENT_ID='your_client_id' >> .env
      echo SPOTIFY_CLIENT_SECRET='your_client_secret' >> .env

用法

启动身份验证服务器

  1. 在 Spotify 开发者仪表板中设置您的重定向 URI:

    • Spotify 开发者面板中进入你的应用

    • 点击“编辑设置”

    • http://localhost:5000/callback添加到重定向 URI

    • 保存更改

  2. 启动认证服务器:

    python main.py

    这将在端口 5000 上启动一个处理 Spotify OAuth 身份验证的本地服务器。

  3. 在浏览器中访问http://localhost:5000进行 Spotify 身份验证。身份验证成功后,您的访问令牌将被保存,以供 MCP 使用。

与 Cursor 集成

  1. 打开 Cursor 并转到“设置”

  2. 导航至“模型上下文协议”部分

  3. 点击“添加 MCP”

  4. 在 mcp.json 中输入以下详细信息,替换 PATH-TO-BASE-DIR:

{
  "mcpServers": {
    "spotify": {
        "command": "uv",
        "args": [
          "--directory",
          "PATH-TO-BASE-DIR/spotify-mcp",
          "run",
          "spotify.py"
        ]
    }
  }
}

现在,您可以使用 Cursor 中的 Spotify MCP 命令直接从编辑器创建和管理播放列表!

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.

Latest Blog Posts

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/belljustin/spotify-mcp'

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