Spotify MCP Server
Provides comprehensive Spotify integration including search for tracks/albums/artists/playlists, playback control (play/pause/skip/volume/shuffle), library management (saving and removing tracks), playlist operations (create/modify playlists), and personalized music recommendations based on mood, genre, and listening history.
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
Model Context Protocol (MCP) server that provides Spotify integration for Claude Desktop.
β οΈ This project is experimental / for personal use only
This repository is a personal project created for fun and learning. It has not been exhaustively tested or production hardened. Use at your own risk β including re-authenticating if scopes change and backing up any important data.
Features
π Search
Search for tracks, albums, artists, and playlists
π΅ Playback Control
Get current playback state
Play/pause, skip, previous track
Control volume and shuffle
Seek within tracks
π Library Management
Get saved tracks
Save and remove tracks from library
Check if tracks are saved
πΌ Playlists
Get user playlists
Create new playlists
Add/remove tracks from playlists
Get playlist details
π― Recommendations
Get personalized recommendations based on:
Seed tracks, artists, or genres
Mood preferences (energy, danceability, valence)
Automatic recommendations from recent listening history
Get available genre seeds
π¬ Intelligent Prompts
Discover Music: Get recommendations based on mood and preferences
Analyze Now Playing: Deep analysis of currently playing track
Create Themed Playlist: Build playlists around themes or activities
Related MCP server: Spotify MCP Server
Setup
1. Create Spotify App
Click "Create app"
Fill in:
App name: "MCP Spotify" (or any name)
App description: "Personal Spotify MCP Server"
Redirect URI:
http://localhost:3000/callback
Check "Web API" under "Which API/SDKs are you planning to use?"
Agree to terms and click "Save"
Click "Settings" to view your Client ID and Client Secret
2. Configure Environment
Create a .env file in the project root:
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_here
SPOTIFY_REDIRECT_URI=http://localhost:3000/callback3. Build the Server
npm install
npm run build4. Configure Claude Desktop
Edit your Claude Desktop config file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Add the MCP server configuration:
{
"mcpServers": {
"mcp-spotify": {
"command": "node",
"args": [
"C:\\path\\to\\mcp-spotify\\build\\index.js"
]
}
}
}Replace C:\\path\\to\\mcp-spotify with the actual path to this project.
5. First Run Authentication
Restart Claude Desktop
The server will automatically open a browser for Spotify authentication
Log in and authorize the app
You'll be redirected to a success page
Tokens are saved to
~/.mcp-spotify/tokens.json
Available Tools
Search
search_tracks- Search for trackssearch_albums- Search for albumssearch_artists- Search for artistssearch_playlists- Search for playlists
Playback
get_playback_state- Get current playback informationplayback_control- Control playback (play, pause, skip, previous, shuffle, volume, seek)
Library
get_saved_tracks- Get user's saved trackssave_tracks- Save tracks to libraryremove_saved_tracks- Remove tracks from libraryget_recently_played- Get recently played tracks (useful for recommendations)
Playlists
get_playlists- Get user's playlistscreate_playlist- Create a new playlistadd_tracks_to_playlist- Add tracks to a playlist
Recommendations
get_recommendations- Get track recommendations based on seeds and preferences (supportsuse_recent_listeningparameter)get_genre_seeds- Get list of available genre seeds
Available Prompts
discover_music
Discover new music based on your mood, genres, and listening preferences.
Arguments:
mood(optional): Desired mood (energetic, chill, happy, melancholic)genre(optional): Preferred genre
Example: "Discover energetic electronic music"
analyze_now_playing
Get detailed analysis of the currently playing track including audio features and recommendations.
Example: "Analyze what I'm listening to"
create_themed_playlist
Create a playlist based on a theme, mood, or activity.
Arguments:
theme: Theme or mood (e.g., "Workout", "Study", "Road Trip")size(optional): Number of tracks (default: 20)
Example: "Create a chill study playlist with 30 songs"
Example Interactions
You: "What am I currently listening to?"
β Uses get_playback_state to show current track
You: "Find me some energetic electronic music"
β Uses search_tracks or get_recommendations with appropriate filters
You: "Create a workout playlist"
β Uses create_themed_playlist prompt to search, gather tracks, and create playlist
You: "Save this track to my library"
β Uses save_tracks to add the current or mentioned track
You: "Skip to the next song"
β Uses playback_control with action: "skip"Project Structure
src/
βββ index.ts # Main entry point, server setup
βββ auth.ts # OAuth 2.0 authentication flow
βββ spotify-client.ts # HTTP client for Spotify API
βββ logger.ts # Logging utility
βββ types.ts # TypeScript type definitions
βββ utils.ts # Helper utilities
βββ tools/
β βββ search.ts # Search functionality
β βββ playback.ts # Playback control
β βββ library.ts # Library management
β βββ playlists.ts # Playlist operations
β βββ recommendations.ts # Recommendations logic
β βββ declarations/
β βββ *.ts # Tool registration
βββ prompts/
βββ declarations/
βββ *.ts # Prompt registrationTroubleshooting
"Spotify API error: 401"
Tokens may be expired. Delete
~/.mcp-spotify/tokens.jsonand restart ClaudeCheck that your Client ID and Client Secret are correct in
.env
"No playback device found"
Open Spotify on any device (desktop, mobile, web)
Start playing any track to activate a device
The API requires an active device for playback control
Recommendations returning 404
This is expected! Spotify deprecated the old recommendations API
The server now uses Search API with filters as a replacement
Technical Details
Language: TypeScript
Runtime: Node.js v23.9.0
MCP SDK: @modelcontextprotocol/sdk v1.20.0
Transport: stdio
Auth: OAuth 2.0 Authorization Code Flow with refresh tokens
Token Storage:
~/.mcp-spotify/tokens.json(auto-refreshed)
License
MIT
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 MCP server for ChatGPT, Claude and any AI agent: search songs and artists, list playlists, read playlist songs, create playlist, add songs to playlist, remove songs from playlist, set playlist public or private and save to Liked Songs in your own Spotify account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Spotify yourself; Cotlet does not store your password and you need no Spotify API key. About the official Spotify API: Spotify has a full Web API and, since 23 Apr 2026, an official connector for Claude (checked 5 Nov 2026). The API needs an app you register, and in development mode the app owner must have Premium and the app allows 5 users; unlimited users need a registered business with at least 250,000 monthly users. Setup and FAQ: https://cotlet.dev/integrations/spotify-api-mcp-server
Full Spotify Web API coverage - albums, artists, playlists, player controls, and more.
Spotify: Spotify Data API for Millions of songs & podcasts, artists, albums, playlists and more.
Generate full songs with vocals, instrumentals and sound effects from text. One server for Suno, Google Lyria, Mureka, MiniMax, ACE-Step, YuE and ElevenLabs. Your agent can quote the credit cost before generating, start a song, wait for it to finish and return download links. Sign in with OAuth; optional daily credit caps; retries never charge twice.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Spotify's music catalog through natural language conversations. Search for tracks and artists, get recommendations, explore playlists, and browse artist discographies using the Spotify Web API.-
- FlicenseBqualityDmaintenanceEnables AI assistants to control Spotify playback, search for music, manage playlists, and interact with your Spotify library through natural language commands.19-
- 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-
- AlicenseAqualityDmaintenanceEnables control of Spotify playback and management of liked songs through natural language. Supports play/pause controls, track information retrieval, and adding songs to your Spotify library.4MIT