spotify-mcp
by: varunneal
MCP to connect Claude with Spotify.
📌Overview
Purpose: To create a framework that connects Claude with Spotify, leveraging the Spotipy API to enhance music playback capabilities.
Overview: The Spotify MCP server facilitates interaction with Spotify's music streaming service, allowing users to control playback, search for music, and manage their Spotify queue through a unified interface.
Key Features:
-
Playback Control: Start, pause, and skip songs, enabling seamless music enjoyment without direct interaction with the Spotify app.
-
Music Search: Search for tracks, albums, artists, and playlists, making it easy to discover new music or access existing favorites.
-
Information Retrieval: Get detailed information about tracks, albums, artists, and playlists, enhancing users' knowledge and engagement with music content.
-
Queue Management: Organize and manage the Spotify queue, offering customized playback experiences tailored to user preferences.
Spotify MCP Server
MCP project to connect Claude with Spotify, built on top of spotipy-dev's API.
Features
- Start, pause, and skip playback
- Search for tracks, albums, artists, and playlists
- Get information about tracks, albums, artists, or playlists
- Manage the Spotify queue
Configuration
Getting Spotify API Keys
- Create an account on developer.spotify.com.
- Navigate to the dashboard.
- Create an app with
redirect_uri
set tohttp://localhost:8888
.
Running the Project Locally
Clone this repo to run the project locally:
git clone https://github.com/varunneal/spotify-mcp.git
Add this tool as an MCP server:
- On macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- On Windows:
%APPDATA%/Claude/claude_desktop_config.json
Example configuration:
"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://localhost:8888"
}
}
Troubleshooting
If you encounter issues:
- Ensure
uv
is updated (recommended version>=0.54
). - Check that Claude has execution permissions:
chmod -R 755
. - Confirm you have Spotify Premium for API usage.
TODO
- Adding tests.
- API support for managing playlists.
- API support for paginated search results for playlists and albums.
PRs appreciated!
Deployment
Building and Publishing
To prepare the package for distribution:
-
Sync dependencies and update the lockfile:
uv sync
-
Build package distributions:
uv build
-
Publish to PyPI:
uv publish
Note: Set PyPI credentials via environment variables or command flags:
- Token:
--token
orUV_PUBLISH_TOKEN
- Username/password:
--username
/UV_PUBLISH_USERNAME
and--password
/UV_PUBLISH_PASSWORD