Spotify MCP server

Integrates with Spotify API to enable music playback control, search functionality, and queue management through natural language conversation.
Back to servers
Provider
Varun Srivastava
Release date
Mar 24, 2025
Language
Python

This MCP server connects Claude with Spotify, allowing you to control your Spotify playback directly through Claude. Built on the spotipy API, it enables playback control, search functions, and playlist management without leaving your Claude interface.

Features

  • Start, pause, and skip playback
  • Search for tracks, albums, artists, and playlists
  • Get detailed information about tracks, albums, artists, and playlists
  • Manage the Spotify queue
  • Create, update, and manage playlists

Installation

Prerequisites

  1. A Spotify Premium account (required for API access)
  2. Claude Desktop application

Getting Spotify API Keys

  1. Create an account on developer.spotify.com
  2. Navigate to the dashboard
  3. Create a new app with the redirect URI set to http://127.0.0.1:8080/callback
    • You can choose any port, but you must use http and an explicit loopback address

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/varunneal/spotify-mcp.git
    
  2. Configure Claude Desktop to use this MCP server:

    For MacOS, edit the config file at:

    ~/Library/Application\ Support/Claude/claude_desktop_config.json
    

    For Windows, edit the config file at:

    %APPDATA%/Claude/claude_desktop_config.json
    
  3. Add the following configuration to your Claude config file:

    "spotify": {
        "command": "uv",
        "args": [
          "--directory",
          "/path/to/spotify_mcp",
          "run",
          "spotify-mcp"
        ],
        "env": {
          "SPOTIFY_CLIENT_ID": "YOUR_CLIENT_ID",
          "SPOTIFY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
          "SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8080/callback"
        }
      }
    

    Replace /path/to/spotify_mcp with the actual path where you cloned the repository, and fill in your Spotify API credentials.

Troubleshooting

If you encounter issues with the MCP:

  1. Ensure your uv is updated to version 0.54 or newer
  2. Check execution permissions: chmod -R 755 /path/to/spotify_mcp
  3. Verify you have a Spotify Premium subscription
  4. Check the logs:

Using the MCP Inspector

You can launch the MCP Inspector for debugging:

npx @modelcontextprotocol/inspector uv --directory /path/to/spotify_mcp run spotify-mcp

After launching, the Inspector will provide a URL to access in your browser for debugging.

Usage

Once installed, you can ask Claude to perform various Spotify actions:

Playback Control

  • "Play my Discover Weekly playlist"
  • "Pause my music"
  • "Skip to the next track"
  • "Resume playback"

Search

  • "Search for Taylor Swift albums"
  • "Find playlist with workout music"
  • "Search for the song Bohemian Rhapsody"

Information Retrieval

  • "What song is currently playing?"
  • "Show me details about this artist"
  • "What tracks are on this album?"

Playlist Management

  • "Add this song to my playlist"
  • "Create a new playlist called Summer Hits"
  • "Show me my playlists"

Claude will interact with Spotify through the MCP server to perform these actions on your behalf.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later