pauldprice/spotify-mcp-server
If you are the rightful owner of spotify-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Spotify MCP Server for Claude Desktop allows users to control their Spotify account directly from the Claude application, enabling seamless music management and interaction.
🎵 Spotify MCP Server for Claude Desktop
Control your Spotify account directly from Claude! This MCP (Model Context Protocol) server lets Claude create playlists, search tracks, get recommendations, and manage your Spotify library.
🚀 Quick Start (5 minutes)
Prerequisites
- Claude Desktop app installed
- Node.js (version 18 or higher) - Download here
- Spotify Account (free or premium)
Step 1: Get Your Spotify App Credentials
- Go to Spotify Developer Dashboard
- Click "Create app"
- Fill in:
- App name:
Claude MCP Server(or anything you like) - App description:
MCP server for Claude - Redirect URI:
http://127.0.0.1:9876/callback⚠️ IMPORTANT: Use 127.0.0.1, not localhost! - Which API/SDKs are you planning to use?: Check
Web API
- App name:
- Click "Save"
- Click "Settings" and copy your:
- Client ID
- Client Secret (click "View client secret")
Step 2: Install the MCP Server
-
Download this folder to your computer (e.g., to your Downloads folder)
-
Open Terminal (Mac) or Command Prompt (Windows)
-
Navigate to the folder:
cd ~/Downloads/spotify-mcp-server -
Run the setup:
npm install -
Configure your credentials (Secure Method):
For security, credentials are stored in your home directory:
mkdir -p ~/.spotify-mcp cp .env.example ~/.spotify-mcp/.envThen edit the
.envfile with your favorite text editor:- Mac:
open ~/.spotify-mcp/.envornano ~/.spotify-mcp/.env - Windows:
notepad %USERPROFILE%\.spotify-mcp\.env
Replace the placeholders with your actual Spotify credentials:
SPOTIFY_CLIENT_ID=your_actual_client_id_here SPOTIFY_CLIENT_SECRET=your_actual_client_secret_hereNote: Storing credentials in your home directory prevents accidental commits to Git!
- Mac:
-
Build the server:
npm run build
Step 3: Configure Claude Desktop
-
Open Claude Desktop settings:
- Mac:
Claudemenu →Settings→Developer→Edit Config - Windows:
File→Settings→Developer→Edit Config
- Mac:
-
Add this configuration (merge with existing content if any):
{ "mcpServers": { "spotify": { "command": "node", "args": ["dist/index.js"], "cwd": "/Users/YOUR_USERNAME/Downloads/spotify-mcp-server" } } }⚠️ IMPORTANT: Replace
/Users/YOUR_USERNAME/Downloads/spotify-mcp-serverwith the actual path to your spotify-mcp-server folder!- Mac example:
/Users/john/Downloads/spotify-mcp-server - Windows example:
C:\\Users\\john\\Downloads\\spotify-mcp-server
- Mac example:
-
Save the file and restart Claude Desktop
Step 4: Authorize Spotify (One-time setup)
- Start a new conversation in Claude
- Type: "List my Spotify playlists"
- A browser window will open asking you to authorize the app
- Click "Agree"
- You'll see "Spotify authorization successful" - you can close that tab
- Claude should now show your playlists!
🎉 You're Done!
What Claude Can Now Do
Try these commands:
- "Show me my Spotify playlists"
- "Create a new playlist called 'Workout Vibes'"
- "Search for songs by Taylor Swift"
- "Get recommendations based on Bohemian Rhapsody"
- "Add Hotel California to my Road Trip playlist"
- "Show audio features for my favorite songs"
- "Generate a psychedelic album cover and set it for my Chill Vibes playlist" 🎨
Available Tools
| Tool | What it does | Example command |
|---|---|---|
search_tracks | Find songs | "Search for acoustic versions of popular songs" |
create_playlist | Make new playlists | "Create a chill evening playlist" |
list_playlists | Show your playlists | "What playlists do I have?" |
add_tracks | Add songs to playlists | "Add this song to my workout playlist" |
remove_tracks | Remove songs | "Remove the last song from my playlist" |
get_playlist_tracks | Show playlist contents | "What's in my Discover Weekly?" |
reorder_playlist | Rearrange songs | "Move the first song to the end" |
set_playlist_details | Edit playlist info | "Make my playlist private" |
recommendations | Get song suggestions | "Recommend songs like Wonderwall" |
audio_features | Analyze song characteristics | "How danceable is this song?" |
set_playlist_cover | Upload custom cover image | "Create a retro cover for my 80s playlist" |
🔧 Troubleshooting
"MCP Server failed to start"
- Make sure Node.js is installed: run
node --versionin Terminal - Check that the path in Claude's config file is correct
- Ensure you ran
npm installandnpm run build
"Invalid redirect URI"
- Make sure you're using
http://127.0.0.1:9876/callback(notlocalhost) - Verify this exact URL is in your Spotify app settings
"Cannot read playlists" or API errors
- Check your Client ID and Secret are correct in
.env - Try deleting
tokens.jsonand reauthorizing
Need to reauthorize Spotify?
- Delete the
tokens.jsonfile in the spotify-mcp-server folder - Restart Claude Desktop
- Try using a Spotify command again
🔄 Updating
To update to a newer version:
- Download the new version
- Copy your
.envfile from the old folder to the new one - Run
npm installandnpm run buildin the new folder - Update the path in Claude's config if needed
📝 Notes
- Your Spotify credentials and tokens stay on your computer (never sent anywhere except Spotify)
- The
tokens.jsonfile contains your access token - keep it private - Works with both free and premium Spotify accounts
- Some features may be limited based on your Spotify subscription
🐛 Issues?
If you run into problems:
- Check the logs:
~/Library/Logs/Claude/mcp-server-spotify.log(Mac) - Make sure all paths use forward slashes
/even on Windows - Try restarting Claude Desktop after any configuration changes
Enjoy controlling Spotify with Claude! 🎶