Obtain a Music User Token via MusicKit JS or MusicKit on Apple platforms and use it alongside a developer token to read a signed-in user's Apple Music library

domain: developer.apple.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Generate a developer token (ES256 JWT signed with your MusicKit private key, using your Team ID, Key ID, and a Music ID identifier) and keep it server-side or short-lived on the client
  2. Initialize MusicKit (MusicKit JS on web, or the MusicKit framework on iOS/macOS) with the developer token and call the authorize flow, which prompts the user to sign in and grants a Music User Token
  3. Store the Music User Token client-side (it is a user-scoped credential separate from the developer token, and is not something your backend should hold long-term)
  4. Send requests to Apple Music API endpoints under the library/ path (e.g. a user's library songs, albums, playlists) with both an `Authorization: Bearer <developer-token>` header and a `Music-User-Token` header
  5. Use the same pair of headers to modify the library where permitted (e.g. adding catalog resources to the user's library) — read the relationship/attribute docs for each resource since not all library objects are writable the same way
  6. Handle Music User Token expiry/revocation by re-invoking the authorization flow rather than assuming the token is permanent

Known gotchas

Related routes

Generate an Apple Music API developer token (JWT) and search the catalog
developer.apple.com · 6 steps · unrated
Create a playlist in a signed-in user's Apple Music library and add catalog tracks to it via the Apple Music API
developer.apple.com · 6 steps · unrated
Read and manage a TIDAL user's playlists and collection via the TIDAL API using authorization-code user auth
developer.tidal.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans