mcpField
S
Spotify MCP Server

Spotify MCP Server

Local
github.com/254binaryninjaMedia & Design1Updated 48w ago

About Spotify MCP Server

Spotify MCP Server is a Python MCP server for controlling Spotify playback through the Spotify API. It is for MCP clients that need playback controls such as track selection, skipping, shuffle, and repeat.

Key features

  1. 01Play and pause playback
  2. 02Skip to the next track
  3. 03Shuffle and repeat playlists
  4. 04Play albums by name
  5. 05Play tracks by name

Use cases

  1. 01Control Spotify playback from an MCP client
  2. 02Start a named album or track

MCP support

It exposes Spotify playback controls as tools for MCP clients. The server runs over stdio and uses Spotify credentials configured in a .env file.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Spotify MCP Server

The Spotify MCP Server is a Model Context Protocol (MCP) server designed to interact with the Spotify API. It provides tools to control Spotify playback, such as playing, pausing, skipping tracks, shuffling playlists, and more. This server is built using the mcp framework and spotipy library.

Features

  • Play, pause, and skip tracks.
  • Shuffle and repeat playlists.
  • Play specific albums or tracks by name.
  • Built-in tools for seamless Spotify playback control.

Prerequisites

Before setting up the server, ensure you have the following:

  1. Python 3.12 or higher.
  2. A Spotify Developer account with a registered application. You will need:
    • SPOTIFY_CLIENT_ID
    • SPOTIFY_CLIENT_SECRET
  3. A .env file containing your Spotify credentials.
  4. A premium spotify account

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd spotify-mcp-server
    
  2. Create a virtual environment and activate it:

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install uv for dependency management:

    pip install uv
    

    Windows

    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    
  4. Install dependencies using uv from the pyproject.toml file:

    uv sync
    
  5. Create a .env file in the project root and add your Spotify credentials:

    SPOTIFY_CLIENT_ID=your_client_id
    SPOTIFY_CLIENT_SECRET=your_client_secret
    

Usage

  1. Start the MCP server:

    python server.py
    
  2. Use the provided tools to control Spotify playback. For example:

    • play(): Start playing the current track.
    • pause(): Pause the current track.
    • next_track(): Skip to the next track.
    • play_album("album_name"): Play a specific album by name.
    • play_track("track_name"): Play a specific track by name.
  3. Add MCP tools to your MCP client. For example, if you're using Claude: Add this at the root of your project

    uv mcp install server.py
    

Example Using Calude Desktop

Here is the JSON file

{
"mcpServers": {
  "spotify-mcp-server": {
    "command": "~path-to-project\\spotify-mcp-server\\.venv\\Scripts\\python.exe",
    "args": [
      "~path-to-project\\spotify-mcp-server\\server.py"
    ],
    "transport": "stdio",
    "env":{
      "SPOTIFY_CLIENT_ID": "############",
      "SPOTIFY_CLIENT_SECRET": "############",
      "TRANSPORT": "stdio"
    }
  }
}
}

Troubleshooting

  • Spotify Authentication Failed: Ensure your SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET are correctly set in the .env file.

  • Server Not Starting: Verify that the __name__ check in server.py is correctly set to __server__:

     if __name__ == "__server__":
      mcp.run()
    

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.