spotify-mcp
The Spotify MCP Server is a Model Context Protocol server designed for seamless Spotify integration with AI assistants. It provides tools to manage Spotify playlists and playback control, offering functionalities like searching and retrieving playlist details, controlling playback, and managing the queue.
Spotify MCP Server
A Model Context Protocol (MCP) server for Spotify integration, allowing AI assistants like Claude to control and interact with your Spotify account.
Overview
This project provides a set of MCP tools that enable AI assistants to:
- Search for playlists
- Retrieve playlist details and tracks
- Control playback (play, pause, skip, previous)
- Create and modify playlists
- Toggle shuffle mode
- View currently playing tracks
- Add tracks to the queue
Built on top of the Model Context Protocol and zmb3/spotify Golang SDK.
What is MCP?
The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It allows LLMs like Claude to interact with external systems and data sources in a secure and standardized way.
MCP works like a USB-C port for AI applications - providing a standardized way to connect AI models to different data sources and tools. This project implements a Spotify server that follows the MCP specification, enabling AI assistants to control and interact with your Spotify account.
Setup
Prerequisites
- Go 1.18 or higher
- A Spotify account (you will need Spotify Premium for playback control)
- Spotify Developer credentials
Getting Spotify API Credentials
- Visit the Spotify Developer Dashboard
- Log in with your Spotify account
- Click "Create an App"
- Fill in the application name and description
- Once created, you'll see your Client ID and you can view your Client Secret
- Set the redirect URI to
http://127.0.0.1:1690/callback
Using with Claude
To use this server with Claude for Desktop:
-
Open Claude for Desktop
-
Create or update your MCP configuration at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the following configuration:
{
"mcpServers": {
"spotify": {
"command": "/path/to/spotify-mcp-binary",
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id_here",
"SPOTIFY_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}
- Restart Claude for Desktop
- When first using Spotify tools, you'll need to authenticate using the
spotify_login
tool
Available Tools
Playback
spotify_login
- Start Spotify authentication process for playback controlplay
- Start or resume playback on your Spotify accountpause
- Pause playback on your Spotify accountnext_track
- Skip to the next track in your Spotify queueprevious_track
- Skip to the previous track in your Spotify queueshuffle
- Toggle shuffle mode on your Spotify accountcurrent_track
- Get information about the currently playing trackget_queue
- Get the current playback queueadd_tracks_to_queue
- Add tracks to the current playback queue
Playlist
get_playlist
- Get detailed information about a specific playlistget_playlist_tracks
- Get the tracks in a playlistcreate_playlist
- Create a new Spotify playlistadd_tracks_to_playlist
- Add tracks to a playlistremove_tracks_from_playlist
- Remove tracks from a playlistget_user_playlists
- Get playlists for a Spotify user
Search
simple_playlist_and_album_search
- Search for a playlist or album by namesimple_song_search
- Search for a song by name
License
Acknowledgments
- Built with the zmb3/spotify Golang SDK
- Implements the Model Context Protocol
- Inspired by the growing ecosystem of MCP servers
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.