MCP_Server_Spotify について
MCP_Server_Spotify は、Claude Desktop から Spotify の再生を操作する Python 製 MCP サーバーです。再生操作、曲の検索、再生中の曲の取得に対応し、トークンの自動更新とエラーログ機能を備えています。
主な機能
- 01再生、一時停止、次・前の曲への移動
- 02曲の検索
- 03再生中の曲情報の取得
- 04トークンの自動更新
- 05エラー処理とログ記録
活用シーン
- 01コマンドによる Spotify 再生操作
- 02Spotify での曲探し
- 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
- Clone the repository:
git clone https://github.com/yourusername/spotify-mcp-server.git
cd spotify-mcp-server
- Install dependencies:
pip install -r requirements.txt
-
Set up Spotify Developer credentials:
- Go to Spotify Developer Dashboard
- Create a new application
- Add
http://localhost:8888/callbackas a redirect URI - Copy your Client ID and Client Secret
-
Create a
.envfile:
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
- Authenticate with Spotify:
python authenticate_spotify.py
Follow the prompts to complete authentication.
- Start the MCP server:
python run_spotify_server.py
-
Configure Claude Desktop:
- Copy
claude_mcp_config.jsonto Claude Desktop's MCP configuration directory:- Windows:
%APPDATA%\Claude Desktop\mcp\ - macOS:
~/Library/Application Support/Claude Desktop/mcp/ - Linux:
~/.config/Claude Desktop/mcp/
- Windows:
- Restart Claude Desktop
- Copy
-
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 logsserver_output.log: Server stdout/stderrwrapper_error.log: Wrapper script errors
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Spotipy - Python library for the Spotify Web API
- Flask - Web framework
- Claude Desktop - AI assistant =======
MCP_Server_Spotify
5288f1d010d9cb20435bde5e0798226500eb0489
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。