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 分