Featured

Deploy OpenClaw in 60 seconds β€” 20% off logoDeploy OpenClaw in 60 seconds β€” 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger β†’
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger β†’
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free β†’
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now β†’
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data β€” no proxies, no parsers, no maintenance.

Start building free β†’
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it β€” secured from day one.

Get it set up for you β†’
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free β†’
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here β†’
mcp-apple-music logo

mcp-apple-music

Cifero74/mcp-apple-music
32 starsv1.0.1STDIORegistry activeMITUpdated 2026-05-24Community

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

claude mcp add mcp-apple-music -- uvx mcp-apple-music-server

Summary

mcp-apple-music MCP server](https://glama.ai/mcp/servers/@Cifero74/mcp-apple-music/badges/score.svg)](https://glama.ai/mcp/servers/@Cifero74/mcp-apple-music) 🐍 🏠 🍎 - Full Apple Music integration: search catalog, browse personal library, manage...

Connect from your MCP client

One-click install

Add this server to your editor with a single click. Fill in any required credentials afterward.

Claude Code

Run this once and Claude Code registers the server for you:

claude mcp add mcp-apple-music -- uvx mcp-apple-music-server

Claude Desktop

Add this to claude_desktop_config.json under Settings β†’ Developer β†’ Edit Config:

{
  "mcpServers": {
    "mcp-apple-music": {
      "command": "uvx",
      "args": [
        "mcp-apple-music-server"
      ],
      "env": {
        "APPLE_TEAM_ID": "<APPLE_TEAM_ID>",
        "APPLE_KEY_ID": "<APPLE_KEY_ID>",
        "APPLE_PRIVATE_KEY": "<APPLE_PRIVATE_KEY>",
        "APPLE_MUSIC_USER_TOKEN": "<APPLE_MUSIC_USER_TOKEN>",
        "APPLE_STOREFRONT": "<APPLE_STOREFRONT>"
      }
    }
  }
}

Cursor

Add this to .cursor/mcp.json in your project (or ~/.cursor/mcp.json for all projects):

{
  "mcpServers": {
    "mcp-apple-music": {
      "command": "uvx",
      "args": [
        "mcp-apple-music-server"
      ],
      "env": {
        "APPLE_TEAM_ID": "<APPLE_TEAM_ID>",
        "APPLE_KEY_ID": "<APPLE_KEY_ID>",
        "APPLE_PRIVATE_KEY": "<APPLE_PRIVATE_KEY>",
        "APPLE_MUSIC_USER_TOKEN": "<APPLE_MUSIC_USER_TOKEN>",
        "APPLE_STOREFRONT": "<APPLE_STOREFRONT>"
      }
    }
  }
}

Cline and other MCP clients

Most MCP clients accept the standard mcpServers JSON block:

{
  "mcpServers": {
    "mcp-apple-music": {
      "command": "uvx",
      "args": [
        "mcp-apple-music-server"
      ],
      "env": {
        "APPLE_TEAM_ID": "<APPLE_TEAM_ID>",
        "APPLE_KEY_ID": "<APPLE_KEY_ID>",
        "APPLE_PRIVATE_KEY": "<APPLE_PRIVATE_KEY>",
        "APPLE_MUSIC_USER_TOKEN": "<APPLE_MUSIC_USER_TOKEN>",
        "APPLE_STOREFRONT": "<APPLE_STOREFRONT>"
      }
    }
  }
}

Codex CLI

Register the server with OpenAI's Codex CLI β€” run this once, or add the equivalent block to ~/.codex/config.toml:

codex mcp add mcp-apple-music --env APPLE_TEAM_ID=<APPLE_TEAM_ID> --env APPLE_KEY_ID=<APPLE_KEY_ID> --env APPLE_PRIVATE_KEY=<APPLE_PRIVATE_KEY> --env APPLE_MUSIC_USER_TOKEN=<APPLE_MUSIC_USER_TOKEN> --env APPLE_STOREFRONT=<APPLE_STOREFRONT> -- uvx mcp-apple-music-server

# or add to ~/.codex/config.toml:
[mcp_servers.mcp-apple-music]
command = "uvx"
args = ["mcp-apple-music-server"]
[mcp_servers.mcp-apple-music.env]
APPLE_TEAM_ID = "<APPLE_TEAM_ID>"
APPLE_KEY_ID = "<APPLE_KEY_ID>"
APPLE_PRIVATE_KEY = "<APPLE_PRIVATE_KEY>"
APPLE_MUSIC_USER_TOKEN = "<APPLE_MUSIC_USER_TOKEN>"
APPLE_STOREFRONT = "<APPLE_STOREFRONT>"

OpenClaw

OpenClaw reads MCP servers from the mcp.servers section of ~/.openclaw/openclaw.json (managed via `openclaw mcp add` or the mcporter skill):

{
  "mcp": {
    "servers": {
      "mcp-apple-music": {
        "command": "uvx",
        "args": [
          "mcp-apple-music-server"
        ],
        "env": {
          "APPLE_TEAM_ID": "<APPLE_TEAM_ID>",
          "APPLE_KEY_ID": "<APPLE_KEY_ID>",
          "APPLE_PRIVATE_KEY": "<APPLE_PRIVATE_KEY>",
          "APPLE_MUSIC_USER_TOKEN": "<APPLE_MUSIC_USER_TOKEN>",
          "APPLE_STOREFRONT": "<APPLE_STOREFRONT>"
        }
      }
    }
  }
}

Replace the <PLACEHOLDER> values with your own credentials β€” see the configuration table below.

Configuration

mcp-apple-music reads the following environment variables:

VariableRequired
APPLE_TEAM_IDRequired
APPLE_KEY_IDRequired
APPLE_PRIVATE_KEYRequired
APPLE_MUSIC_USER_TOKENRequired
APPLE_STOREFRONTOptional

README.md

mcp-apple-music 🎡

mcp-name: io.github.Cifero74/mcp-apple-music

![Python 3.10+](https://www.python.org/downloads/) ![License: MIT](LICENSE) ![MCP](https://modelcontextprotocol.io)

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. For playback control, check out chrome-relay β€” a companion CLI that lets an MCP server drive a music.apple.com tab already open in Chrome, enabling play/pause/skip without shipping a MusicKit JS shim.

---

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 create a playlist with them."

"Search for all albums by Joni Mitchell and tell me which ones
 I already have in my library."

"List my playlists, pick the one that looks most like a workout mix,
 and add 5 high-energy songs from the catalog to it."

"Create a playlist called 'Rainy Sunday' with the 10 most mellow tracks
 you can find from my library."

---

Authors

Built by Cifero74 and Claude (Anthropic) as part of a personal MCP ecosystem for Claude Desktop.

This project was conceived, designed, debugged, and shipped entirely through a collaborative conversation between Mario and Claude β€” from API research and auth flow design, through the setup wizard, to live testing with a real Apple Music library.

Contributions, issues and PRs are welcome!

---

License

MIT β€” use it, fork it, build on it.

See related servers & alternatives β†’

Related MCP servers

Browse all β†’

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.