Cadence
Provides tools for playing, pausing, skipping, and controlling Spotify music, with automatic switching based on detected work mode, and personalized curation using local preference learning.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cadenceplay some focus music"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
What it does
You code. Cadence quietly reads the shape of your work โ debugging, writing docs, planning, reviewing, crunching โ and plays music chosen to suit it: lyric-free deep-focus beats while you implement, warm steady jazztronica while you debug, peaceful piano while you write, driving DnB when you're shipping under pressure.
๐๏ธ Auto-switches music as your task changes โ or stays fully manual. Your call.
๐ง Learns your taste per work mode from your feedback (love / like / dislike / ban / more-like-this) and your listening โ all 100% local.
๐ฏ 9 curated vibes mapped to work modes, each grounded in focus/attention research.
๐ Spotify Web API (OAuth PKCE) with a playerctl/AppleScript fallback so basic control works even without Premium on Linux/macOS.
๐ Private by design โ tokens in your OS keychain, preferences in a local file, nothing phoned home.
Related MCP server: Spotify MCP Server
How it works
Claude Code session
โ
hooks (UserPromptSubmit / PostToolUse / SessionStart) โ ~5ms, non-blocking
โ one-line event over a Unix socket
โผ
Cadence MCP server โโ the single "brain" โโโโโโโโโโโโโโโ
โ โ
โโโโโโดโโโโโโฌโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโค
detect curation learning Spotify local
work mode 9-vibe map (local, no-ML) Web API playerctl
/ AppleScript
โฒ
slash commands (/cadence, /focus, /vibe) โ mcp__cadence__* toolsOne MCP server owns everything (OAuth, state, curation, learning, playback). Hooks are deliberately dumb โ they fire a tiny event at the brain and exit immediately, so they never stall your turn. Discovery is built entirely on Spotify's surviving API surface (search + your own library) and a local, fully-deterministic preference model โ no ML training on Spotify content.
Install
Requires: Node.js โฅ 18, a free Spotify account (Premium for Web API playback control โ see limitations), and your own Spotify app Client ID (one-time, 2 minutes โ below).
1. Create your Spotify app (one time)
Go to the Spotify Developer Dashboard โ Create app.
Add a Redirect URI:
http://127.0.0.1/callbackuse the
127.0.0.1loopback IP literal (notlocalhost)omit the port โ Cadence binds an ephemeral port and matches it dynamically.
Copy the Client ID.
2. Add the plugin
/plugin marketplace add lomartins/cadence
/plugin install cadence@cadence-marketplaceWhen prompted, paste your Client ID and pick your market (e.g. US, GB, BR).
3. Connect & play
/cadence connect # opens your browser to authorize Spotify
/cadence play # start focus music for what you're doingThat's it. Auto-switch is on by default.
Commands
Command | What it does |
| Authorize Spotify (first run) |
| Start music for the current task |
| Transport controls |
| Switch vibe |
| Energy: 0 minimal โฆ 4 peak |
| Automatic switching |
| Teach your taste |
| What's happening |
| List vibes |
| Manage your data |
| Shortcut to start instantly |
You can also just talk to Claude: "play something calmer", "I love this one", "stop changing the music" โ the bundled skill maps that to the right action.
The vibes
Vibe | For | Character |
| implementation / deep-focus coding | lo-fi, ambient, chillhop โ lyric-free, steady |
| debugging | warm chillhop / nu-jazz โ predictable, frustration-buffering |
| writing & docs | solo piano / neoclassical โ zero lyrics, protects verbal WM |
| planning / architecture | ambient / generative โ spacious, aids divergent thinking |
| code review / reading | quiet ambient / drone โ low-arousal, preserves comprehension |
| learning / research | chillhop / baroque โ alert but unobtrusive |
| repetitive / mechanical | house / nu-disco / funk โ upbeat, lyrics OK |
| breaks | indie folk / bossa nova โ high-valence, restorative |
| crunch / shipping | DnB / techno / epic score โ high-energy, propulsive |
Each vibe carries an intensity scale (0โ4) that widens/narrows the BPM and energy
band of the search. Rationale for every choice lives in
src/data/presets.json.
How learning works
Every signal โ explicit (love/like/dislike/ban/more) and implicit (completed,
skipped-early, replayed, accepted/rejected auto-switch) โ is appended to a local
feedback.jsonl and folded into per-vibe preference profiles: artist/genre/track
scores (weighted updates + exponential decay), an audio-intent centroid, and a
time-of-day histogram. Candidate tracks are ranked with an explainable weighted
sum, and selection is epsilon-greedy (explore vs exploit) with a per-artist
diversity cap so it never goes stale.
It is deterministic statistics, not ML (counts, decay, Welford mean/var) โ
both to stay explainable and to respect Spotify's terms. state.json is just a
fold over the log: /cadence rebuild recomputes it from scratch.
Everything customizable lives in config.json (ranking weights, signal deltas,
thresholds, decay half-life, explore epsilon, auto-switch debounce/confidence).
Privacy
Local only. No telemetry. The only network calls are to your own authenticated Spotify API.
Tokens live in your OS keychain (libsecret / Keychain / Credential Manager), falling back to a
0600file. Never instate.json, never in the repo.Track titles are not stored by default (
privacy.store_track_titles: false) โ only opaque Spotify URIs./cadence export,reset,forget <uri>,rebuildgive you full control.
Spotify 2026 limitations (read this)
Spotify heavily restricted the Web API for new apps (Nov 2024 + Feb/Mar 2026). Cadence is built around what survives, but you should know:
You supply your own Client ID. A dev-mode app is capped at 5 users, so sharing one app doesn't scale โ each user registers their own (2 min, above).
The app owner (you) must have an active Spotify Premium subscription for the app to function at all, and playback control (play/pause/skip) requires the listening account to be Premium.
No Premium? On Linux (
playerctl) and macOS (AppleScript) Cadence falls back to controlling your desktop Spotify app for play/pause/next (no track selection). Windows without Premium can't control playback.Recommendations / audio-features / related-artists endpoints are gone for new apps โ Cadence discovers via Search + your library instead, which is why curated search queries and your own taste do the heavy lifting.
Refresh tokens expire after ~6 months โ you'll re-run
/cadence connectabout twice a year.
Develop
npm install # also builds dist/ via the prepare hook
npm run build # esbuild bundle -> dist/
npm run typecheck # tsc --noEmit
npm test # vitest
npm run dev # run the MCP server directly (uses .env)Architecture details: docs/ARCHITECTURE.md.
License
MIT ยฉ Luisa Martins. See LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/lomartins/cadence'
If you have feedback or need assistance with the MCP directory API, please join our Discord server