Spotify

Provides MCP-based control of Spotify playback, track search, and current track info via Claude Desktop.
  • python

0

GitHub Stars

python

Language

4 months ago

First Indexed

3 weeks ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "hashim9184-mcp_server_spotify": {
      "command": "python",
      "args": [
        "run_spotify_server.py"
      ],
      "env": {
        "SPOTIFY_CLIENT_ID": "YOUR_CLIENT_ID",
        "SPOTIFY_CLIENT_SECRET": "YOUR_CLIENT_SECRET"
      }
    }
  }
}

This MCP server lets Claude Desktop control Spotify playback through natural language commands. It supports playback actions, searching tracks, retrieving current track details, and automatic token handling, enabling seamless voice-driven music control.

How to use

You interact with the Spotify MCP Server through an MCP client like Claude Desktop. Once running, you can issue natural language commands such as “Play Bohemian Rhapsody on Spotify,” “Pause the music,” “Skip to next track,” or “What song is currently playing?” The server handles authentication, forwards your intent to Spotify, and returns the results or playback status to your MCP client. Ensure your Spotify credentials are configured and the server is running before issuing commands.

How to install

Prerequisites you need on your machine before you begin are: Python 3.7 or higher, a Spotify Premium account, a Spotify Developer account, and Claude Desktop.

# 1) Clone the project
git clone https://github.com/hashim9184/mcp_server_spotify.git
cd mcp_server_spotify

# 2) Install dependencies
pip install -r requirements.txt
  1. Set up Spotify Developer credentials. Create an app and add a redirect URI of http://localhost:8888/callback. Take note of your Client ID and Client Secret.
# 4) Create and configure environment variables
cp .env.example .env
# Edit .env to include your credentials
# SPOTIFY_CLIENT_ID=your_client_id_here
# SPOTIFY_CLIENT_SECRET=your_client_secret_here
  1. Authenticate Spotify access and start the MCP server.
# Authenticate with Spotify
python authenticate_spotify.py

# Start the MCP server
python run_spotify_server.py
  1. Configure Claude Desktop to use the MCP endpoint. Use your Claude Desktop MCP configuration directory and restart the application.

  2. Validate the server by issuing basic commands such as Play, Pause, and Next Track via Claude Desktop.

Additional notes

The server stores logs to help diagnose issues. If you need to reauthenticate, run the authentication step again. Ensure the environment variables are securely stored and not shared publicly.

Configuration and troubleshooting

If you encounter authentication errors, re-run the authentication helper to refresh tokens. Check that the redirect URI used during Spotify app setup exactly matches the one configured in your environment. Review log files such as spotify_mcp_server.log and server_output.log for clues about failures.

Available tools

playback_control

Controls playback including play, pause, next, and previous track based on natural language commands.

search_tracks

Search for tracks by query and return matching results.

get_current_track

Retrieve information about the currently playing track.

token_refresh

Automatically refresh Spotify access tokens as needed.

logging_and_error_handling

Robust logging and error handling to diagnose issues quickly.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational