mcpField
M
MCP_Server_Spotify

MCP_Server_Spotify

本地服务
github.com/Hashim9184媒体与设计072 周前更新

关于 MCP_Server_Spotify

MCP_Server_Spotify 是一个 Python MCP 服务,可通过 Claude Desktop 控制 Spotify 播放。它支持播放操作、曲目搜索和当前曲目信息查询,并具备令牌自动刷新及错误日志功能。

主要功能

  1. 01播放、暂停、切歌和返回上一首
  2. 02搜索曲目
  3. 03获取当前曲目信息
  4. 04自动刷新令牌
  5. 05错误处理与日志记录

适用场景

  1. 01通过命令控制 Spotify 播放
  2. 02在 Spotify 中查找曲目
  3. 03查看当前播放的曲目

MCP 相关

该 MCP 服务向 Claude Desktop 提供 Spotify 播放控制、曲目搜索和当前曲目信息。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

README 原文English

来自项目 README

README 暂无中文译文,以下为英文原文;中文介绍见上方。

<<<<<<< HEAD

Spotify MCP Server for Claude Desktop

A Message Control Protocol (MCP) server that enables Claude Desktop to control Spotify playback through natural language commands.

Features

  • Control Spotify playback (play, pause, next, previous)
  • Search for tracks
  • Get current track information
  • Automatic token refresh
  • Robust error handling and logging
  • Easy authentication process

Prerequisites

  • Python 3.7 or higher
  • Spotify Premium account
  • Spotify Developer account
  • Claude Desktop

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/spotify-mcp-server.git
cd spotify-mcp-server
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up Spotify Developer credentials:

    • Go to Spotify Developer Dashboard
    • Create a new application
    • Add http://localhost:8888/callback as a redirect URI
    • Copy your Client ID and Client Secret
  2. Create a .env file:

cp .env.example .env

Then edit .env and add your Spotify credentials:

SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_here

Usage

  1. Authenticate with Spotify:
python authenticate_spotify.py

Follow the prompts to complete authentication.

  1. Start the MCP server:
python run_spotify_server.py
  1. Configure Claude Desktop:

    • Copy claude_mcp_config.json to Claude Desktop's MCP configuration directory:
      • Windows: %APPDATA%\Claude Desktop\mcp\
      • macOS: ~/Library/Application Support/Claude Desktop/mcp/
      • Linux: ~/.config/Claude Desktop/mcp/
    • Restart Claude Desktop
  2. Use Claude Desktop to control Spotify with commands like:

    • "Play Bohemian Rhapsody on Spotify"
    • "Pause the music"
    • "Skip to next track"
    • "What song is currently playing?"

Testing

Run the test script to verify the server is working:

python test_spotify_server.py

Project Structure

spotify-mcp-server/
├── README.md
├── requirements.txt
├── .env.example
├── claude_mcp_config.json
├── spotify_mcp_server.py      # Main server implementation
├── run_spotify_server.py      # Server wrapper script
├── authenticate_spotify.py    # Authentication helper
└── test_spotify_server.py     # Test script

Logging

The server generates several log files:

  • spotify_mcp_server.log: Main server logs
  • server_output.log: Server stdout/stderr
  • wrapper_error.log: Wrapper script errors

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

MCP_Server_Spotify

5288f1d010d9cb20435bde5e0798226500eb0489

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。