Spotify MCP Server
Spotify MCP サーバー
このプロジェクトは、 CursorやClaude for Desktop (macOS および Windows のみ) などの MCP クライアントを通じて自然言語を使用して Spotify の再生を制御できるModel Context Protocol (MCP)サーバーを実装します。
特徴
このサーバーは次のツールを公開します。
play: トラック、アルバム、またはプレイリストを再生するか、再生を再開します。pause: 再生を一時停止します。next: 次のトラックにスキップします。previous: 前のトラックにスキップします。get_current_track: 現在再生中のトラックに関する情報を取得します。search: トラック、アルバム、アーティスト、またはプレイリストを検索します。
Related MCP server: Vulpes Spotify MCP Server
前提条件
Bun (バージョン1.0.0以降)
Spotify Premium アカウント。
Spotify 開発者アプリケーション:
Spotify 開発者ダッシュボードで作成します。
クライアント ID とクライアント シークレットを取得します。
アプリの設定のリダイレクト URI に
http://localhost:8888/callbackを追加します。
MCP クライアント (例: Cursor または Claude for Desktop)。
インストールとセットアップ
リポジトリをクローンします。
git clone https://github.com/obre10off/spotify-mcp.git cd spotify-mcp依存関係をインストールします:
bun install.envファイルを作成します。プロジェクトディレクトリのルートに
.envというファイルを作成します。以下のコードを追加し、プレースホルダーを実際のSpotifyの認証情報に置き換えます。SPOTIFY_CLIENT_ID=your_spotify_client_id SPOTIFY_CLIENT_SECRET=your_spotify_client_secret SPOTIFY_REDIRECT_URI=http://localhost:8888/callback # These will be filled in after running the auth script: SPOTIFY_ACCESS_TOKEN= SPOTIFY_REFRESH_TOKEN=認証スクリプトを実行します。
このスクリプトはブラウザを開き、Spotify にログインして権限を付与するように要求し、最初のアクセス トークンと更新トークンを取得します。
bun run authスクリプトはコンソールに
SPOTIFY_ACCESS_TOKENとSPOTIFY_REFRESH_TOKENを出力します。これらの値を.envファイルにコピーしてください。MCP クライアントを構成します。
カーソル:
カーソルの設定を開きます (Cmd+, または Ctrl+,)。
「モデルコンテキストプロトコル」を検索します。
「settings.json で編集」をクリックします。
mcp.servers配列に以下を追加します (/absolute/path/to/your/spotify-mcp``spotify-mcpディレクトリへの絶対パスに置き換えます)。{ "mcp.servers": [ { "spotify": { "command": "bun", "args": ["/absolute/path/to/your/spotify-mcp/src/index.ts"], "env": { "SPOTIFY_CLIENT_ID": "your_spotify_client_id", "SPOTIFY_CLIENT_SECRET": "your_spotify_client_secret", "SPOTIFY_REDIRECT_URI": "http://localhost:8888/callback", "SPOTIFY_ACCESS_TOKEN": "your_spotify_access_token", "SPOTIFY_REFRESH_TOKEN": "your_spotify_refresh_token" } } } ] }値をsettings.jsonファイルに追加するのではなく、
.envファイルを使用して、Spotifyに関連する環境変数のみをそこに置くことをお勧めします。
デスクトップ版Claude(macOS/Windows):
Claude for Desktop 構成ファイルを開きます。
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
mcpServersオブジェクトに以下を追加します (/absolute/path/to/your/spotify-mcp``spotify-mcpディレクトリへの絶対パスに置き換えます): GXP6
**重要:**クライアント構成では常に絶対パスを使用してください。
MCPクライアントを再起動します
設定を適用するには、必ず MCP クライアント (Cursor/Claude) を再起動してください。
サーバーの実行
bun run start
This command starts the server with automatic reloading on file changes (thanks to Bun's --watch flag). Keep this terminal window open while you're using the server.
## Usage
Once the server is running and your MCP client is configured, you can start using natural language commands to control Spotify. Examples:
"Play Bohemian Rhapsody"
"Pause the music"
"What song is playing?"
"Search for Taylor Swift albums"
"Next track"
"Play spotify:track:4uLU6hMCjMI75M1A2tKUQC"This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Generate AI music via the Lacuna Music API from MCP clients like Claude Desktop & Code.
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- FlicenseBqualityCmaintenanceA lightweight Model Context Protocol server that enables AI assistants like Cursor & Claude to control Spotify playback and manage playlists.22479-
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants like Claude to interact with Spotify, allowing them to search for tracks, control playback, and manage playlists.1-
- FlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI assistants like Claude Desktop to interact with Spotify's music streaming service, supporting playback control, playlist management, music search, and user profile access.412-
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables searching and managing Spotify music, playlists, artists, albums, and audiobooks through natural language.2442 npmMIT