- Home
- MCP servers
- Spotify
Spotify
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can run and connect to a Spotify MCP Server to control playback, search music, manage playlists, and query user data through natural language commands or direct tool calls. This MCP server comes in two deployment styles: a local Python implementation and a cloud-ready Vercel deployment, letting you choose between self-hosting or hosted execution while integrating with the Spotify API.
How to use
You interact with the MCP server from an MCP client by issuing natural language instructions or by calling specific MCP tools. In practice, you can ask to play a track, search for music, create or edit a playlist, adjust playback volume, switch devices, or fetch your top tracks and recently played items. If you work with Poke by Interaction, you can speak or type commands like asking to play jazz, search for an artist, or skip to the next track, and the MCP server translates those requests into Spotify API actions.
How to install
Prerequisites: Python 3.x installed for the Python implementation, and Node.js installed if you choose the cloud-based Vercel deployment.
Choose your deployment: local Python MCP server or Vercel cloud MCP server.
Python implementation steps
-
Ensure Python and pip are installed on your system.
-
Install dependencies
pip install -r requirements.txt
- Set up Spotify API credentials
-
Create a Spotify app in the Spotify Developer Dashboard.
-
Note the Client ID and Client Secret.
-
Set Redirect URI to http://localhost:8888/callback.
- Configure environment variables
cp .env.example .env
Edit .env to include your Spotify credentials and redirect URI.
5. Test the connection
python test_connection.py
6. Run the server
python main.py
## Vercel (cloud) deployment steps
1. Create a Vercel project and connect it to your repository containing the Vercel implementation.
2. Set required environment variables in your Vercel project dashboard
- SPOTIFY\_CLIENT\_ID
- SPOTIFY\_CLIENT\_SECRET
- SPOTIFY\_REFRESH\_TOKEN (optional for user-specific operations)
3. Endpoints to use in Poke by Interaction
- Test endpoint: /api/test
- MCP JSON-RPC endpoint: /api/index
## Configuration and runtime notes
Python implementation uses a .env file for Spotify credentials and server configuration. Vercel implementation relies on project environment variables. Ensure the redirect URI used in Spotify matches your setup. If you change scopes, re-authentication may be necessary.
## Troubleshooting
Authentication errors often come from incorrect credentials or redirect URI mismatches. Verify the Spotify app’s scopes and refresh tokens if needed. If no playback devices are found, ensure Spotify is running on a device and connected to the same network. For debugging, enable verbose logging in Python to trace startup and API calls.
## Notes on usage with Poke by Interaction
This MCP server is designed to work with Poke by Interaction. You can run a local Python server or deploy to Vercel and connect Poke to the corresponding MCP endpoint. Use natural language to control playback, search for music, manage playlists, and retrieve user data.
## Available tools
### spotify\_play
Start playback of a track or playlist
### spotify\_pause
Pause current playback
### spotify\_resume
Resume paused playback
### spotify\_skip\_next
Skip to the next track
### spotify\_skip\_previous
Skip to the previous track
### spotify\_set\_volume
Set playback volume (0-100%)
### spotify\_search
Search for tracks, albums, artists, and playlists
### spotify\_get\_user\_top\_tracks
Get the user's top tracks
### spotify\_get\_recently\_played
Get recently played tracks
### spotify\_get\_user\_playlists
Get the user's playlists
### spotify\_create\_playlist
Create a new playlist
### spotify\_add\_to\_playlist
Add tracks to a playlist
### spotify\_get\_current\_track
Get currently playing track information
### spotify\_get\_devices
Get available Spotify devices
### spotify\_get\_user\_profile
Get current user's profile