Skip to main content
Glama

Spotify Model Context Protocol

by belljustin

Spotify 模型上下文协议 (MCP)

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

先决条件

  • Python 3.6 或更高版本

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

设置

  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 命令直接从编辑器创建和管理播放列表!

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

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

通过 OAuth 身份验证将 Cursor 编辑器连接到 Spotify 的 API,从而能够根据文本描述创建 Spotify 播放列表。

  1. 先决条件
    1. 设置
      1. 用法
        1. 启动身份验证服务器
        2. 与 Cursor 集成

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        Enables interaction with Spotify's music catalog via the Spotify Web API, supporting searches, artist information retrieval, playlist management, and automatic token handling.
        Last updated -
        547
        14
        MIT License
      • A
        security
        F
        license
        A
        quality
        A FastMCP tool that enables control of Spotify through natural language commands in Cursor Composer, allowing users to manage playback, search for content, and interact with playlists.
        Last updated -
        5
      • A
        security
        F
        license
        A
        quality
        A lightweight Model Context Protocol server that enables AI assistants like Cursor & Claude to control Spotify playback and manage playlists.
        Last updated -
        18
        146
      • A
        security
        F
        license
        A
        quality
        A tool that connects to the Spotify API and enables Claude to access artist information for enhanced music discovery through natural language queries.
        Last updated -
        1

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

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