MCP ExplorerExplorer

Spotify

@varunnealon 12 days ago
352 MIT
FreeCommunity
Media Creation
#spotify#audio
This MCP allows an LLM to play and use Spotify.

Overview

What is Spotify

The Spotify MCP is a project designed to connect Claude with Spotify using the Spotipy-dev API. It enables interaction with Spotify features through a command-line interface.

Use cases

Users can manage music playback by starting, pausing, or skipping tracks. They can also search for tracks, albums, artists, and playlists; retrieve detailed info about specific items; manage the playback queue; and create or update playlists.

How to use

To use the project, clone the repository and configure MCP settings in the Claude Desktop configuration file, providing necessary Spotify API credentials. After setting up, you can run the service locally to interact with Spotify.

Key features

Key features include control over playback (start, pause, skip), search functionality for various media, access to track and playlist info, queue management, and playlist creation/updating.

Where to use

This MCP is designed to be run locally on users’ machines, particularly within the Claude Desktop environment, allowing users to interface directly with their Spotify account.

Content

spotify-mcp 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/playlists
  • Get info about a track/album/artist/playlist
  • Manage the Spotify queue
  • Manage, create, and update playlists

Demo

Make sure to turn on audio

Video https://github.com/user-attachments/assets/20ee1f92-f3e3-4dfa-b945-ca57bc1e0894

Configuration

Getting Spotify API Keys

Create an account on developer.spotify.com. Navigate to the dashboard.
Create an app with redirect_uri as http://127.0.0.1:8080/callback.
You can choose any port you want but you must use http and an explicit loopback address (IPv4 or IPv6).

See here for more info/troubleshooting.
You may have to restart your MCP environment (e.g. Claude Desktop) once or twice before it works.

Run this project locally

This project is not yet set up for ephemeral environments (e.g. uvx usage).
Run this project locally by cloning this repo

git clone https://github.com/varunneal/spotify-mcp.git

Add this tool as a mcp server.

Claude Desktop on MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

Claude Desktop on Windows: %APPDATA%/Claude/claude_desktop_config.json

Troubleshooting

Please open an issue if you can’t get this MCP working. Here are some tips:

  1. Make sure uv is updated. I recommend version >=0.54.
  2. Make sure claude has execution permisisons for the project: chmod -R 755.
  3. Ensure you have Spotify premium (needed for running developer API).

This MCP will emit logs to std err (as specified in the MCP) spec. On Mac the Claude Desktop app should emit these logs
to ~/Library/Logs/Claude.
On other platforms you can find logs here.

You can launch the MCP Inspector via npm with this command:

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

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

TODO

Unfortunately, a bunch of cool features have now been deprecated
from the Spotify API. Most new features will be relatively minor or for the health of the project:

  • tests.
  • adding API support for managing playlists.
  • adding API support for paginated search results/playlists/albums.

PRs appreciated! Thanks to @jamiew, @davidpadbury, @manncodes, @hyuma7, @aanurraj, and others for contributions.

Deployment

(todo)

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:
uv sync
  1. Build package distributions:
uv build

This will create source and wheel distributions in the dist/ directory.

  1. Publish to PyPI:
uv publish

Note: You’ll need to set PyPI credentials via environment variables or command flags:

  • Token: --token or UV_PUBLISH_TOKEN
  • Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Tools

SpotifyPlayback
Manages the current playback with the following actions: - get: Get information about user's current track. - start: Starts playing new item or resumes current playback if called with no uri. - pause: Pauses current playback. - skip: Skips current track.
SpotifySearch
Search for tracks, albums, artists, or playlists on Spotify.
SpotifyQueue
Manage the playback queue - get the queue or add tracks.
SpotifyGetInfo
Get detailed information about a Spotify item (track, album, artist, or playlist).

Comments