Skip to main content
Glama
seenws

spotify-mcp

by seenws

An MCP server that lets MCP clients build and edit Spotify playlists from a description. "Moody 90s trip-hop for a rainy commute", "add three more like the last one", "drop anything over five minutes", etc. This is just a personal project intended for personal use, if you find it useful, that's a side effect, and you're welcome to use it.

How it works

Spotify deprecated /recommendations, /audio-features, /audio-analysis and related-artists for every app created after 2024-11-27, they return 403 and have no replacement. So the model itself is the recommendation engine. These seven tools give it the three things it can't do itself:

Tool

Purpose

Resolve

search_tracks

Turn "Massive Attack – Teardrop" into a track URI. Supports artist:, year:1990-1999, genre:, album:

Ground

get_my_taste

Your real top tracks/artists, so "music like I listen to" means something

Read

list_my_playlists, get_playlist

Find a playlist by name; see what's in it before editing

Write

create_playlist, add_tracks, remove_tracks

Build and edit. Batched past Spotify's 100-track-per-request cap automatically

There's a similar project named spotify-mcp-server by Marcel Marais that exposes many more functionalities. If you want to use this tool but find that the current list of exposed functions aren't enough for what you want to do, I'd recommend looking at his MCP server instead.

Related MCP server: spotify-mcp

Setup

1. Create a Spotify app

At developer.spotify.com/dashboardCreate app.

Footgun 1 — the redirect URI. Spotify rejects localhost. Register the IP literal, exactly: http://127.0.0.1:8888/callback

Footgun 2 — the allowlist. New apps are in development mode: capped at 5 users, and each one must be added under Settings → User Management by their Spotify account email — including your own. Miss this and every API call 403s despite a perfectly valid token. (Extended quota has been organizations-only since 2025-05-15 and requires 250k+ monthly actives, so 5 users is the practical ceiling.)

Copy the Client ID and Client secret.

2. Build and log in

npm install && npm run build

export SPOTIFY_CLIENT_ID=...
export SPOTIFY_CLIENT_SECRET=...
npm run login

npm run login prints an authorization URL (and tries to open your browser), catches the callback on 127.0.0.1:8888, and writes a refresh token to ~/.config/spotify-mcp/token.json with mode 0600. One time only — the server refreshes access tokens itself from then on.

Scopes requested: playlist-modify-public, playlist-modify-private, playlist-read-private, playlist-read-collaborative, user-top-read. No playback scopes — this server doesn't control playback.

3. Register with your MCP client

claude mcp add spotify \
  --env SPOTIFY_CLIENT_ID=... \
  --env SPOTIFY_CLIENT_SECRET=... \
  -- node /absolute/path/to/spotify-mcp/dist/index.js

Or in a client config file:

{
  "mcpServers": {
    "spotify": {
      "command": "node",
      "args": ["/absolute/path/to/spotify-mcp/dist/index.js"],
      "env": {
        "SPOTIFY_CLIENT_ID": "...",
        "SPOTIFY_CLIENT_SECRET": "..."
      }
    }
  }
}

Then just ask: "Make me a 20-track playlist of moody 90s trip-hop for a rainy commute."

Development

npm test     # node:test, no framework — chunking, pagination, token refresh, error handling
npm run build
npx @modelcontextprotocol/inspector node dist/index.js   # poke the tools by hand

Set SPOTIFY_MCP_TOKEN_FILE to override the token location.

Stack: @modelcontextprotocol/server v2 + zod. Everything else is a Node built-in — no express, no axios, no dotenv, no Spotify client library.

Notes

  • Auth flow: authorization code with client secret, not PKCE. Spotify doesn't rotate refresh tokens on this flow, so there's no lose-the-write-lose-the-account failure mode. Everything stays on loopback.

  • Not included: playback control, playlist rename/reorder, saved-library reads. Add when wanted.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Integrates Apple Music with MCP clients to search the global catalog, manage personal playlists, and access library data. It enables users to perform actions like creating playlists, adding tracks, and viewing recommendations through natural language commands.
    1
  • A
    license
    B
    quality
    B
    maintenance
    An MCP server that enables users to control Spotify playback, search music, and manage playlists through natural conversation. It is updated for the February 2026 Spotify Web API changes and supports full playlist CRUD operations.
    5
    6
    8
    MIT

View all related MCP servers

Related MCP Connectors

  • Spotify MCP — Web API via client_credentials OAuth

  • Generate AI music via the Lacuna Music API from MCP clients like Claude Desktop & Code.

  • MCP server for generating rough-draft project plans from natural-language prompts.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/seenws/spotify-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server