Playlist Zentrale
Provides tools for interacting with the Spotify Web API to manage a user's own playlists and library, including searching tracks/artists/albums, creating playlists, adding/removing/reordering tracks, deduplicating, renaming, building playlists from song lists, managing liked songs, and accessing playback state, with audit logging and undo support.
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.
Playlist Zentrale
Let an AI agent edit your Spotify playlists without the risk: every change is logged with what was there before, and one command takes it back.
Playlist Zentrale is an MCP server, a CLI and a local web dashboard for your own Spotify library. Claude Code (or any other MCP client) can search, create, add, remove, reorder, dedupe and rename, and build playlists from a plain list of songs. The dashboard reads your library and shows the numbers Spotify's apps keep to themselves. All three go through the same core, which only touches playlists you own and writes an audit entry before it returns.

Project page · Hosted instance (five seats, waitlist) · Roadmap · Dashboard guide
Contents
Related MCP server: craft
What you can ask for
Once the server is connected, you talk to your agent in plain language:
"Make a private playlist called Sunday Slow from these twelve songs." The agent matches each line through search, shows the misses, and only creates the list when you say apply.
"Remove every duplicate from Old Favourites." The tool can show a dry run first; it keeps the first copy of each song.
"Add my top five tracks of the last month to Run Club, but skip what is already there."
"Undo that." The previous track list comes back, unless you edited the playlist yourself in the meantime, in which case nothing is overwritten and the agent tells you why.
Behind every one of those requests sits the same rule: a write needs a playlist you own, and it leaves an audit entry with the previous state.
Quick start
You need Bun 1.3 or newer and a Spotify account (the developer app below needs its owner to have Premium).
Create a Spotify developer app. Go to https://developer.spotify.com/dashboard, choose Create app, pick "Web API", and add this redirect URI exactly:
http://127.0.0.1:3000/spotify/callback. Spotify rejectslocalhost, so it has to be127.0.0.1. Copy the client id.Install.
git clone https://github.com/noluyorAbi/playlist-zentrale.git cd playlist-zentrale bun install bun run check # typecheck, tests, dash guardStore the client id outside the repo, readable only by you:
mkdir -p ~/.config/playlist-zentrale && chmod 700 ~/.config/playlist-zentrale printf 'SPOTIFY_CLIENT_ID=%s\n' 'your-client-id' > ~/.config/playlist-zentrale/secrets.env chmod 600 ~/.config/playlist-zentrale/secrets.envThe login uses PKCE, so no client secret is needed.
Log in.
bun run login # opens the consent page, waits on 127.0.0.1:3000 for the callback bun run whoami # checks the stored loginThe tokens land in
~/.config/playlist-zentrale/token.json(mode 0600). Access tokens last an hour and refresh on their own; a rotated refresh token is saved.bun run login --printshows the authorize URL and the scopes without starting anything.
Port 3000 taken by a dev server? Register http://127.0.0.1/callback (no port) in the Spotify
dashboard as well; a loopback URI without a port accepts any port. Then:
SPOTIFY_REDIRECT_URI=http://127.0.0.1:8888/callback bun run loginConnect an MCP client
Claude Code, at user scope so it works in every project. Run this from the repo folder:
claude mcp add --scope user playlist-zentrale -- "$(command -v bun)" "$PWD/src/mcp.ts"
claude mcp list | grep playlist-zentraleUse the absolute bun path: servers started by an MCP client often do not have ~/.bun/bin on
their PATH. No secret goes into the MCP config; the server reads the files above at runtime. It
starts even when you are not logged in yet and reports that on each tool call.
Claude Desktop, Cursor and other clients take the same command in their JSON config
(Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json on macOS;
Cursor: ~/.cursor/mcp.json):
{
"mcpServers": {
"playlist-zentrale": {
"command": "/absolute/path/to/bun",
"args": ["/absolute/path/to/playlist-zentrale/src/mcp.ts"]
}
}
}Restart the client after adding it.
The tools
Tool | What it does | Writes |
| The logged-in user | |
| Playlists in your library, | |
| Details and ordered tracks (your own or collaborative ones) | |
| Tracks, artists, albums, playlists (Spotify allows 10 per type per call) | |
| New playlist, private by default, optional tracks | undoable |
| Adds tracks, skipping ones already present unless | undoable |
| Removes every occurrence of the given tracks | undoable |
| Replaces the whole list, any length | undoable |
| Moves a range of tracks | undoable |
| Name, description, public | undoable |
| Uploads a local JPEG (256 KB base64 at most) | logged, not undoable |
| Drops repeated tracks, keeps the first, supports | undoable |
| "Artist - Title" lines to matches and misses; dry run unless | undoable |
| Removes a playlist from your library; needs | undoable |
| Top tracks or artists by time range | |
| The last 50 plays | |
| Liked Songs | |
| Like or unlike | undoable |
| Playback state and devices | |
| Play, pause, next, previous, queue | logged, not undoable |
| Recent writes and whether they can still be undone | |
| Reverses the newest reversible writes |
Playlist arguments accept an id, a spotify:playlist: uri, a link, or the exact name of one of
your playlists. Tracks accept uris, links or bare ids.
CLI
The same operations for people, with the same checks and the same audit log:
bun run cli help
bun run cli playlists --owned
bun run cli show "Sunday Slow"
bun run cli search 'track:"Lovely Day" artist:"Bill Withers"'
bun run cli build songs.txt --name "Road Trip" --apply
bun run cli dedupe "Old Favourites" --dry-run
bun run cli details "Run Club" --description "No slow intros."
bun run cli cover "Run Club" ~/Pictures/cover.jpg
bun run cli undoAdd --json to playlists and show for machine-readable output.
The dashboard
bun run web # http://127.0.0.1:7173, opens the browser
bun run web --no-open # just serveA local page over the same core. It reads everything Spotify still lets this kind of app read and turns it into numbers you can check: every figure has a "How is this computed?" note, and every suggestion has a score you can click to see the arithmetic. Adds and creates go through the audited core, so the Undo pill in the header reverses them.
Overview. Number one artist, day ones, pinned playlists, a printable receipt. | Analysis. Claude reads a digest of your library; every claim cites its evidence. |
Stats. When you hit like, how old songs are when you find them, how concentrated your taste is. | Moods. Energy and valence of your artists, and how your moods moved year by year. |
Discover. Songs that fit a playlist, with the score explained. After an add, Undo sits in the header. | Live. Tour dates of the artists you actually play, ranked by how much they matter to you. |
The other tabs cover top lists, history, library, links between artists and playlists, and DJ-style ordering for new playlists. docs/DASHBOARD.md explains each tab and how its numbers are computed.
Try it without a Spotify account
bun run demo # http://127.0.0.1:7174This serves the real dashboard over an invented library: invented artists, songs, covers,
playlists and listening history, an invented AI analysis, invented concerts. Spotify is replaced
by the in-memory fake the tests use (test/fake.ts), the AI runner and the Bandsintown and
Deezer lookups are stubbed, and every file lives in a temp folder that is deleted on exit. Adds,
creates and undo work against the fake. The screenshots and the video in this README come from
it.
Hosted mode and self-hosting
The same dashboard also runs as a multi-user app on Vercel. The instance at https://zentrale.adatepe.dev is in Spotify's Development Mode, which allows five listeners who are added by hand; everyone else can join the waitlist there.
How the hosted mode differs from the local one (code in src/saas/):
Login is PKCE on the server. The verifier rides in a signed ten minute cookie, and the session is a signed HttpOnly cookie. Every write still needs the page token and a same-origin
Origin.Each user's files live in a private Vercel Blob store, every file encrypted with AES-256-GCM under a key derived from
SESSION_SECRET.The AI features run through Vercel AI Gateway instead of the local Claude Code CLI and are only enabled for the ids in
OWNER_SPOTIFY_IDSandPOWER_SPOTIFY_IDS, because they cost money per user.A daily cron logs recent plays for every user. "Delete my data" removes every stored file of that user.
To run your own instance:
vercel link # once, in the repo folder
OWNER_SPOTIFY_IDS=<your spotify user id> \
bash scripts/setup-vercel-env.sh https://your-domain.example
bun run deploy:prod # check, bundle, deploysetup-vercel-env.sh generates SESSION_SECRET and CRON_SECRET and pipes them straight into
Vercel without printing them. Add a private Blob store to the project for BLOB_READ_WRITE_TOKEN.
Register https://your-domain.example/api/auth/callback as a redirect URI in the Spotify
dashboard, and add each listener under User Management. APP_ORIGIN must be the origin people
open; requests to any other host are refused.
The project page in landing/ is a separate static site; see landing/README.md.
Security model
An MCP server with write access to your account is a target for prompt injection: a playlist name or a song title written by a stranger ends up in the agent's context. The guardrails assume that will happen.
Only your own playlists are changed. Followed playlists and collaborative playlists owned by someone else are refused.
Every write is logged before the call returns, with the previous state (track list, name, description, public), the client that made it and its process id. The log is append-only:
~/.config/playlist-zentrale/audit.jsonl.Undo never overwrites a later edit.
undo_lastrestores the previous state only if the playlist still looks exactly like it did right after the write. Undo state is derived from appended entries, and undo runs under a lockfile, so two sessions cannot reverse the same change twice.Destructive calls need an explicit flag.
unfollow_playlistneedsconfirm: true, andbuild_playlist_from_listis a dry run unlessapply: true.Every tool response is marked as untrusted data. Names, descriptions and titles are written by other people and must never be read as instructions.
Cover uploads are sandboxed.
set_playlist_coveronly reads regular.jpgfiles insideSPOTIFY_COVER_DIRS(default~/Pictures,~/Desktop,~/Downloads), never inside a hidden folder such as~/.ssh, with symlinks resolved first. A prompt-injected agent cannot upload arbitrary files to Spotify.Tokens never show up in output. The client secret and tokens are redacted from every tool and CLI response.
The dashboard is local and locked down. It binds to 127.0.0.1, refuses other Host headers (DNS rebinding), needs a per-launch page token for every API call and a same-origin
Originplus a JSON body for every write, and sends a strict Content-Security-Policy. Spotify strings are rendered as text, never as HTML.
What cannot be undone: cover uploads (Spotify offers no way to read the previous image back as a file) and playback commands. Undoing a track list change rewrites the list, which resets the "added" dates.
Found a hole? See SECURITY.md.
Privacy
Locally, everything stays on your machine in ~/.config/playlist-zentrale/: the login, the audit
log, and the cache (cache/: library snapshot, AI analysis, mood tags, concerts, play log). The
folder is mode 0700 and every file in it 0600. Deleting the folder removes everything.
Apart from the Spotify API itself (and the album art the page loads from Spotify's image servers), data leaves your machine only when you press a button for it:
AI analysis and mood tags: artist and song names, counts and play hours go to Claude through your own Claude Code login. No ids, tokens or account data. "What is sent" shows the exact text first.
Concerts: artist names go to Bandsintown's public API.
Tempo for DJ mixing: song ISRCs go to Deezer's public API.
The hosted mode stores the same kinds of files per user, encrypted, and runs the AI features only for invited users. Its privacy page is at https://zentrale.adatepe.dev/privacy.
Spotify's limits
Since February 2026, apps in Development Mode work under tight rules, and this project follows them:
The app owner needs Premium, and at most five users can log in, each added by hand.
Search returns at most 10 results per type per call.
Playlist items are only readable for playlists you own or collaborate on.
Recommendations, audio features, related artists, artist top tracks, browse and batch GETs are closed. Suggestions are therefore built from your own data, and moods come from Claude's tags.
The details, with sources: docs/KNOWLEDGE.md.
Configuration
Variable | Default | Purpose |
|
| Client id (and optional secret) |
|
| Stored tokens |
|
| Audit log |
|
| Dashboard cache |
|
| Login callback |
|
| Dashboard port |
|
| Folders cover uploads may read |
|
| Claude Code CLI for the AI features |
| CLI default | Model alias for the analysis |
|
| Language of the AI text |
| none |
|
| public example id | Your own Bandsintown app id |
SPOTIFY_CLIENT_ID in the environment overrides the secrets file.
Troubleshooting
Symptom | Fix |
|
|
| The refresh token expired or was revoked: |
403 on everything | The app owner's Premium lapsed, or the account is not under User Management |
403 on one call | Endpoint closed to Development Mode, missing scope (log in again), or not your playlist |
404 on playback | No active device: open Spotify somewhere, or pass |
| The URI is not registered exactly; check |
Port 3000 busy | Stop the dev server, or use the portless redirect URI (see Quick start) |
Cover refused | JPEG under about 190 KB: |
Tools missing in the client |
|
No "Create app" button | A narrow window hides it; open https://developer.spotify.com/dashboard/create |
Development
bun install
bun run check # tsc --noEmit, bun test, no em or en dash anywhere
bun run demo # the dashboard over invented dataTests run against an in-memory fake of the Spotify routes (test/fake.ts) and never touch the
network or real secrets. AGENTS.md describes the layout, the rules every write
follows, and how to add a tool. Issues are welcome; pull requests are not accepted, see
CONTRIBUTING.md.
Roadmap
ROADMAP.md lists what comes next: a setup command, the whole audit log in the dashboard, and remote MCP for the hosted mode.
License
Playlist Zentrale is source-available, free for noncommercial use, under the PolyForm Noncommercial License 1.0.0. You may read, run, modify, self-host and share it for any noncommercial purpose, including personal projects, research and teaching. Using it for commercial advantage or monetary compensation (a paid product, a paid service, client work) needs a commercial license: open an issue with the commercial license template. Keep confidential details out of it; the reply moves the conversation to a private channel.
Playlist Zentrale is an independent project for Spotify users. It is not affiliated with, endorsed or sponsored by Spotify. Spotify is a trademark of Spotify AB.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Manage Superlist tasks and lists in plain language from any MCP-compatible AI agent.
Runtime permission, approval, and audit layer for AI agent tool execution.
A home for your agents: an owned book of record any AI agent can write to, with provenance and undo.
Supervised API-write gateway for AI agents with policy, human approval and execution receipts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to safely explore directories, read files, search content by pattern or filename, and edit files with checksum verification and dry-run preview within sandboxed filesystem access.76MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to index and search local skill libraries, persist and resume task checkpoints, and run validated workflow plans with controlled approval and write permissions.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to list entries and metadata, run commands with secrets injected as environment variables while scrubbing every value from the output, copy secrets straight to the clipboard, and generate or store new secrets without their plaintext ever entering the conversation. Obvious dumpers are refused and destructive edits require explicit confirmation, closing off accidental exposure paths.44 PyPIMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to create password-protected, link-shareable lists and then read, edit, and restyle them — managing typed columns, rows, and per-list CSS, and looking up product pages to fill in prices, photos, and names. It exposes eighteen tools over Streamable HTTP with per-agent bearer tokens, so agents can build and maintain a shared list end to end.MIT