Spotify 模型上下文协议 (MCP)
用于根据描述创建播放列表的 Spotify MCP。
先决条件
Python 3.6 或更高版本
Spotify 开发者凭证(客户端 ID 和客户端密钥)
设置
克隆此存储库:
git clone https://github.com/yourusername/spotify-mcp.git cd spotify-mcp安装所需的依赖项:
pip install -r requirements.txt设置您的 Spotify 开发者凭证:
创建新应用程序
设置环境变量:
echo SPOTIFY_CLIENT_ID='your_client_id' >> .env echo SPOTIFY_CLIENT_SECRET='your_client_secret' >> .env
用法
启动身份验证服务器
在 Spotify 开发者仪表板中设置您的重定向 URI:
在Spotify 开发者面板中进入你的应用
点击“编辑设置”
将
http://localhost:5000/callback
添加到重定向 URI保存更改
启动认证服务器:
python main.py这将在端口 5000 上启动一个处理 Spotify OAuth 身份验证的本地服务器。
在浏览器中访问
http://localhost:5000
进行 Spotify 身份验证。身份验证成功后,您的访问令牌将被保存,以供 MCP 使用。
与 Cursor 集成
打开 Cursor 并转到“设置”
导航至“模型上下文协议”部分
点击“添加 MCP”
在 mcp.json 中输入以下详细信息,替换 PATH-TO-BASE-DIR:
现在,您可以使用 Cursor 中的 Spotify MCP 命令直接从编辑器创建和管理播放列表!
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
通过 OAuth 身份验证将 Cursor 编辑器连接到 Spotify 的 API,从而能够根据文本描述创建 Spotify 播放列表。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityEnables interaction with Spotify's music catalog via the Spotify Web API, supporting searches, artist information retrieval, playlist management, and automatic token handling.Last updated -54714MIT License
- AsecurityFlicenseAqualityA 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
- AsecurityFlicenseAqualityA lightweight Model Context Protocol server that enables AI assistants like Cursor & Claude to control Spotify playback and manage playlists.Last updated -18146
- AsecurityFlicenseAqualityA 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