Spotify MCP Server
Used as a deployment platform for hosting the MCP server with environment variable configuration for production use.
Provides access to Spotify's music data through the Web API, enabling search for tracks and artists, retrieving top tracks and albums, getting personalized music recommendations, and exploring playlist contents.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Spotify MCP Server
A FastMCP server that provides provides access to Spotify's music data through the Spotify Web API.
🎵 Features
Search Tracks: Find songs by name, artist, or lyrics
Search Artists: Discover artists and get their information
Artist Top Tracks: Get the most popular tracks for any artist
Note: The Recommendations API is no longer available for new Spotify apps as of November 27, 2024. See Spotify's announcement for more details.
Related MCP server: Spotify MCP Server
🚀 Quick Start
Prerequisites
Python 3.8+
Spotify Developer Account
Spotify App credentials (Client ID and Client Secret)
Local Development
Clone and navigate to the repository:
git clone <your-repo-url> cd mcp-spotifyCreate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtSet up Spotify API credentials:
export SPOTIFY_CLIENT_ID="your_client_id" export SPOTIFY_CLIENT_SECRET="your_client_secret"Run the server:
python src/server.py
The server will start on http://localhost:8000 with the MCP endpoint at http://localhost:8000/mcp.
🔑 Getting Spotify API Credentials
Log in with your Spotify account
Click "Create App"
Fill in the app details:
App name:
Your MCP Server(or any name you prefer)App description:
MCP server for Spotify integrationWebsite:
https://spotify-mcp.onrender.com(use your deployed URL)Redirect URI:
https://spotify-mcp.onrender.com(use your deployed URL)
Select "Web API" when asked about APIs/SDKs
Click "Save"
Copy your
Client IDandClient Secret
Note: Use your deployed Render URL (not localhost) for the redirect URI since Spotify requires HTTPS for security.
🚢 Deployment
Deploy to Render
Steps:
Click the "Deploy to Render" button below (or go to render.com and sign up/login)
Connect your GitHub account to Render (if you haven't already)
Create a new Web Service:
Connect this repository
Name:
spotify-mcpEnvironment:
Python 3Plan:
FreeBuild Command:
pip install -r requirements.txtStart Command:
python src/server.py
Set environment variables:
Go to your Render service dashboard
Click on "Environment" tab
Add:
SPOTIFY_CLIENT_ID=your_client_idSPOTIFY_CLIENT_SECRET=your_client_secret
Click "Save Changes"
Deploy!
Note: On Render's free tier, services go idle after ~15 minutes of inactivity and may require a manual "Deploy" to wake or to pick up the latest commit. Unlike Vercel, pushes do not auto-deploy by default.
Your server will be available at https://spotify-mcp.onrender.com/mcp
🎯 Poke Integration
Add the MCP URL:
https://spotify-mcp.onrender.com/mcpGive it a name like "Spotify"
Try: "Can you use the Spotify MCP to search tracks for 'Bohemian Rhapsody'?"
References
Based on the Interaction MCP server template: MCP Server Template
Discovered via Interaction’s HackMIT challenge: Interaction HackMIT Challenge
🛠️ Available Tools
search_tracks(query, limit=10)
Search for tracks on Spotify.
Parameters:
query(string): Search query (song name, artist, lyrics, etc.)limit(int, optional): Number of results to return (1-50, default: 10)
Example:
search_tracks("Bohemian Rhapsody", 5)search_artists(query, limit=10)
Search for artists on Spotify.
Parameters:
query(string): Search query (artist name, genre, etc.)limit(int, optional): Number of results to return (1-50, default: 10)
Example:
search_artists("Queen", 3)get_artist_top_tracks(artist_id, market="US")
Get the top tracks for a specific artist.
Parameters:
artist_id(string): Spotify artist IDmarket(string, optional): Market code (default: "US")
Example:
get_artist_top_tracks("1dfeR4HaWDbWqFHLkxsg1d") # Queen's artist ID🧪 Testing
Test the server locally:
# Test health endpoint
curl http://localhost:8000/
# Test MCP endpoint
curl -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}'📝 Notes
Rate Limiting: The Spotify API has rate limits. The server includes automatic token refresh.
Authentication: Uses Spotify's Client Credentials flow (no user login required).
Data Format: All responses are in JSON format for easy integration.
Error Handling: Comprehensive error handling with descriptive error messages.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Spotify: Spotify Data API for Millions of songs & podcasts, artists, albums, playlists and more.
Full Spotify Web API coverage - albums, artists, playlists, player controls, and more.
Spotify play counts, monthly listeners, charts, artist stats, albums, playlists and ISRC lookup.
Search, analyze, and discover commercially released music using sonic intelligence.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with Spotify's music catalog via the Spotify Web API, supporting searches, artist information retrieval, playlist management, and automatic token handling.269 npm23MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Spotify through natural language for music discovery, playback control, library management, and playlist creation. Supports searching for music, controlling playback, managing saved tracks, and getting personalized recommendations based on mood and preferences.118 npm5MIT
- AlicenseAqualityDmaintenanceEnables interaction with Spotify through LLMs using OAuth2 authentication. Supports music search, playback control, playlist management, and device management through natural language commands.142MIT
- FlicenseAqualityDmaintenanceEnables AI assistants to control Spotify playback, search for music, manage playlists, and access library information through the Spotify API. Requires Spotify Premium for playback control features.4-