Apple Music MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/popand/AppleMusicMCP
cd AppleMusicMCP
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "APPLE_MUSIC_TEAM_ID=${APPLE_MUSIC_TEAM_ID}" -e "APPLE_MUSIC_KEY_ID=${APPLE_MUSIC_KEY_ID}" -e "APPLE_MUSIC_PRIVATE_KEY_PATH=${APPLE_MUSIC_PRIVATE_KEY_PATH}" apple-music-cb69 -- node "<FULL_PATH_TO_APPLEMUSICMCP>/dist/index.js"

Replace <FULL_PATH_TO_APPLEMUSICMCP>/dist/index.js with the actual folder you prepared in step 1.

Required:APPLE_MUSIC_TEAM_IDAPPLE_MUSIC_KEY_IDAPPLE_MUSIC_PRIVATE_KEY_PATH+ 3 optional
README.md

Integrates Apple Music with MCP clients to search and manage your library.

Apple Music MCP Server

An MCP (Model Context Protocol) server that integrates with Apple Music, allowing Claude and other MCP clients to search the catalog, manage playlists, and access your library.

Claude creating a Deep Focus Coding playlist on Apple Music

Features

  • Search the Apple Music catalog (songs, albums, artists, playlists)
  • List your playlists and browse their tracks
  • Create new playlists with optional initial tracks
  • Add tracks to existing playlists
  • Browse your library songs
  • View recently played tracks
  • Get personalized recommendations

Prerequisites

Apple Developer Setup

1. Create a MusicKit Identifier

  1. Go to Apple Developer > Certificates, Identifiers & Profiles
  2. Click + to register a new identifier
  3. Select MusicKit IDs (or Media IDs)
  4. Enter a description (e.g., "MCP Server") and an identifier (e.g., com.yourname.musicmcp)
  5. Click Continue and Register

2. Create a MusicKit Private Key

  1. Go to Apple Developer > Keys
  2. Click + to create a new key
  3. Name it (e.g., "MusicKit MCP Key")
  4. Check MusicKit and configure it with your MusicKit identifier
  5. Click Continue and Register
  6. Download the .p8 file (you can only download it once!)
  7. Note the Key ID shown on the page

3. Find Your Team ID

Your Team ID is visible at the top right of the Apple Developer portal, or under Membership Details.

Installation

git clone <this-repo>
cd AppleMusicMCP
npm install
npm run build

Configuration

The server is configured via environment variables:

Variable Required Description
APPLE_MUSIC_TEAM_ID Yes Your Apple Developer Team ID
APPLE_MUSIC_KEY_ID Yes Your MusicKit Key ID (from the key you created)
APPLE_MUSIC_PRIVATE_KEY_PATH Yes Absolute path to your .p8 private key file
APPLE_MUSIC_STOREFRONT No ISO 3166 alpha-2 country code (default: us)
APPLE_MUSIC_CONFIG_DIR No Config directory path (default: ~/.apple-music-mcp/)
APPLE_MUSIC_AUTH_PORT No Port for auth server (default: 7829)

Authorization

Before using library features (playlists, library songs, recommendations), you need to authorize with your Apple Music account:

APPLE_MUSIC_TEAM_ID=YOUR_TEAM_ID \
APPLE_MUSIC_KEY_ID=YOUR_KEY_ID \
APPLE_MUSIC_PRIVATE_KEY_PATH=/path/to/AuthKey.p8 \
node dist/index.js auth

This will:

  1. Open your browser to a local authorization page
  2. You click "Authorize with Apple Music" and sign in with your Apple ID
  3. The Music User Token is captured and stored in ~/.apple-music-mcp/tokens.json
  4. The token is valid for approximately 6 months

Note: Catalog search works without authorization. Only library/personal features require it.

Adding to Claude Desktop

Add this to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "apple-music": {
      "command": "node",
      "args": ["/absolute/path/to/AppleMusicMCP/dist/index.js"],
      "env": {
        "APPLE_MUSIC_TEAM_ID": "YOUR_TEAM_ID",
        "APPLE_MUSIC_KEY_ID": "YOUR_KEY_ID",
        "APPLE_MUSIC_PRIVATE_KEY_PATH": "/absolute/path/to/AuthKey_XXXXXXXX.p8",
        "APPLE_MUSIC_STOREFRONT": "us"
      }
    }
  }
}

Adding to Claude Code

Add to your Claude Code settings (.claude/settings.json or global settings):

{
  "mcpServers": {
    "apple-music": {
      "command": "node",
      "args": ["/absolute/path/to/AppleMusicMCP/dist/index.js"],
      "env": {
        "APPLE_MUSIC_TEAM_ID": "YOUR_TEAM_ID",
        "APPLE_MUSIC_KEY_ID": "YOUR_KEY_ID",
        "APPLE_MUSIC_PRIVATE_KEY_PATH": "/absolute/path/to/AuthKey_XXXXXXXX.p8"
      }
    }
  }
}

Available Tools

`search_music`

Search the Apple Music catalog.

  • query (string, required): Search term
  • types (array, optional): ["songs", "albums", "artists", "playlists"] (default: songs, albums, artists)
  • limit (number, optional): 1-25 results per type (default: 10)
  • storefront (string, optional): Country code

`get_user_playlists`

List your playlists.

  • limit (number, optional): 1-100 (default: 25)
  • offset (number, optional): Pagination offset

`get_playlist_tracks`

Get tracks from a playlist.

  • playlist_id (string, required): Playlist ID
  • limit (number, optional): 1-100 (default: 100)
  • offset (number, optional): Pagination offset

`create_playlist`

Create a new playlist.

  • name (string, required): Playlist name
  • description (string, optional): Playlist description
  • track_ids (string[], optional): Song IDs to a

Tools (4)

search_musicSearch the Apple Music catalog for songs, albums, artists, or playlists.
get_user_playlistsList your personal Apple Music playlists.
get_playlist_tracksRetrieve the list of tracks from a specific Apple Music playlist.
create_playlistCreate a new playlist in your Apple Music library.

Environment Variables

APPLE_MUSIC_TEAM_IDrequiredYour Apple Developer Team ID
APPLE_MUSIC_KEY_IDrequiredYour MusicKit Key ID
APPLE_MUSIC_PRIVATE_KEY_PATHrequiredAbsolute path to your .p8 private key file
APPLE_MUSIC_STOREFRONTISO 3166 alpha-2 country code
APPLE_MUSIC_CONFIG_DIRConfig directory path
APPLE_MUSIC_AUTH_PORTPort for auth server

Configuration

claude_desktop_config.json
{"mcpServers": {"apple-music": {"command": "node", "args": ["/absolute/path/to/AppleMusicMCP/dist/index.js"], "env": {"APPLE_MUSIC_TEAM_ID": "YOUR_TEAM_ID", "APPLE_MUSIC_KEY_ID": "YOUR_KEY_ID", "APPLE_MUSIC_PRIVATE_KEY_PATH": "/absolute/path/to/AuthKey_XXXXXXXX.p8", "APPLE_MUSIC_STOREFRONT": "us"}}}}

Try it

Search for the latest album by Radiohead and list the tracks.
Create a new playlist called 'Deep Focus Coding' and add my favorite ambient tracks to it.
Show me my current playlists and tell me which one has the most songs.
Find some personalized music recommendations for me based on my library.

Frequently Asked Questions

What are the key features of Apple Music MCP Server?

Search the Apple Music catalog for songs, albums, artists, and playlists. List and browse tracks within personal playlists. Create new playlists with optional initial tracks. Access library songs and view recently played tracks. Retrieve personalized music recommendations.

What can I use Apple Music MCP Server for?

Automating the creation of themed playlists for coding or study sessions. Quickly searching for specific tracks or artists without leaving the Claude interface. Managing and organizing large music libraries through natural language commands. Generating personalized music discovery lists based on existing library preferences.

How do I install Apple Music MCP Server?

Install Apple Music MCP Server by running: git clone https://github.com/popand/AppleMusicMCP && cd AppleMusicMCP && npm install && npm run build

What MCP clients work with Apple Music MCP Server?

Apple Music MCP Server 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 MCP Server 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