spotify-mcp-server

pauldprice/spotify-mcp-server

3.1

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.

Tools
11
Resources
0
Prompts
0

🎵 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

  1. Go to Spotify Developer Dashboard
  2. Click "Create app"
  3. 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
  4. Click "Save"
  5. Click "Settings" and copy your:
    • Client ID
    • Client Secret (click "View client secret")

Step 2: Install the MCP Server

  1. Download this folder to your computer (e.g., to your Downloads folder)

  2. Open Terminal (Mac) or Command Prompt (Windows)

  3. Navigate to the folder:

    cd ~/Downloads/spotify-mcp-server
    
  4. Run the setup:

    npm install
    
  5. Configure your credentials (Secure Method):

    For security, credentials are stored in your home directory:

    mkdir -p ~/.spotify-mcp
    cp .env.example ~/.spotify-mcp/.env
    

    Then edit the .env file with your favorite text editor:

    • Mac: open ~/.spotify-mcp/.env or nano ~/.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_here
    

    Note: Storing credentials in your home directory prevents accidental commits to Git!

  6. Build the server:

    npm run build
    

Step 3: Configure Claude Desktop

  1. Open Claude Desktop settings:

    • Mac: Claude menu → SettingsDeveloperEdit Config
    • Windows: FileSettingsDeveloperEdit Config
  2. 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-server with 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
  3. Save the file and restart Claude Desktop

Step 4: Authorize Spotify (One-time setup)

  1. Start a new conversation in Claude
  2. Type: "List my Spotify playlists"
  3. A browser window will open asking you to authorize the app
  4. Click "Agree"
  5. You'll see "Spotify authorization successful" - you can close that tab
  6. 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

ToolWhat it doesExample command
search_tracksFind songs"Search for acoustic versions of popular songs"
create_playlistMake new playlists"Create a chill evening playlist"
list_playlistsShow your playlists"What playlists do I have?"
add_tracksAdd songs to playlists"Add this song to my workout playlist"
remove_tracksRemove songs"Remove the last song from my playlist"
get_playlist_tracksShow playlist contents"What's in my Discover Weekly?"
reorder_playlistRearrange songs"Move the first song to the end"
set_playlist_detailsEdit playlist info"Make my playlist private"
recommendationsGet song suggestions"Recommend songs like Wonderwall"
audio_featuresAnalyze song characteristics"How danceable is this song?"
set_playlist_coverUpload 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 --version in Terminal
  • Check that the path in Claude's config file is correct
  • Ensure you ran npm install and npm run build

"Invalid redirect URI"

  • Make sure you're using http://127.0.0.1:9876/callback (not localhost)
  • 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.json and reauthorizing

Need to reauthorize Spotify?

  • Delete the tokens.json file in the spotify-mcp-server folder
  • Restart Claude Desktop
  • Try using a Spotify command again

🔄 Updating

To update to a newer version:

  1. Download the new version
  2. Copy your .env file from the old folder to the new one
  3. Run npm install and npm run build in the new folder
  4. 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.json file 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:

  1. Check the logs: ~/Library/Logs/Claude/mcp-server-spotify.log (Mac)
  2. Make sure all paths use forward slashes / even on Windows
  3. Try restarting Claude Desktop after any configuration changes

Enjoy controlling Spotify with Claude! 🎶