spotify-mcp
If you are the rightful owner of spotify-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Control Protocol (MCP) integration for Spotify that allows you to control your Spotify playback through AI assistants.
Spotify MCP
A Model Control Protocol (MCP) integration for Spotify that allows you to control your Spotify playback through AI assistants.
Features
- Search: Search for songs on Spotify
- Play: Play songs on your active Spotify device
- Pause: Pause currently playing music
Prerequisites
- Python 3.11 or higher
- Spotify Developer credentials
Installation
-
Clone this repository:
git clone https://github.com/yourusername/spotify-mcp.git cd spotify-mcp
-
Set up a virtual environment:
uv venv
-
Install dependencies:
uv sync
Configuration
-
Create a Spotify application at Spotify Developer Dashboard
-
Get your Client ID and Client Secret from your Spotify application
-
Update
main.py
with your credentials:SPOTIPY_CLIENT_ID = "your-spotify-client-id" SPOTIPY_CLIENT_SECRET = "your-spotify-client-secret"
Usage
Run the MCP server:
python main.py
When you run the application for the first time, a browser window will open asking you to log in to your Spotify account and authorize the application.
How It Works
This project uses:
- MCP (Model Control Protocol): For creating AI-controlled tools
- Spotipy: Python client for the Spotify Web API
The MCP server exposes three functions that can be called by AI assistants:
search
: Find songs on Spotifyplay
: Play a specific songpause
: Pause the currently playing song