@apple-music-agent/mcp-server
Provides tools for interacting with the Apple Music catalog and user library through the Apple Music Web Player API, including catalog search, playlist and library reading, playlist creation, adding/removing tracks, favorites/ratings, and cross-platform playlist import.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
🍎 Apple Music Agent
English | 简体中文
Zero-developer-account open-source Apple Music AI assistant — an MCP Server, Agent Skill, and local-only Manifest V3 Chrome Extension powered by the Apple Music Web Player API (amp-api.music.apple.com).
Control your Apple Music catalog, library, playlists, favorites, cross-platform migrations, and AI recommendations in plain natural language from Claude Desktop, Claude Code, Cursor, Antigravity, or any MCP-compatible AI agent — without paying $99/year for an Apple Developer account.
Disclaimer: This project is strictly for personal learning and self-hosted productivity. It communicates with Apple Music's unofficial Web Player API (amp-api.music.apple.com), is not affiliated with or endorsed by Apple Inc., and may break if Apple changes internal endpoints. All credentials remain 100% on your local machine. Do NOT publish the bundled token-capture Chrome extension to the Chrome Web Store or any public extension marketplace.
30-Second Quickstart
Requires Node.js >= 20 and an Apple Music subscription.
# Claude Code — one line, no clone needed
claude mcp add apple-music -- npx -y @apple-music-agent/mcp-serverClaude Desktop / Cursor / Antigravity — add to your MCP config and restart the client:
{
"mcpServers": {
"apple-music": {
"command": "npx",
"args": ["-y", "@apple-music-agent/mcp-server"]
}
}
}Then sign in at music.apple.com and load the Chrome extension (see Auth setup below) — it syncs your session tokens automatically. That's it: try "List my Apple Music playlists" or "Move my NetEase playlist 'Running' into Apple Music".
Install from source instead?
git clone https://github.com/zuoherry66-boop/apple-music-agent.git && cd apple-music-agent && npm install && npm run build, then point your MCP config atpackages/mcp-server/dist/index.js(see Development).
Related MCP server: applemusic-mcp
Demo
Demo walkthrough (video coming soon): in one sentence, ask the agent to migrate a NetEase Cloud Music playlist into Apple Music — it parses the playlist, matches each track against Apple's catalog (ISRC-first), and creates the playlist with a match report. Then ask it to delete a song: instead of deleting immediately, it shows a dry-run preview and waits for your explicit confirmation before anything is removed.
Features
Feature | What it does |
Zero Developer Account Cost | Reuses your own local |
14 Strict-Typed MCP Tools | Catalog search (keyword + ISRC), library & playlist reading, recently played history, playlist creation, library/playlist additions, Favorites/Ratings, cross-platform import, safe deletion |
Mandatory Anti-Accident Protection |
|
Smart Cross-Platform Migration | Built-in CSV / JSON / plain-text parser (Spotify, NetEase Cloud Music, QQ Music), marketing-noise title cleaner, version detector (Studio Original vs. Live / Remix / Cover / Instrumental), ISRC-first scorer, deduplicator |
Privacy-First MV3 Extension | Captures headers locally via read-only |
Ready-to-Use Agent Skill |
|
Comparison
Honest comparison with the closest alternative, epheterson/applemusic-mcp (Python, 140 stars). Pick whichever fits your setup — the table states what each project actually does.
apple-music-agent (this project) | epheterson/applemusic-mcp | |
Install |
|
|
Apple Developer account | Never needed (web session tokens) | Not needed on macOS; needed for API mode on Windows/Linux |
Playback control | ✗ Not possible via the | ✓ Via Mac Music.app or web player |
Engines | 1 (Apple Music web API, any OS) | 4 (Music.app, API, Safari/Chrome web player, full) |
Token sync | ✓ Chrome extension auto-syncs on every | Manual |
Cross-platform migration | ✓ Built-in parsers for Spotify / NetEase / QQ Music | Playlist import only, no built-in source parsers |
Delete safety | ✓ Mandatory two-step confirmation + dry-run preview | No equivalent confirmation flow |
Agent Skill | ✓ Bundled | ✗ |
Language | TypeScript | Python |
Architecture
flowchart LR
EXT["MV3 Chrome Extension\n(Local Header Capture)"] -.->|"Copy / Download / 127.0.0.1 Sync"| AUTH["~/.config/apple-music-agent/auth.json"]
SKILL["Agent Skill\n(SKILL.md)"] --> AGENT["AI Agent\n(Claude / Cursor / Antigravity)"]
AGENT <-->|"MCP (stdio)"| MCP["@apple-music-agent/mcp-server"]
MCP --> CORE["@apple-music-agent/core\n(Client / Matching / Safety)"]
AUTH --> CORE
CORE <-->|"HTTPS"| AMP["amp-api.music.apple.com"]See docs/architecture.md for sequence diagrams and verified amp-api endpoint mappings.
Auth & Chrome Extension
While running, the MCP server listens on 127.0.0.1:48123 (strictly allowing only chrome-extension:// origins with a custom preflight header; set APPLE_MUSIC_DISABLE_LOCAL_SYNC=1 to disable) and reloads ~/.config/apple-music-agent/auth.json dynamically on every request.
Load packages/chrome-extension/dist as an unpacked extension in chrome://extensions (Developer mode ON):
Open https://music.apple.com and sign in.
Browse your library briefly — the extension captures your headers and silently auto-syncs them to
~/.config/apple-music-agent/auth.json(badge turns greenOK). No terminal commands or pairing codes required!Whenever tokens expire in the future, simply refresh
https://music.apple.comand they refresh automatically.
(Prefer manual export? Click Download auth.json or Copy .env in the popup, or follow docs/auth-setup.md.)
Install the Agent Skill (Optional but Recommended)
Copy or symlink skills/apple-music-manager into your agent's skills directory (e.g., ~/.agents/skills/apple-music-manager or .claude/skills/apple-music-manager) so your AI automatically follows the migration, recommendation, and safe-deletion SOPs.
Available MCP Tools
Tool | Description |
| Verify credentials and detect active Apple Music storefront ( |
| Search catalog by keyword or batch ISRCs ( |
| List user's library playlists (paginated) |
| Read playlist tracks (paginated) with optional duplicate analysis |
| List user's library songs (paginated) |
| Fetch recently played tracks for taste profiling |
| Create a new library playlist with optional initial tracks |
| Add catalog songs, albums, or playlists to library |
| Append songs to an editable library playlist |
| Mark Favorite ( |
| Remove tracks from playlist (Two-Step Confirmation required) |
| Delete songs from library (Two-Step Confirmation required) |
| Parse CSV/JSON/text playlist, clean titles, and classify matches into 3 buckets |
| Create or append confirmed catalog tracks with deduplication |
Development & Testing
npm run lint # ESLint across all packages
npm run typecheck # TypeScript strict check
npm run build # Build core, mcp-server, and chrome-extension
npm test # Vitest unit tests (cleaner, scorer, dedup, parsers, confirmation, mocked API)Troubleshooting
AUTH_EXPIRED(HTTP 401 / 403): Apple Music web tokens expire periodically. Reopenhttps://music.apple.com, ensure you are signed in, and re-sync with the Chrome extension. No MCP restart is needed.RATE_LIMITED(HTTP 429): The client automatically retries with exponential backoff (respectingRetry-After). For very large playlists (200+ songs), split imports into batches of ~100 tracks.Track marked
unavailable_in_storefront: The song exists in Apple's catalog metadata, but lacksplayParamsin your account's storefront due to regional licensing.Deleting a song from library removed it from playlists: This is standard Apple Music behavior.
remove_from_libraryalways warns about this during dry-run preview.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.
Automate 1,000+ services from any MCP-compatible AI agent: build Applets, run actions and queries.
Audio, music, video, image, PDF, speech, text and web-check tools callable from any MCP client.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceEnables MCP clients to search the catalog, manage playlists, folders, and library items, and control playback, ratings, and the Up Next queue across macOS, Windows, and Linux. It selects among native Music.app, Safari, Chrome, and web API engines so an assistant can drive Apple Music with or without a subscription.-
- FlicenseNot gradedqualityAmaintenanceEnables MCP clients to search and browse the Apple Music catalog, manage library items, ratings, favorites and playlists with nested folders, and control playback, volume, shuffle, repeat and the Up Next queue. Runs via native Music.app, Safari, Chrome, or the Apple Music web API, so it works on macOS, Windows and Linux with just a Mac or an Apple Music subscription.-
- FlicenseNot gradedqualityAmaintenanceLets any MCP client search and browse the Apple Music catalog, manage library items, playlists and folders, and control playback and the Up Next queue through natural language. It works across macOS, Windows and Linux by picking among native Music.app, Safari, Chrome and the Apple Music API engines, needing only a Mac or an Apple Music subscription.-
- FlicenseNot gradedqualityAmaintenanceEnables MCP clients to manage Apple Music playlists, library, catalog, discovery, playback, and the Up Next queue across macOS, Windows, and Linux using native Music.app, the Apple Music API, Safari, or Chrome engines.-