home / mcp / spotify mcp server
Spotify Model Context Protocol server for creating playlists
Configuration
View docs{
"mcpServers": {
"belljustin-spotify-mcp": {
"command": "uv",
"args": [
"--directory",
"PATH-TO-BASE-DIR/spotify-mcp",
"run",
"spotify.py"
],
"env": {
"SPOTIFY_CLIENT_ID": "YOUR_CLIENT_ID",
"SPOTIFY_CLIENT_SECRET": "YOUR_CLIENT_SECRET"
}
}
}
}The Spotify Model Context Protocol (MCP) lets you generate and manage playlists based on descriptions directly from your editor. It connects with Spotify to create personalized playlists, making it easy to turn ideas into organized music collections without leaving your coding workflow.
You will authenticate with Spotify once to grant access for playlist creation. After authentication, you can issue MCP commands from your editor to create, update, or curate playlists based on descriptions. The integration is designed to work smoothly inside Cursor, so you can describe a playlist and have it generated and managed within your editing environment.
Prerequisites you need before starting:
- Python 3.6 or higher
- Spotify Developer credentials (Client ID and Client Secret)
Step 1: Set up your environment and dependencies
Step-by-step commands you will run
1. Set up Python and dependencies
2. Install required Python packages
3. Configure Spotify credentials
4. Start the authentication server to enable OAuth with Spotify
5. Integrate with Cursor using the MCP configuration snippet
Concrete commands you will run
# 1) Install Python dependencies
pip install -r requirements.txt
# 2) Set Spotify credentials in a local environment file
echo SPOTIFY_CLIENT_ID='your_client_id' >> .env
echo SPOTIFY_CLIENT_SECRET='your_client_secret' >> .env
# 3) Start the authentication server to handle Spotify OAuth
python main.py6. Start the MCP runner via the provided stdio command when ready
7. Add the MCP configuration to Cursor to enable the Spotify MCP
8. Use the editor integration to describe a playlist and manage it through Spotify MCP
You can customize the MCP runner to point to the Spotify MCP directory and run the Spotify MCP script via the stdio interface. The following configuration snippet shows how to define the MCP server in your MCP setup.
{
"mcpServers": {
"spotify": {
"command": "uv",
"args": [
"--directory",
"PATH-TO-BASE-DIR/spotify-mcp",
"run",
"spotify.py"
]
}
}
}- Your Spotify credentials are required for playlist creation. Keep them secure and do not expose them in shared environments.
- If you encounter authentication failures, ensure your Redirect URI is set correctly in the Spotify Developer Dashboard to http://localhost:5000/callback and that the local server is running.
- The Spotify MCP is designed to run locally and integrate with Cursor for a seamless playlist workflow. Ensure you have the necessary Python version and Spotify developer credentials before starting.
This MCP setup provides a local stdio interface to run the Spotify MCP script and a local HTTP-like flow to handle authentication via a temporary local server. The primary endpoints are the Spotify authentication flow and the local MCP runner that executes the spotify.py script.