home / mcp / spotify mcp server

Spotify MCP Server

Spotify Model Context Protocol server for creating playlists

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "belljustin-spotify-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "PATH-TO-BASE-DIR/spotify-mcp",
        "run",
        "spotify.py"
      ],
      "env": {
        "SPOTIFY_CLIENT_ID": "YOUR_CLIENT_ID",
        "SPOTIFY_CLIENT_SECRET": "YOUR_CLIENT_SECRET"
      }
    }
  }
}

The Spotify Model Context Protocol (MCP) lets you generate and manage playlists based on descriptions directly from your editor. It connects with Spotify to create personalized playlists, making it easy to turn ideas into organized music collections without leaving your coding workflow.

How to use

You will authenticate with Spotify once to grant access for playlist creation. After authentication, you can issue MCP commands from your editor to create, update, or curate playlists based on descriptions. The integration is designed to work smoothly inside Cursor, so you can describe a playlist and have it generated and managed within your editing environment.

How to install

Prerequisites you need before starting:

- Python 3.6 or higher

- Spotify Developer credentials (Client ID and Client Secret)

How to install

Step 1: Set up your environment and dependencies

How to install

Step-by-step commands you will run

How to install

1. Set up Python and dependencies

How to install

2. Install required Python packages

How to install

3. Configure Spotify credentials

How to install

4. Start the authentication server to enable OAuth with Spotify

How to install

5. Integrate with Cursor using the MCP configuration snippet

How to install

Concrete commands you will run

How to install

# 1) Install Python dependencies
pip install -r requirements.txt

# 2) Set Spotify credentials in a local environment file
echo SPOTIFY_CLIENT_ID='your_client_id' >> .env
echo SPOTIFY_CLIENT_SECRET='your_client_secret' >> .env

# 3) Start the authentication server to handle Spotify OAuth
python main.py

How to install

6. Start the MCP runner via the provided stdio command when ready

How to install

7. Add the MCP configuration to Cursor to enable the Spotify MCP

How to install

8. Use the editor integration to describe a playlist and manage it through Spotify MCP

Additional sections

You can customize the MCP runner to point to the Spotify MCP directory and run the Spotify MCP script via the stdio interface. The following configuration snippet shows how to define the MCP server in your MCP setup.

Additional sections

{
  "mcpServers": {
    "spotify": {
        "command": "uv",
        "args": [
          "--directory",
          "PATH-TO-BASE-DIR/spotify-mcp",
          "run",
          "spotify.py"
        ]
    }
  }
}

Configuration and security notes

- Your Spotify credentials are required for playlist creation. Keep them secure and do not expose them in shared environments.

Troubleshooting and tips

- If you encounter authentication failures, ensure your Redirect URI is set correctly in the Spotify Developer Dashboard to http://localhost:5000/callback and that the local server is running.

Notes

- The Spotify MCP is designed to run locally and integrate with Cursor for a seamless playlist workflow. Ensure you have the necessary Python version and Spotify developer credentials before starting.

Tools and endpoints

This MCP setup provides a local stdio interface to run the Spotify MCP script and a local HTTP-like flow to handle authentication via a temporary local server. The primary endpoints are the Spotify authentication flow and the local MCP runner that executes the spotify.py script.