Apple Music MCP
Controls Apple Music on macOS via AppleScript, enabling playback, lyrics retrieval, playlist management, and catalog search through an MCP interface.
README
šµ Apple Music MCP
An MCP (Model Context Protocol) server that lets AI assistants control Apple Music on macOS ā play, pause, skip, read lyrics, manage playlists, and search the catalog.
Built for Claude Desktop and Claude Code. Works with any MCP-compatible client.
<p align="center"> <img src="demo.gif" alt="Apple Music MCP demo" width="600" /> </p>
What It Does
| Tool | Description |
|---|---|
get_current_track |
Now playing info ā title, artist, album, progress |
get_lyrics |
Time-synced lyrics via LRCLIB ā NetEase Cloud Music fallback |
control_playback |
Play, pause, toggle, next, previous, stop |
create_playlist |
Create a new playlist |
add_to_playlist |
Add the current track to a playlist (works with subscription tracks) |
list_playlists |
List all user playlists |
search_tracks |
Search library + Apple Music catalog |
search_and_add |
Find a track and add it to a playlist in one call |
How It Works
The server bridges your AI assistant to Apple Music through three layers:
AppleScript ā Music.app ā All playback control and playlist operations go through macOS's native AppleScript interface. The server sends commands to Music.app directly ā no Apple Music API keys, no web auth, no token management. If Music.app can do it, this server can do it.
Lyrics: LRCLIB ā NetEase fallback ā When your AI asks for lyrics, the server tries LRCLIB first (strong English coverage), then falls back to NetEase Cloud Music for Chinese and Asian-language songs. Both are free, no API keys required. Results are time-synced and returned with the current playback position so your AI knows which line is playing now.
Architecture ā The design was informed by netease-music-mcp's approach to lyrics retrieval. We extended it with Apple Music's native AppleScript integration and a dual-source lyrics fallback for broader language coverage.
Requirements
- macOS (uses AppleScript under the hood)
- Python 3.10+
- Apple Music with an active subscription or local library
Installation
git clone https://github.com/yauyuuue-commits/apple-music-mcp.git
cd apple-music-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Setup
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"apple-music": {
"command": "/ABSOLUTE/PATH/TO/apple-music-mcp/.venv/bin/python",
"args": ["-m", "apple_music_mcp"]
}
}
}
ā ļø Replace
/ABSOLUTE/PATH/TO/with the actual path where you cloned the repo.
Claude Code
claude mcp add apple-music -- /ABSOLUTE/PATH/TO/apple-music-mcp/.venv/bin/python -m apple_music_mcp
Quick Test
After setup, open a new Claude conversation and say "what song is playing?" ā if Claude returns track info from Apple Music, you're good to go.
Lyrics
The get_lyrics tool fetches time-synced lyrics with a two-tier fallback:
- LRCLIB ā community lyrics database, good English coverage
- NetEase Cloud Music ā fills gaps for Chinese and other Asian-language songs
No API keys needed. Coverage varies ā some songs won't have synced lyrics on either source.
Card Display (Optional & Customizable)
This MCP gives your AI the raw tools. What it does with them is up to you.
For example, we built a Tinder-style swipe card UI for music discovery ā Claude listens to each song, reads the lyrics, decides if it likes it, and shows an animated card that swipes right (save) or left (skip). See the demo above for what this looks like in action.
The card display is not part of this MCP server. It lives in the AI's conversation as a prompt-driven behavior. If you want something similar, design it together with your Claude ā that's half the fun. The data structure is simple: song title, artist, a lyrics snippet, and a verdict. The visual style is yours to create.
Known Limitations
- macOS only ā AppleScript doesn't exist on Windows or Linux
- Subscription tracks ā
add_to_playlistworks with subscription tracks by copying them to your library first, but there's a brief delay (~4s) - Library-only search for
search_and_addā if a track isn't in your library, it returns the catalog match but can't add it directly. Play it first, then useadd_to_playlist - Lyrics coverage ā LRCLIB + NetEase covers most popular songs, but niche or very new tracks may not have synced lyrics available
Project Structure
apple-music-mcp/
āāā README.md
āāā LICENSE
āāā pyproject.toml
āāā src/
āāā apple_music_mcp/
āāā __init__.py
āāā __main__.py
āāā server.py ā all 8 tools live here
Acknowledgments
Lyrics integration inspired by luuu h's netease-music-mcp ā the NetEase fallback approach for Chinese lyrics coverage came from studying that project.
License
MIT ā see LICENSE.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.