{"slug": "harmonic-mixing-over-mcp-the-dj-set-builder-spotify-never-shipped", "title": "Harmonic mixing over MCP: the DJ set-builder Spotify never shipped", "summary": "FreqBlog rebuilt Spotify's deprecated Audio Features, Recommendations, and Related Artists endpoints and added a DJ set-builder with harmonic mixing over MCP. The API exposes pairwise transition scoring, next-track ranking, and full setlist ordering around the Camelot wheel, accessible via REST or MCP for LLMs and agents.", "body_md": "When Spotify deprecated Audio Features, Recommendations, and Related Artists for new apps in November 2024, a wave of \"drop-in replacement\" APIs appeared. Most stop at parity: you send a track, you get BPM, key and energy back. Useful — but that's the same lookup Spotify already gave you.\n\nFreqBlog went a layer further. It rebuilt the dead endpoints, then shipped the thing Spotify never had: a **set-builder**. Pairwise transition scoring, next-track ranking, and full setlist ordering around the Camelot wheel. And the whole surface is exposed over an **MCP server**, so an LLM or agent can plan a DJ set by calling tools directly — no glue code between the model and the music theory.\n\nThis is for people building music or AI tooling. I'll show the harmonic-mixing model concretely, then call it two ways: plain REST and MCP.\n\nBefore the interesting part, the boring-but-necessary drop-ins:\n\n`GET /recommendations`\n\n(and the MCP tool `get_recommendations`\n\n) — the replacement for the removed `/v1/recommendations`\n\n, re-ranked by genre affinity so a feature-close cross-genre track can't outrank same-genre picks.`GET /related-artists`\n\n— replaces the killed related-artists endpoint.`GET /v1/audio-features/{id}`\n\nreturns a bare Spotify `AudioFeaturesObject`\n\n; `GET /v1/audio-features?ids=`\n\nreturns the `{\"audio_features\":[...]}`\n\narray envelope. Both mirror Spotify's own shapes, so porting existing code is a small diff.The native lookup is flatter and richer. `GET /lookup`\n\nresolves a track by name, ISRC, MusicBrainz ID or Spotify ID and returns **one flat object** — over 40 fields, no nesting:\n\n```\ncurl -s \"https://api.freqblog.com/lookup?track=Strobe&artist=deadmau5&wait=10\" \\\n  -H \"X-Api-Key: $FREQBLOG_KEY\"\n// shape (values illustrative) — every feature is top-level, no \"audio_features\" wrapper\n{\n  \"track_name\": \"Strobe\",\n  \"artist_name\": \"deadmau5\",\n  \"bpm\": 128.0,\n  \"key\": \"B\",\n  \"camelot\": \"1A\",\n  \"mode\": \"minor\",\n  \"energy\": 0.61,\n  \"danceability\": 0.72,\n  \"valence\": 0.35,\n  \"genre\": \"progressive house\"\n}\n```\n\nTwo things worth knowing: `bpm`\n\nand `key`\n\nare always present and non-null, and `?wait=10`\n\nopts into a bounded synchronous mode — up to 25 seconds — that returns the analysed track inline as a `200`\n\ninstead of the default `202 + Retry-After`\n\nwhen a track isn't cached yet.\n\nEvery musical key maps to a clock position on the **Camelot wheel**: a number `1`\n\n–`12`\n\nplus a letter (`A`\n\n= minor, `B`\n\n= major). Two tracks mix without a key clash when they sit next to each other on the wheel: the **same** key, the **relative** major/minor (same number, flipped letter), or the **adjacent** `+1`\n\n/`-1`\n\nneighbours. Jump `+7`\n\nand you get the classic energy-boost mix.\n\n`find_compatible_keys`\n\nis pure theory — no catalog hit, **zero quota**:\n\n```\n// find_compatible_keys(camelot=\"8A\", extended=true)\n{\n  \"camelot\": \"8A\",\n  \"compatible\": [\n    { \"camelot\": \"8A\", \"relation\": \"same\" },\n    { \"camelot\": \"8B\", \"relation\": \"relative\" },      // minor <-> major\n    { \"camelot\": \"7A\", \"relation\": \"adjacent_down\" }, // -1\n    { \"camelot\": \"9A\", \"relation\": \"adjacent_up\" },   // +1\n    { \"camelot\": \"3A\", \"relation\": \"energy_boost\" },  // +7  (extended=true)\n    { \"camelot\": \"1A\", \"relation\": \"energy_drop\" }    // -7  (extended=true)\n  ]\n}\n```\n\nKnowing which keys *could* mix is table stakes. `score_transition`\n\nrates how well one real track mixes into another, `0`\n\n–`100`\n\n, blending Camelot key compatibility, octave-aware BPM proximity (half/double-time counts as a match), and energy smoothness — and it hands back a human reason:\n\n```\n// score_transition(from_track_id=\"apple_ad1829eeccb70f9a\",\n//                  to_track_id=\"apple_7c1120fbe0\")  — costs 1 quota\n{\n  \"score\": 91,\n  \"components\": { \"harmonic\": 95, \"tempo\": 92, \"energy\": 86 },\n  \"reason\": \"8A->9A +1 adjacent, 126->128 BPM (+2.0), energy +0.04\"\n}\n```\n\nThere's no raw key/BPM endpoint anywhere that gives you *that* — the pairwise judgement is the product.\n\n`suggest_next_track`\n\ntakes the track that's playing and returns the top-N catalog tracks to play next, each with the same score, components and reason (e.g. `\"11B->11B same key, 118->117 BPM (-0.29), energy +0.12\"`\n\n). It's genre-aware by default, so an off-genre track that only *coincidentally* shares your key/BPM sinks to the bottom.\n\n`build_setlist`\n\norders an entire crate (2–100 tracks) into a beat-matched set that follows an energy `arc`\n\n— `peak_time`\n\n, `warmup`\n\n, `cooldown`\n\n, or `flat`\n\n— keeping every consecutive transition harmonically and tempo-smooth. It returns an overall `flow_score`\n\n, the tracks in play order, and the per-step transitions.\n\nHere's where it stops being an API and starts being a capability you hand to a model. Point any MCP client at:\n\n```\nhttps://mcp.freqblog.com/mcp\n```\n\nThat exposes twelve tools — `search_catalog`\n\n, `get_audio_features`\n\n, `get_audio_features_batch`\n\n, `find_tracks_by_bpm`\n\n, `find_tracks_by_key`\n\n, `find_compatible_keys`\n\n, `get_recommendations`\n\n, `get_related_artists`\n\n, `score_transition`\n\n, `suggest_next_track`\n\n, `build_setlist`\n\n, `tag_track`\n\n. The agent orchestrates them itself. A single prompt like *\"build me a 90-minute peak-time set from these ten tracks\"* becomes:\n\n`search_catalog`\n\non each fuzzy name → concrete `itunes_track_id`\n\ns`build_setlist(track_ids=[...], arc=\"peak_time\")`\n\n→ ordered set + `flow_score`\n\n`itunes_track_id`\n\ns to `GET /export/rekordbox`\n\n(also `traktor`\n\n, `m3u`\n\n, `cuesheet`\n\n, `csv`\n\n) and drop the crate straight into your DJ softwareNo orchestration code on your side — the tool descriptions carry enough for the model to chain them. The set-builder tools cost a little more quota than a plain lookup (`score_transition`\n\n1, `get_recommendations`\n\n2, `suggest_next_track`\n\n3, `build_setlist`\n\n5), because each one is doing real combinatorial work.\n\nAuth is an `X-Api-Key`\n\nheader (a `?key=`\n\nquery fallback exists for browser and email links). Everything above is also available as plain REST — `GET /transition`\n\n, `GET /next-track`\n\n, `POST /setlist`\n\n, `GET /similar?track_id=...`\n\n— if you'd rather not run an MCP client. It's on RapidAPI too. Pricing starts at **£0.17/1k**, and the free tier is 1,000 requests/month, which is plenty to prototype a set planner.\n\n`itunes_track_id`\n\ns, so a track has to resolve first (`search_catalog`\n\n/ `/lookup`\n\n). Coverage is deep but not universal — niche or regional catalogs have holes.`/analyze`\n\nand `/identify`\n\n— not the audio itself.Grab a free key and the OpenAPI docs at ** api.freqblog.com/docs**, or read more about the API on", "url": "https://wpnews.pro/news/harmonic-mixing-over-mcp-the-dj-set-builder-spotify-never-shipped", "canonical_source": "https://dev.to/birrings/harmonic-mixing-over-mcp-the-dj-set-builder-spotify-never-shipped-2dgo", "published_at": "2026-07-14 13:15:57+00:00", "updated_at": "2026-07-14 13:32:34.465100+00:00", "lang": "en", "topics": ["artificial-intelligence", "developer-tools", "ai-tools"], "entities": ["FreqBlog", "Spotify", "Camelot"], "alternates": {"html": "https://wpnews.pro/news/harmonic-mixing-over-mcp-the-dj-set-builder-spotify-never-shipped", "markdown": "https://wpnews.pro/news/harmonic-mixing-over-mcp-the-dj-set-builder-spotify-never-shipped.md", "text": "https://wpnews.pro/news/harmonic-mixing-over-mcp-the-dj-set-builder-spotify-never-shipped.txt", "jsonld": "https://wpnews.pro/news/harmonic-mixing-over-mcp-the-dj-set-builder-spotify-never-shipped.jsonld"}}