Mcp Apple Music

io.github.Cifero74由 GitHub 帳號 Cifero74 發布v1.3.0更新於 Oct 24, 2026

Apple Music MCP server — search catalog, manage playlists, and access your library via Claude.

已驗證STDIO僅桌面效率與工作流媒體與設計

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理透過 Apple MusicKit API 搜尋 Apple Music 目錄、瀏覽個人資料庫,並建立或編輯播放清單。

可以做什麼
  • 在 Apple Music 目錄與個人資料庫中搜尋歌曲、專輯、演出者和播放清單
  • 列出資料庫中的歌曲、專輯、演出者和播放清單,並讀取某個播放清單內的曲目
  • 建立播放清單,並將資料庫或目錄中的曲目加入其中
  • 把目錄中的歌曲、專輯和播放清單儲存到資料庫
  • 查看最近播放內容與個人化推薦
  • 將目錄歌曲標記或取消標記為喜愛,並查詢喜愛狀態
適用情境
適合想讓助理直接操作自己 Apple Music 帳號的情況:依收聽紀錄或推薦建立播放清單、核對已擁有的專輯或演出者,或搜尋目錄並把結果存進資料庫。
執行需求
以 Python 套件形式在桌面本機執行(Python 3.10+,可用 uv 或 pip)。需要付費的 Apple Developer Program 會員資格以建立 MusicKit 金鑰、有效的 Apple Music 訂閱,並需執行一次瀏覽器授權精靈。必要設定:APPLE_KEY_ID、APPLE_TEAM_ID、APPLE_PRIVATE_KEY、APPLE_MUSIC_USER_TOKEN;選用 APPLE_STOREFRONT。需能連線至 Apple 的 API。
安裝前請注意
需要 MusicKit 私密金鑰(APPLE_PRIVATE_KEY)與 Music User Token(APPLE_MUSIC_USER_TOKEN),兩者存放在本機設定檔中;金鑰只能下載一次,請妥善保管。Apple Developer Program 每年費用 99 美元。相關工具會寫入帳號:建立播放清單、加入曲目、將內容存進資料庫以及變更喜愛狀態。不支援播放控制。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Apple Music,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-apple-music 🎵

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

[Python 3.10+] [License: MIT] [MCP]

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

ToolDescription
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 one of your playlists or an Apple Music catalog playlist (pl. IDs)
create_playlistCreate a new playlist
add_tracks_to_playlistAdd songs to a playlist (library or catalog tracks)
add_to_librarySave catalog songs, albums or playlists into your library
get_recently_playedSee recently played albums/playlists/stations
get_recommendationsGet personalised Apple Music picks
favorite_songMark a catalog song as favorite (star)
unfavorite_songRemove a catalog song from favorites
get_song_favorite_statusCheck which catalog songs are favorited

Requirements

  • Python 3.10+
  • uv (recommended) or pip
  • A paid Apple Developer Program membership (99 USD/year) to create a MusicKit key. The free Apple Developer account can't create MusicKit keys.
  • 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

bash
git clone https://github.com/Cifero74/mcp-apple-musiccd mcp-apple-music
# with uv (recommended)uv sync
# or with pippip install -e .

3. Run the one-time setup wizard

bash
# with uvuv run mcp-apple-music-setup
# or directlypython -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

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 APIBrowser 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 14 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.

來源:README.md,提交 40183d5

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:該軟體包類型無法在沙箱中執行。

版本歷史

3
  1. v1.3.0最新Oct 22, 2026
  2. v1.1.0Sep 30, 2026
  3. v1.0.1Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分