- Explore MCP Servers
- spotify-mcp
Spotify Mcp
What is Spotify Mcp
The Spotify MCP Server is a Model Context Protocol (MCP) server designed to interact with the Spotify API, allowing users to control Spotify playback functionalities.
Use cases
Use cases include creating a custom music player that integrates with Spotify, automating music playback in smart home setups, or developing a web application that provides Spotify playback functionalities.
How to use
To use the Spotify MCP Server, clone the repository, set up a virtual environment, install dependencies, configure your Spotify credentials in a .env file, and start the server using the command ‘python server.py’.
Key features
Key features include playing, pausing, and skipping tracks, shuffling and repeating playlists, and the ability to play specific albums or tracks by name.
Where to use
The Spotify MCP Server can be used in applications that require Spotify playback control, such as personal music management tools, home automation systems, or custom media players.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Spotify Mcp
The Spotify MCP Server is a Model Context Protocol (MCP) server designed to interact with the Spotify API, allowing users to control Spotify playback functionalities.
Use cases
Use cases include creating a custom music player that integrates with Spotify, automating music playback in smart home setups, or developing a web application that provides Spotify playback functionalities.
How to use
To use the Spotify MCP Server, clone the repository, set up a virtual environment, install dependencies, configure your Spotify credentials in a .env file, and start the server using the command ‘python server.py’.
Key features
Key features include playing, pausing, and skipping tracks, shuffling and repeating playlists, and the ability to play specific albums or tracks by name.
Where to use
The Spotify MCP Server can be used in applications that require Spotify playback control, such as personal music management tools, home automation systems, or custom media players.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Spotify MCP Server
The Spotify MCP Server is a Model Context Protocol (MCP) server designed to interact with the Spotify API. It provides tools to control Spotify playback, such as playing, pausing, skipping tracks, shuffling playlists, and more. This server is built using the mcp framework and spotipy library.
Features
- Play, pause, and skip tracks.
- Shuffle and repeat playlists.
- Play specific albums or tracks by name.
- Built-in tools for seamless Spotify playback control.
Prerequisites
Before setting up the server, ensure you have the following:
- Python 3.12 or higher.
- A Spotify Developer account with a registered application. You will need:
SPOTIFY_CLIENT_IDSPOTIFY_CLIENT_SECRET
- A
.envfile containing your Spotify credentials. - A premium spotify account
Installation
-
Clone the repository:
git clone <repository-url> cd spotify-mcp-server -
Create a virtual environment and activate it:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate -
Install
uvfor dependency management:pip install uvWindows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" -
Install dependencies using
uvfrom the pyproject.toml file:uv sync -
Create a
.envfile in the project root and add your Spotify credentials:SPOTIFY_CLIENT_ID=your_client_id SPOTIFY_CLIENT_SECRET=your_client_secret
Usage
-
Start the MCP server:
python server.py -
Use the provided tools to control Spotify playback. For example:
play(): Start playing the current track.pause(): Pause the current track.next_track(): Skip to the next track.play_album("album_name"): Play a specific album by name.play_track("track_name"): Play a specific track by name.
-
Add MCP tools to your MCP client. For example, if you’re using Claude:
Add this at the root of your projectuv mcp install server.py
Example Using Calude Desktop
Here is the JSON file
{ "mcpServers": { "spotify-mcp-server": { "command": "~path-to-project\\spotify-mcp-server\\.venv\\Scripts\\python.exe", "args": [ "~path-to-project\\spotify-mcp-server\\server.py" ], "transport": "stdio", "env":{ "SPOTIFY_CLIENT_ID": "############", "SPOTIFY_CLIENT_SECRET": "############", "TRANSPORT": "stdio" } } } }
Troubleshooting
-
Spotify Authentication Failed: Ensure your
SPOTIFY_CLIENT_IDandSPOTIFY_CLIENT_SECRETare correctly set in the.envfile. -
Server Not Starting: Verify that the
__name__check inserver.pyis correctly set to__server__:if __name__ == "__server__": mcp.run()
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










