Apple Music MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add apple-music -- uv run --directory /absolute/path/to/mcp-apple-music mcp-apple-music
README.md

Full Apple Music integration for Claude

mcp-apple-music šŸŽµ

An MCP (Model Context Protocol) server that gives Claude full access to your Apple Music account — search the catalog, browse your personal library, manage playlists, and explore your listening history and recommendations.

Ask Claude things like:

  • "Based on what I've been listening to lately, recommend 15 songs I don't have yet and add them to a new playlist"
  • "Show me all my playlists and tell me which artists appear most"
  • "Search for albums by Nick Cave and add my three favourites to a playlist called Dark Picks"

Features

Tool Description
search_catalog Search Apple Music catalog (songs, albums, artists, playlists)
search_library Search within your personal library
get_library_songs List songs saved in your library (paginated)
get_library_albums List albums in your library (paginated)
get_library_artists List artists in your library
get_library_playlists List all your playlists with IDs
get_playlist_tracks Get tracks inside a specific playlist
create_playlist Create a new playlist
add_tracks_to_playlist Add songs to a playlist (library or catalog tracks)
get_recently_played See recently played albums/playlists/stations
get_recommendations Get personalised Apple Music picks

Requirements

  • Python 3.10+
  • uv (recommended) or pip
  • An Apple Developer account (free tier is fine) with a MusicKit key
  • An active Apple Music subscription

Setup

1. Create a MusicKit Key

  1. Go to developer.apple.com → Certificates, Identifiers & Profiles
  2. Under Keys, click + to create a new key
  3. Give it any name, enable MusicKit, and click Continue → Register
  4. Download the .p8 file — you can only download it once, keep it safe!
  5. Note your Key ID (e.g. ABC123DEF4) and your Team ID (found under Membership Details)

āš ļø The Key ID is the alphanumeric code shown next to the key name — not the filename of the .p8 file.

2. Clone and install

git clone https://github.com/marioinghilleri/mcp-apple-music
cd mcp-apple-music

# with uv (recommended)
uv sync

# or with pip
pip install -e .

3. Run the one-time setup wizard

# with uv
uv run mcp-apple-music-setup

# or directly
python -m mcp_apple_music.setup

The wizard will ask for your Team ID, Key ID, and the path to your .p8 file. It then opens a browser page where you click "Authorise Apple Music" — this uses Apple's official MusicKit JS to obtain your Music User Token, which is stored securely at ~/.config/mcp-apple-music/config.json (file permissions: 600).

4. Add to Claude Desktop

Open your Claude Desktop config:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "apple-music": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/absolute/path/to/mcp-apple-music",
        "mcp-apple-music"
      ]
    }
  }
}

Restart Claude Desktop — you should see the apple-music tools available in the toolbar.


How it works

Apple Music requires two separate tokens:

  • Developer Token — a JWT you sign locally with your .p8 private key. Valid up to 6 months; the server regenerates it automatically before expiry. Your key never leaves your machine.
  • Music User Token — obtained once via MusicKit JS OAuth in the browser (the setup wizard handles this). Stored locally at ~/.config/mcp-apple-music/config.json.
Your .p8 key  ──►  Developer Token (JWT, auto-renewed)  ─┐
                                                           ā”œā”€ā”€ā–ŗ Apple Music API
Browser OAuth ──►  Music User Token (stored locally)    ā”€ā”˜

āš ļø Playback control (play/pause/skip) is not available via Apple's REST API. It requires native MusicKit frameworks (iOS/macOS app) or MusicKit JS running in a browser context.


Project structure

mcp-apple-music/
ā”œā”€ā”€ src/
│   └── mcp_apple_music/
│       ā”œā”€ā”€ __init__.py
│       ā”œā”€ā”€ auth.py      — Developer Token generation + User Token management
│       ā”œā”€ā”€ client.py    — Async HTTP client for api.music.apple.com
│       ā”œā”€ā”€ server.py    — FastMCP server with all 11 tools
│       └── setup.py     — One-time setup wizard (browser-based OAuth)
ā”œā”€ā”€ config.example.json  — Example config structure (no secrets)
ā”œā”€ā”€ pyproject.toml
└── README.md

Example prompts

Once connected, you can ask Claude:

"What have I been listening to this week? Based on that, find 10 songs
 I don't own yet that I'd probably enjoy and

Tools (11)

search_catalogSearch Apple Music catalog (songs, albums, artists, playlists)
search_librarySearch within your personal library
get_library_songsList songs saved in your library (paginated)
get_library_albumsList albums in your library (paginated)
get_library_artistsList artists in your library
get_library_playlistsList all your playlists with IDs
get_playlist_tracksGet tracks inside a specific playlist
create_playlistCreate a new playlist
add_tracks_to_playlistAdd songs to a playlist (library or catalog tracks)
get_recently_playedSee recently played albums/playlists/stations
get_recommendationsGet personalised Apple Music picks

Configuration

claude_desktop_config.json
{"mcpServers": {"apple-music": {"command": "uv", "args": ["run", "--directory", "/absolute/path/to/mcp-apple-music", "mcp-apple-music"]}}}

Try it

→Based on what I've been listening to lately, recommend 15 songs I don't have yet and add them to a new playlist.
→Show me all my playlists and tell me which artists appear most.
→Search for albums by Nick Cave and add my three favourites to a playlist called Dark Picks.
→What have I been listening to this week? Based on that, find 10 songs I don't own yet that I'd probably enjoy.

Frequently Asked Questions

What are the key features of Apple Music?

Search the Apple Music catalog for songs, albums, artists, and playlists.. Browse and manage your personal Apple Music library.. Create new playlists and add tracks from the catalog or your library.. Retrieve personalized music recommendations based on your listening history.. View recently played albums, playlists, and stations..

What can I use Apple Music for?

Automating the creation of curated playlists based on specific artist searches.. Analyzing personal listening habits and library composition using Claude's reasoning.. Discovering new music by generating recommendations and adding them to your library.. Organizing personal music collections by identifying frequently appearing artists in playlists..

How do I install Apple Music?

Install Apple Music by running: git clone https://github.com/marioinghilleri/mcp-apple-music && cd mcp-apple-music && uv sync

What MCP clients work with Apple Music?

Apple Music works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Apple Music docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare