spotify-mcp
Provides tools for interacting with Spotify, including catalog search, accessing top tracks and liked songs, reading playlists, creating and editing playlists, adding/reordering/removing tracks, and building workout playlists filtered by tempo and energy.
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.
spotify-mcp
An MCP server that lets Claude build Spotify playlists for a workout. It picks songs from your own top tracks and liked songs, filters them by energy and tempo (BPM), and creates or edits playlists in your account.
Built for one user on a homelab, behind a shared-secret header, with the Spotify refresh token stored on a persistent volume. It is not a general multi-user service.
What it does and does not use from Spotify
Spotify's audio-features endpoint (BPM, energy) is closed to apps created after
November 2024, and its February 2026 Development Mode changes cut the search
limit to 10, removed batch track lookups, and moved playlist writes to
/playlists/{id}/items. This server follows those rules.
From Spotify: search, your top tracks, your liked songs, your playlists, and playlist create and edit.
From ReccoBeats (
api.reccobeats.com, no key): tempo and energy per Spotify track ID. Results are cached in SQLite on the data volume. A track ReccoBeats does not know is retried after a week, andset_track_temporecords a BPM by hand.From tempo-service (optional,
TEMPO_SERVICE_URL): when ReccoBeats has no tempo, tempo-service measures the BPM from the track's iTunes preview, looked up by first artist and title. It gives tempo only, no energy, and atrustofhighorcheck. Lookups take 4 to 7 seconds, so each tool call makes at mostTEMPO_SERVICE_MAX_PER_CALLof them, within 60 seconds, and reports the rest as pending. The artist and title go to tempo-service and on to Apple's iTunes Search API.When a source errors: the tool call still returns. Tracks ReccoBeats or tempo-service did not answer are listed as pending, and the next call retries them.
Related MCP server: speediance-mcp
Tools
Tool | Purpose |
| Catalog search (max 10 per call). |
| Your listening history. |
| Tempo, energy, danceability, valence, loudness for track IDs, with each tempo's source and the IDs still pending. |
| Record a BPM by hand. |
| Your tracks inside a BPM and energy window, with optional half or double time. |
| Read your own playlists. |
| After a workout: match the plays in its time window, tie them to it, add the completed ones to the "Workouts" playlist. |
| What the log says: skips, effort, cadence, tempo bands, keepers. |
| Edit playlists. Run playlists are named |
Listening log
Spotify's recently-played endpoint holds only the last 50 plays. A poller
thread copies them into listening.sqlite3 on the data volume every 10
minutes (SPOTIFY_MCP_POLL_SECONDS, 0 turns it off). log_workout_listening
ties the plays in a workout's window to that workout. The log never leaves the
volume, and nothing in it is sent anywhere except to Claude when a tool is
called. Delete listening.sqlite3 to erase it.
Skips are inferred from the time between consecutive plays, because Spotify reports no play length. The learning is plain tables and aggregate queries, and shows what coincided with a track, not what it caused.
Configuration
Variable | Meaning |
| From your Spotify developer app. No client secret is used (PKCE). |
| Default |
| Where |
| Required unless bound to loopback. Sent as |
| Default |
| Default |
| Play-log poll interval. Default |
| tempo-service base URL. Unset turns the fallback off. |
| Fallback lookups per tool call. Default |
Login
spotify-mcp-authIt prints a URL. Approve in a browser, then paste the address the browser was sent to (the page itself fails to load, which is expected).
Spotify's terms
Spotify's developer terms forbid using Spotify content to train machine learning models. This server only passes track names and IDs to the model at request time. Read the current terms before widening that use.
Tests
uv sync && uv run pytestDeployment
homelab-gitops runs it at https://spotify.benniemosher.dev/mcp (see
apps/spotify-mcp/RUNBOOK.md there). Every push to main builds
ghcr.io/mosher-labs/spotify-mcp:<short sha>, and the cluster pins the
digest.
Contributing
Install the pre-commit hooks once after cloning, and run them before each commit:
pre-commit install
pre-commit run --all-filesCommits follow Conventional Commits, which drives the release workflow.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect Claude to your Intervals.icu watch data for fitness, workout review, and plan writing.
Workout journal Claude and ChatGPT write to: log workouts, get a program, see your progress.
tri-train is a training platform for triathletes that syncs activities from Strava and Garmin and exposes them to Claude through a remote MCP server. Ask Claude how your last block went, why your run pace dropped, or whether you are fresh enough for Sunday's race, and it answers from your real data: activities with laps and grade-adjusted pace, weekly load and the performance management chart (CTL/ATL/TSB), sleep, HRV and resting heart rate, and your race calendar with predictions. Claude can also act: create and adjust planned workouts with structured intervals, push them to your Garmin watch, add races and write notes. Every change is journaled and can be undone. Read and write access are separate OAuth scopes, and the server enforces them on every call. Built and hosted in Switzerland by a triathlete; data stays on our own servers (Swiss revDSG / GDPR).
WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables workout tracking and coaching within Claude conversations, managing exercise configs, logs, streaks, and health metrics via an MCP server with PostgreSQL.-
- AlicenseAqualityCmaintenanceLets Claude read and manage Speediance Gym Monster training data — session history, per-set logs, exercise progress, rowing and heart-rate stats, custom workouts and schedule — plus a coaching memory of goals, injuries and preferences. It runs self-hosted on the user's own machine, talking directly to the user's account and keeping stored data local.297MIT
- AlicenseNot gradedqualityNot gradedmaintenanceLets Claude read recent training history and wellness signals, then design structured workouts and write, edit, or remove them on an intervals.icu calendar so they sync through to a Garmin watch. It brokers all of this through intervals.icu's documented API, so no Garmin credentials are ever shared.MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables Claude to read recent activities and wellness data, then design, create, update, and delete structured workouts that sync through intervals.icu to Garmin Connect and the user's watch.MIT