Applemusic Mcp

io.github.epheterson由 GitHub 账号 epheterson 发布v0.22.0更新于 Nov 7, 2026

Apple Music MCP server: playlists, library, catalog, playback and Up Next, on Mac/Windows/Linux.

已验证STDIO仅桌面效率与工作流媒体与设计

概览

AI 生成的概览

本地 MCP 服务器,让助手控制 Apple Music:播放列表、资料库、目录搜索、推荐、播放与 Up Next 队列。

可以做什么
  • 管理播放列表与文件夹:列出、创建、添加、复制、移动、重命名、删除
  • 搜索与编辑资料库:浏览、添加或移除条目、评分、收藏、最近播放与最近添加
  • 搜索 Apple Music 目录,查看专辑、歌曲、艺人详情、曲风与推荐建议
  • 浏览发现内容:推荐、排行榜、热门歌曲、常听内容与相似艺人
  • 控制播放:播放歌曲、专辑、播放列表或链接,暂停、切歌、跳转、音量、随机、循环、AirPlay
  • 管理 Up Next 队列,并查看或修改服务器配置与登录状态
适用场景
适合让助手创建或整理 Apple Music 播放列表、查询目录音乐,或通过对话控制播放与队列。Mac 用户配合 Music 资料库体验最完整;Windows 和 Linux 用户可使用目录与网页播放器相关功能。
运行要求
通过 PyPI 包以 uvx 或 pip 在本地运行,需要 Python 3.10+,以及一台 Mac 或 Apple Music 订阅。api 与 web 级别需要登录;在 Mac 上需在 Safari 中允许来自 Apple Events 的 JavaScript。Chrome 网页播放器需要 Google Chrome 与 Playwright Chromium。权限级别(music、api、web 或 full)在客户端配置中设置。
安装前请注意
默认级别为 full,包含在 Music 应用内点击以及访问网页播放器;可调低级别以限制权限。登录会在本地保存凭据,reset 命令可清除它们。相关工具可创建、重命名、删除播放列表并移除资料库条目。批量操作可能触及共享速率限制,除非提供自己的 Apple 开发者令牌。界面点击需要辅助功能权限并保持屏幕解锁。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Applemusic Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

applemusic-mcp

[Release] [License] [macOS] [Python] [Downloads] [MCP]

MCP server for Apple Music. It gives any MCP client (Claude, Cursor, Cline, Windsurf) control of your playlists, library, catalog, discovery, playback, and the Up Next queue. Runs on macOS, Windows, and Linux.

A Mac or an Apple Music subscription is all you need.

"Create a playlist called Road Trip and fill it with upbeat 90s alternative." · "Play my workout playlist on shuffle, and queue up Bohemian Rhapsody next." · "What have I been listening to lately, and what's topping the charts?"

Choose how much it can reach

You decide what this server may touch, in your MCP client's config. The assistant can't change it, and tools that need more than you allowed aren't offered to it at all.

--levelIt can reachGood for
musicOnly the Music app on your Mac. No network, no browser.Your library, playlists, playback, ratings, AirPlay
api+ Apple's music service over the internetSearching and adding from the full catalog, recommendations, Windows and Linux
web+ a Safari or Chrome web playerThe Up Next queue, and playback off the Mac
fullEverything, including clicking inside the Music appEvery feature, nothing to decide
--allow-ui (with any level)+ clicking inside the Music app (macOS Accessibility)Playing catalog songs with no sign-in

Start with music and move up when you want a feature that needs more. Leaving --level off is the same as full for now, as before 0.21.

For a Mac app with a guided setup instead of a terminal command, consider the community fork secure-applemusic-mcp-for-osx.

Features

What each engine can do, and the level that turns it on. ✓ supported, ✗ not possible there, — not applicable.

CapabilityMusic.app (macOS) · musicApple Music API (any OS) · apiWeb player (Safari / Chrome) · web
Catalog search / browse✓✓ (+ tokenless resolve)—
Recommendations / charts / suggestions✗✓—
Library search / browse✓✓—
Genre search✓✗—
Recently played / added✓✓—
Add catalog → library✓✓✓ (in-page POST)
Remove from library✓✓—
Love / dislike✓✓—
1–5 star ratings✓✗✗
Favorites list✓✗✗
Playlist create / add / remove / rename✓✓—
Playlist copy✓✗—
Playlist delete✓✓ (web token)—
Folders: single level + move in/out✓✓—
Folders: nested paths / tree / path✓✗✗
Playback: play song / album / playlist / URL✓—✓
Controls: pause / stop / next / prev / seek✓—✓
Settings: volume / shuffle / repeat✓—✓
now_playing✓—✓
Up Next queue: view / next / last / remove / jump / clear / autoplay✗—✓
Reveal in app✓—✓ (navigates page)
AirPlay device select✓✗✗
Library snapshot / integrity✓✗✗
Works with no Apple account✓✗✗
Cross-platform (Win/Linux)✗✓✓

Music.app's catalog search and catalog play click inside the app, so at a set level they also need --allow-ui. Playback and the queue in a web player need a desktop session: Safari on a Mac (nothing to install) or Google Chrome elsewhere. How the engines are picked and overridden: configuration.

Setup

Requirements: Python 3.10+, plus a Mac or an Apple Music subscription. On a Mac nothing else is needed. The Chrome web player (Windows, Linux, or opt-in on a Mac) needs Google Chrome.

Claude Code, one line:

bash
claude mcp add "Apple Music" -- uvx applemusic-mcp serve --level music

Claude Desktop / Cursor / Cline / Windsurf, install once, then add the config block:

bash
pipx install applemusic-mcp        # or: pip install applemusic-mcpplaywright install chromium        # the Chrome web player: Windows/Linux, or a Mac with the [browser] extra
json
{  "mcpServers": {    "Apple Music": {      "command": "applemusic-mcp",      "args": ["serve", "--level", "music"]    }  }}

Change music to api or web to unlock more; on Windows or Linux start at api, since music needs a Mac. Config file locations, the Chrome web player on a Mac, and source installs: configuration.

Restart your client and try "List my Apple Music playlists" or "Play my favorites." On macOS the local library and playback work immediately. To add catalog music or run on any OS, sign in.

Sign in

Needed for api and web. Your password never touches this tool, and sign-in persists.

bash
applemusic-mcp login            # Mac: reads your signed-in Safari. Windows/Linux: opens Chromeapplemusic-mcp status           # verify

On a Mac, sign in at music.apple.com in Safari first and turn on Safari's Develop → Allow JavaScript from Apple Events once; login tells you exactly what's missing. For bulk work (playlist imports, library migrations), use your own Apple developer token to avoid the shared rate limit. Details, the Chrome and developer-token paths, and which API each write uses: signing in.

Tools

Seven action-based tools keep the MCP context small. Each takes an action and routes to the right engine.

ToolActions
playlistlist, folders, tracks, search, create, add, copy, move, remove, delete, rename, path (playlists and folders)
librarysearch, add, browse, favorites, recently_played, recently_added, rate, remove, snapshot
catalogsearch, resolve, album_tracks, album_details, song_details, artist_details, genres, suggestions
discoverrecommendations, heavy_rotation, charts, top_songs, similar_artists, personal_station, song_station
playbackplay (track / album / playlist / URL), control, now_playing, settings, reveal, airplay
queuelist, set, play_next, play_last, remove, jump, clear, autoplay (Up Next — Safari on macOS, Chrome elsewhere; engine= to pick)
configstatus, signin, logout, reset, set-pref, audit-log, clear-audit-log, list-storefronts

Batching, importing playlists, dry runs, export formats and storefronts: usage patterns.

CLI

bash
applemusic-mcp serve --level music   # run the MCP server (your client calls this)applemusic-mcp login                 # web sign-in (macOS: Safari; Windows/Linux: Chrome)applemusic-mcp login --chrome        # use the Chrome web player on a Macapplemusic-mcp login --dev           # your own Apple developer token (.p8)applemusic-mcp logout                # sign out (switch accounts)applemusic-mcp status                # auth status and permission levelapplemusic-mcp reset --force         # wipe credentials (keeps your .p8 key file)applemusic-mcp reset --all --force   # full uninstall: also removes the .p8, profile, and cache

Good to know

  • Playing catalog songs in Music.app needs --allow-ui, an unlocked screen and Accessibility permission. It clicks Play inside the app. Songs already in your library don't need any of this. Or, at --level web, set mode="safari" to play in Safari instead.
  • Safari playback needs one real click to start. The first time you play in a freshly-opened or reloaded Safari tab, the browser requires a genuine click before it will start audio (a standard autoplay rule — we don't fake it). Click ▶ once in the Apple Music tab, then play/pause/next all work hands-free. If a play command reports the queue is ready but the track sits at 0:00, that's this — give the tab one click.
  • Brand-new playlists take a moment to be addable over the API (cloud propagation). Existing ones are immediate.
  • If catalog actions start failing, re-run applemusic-mcp login. A handful of user playlists silently revert AppleScript edits (known Music.app bug); the server detects and surfaces the rollback.

Star History

[Star History Chart]


License

MIT · Unofficial community project — not affiliated with or endorsed by Apple. Uses your own Apple Music account for personal use; follow Apple's terms.

mcp-name: io.github.epheterson/applemusic-mcp

Credits

FastMCP · Apple MusicKit · Model Context Protocol


Built with ❤️ in California by @epheterson and Claude Code.

来源:README.md,提交 3f21259

工具

7

playlist

Playlists & folders

Playlist and folder operations. Actions: list, folders (macOS — show the folder tree; folders are NOT in `list`), tracks, search, create, add, copy, move, path (macOS), remove, delete, rename. (move/remove/delete/rename work on every OS — via Music.app on macOS, via the web API on Windows/Linux. Only folders/path are macOS-only.) To find a playlist by name, use action='list' with filter='alice' (loose name match) rather than action='search', which searches the TRACKS inside a given playlist and needs a playlist param. action='tracks' returns one page: limit (default 500; 0 = every track) caps the tracks returned, offset pages through longer playlists, and the text header shows 'start-end of total' with a note when more remain; filter (loose match on track name or artist) is applied across the whole playlist, then paged. Folders support slash-separated paths (e.g. 'Summer/Chill/Deep'). For action='add', `track` accepts a song NAME, a catalog song id (a numeric id like '1440857781' — pins the EXACT edition, avoiding name/album version mismatches), or a library id; set auto_add=True to find tracks not already in the user's library — this is required to add catalog songs the user doesn't own. Note: adding a not-yet-owned catalog track to a Music.app-made playlist is two-step — it's added to the library over the API, then attached locally once iCloud syncs it down (usually seconds). If the sync is slow it may return "added to your library — re-run to attach"; just re-run the same add. Rarely, if the sync stalls past ~20s, Music.app briefly flashes to the foreground as a last-resort sync nudge — expected, not a glitch. To SWAP one track for another, use action='add' with `replace`=<the old track to remove>: it adds the new track, confirms it actually persisted, and only THEN removes the old one — so if the add silently reverts (a Music.app bug), the old track is kept rather than lost.

输入参数fullnamealbumlimitquerytrackactionartistexportfilterfolderformat另有 11 个

library

Library

Your library. Actions: search, add, recently_played, recently_added, browse, favorites (macOS), rate, remove, snapshot (macOS). action='search' searches the user's local library only — for catalog (Apple Music's full library) use catalog(action='search'). For search, types can be 'songs' (default), 'artists', 'albums', 'all', or 'genre' — types='genre' lists the user's own tracks whose genre matches query (e.g. query='Rock'); genre filtering is macOS-only (local Music app). Search returns one page: limit (default 25) caps results and offset pages through larger result sets — the text header shows 'start-end of total' so you know when more remain. action='favorites' lists songs marked Favorite (loved) in Music.app. action='add' adds catalog tracks/albums to your library over the API (developer token — generated or harvested — plus a media-user-token from `signin`); there is no UI-automation fallback. In api mode, search/browse read via the API and love/dislike rate via the API; star ratings (rate get/set) need native mode (local Music.app).

输入参数fullalbumlimitquerystarstracktypesactionartistexportformatoffset另有 4 个

discover

Discover

Personalized discovery. Actions: recommendations, heavy_rotation, personal_station, charts, top_songs, similar_artists, song_station.

输入参数fulllimitactionartistexportformatsong_idchart_typestorefront

catalog

Catalog search

Apple Music catalog. Actions: search, resolve, album_tracks, album_details, song_details, artist_details, genres, suggestions. `search` is discovery: one query in, a ranked list out, for browsing. `resolve` is identification: N identifiers in, N verdicts out, writing nothing — use it (never repeated `search`) to turn a track list into catalog IDs. It routes on which identifier you have: - `resolve(isrcs=...)` — exact, 25 per request. ISRCs come with Spotify/Rekordbox/ Plex exports; this is what keeps a large import under Apple's rate limit. - `resolve(tracks=...)` — titles/artists, fuzzy, reporting how confident each match is so a wrong edition gets caught before it's written. One request per track, so it's capped at 25 (raise with `max_tracks`, not `limit`). Either way the IDs come back ready for `playlist(action="add", track=...)` — or use `playlist(action="add", dry_run=True)` to preview against a specific playlist, which also reports what's already in it.

输入参数fulltermalbumisrcslimitquerytypesactionartistexportformatoffset另有 5 个

config

Settings & auth

Config, cache, and authentication. Settings/cache actions: info, set-pref, list-storefronts, audit-log, clear-tracks, clear-exports, clear-audit-log. Auth actions (no terminal needed — just ask): - auth-status (or status): which tokens are active, expiry/auto-renew, what works, next step - signin: open a browser to sign in (any OS) and capture your session - logout: sign out — clears your user token + browser session so you can switch accounts (needs confirm=True) - reset: wipe ALL credentials for a clean slate or to drop a dev token for the web path; keeps your .p8 (needs confirm=True)

输入参数limitvalueactionconfirmdays_oldpreferencestring_value

queue

Up Next queue

The Up Next play queue — the web player's own MusicKit state (the same Up Next you see in the player). It runs on a web engine: Safari on macOS (no Chrome needed) or Chrome elsewhere, picked by your `mode` (auto/safari/chrome) or a per-call `engine=` ('safari' | 'chrome'). Using the queue makes it the active playback engine, so transport controls reach it. Native (Music.app) mode has no Up Next — set mode to safari/chrome or pass engine='safari'. Actions: - `list` — show Up Next (▶ marks the current item; indices are 0-based) - `set` — replace the whole queue in order, one call (`track`=comma/newline-separated ids or names) - `play_next` — insert a track right after the current one (`track`=name or catalog id, optional `artist`) - `play_last` — append a track to the end of Up Next - `remove` — remove the item at `index` (can't remove the currently-playing item — jump away first) - `clear` — empty the queue - `jump` — jump playback to a track: by `track` (name or catalog id — drift-proof, preferred since Up Next auto-advances) or by `index` - `autoplay` — set Autoplay (∞: keep playing similar music when the queue ends); pass `enabled=true` or `enabled=false` (required)

输入参数indextrackactionartistengineenabled

playback

Playback transport

Playback transport. play/control/now_playing/settings run on the engine the `mode` preference resolves to — native Music.app (macOS), the Safari web player (macOS), or the Chrome web player (any OS). Override it for ONE call with `engine=`: 'native', 'safari', 'chrome', 'web' (the web engine — Safari on macOS, Chrome off-mac), or 'auto'. control/now_playing follow whichever engine is actively playing (so after a Safari queue, pause/next reach Safari). Safari needs a signed-in Safari + "Allow JavaScript from Apple Events"; Chrome needs a signed-in Chrome (`applemusic-mcp login`) + a desktop session. reveal and airplay are macOS-only. For the Up Next queue, use the separate `queue` tool. Actions: play, control, now_playing, settings, reveal, airplay.

输入参数urlalbumtrackactionartistenginerepeatrevealvolumecontrolsecondsshuffle另有 5 个

版本历史

5
  1. v0.22.0最新Nov 7, 2026
  2. v0.21.0Oct 23, 2026
  3. v0.20.3Oct 8, 2026
  4. v0.20.2Oct 7, 2026
  5. v0.20.1Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分