applemusic-mcp
Integrates with Apple Music to manage playlists, control playback, browse library, search catalog, and more.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@applemusic-mcplist my playlists"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
applemusic-mcp
MCP server for Apple Music — lets your AI assistant (Claude, Cursor, Cline, Windsurf, or any MCP client) manage playlists, control playback, and browse your library.
Features
Feature | macOS | API |
List playlists | ✓ | ✓ |
Browse library songs | ✓ | ✓ |
Create playlists | ✓ | ✓ |
Search library | ✓ | ✓ |
Love/dislike tracks | ✓ | ✓ |
CSV/JSON export | ✓ | ✓ |
Add tracks to playlists | ✓ | API-created |
Search catalog | UI* | ✓ |
Add songs to library | UI* | ✓ |
Recommendations, charts, radio | ✓ | |
Play tracks | ✓ / UI* | |
Play by URL (album, playlist, song) | UI* | |
Playback control (pause/skip/seek) | ✓ | |
Volume, shuffle, repeat | ✓ | |
Star ratings (1-5) | ✓ | |
Remove tracks from playlists | ✓ | |
Delete playlists/folders | ✓ | |
Create folders | ✓ | top-level |
Rename playlists/folders | ✓ | |
Move playlists/folders | ✓ | |
Folder hierarchy/paths | ✓ |
macOS uses AppleScript for full local control. API mode enables catalog features and works cross-platform. UI* = UI automation fallback (requires the screen to be unlocked, display attached, and Accessibility permissions; Top Results only for search).
Quick Start (macOS)
Requirements: Python 3.10+, Apple Music app with subscription.
No Apple Developer account needed on macOS! Most features work instantly via AppleScript. Catalog features use the API when available, with UI automation fallback on macOS (requires display + Accessibility permissions). On other platforms and for more features a $99/yr Apple Developer Program membership is required for the API.
git clone https://github.com/epheterson/applemusic-mcp.git
cd applemusic-mcp
python3 -m venv venv && source venv/bin/activate
pip install -e .Add to your MCP client config. Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json); Cursor / Cline / Windsurf use the same mcpServers shape — see your client's docs for the file location.
{
"mcpServers": {
"Apple Music": {
"command": "/full/path/to/applemusic-mcp/venv/bin/python",
"args": ["-m", "applemusic_mcp"]
}
}
}That's it! Restart your client and try: "List my Apple Music playlists" or "Play my favorites playlist"
Windows/Linux users: Skip to API Setup - AppleScript features require macOS, but API mode works cross-platform.
API Setup (Optional on macOS, Required on Windows/Linux)
Requirements: Python 3.10+, Apple Music app with subscription, active Apple Developer Program membership ($99/yr USD).
Want catalog search, recommendations, and Windows/Linux support? Set up API access.
1. Get MusicKit Key
Apple Developer Portal → Keys → Click +
Name it anything, check MusicKit, click Continue → Register
Download the .p8 file (one-time download!)
Note your Key ID (10 chars) and Team ID (from Membership)
2. Configure
mkdir -p ~/.config/applemusic-mcp
cp ~/Downloads/AuthKey_XXXXXXXXXX.p8 ~/.config/applemusic-mcp/Create ~/.config/applemusic-mcp/config.json:
{
"team_id": "YOUR_TEAM_ID",
"key_id": "YOUR_KEY_ID",
"private_key_path": "~/.config/applemusic-mcp/AuthKey_XXXXXXXXXX.p8"
}3. Generate Tokens
applemusic-mcp generate-token # Creates developer token (180 days)
applemusic-mcp authorize # Opens browser for Apple Music auth
applemusic-mcp status # Verify everything works4. Add to Your MCP Client (Windows/Linux)
Same mcpServers shape works across clients (Claude Desktop, Cursor, Cline, Windsurf, etc.) — only the config file path differs.
Claude Desktop:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"Apple Music": {
"command": "/full/path/to/applemusic-mcp/venv/bin/python",
"args": ["-m", "applemusic_mcp"]
}
}
}Optional Preferences
Add to config.json:
{
"preferences": {
"auto_search": true,
"clean_only": false,
"fetch_explicit": false,
"reveal_on_library_miss": false
}
}auto_search: Enables catalog search + library-add fallback forplaylist(action="add")when a track isn't already in the user's library (default: false to avoid unintended library writes — set to true for "fill this playlist" workflows). On macOS works without an API token by falling back to Music.app UI automation (requires display + Accessibility permissions for the host process).clean_only: Filter explicit content, forsearch_catalog,search_library,browse_library(default: false)fetch_explicit: Fetch explicit status (cached), forget_playlist_tracks,search_library,browse_library(default: false)reveal_on_library_miss: Open catalog tracks in Music app, forplay(default: false)
Usage Examples
Playlist management:
"List my Apple Music playlists"
"Create a playlist called 'Road Trip' and add some upbeat songs"
"Add Hey Jude by The Beatles to my Road Trip playlist"
"Remove the last 3 tracks from my workout playlist"
"Export my library to CSV"
Folder organization (macOS):
"Create a folder called Genres and put subfolders for Rock, Jazz, and Electronic in it"
"Move my Road Trip playlist into the Summer folder"
"Show me my folder hierarchy"
"Where is my workout playlist?"
Discovery & playback (macOS):
"What have I been listening to recently?"
"Play my workout playlist on shuffle"
"Skip to the next track"
"What's playing right now?"
With API enabled:
"Search Apple Music for 90s alternative rock"
"Find songs similar to Bohemian Rhapsody and add them to my library"
"What are the top charts right now?"
"Get me personalized recommendations"
Tools
playlist(action=...)
Playlist and folder operations - list, manage tracks, create, copy, remove (macOS), delete (macOS), rename (macOS), folder management (macOS)
Action | Parameters | Description | Platform |
|
| List all playlists | All |
|
| Get playlist tracks with filter/pagination | All (by-name: macOS) |
|
| Search tracks in playlist | All |
|
| Create playlist and/or folder. | All |
|
| Smart add: auto-search catalog, UI fallback when no API token, skip duplicates | All (by-name: macOS) |
|
| Copy playlist to editable version | All (by-name: macOS) |
|
| Move playlist/folder into a folder path. | macOS |
|
| Remove track(s) from playlist | macOS |
|
| Delete a playlist or folder (supports slash paths) | macOS |
|
| Rename a playlist or folder | macOS |
|
| Get full path of a playlist/folder. No args = show full hierarchy. | macOS |
Folder paths: Use / for nesting: create(folder="Music/Genres/Jazz") creates all levels. Works with move, delete, and create.
Note: The Apple Music API only supports creating single-level folders. Nested paths, move, delete, rename, tree, and path operations require macOS (AppleScript). Snapshots on macOS capture full folder hierarchy.
*Move-to-root limitation: Music.app's AppleScript interface cannot move playlists out of folders. folder="" recreates the playlist at root with the same tracks — the playlist's persistent ID will change. Moving INTO folders preserves the ID.
Examples:
playlist(action="list")
playlist(action="create", name="Road Trip", description="Summer vibes")
playlist(action="create", folder="Summer/Chill") # nested folders
playlist(action="create", name="Road Trip", folder="Summer/Chill") # playlist in nested folder
playlist(action="move", playlist="Road Trip", folder="Summer/Chill") # into nested folder
playlist(action="move", playlist="Road Trip", folder="") # back to root
playlist(action="move", playlist="Chill", folder="Archive") # folder into folder
playlist(action="path") # show full hierarchy
playlist(action="path", playlist="Road Trip") # "Summer/Chill/Road Trip"
playlist(action="path", folder="Chill") # "Summer/Chill"
playlist(action="delete", folder="Summer/Chill") # delete nested folder
playlist(action="rename", folder="Summer", new_name="Summer 2026")
playlist(action="add", playlist="Road Trip", track="Hey Jude", artist="Beatles")Unified track parameter auto-detects: names, IDs (catalog/library/persistent), CSV, or JSON arrays. Add entire albums with album parameter.
library(action=...)
Library management - search, add, browse, rate, recently played/added, remove (macOS), snapshot (macOS)
Action | Parameters | Description | Platform |
|
| Search your library (fast local on macOS) | All |
|
| Add tracks/albums from catalog | All |
|
| List songs/albums/artists/videos | All |
|
| Recent listening history | All |
|
| Recently added content | All |
|
| Love/dislike/clear/get/set ratings | All (stars/clear: macOS) |
|
| Remove track(s) from library | macOS |
|
| Library integrity checking — captures tracks, playlists, and folder hierarchy | macOS |
Snapshot sub-commands via query:
Query | Description |
(empty) | Diff current state from baseline, or take initial baseline |
| Reset baseline to current state |
| View recorded changes over time |
| List all saved snapshot/diff files |
| Delete a specific diff file |
Examples:
library(action="search", query="Beatles", types="songs", limit=25)
library(action="add", album="Abbey Road", artist="Beatles")
library(action="recently_played", limit=30)
library(action="rate", rate_action="love", track="Hey Jude")catalog(action=...)
Catalog search and details - search, albums, songs, artists, genres, stations
search accepts fuzzy queries — typos, partial lyrics, vague descriptions ("whistling beatles song"). On macOS it falls back to Music.app's built-in UI search when no API token is available, so you can find a half-remembered song without credentials.
Action | Parameters | Description | Platform |
|
| Search Apple Music catalog (fuzzy; UI fallback on macOS when no API token) | All |
|
| Get album tracks (by name or ID) | All |
|
| Full album metadata + track listing | All |
|
| Full song metadata | All |
|
| Artist info and discography | All |
|
| Get radio station for song | All |
| - | List all available genres | All |
Examples:
catalog(action="search", query="90s alternative", types="songs", limit=50)
catalog(action="album_tracks", album="Abbey Road", artist="Beatles")
catalog(action="album_details", album="GNX", artist="Kendrick Lamar")
catalog(action="artist_details", artist="The Beatles")discover(action=...)
Discovery and recommendations - personalized stations, charts, top songs, similar artists
Action | Parameters | Description | Platform |
|
| Personalized recommendations | All |
|
| Your frequently played | All |
|
| Apple Music charts | All |
|
| Artist's popular songs | All |
|
| Find similar artists | All |
|
| Autocomplete suggestions | All |
| - | Your personal radio station | All |
Optional: All catalog-based discover actions (charts, top_songs, similar_artists, song_station) accept an optional storefront parameter to query other regions without changing your default storefront.
Examples:
discover(action="recommendations")
discover(action="charts", chart_type="songs", storefront="it") # Italy charts
discover(action="top_songs", artist="The Beatles")Playback (macOS only)
Action | Description | Method |
| Play track, playlist, album, or URL | API + AS |
| Play, pause, stop, next, previous, seek | AppleScript |
| Current track info and player state | AppleScript |
| Get/set volume, shuffle, repeat | AppleScript |
| List or switch AirPlay devices | AppleScript |
play accepts ONE of: track, playlist, album, or url. Use shuffle=True for shuffled playback. Response shows source: [Library], [Catalog], [Catalog→Library], [UI Catalog] (UI played a track API resolved), or [UI Search] (UI played a track only the UI search found). Catalog items can be added first (add_to_library=True) or opened in Music (reveal=True).
URL playback — albums, playlists (including personal pl.u-), and songs via ?i=:
playback(action="play", url="https://music.apple.com/us/album/ok-computer/1097861387")
playback(action="play", url="https://music.apple.com/us/album/cowboy-carter/1738363766?i=1738363961")
playback(action="play", url="https://music.apple.com/us/playlist/todays-hits/pl.f4d106fed2bd41149aaacabb233eb5eb")Uses UI scripting (requires display + Accessibility permissions). The mouse cursor may briefly move for ?i= track selection.
Utilities
Tool | Description | Platform |
| Preferences, storefronts, cache, audit log | All |
| Verify tokens and API connection | All |
| List or switch AirPlay devices | macOS |
| Show track in Music app | macOS |
Config actions: info, set-pref, list-storefronts, audit-log, clear-tracks, clear-exports, clear-audit-log
All modifying operations are logged — view with config(action="audit-log").
Output Format
Most list tools support these output options:
Parameter | Values | Description |
|
| Response format |
|
| Write file to disk |
|
| Include all metadata |
Text format auto-selects the best tier that fits:
Full: Name - Artist (duration) Album [Year] Genre id
Compact: Name - Artist (duration) id
Minimal: Name - Artist id
Examples:
library(action="search", query="beatles", format="json") # JSON response
library(action="browse", item_type="songs", export="csv") # Text + CSV file
library(action="browse", item_type="songs", format="none", export="csv") # CSV only (saves tokens)
playlist(action="tracks", playlist="p.123", export="json", full=True) # JSON file with all metadataMCP Resources
Exported files are accessible via MCP resources (any MCP client that supports resource reads):
Resource | Description |
| List all exported files |
| Read a specific export file |
Limitations
Windows/Linux
Limitation | Workaround |
Only API-created playlists editable |
|
Can't delete playlists or remove tracks | Create new playlist instead |
No playback control | Use Music app directly |
Both Platforms
Tokens expire: Developer token lasts 180 days. You'll see warnings starting 30 days before expiration. Run
applemusic-mcp generate-tokento renew.Screen must be unlocked for UI flows: The catalog search / hover-to-add / play UI paths drive Music.app via System Events; a locked screen blocks them. The MCP detects this and returns a clear error.
A few playlists silently revert AppleScript edits (known Music.app/AppleScript bug). The MCP detects the rollback automatically and returns an actionable error suggesting Music.app's right-click → Add to Playlist as a workaround.
Troubleshooting
Problem | Solution |
401 Unauthorized |
|
"Cannot edit playlist" | Use |
Token expiring |
|
Check everything |
|
CLI Reference
applemusic-mcp status # Check tokens and connection
applemusic-mcp generate-token # New developer token (180 days)
applemusic-mcp authorize # Browser auth for user token
applemusic-mcp serve # Run MCP server (auto-launched by your MCP client)Config: ~/.config/applemusic-mcp/ (config.json, .p8 key, tokens)
License
MIT · Unofficial community project, not affiliated with Apple.
Credits
FastMCP · Apple MusicKit · Model Context Protocol
Built with ❤️ in California by @epheterson and Claude Code.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/epheterson/applemusic-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server