trackmcp
Back to directory
iankan04

MCP-Spotify

View on GitHub

MCP Spotify AI Assistant

1 stars JavaScriptOthers Updated Jun 20, 2025

Documentation

A Model Context Protocol (MCP) server that enables Claude to control Spotify features.

Contents

Example Interactions

  • _"Can you add the top 5 Coldplay songs to my playlist vibes"_
  • _"What are my most listened to songs this past month"_
  • _"Can you shuffle play my top songs"_

Tools

Read Operations

1. searchSpotify

    2. getTopItems

      3. getMyPlaylists

        4. getPlaylistItems

          5. getCurrentUserProfile

            6. getCurrentlyPlaying

              7. getRecentlyPlayedTracks

                8. getUserQueue

                  Write Operations

                  1. startPlayback

                    2. resumePlayback

                      3. pausePlayback

                        4. addQueue

                          5. togglePlaybackShuffle

                            6. createPlaylist

                              7. addItemsToPlaylist

                                7. changePlaylistDetails

                                  Setup

                                  Prerequisites

                                  • Node.js v16+
                                  • A Spotify Premium account
                                  • A registered Spotify Developer application

                                  Installation

                                  bash
                                  git clone https://github.com/iankan04/MCP-Spotify.git
                                  cd mcp-spotify
                                  npm install
                                  npm run build

                                  Creating a Spotify Developer Application

                                  1. Go to the Spotify Developer Dashboard

                                  2. Log in with your Spotify account

                                  3. Click the "Create an App" button

                                  4. Fill in the app name and description

                                  5. Accept the Terms of Service and click "Create"

                                  6. In your new app's dashboard, you'll see your Client ID

                                  7. Click "Show Client Secret" to reveal your Client Secret

                                  8. Click "Edit Settings" and add a Redirect URI (e.g., `http://localhost:8000/callback`)

                                  9. Save your changes

                                  Spotify API Configuration

                                  Create a `.env.local` file in the project root (you can copy and modify the provided example):

                                  bash
                                  SPOTIFY_CLIENT_ID='Your client_id'
                                  SPOTIFY_CLIENT_SECRET='Your client_secret'
                                  SPOTIFY_REDIRECT_URI='Your redirect_uri (i.e. http://127.0.0.1:8000/callback'

                                  Make sure your redirect_uri follows the newest Spotify Developer Settings.

                                  Authentication Process

                                  The Spotify API uses OAuth 2.0 for authentication. Follow these steps to authenticate your application:

                                  1. Open two terminal screens. In one, run

                                  bash
                                  redis-server

                                  In the other, run

                                  bash
                                  npm run auth

                                  2. The script will generate an authorization URL. Open this URL in your web browser.

                                  3. You'll be prompted to log in to Spotify and authorize your application.

                                  4. After authorization, Spotify will redirect you to your specified redirect URI with a code parameter in the URL.

                                  5. The authentication script will automatically exchange this code for access and refresh tokens.

                                  6. These tokens will be saved to the Redis database and automatically refreshed when called

                                  Integrating with Claude Desktop

                                  To use your MCP server with Claude Desktop, add it to your Claude configuration:

                                  json
                                  {
                                    "mcpServers": {
                                      "spotify": {
                                        "command": "node",
                                        "args": ["MCP-Spotify/build/index.js"]
                                      }
                                    }
                                  }

                                  If Claude is running, restart the application, and you should see "spotify" as a new tool

                                  Frequently asked questions

                                  What is MCP-Spotify?

                                  MCP-Spotify is MCP Spotify AI Assistant

                                  How do I install MCP-Spotify?

                                  Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

                                  Is MCP-Spotify open source?

                                  Yes — it is hosted on GitHub at https://github.com/iankan04/MCP-Spotify and has 1 stars.

                                  Related MCP tools

                                  Run your own MCP server? See who uses it and what to fix.

                                  Measure it with TrackMCP