Spotify Model Context Protocol

by belljustin
MIT License

Integrations

  • Enables creation of Spotify playlists based on text descriptions, with OAuth authentication handling for accessing Spotify's API.

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開発者ダッシュボードでアプリにアクセスします
    • 「設定を編集」をクリックします
    • リダイレクトURIにhttp://localhost:5000/callbackを追加します。
    • 変更を保存する
  2. 認証サーバーを起動します。
    python main.py
    これにより、Spotify OAuth 認証を処理するポート 5000 上のローカル サーバーが起動します。
  3. ブラウザでhttp://localhost:5000にアクセスし、Spotify で認証してください。認証に成功すると、MCP で使用するためのアクセストークンが保存されます。

カーソルとの統合

  1. カーソルを開いて設定へ移動します
  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" ] } } }

カーソル内の Spotify MCP コマンドを使用して、エディターから直接プレイリストを作成および管理できるようになりました。

You must be authenticated.

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

OAuth 認証を介してカーソル エディターを Spotify の API に接続することで、テキストの説明に基づいて Spotify プレイリストを作成できるようになります。

  1. Prerequisites
    1. Setup
      1. Usage
        1. Starting the Authentication Server
        2. Integrating with 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 -
        26
        547
        2
        TypeScript
        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 -
        21
        1
        Python
      • -
        security
        F
        license
        -
        quality
        Integrates with Spotify Web API through the Model Context Protocol, allowing users to search tracks, control playback, and manage playlists programmatically.
        Last updated -
        JavaScript
      • A
        security
        F
        license
        A
        quality
        Enables Claude to interact with Spotify by searching songs, creating playlists, getting recommendations, and managing your music through your Spotify account.
        Last updated -
        7
        1
        JavaScript

      View all related MCP servers

      ID: 4bz9ehbqc6