Apple Music Remote MCP
A read-only MCP bridge that lets ChatGPT access your personal Apple Music playlists and library from ordinary conversations.
README
Apple Music Remote MCP — Read-Only ChatGPT Prototype
A small read-only MCP bridge that lets ChatGPT access your personal Apple Music playlists and library from ordinary conversations.
It wraps [applemusic-mcp] as a local upstream server, exposes a deliberately restricted MCP interface over Streamable HTTP, and uses a Cloudflare Tunnel to make that local MCP endpoint reachable from ChatGPT.
Prototype status: this project is intended for personal development and testing. The current Cloudflare Quick Tunnel setup is temporary and unauthenticated.
What this project does
The upstream applemusic-mcp project supports a wide range of Apple Music operations, including both reads and writes.
This prototype intentionally exposes only a small read-only subset:
playlist
listfolderstrackssearch
library
searchbrowsefavoritesrecently_playedrecently_added
Mutation actions such as creating playlists, adding tracks, deleting items, renaming playlists, rating tracks, or removing library items are not exposed.
The restriction is enforced twice:
- the MCP tool schema shown to ChatGPT contains only the allowed read actions;
- every actual tool call is checked again server-side before being forwarded upstream.
This means manually constructing a blocked action does not bypass the read-only boundary.
Architecture
ChatGPT
|
| MCP over HTTPS
v
Cloudflare Tunnel
|
| forwards to localhost
v
remote_mcp.py
http://127.0.0.1:8787/mcp
|
| local stdio MCP
v
applemusic-mcp
|
v
Apple Music
There are therefore three relevant components:
-
applemusic-mcpHandles the actual Apple Music authentication and API/library access. -
remote_mcp.pyActs as a read-only proxy and exposes Streamable HTTP MCP on localhost. -
Cloudflare Tunnel Gives the local MCP server a temporary public HTTPS address that ChatGPT can reach.
Both the local MCP server and the Cloudflare Tunnel must be running for ChatGPT access to work.
Project structure
.
├── remote_mcp.py
├── test_mcp.py
├── requirements.txt
├── .gitignore
└── README.md
remote_mcp.py
Main server.
It:
- launches short-lived local connections to
applemusic-mcp serve; - discovers the upstream MCP tools;
- exposes only
playlistandlibrary; - rewrites their action schemas to contain only approved read operations;
- validates every tool call before forwarding it upstream;
- serves the resulting MCP interface over Streamable HTTP;
- enables MCP DNS-rebinding protection;
- binds only to
127.0.0.1.
test_mcp.py
Small MCP client used to verify the proxy before connecting it to ChatGPT.
It:
- connects to the Streamable HTTP MCP endpoint;
- lists the exposed tools;
- prints the allowed action enums;
- calls:
playlist(action="list")
- prints the real playlists returned by Apple Music.
Requirements
The current prototype has primarily been tested on Windows.
You need:
- Python 3.10 or newer
- an Apple Music subscription
- Google Chrome on Windows/Linux
cloudflared- access to ChatGPT custom MCP apps / Developer Mode
- internet access while using Apple Music and the tunnel
Python dependencies are defined in requirements.txt:
applemusic-mcp==0.18.5
mcp>=1.28.1,<3
uvicorn[standard]>=0.35,<1
The applemusic-mcp version is currently pinned because this proxy depends on its tool names and schemas.
Installation
1. Clone the repository
git clone <YOUR_REPOSITORY_URL>
cd <YOUR_REPOSITORY_FOLDER>
2. Create a virtual environment
Windows PowerShell
py -m venv .venv
.\.venv\Scripts\Activate.ps1
macOS / Linux
python3 -m venv .venv
source .venv/bin/activate
Upgrade pip:
python -m pip install --upgrade pip
Then install the dependencies:
pip install -r requirements.txt
3. Install the browser runtime
On Windows/Linux, install the Chromium runtime used by the Apple Music authentication flow:
playwright install chromium
A normal Google Chrome installation should also be available on the system.
macOS users may use the Safari/native paths supported by applemusic-mcp instead.
Apple Music authentication
Authentication is handled by applemusic-mcp, not by this proxy.
Run:
applemusic-mcp login
On Windows, this should open a local browser window.
Sign into your Apple Music account there.
Then verify the stored login:
applemusic-mcp status
Once login succeeds, the credentials are stored by applemusic-mcp locally.
They are not stored in this Git repository and do not need to be entered into ChatGPT.
Normally, you only need to sign in once. Restarting this project or recreating the Cloudflare Tunnel does not by itself require another Apple Music login.
Test the MCP server locally
Before involving ChatGPT or Cloudflare, verify that the local MCP proxy works.
Terminal 1 — start the server
Activate the virtual environment:
.\.venv\Scripts\Activate.ps1
Then run:
python remote_mcp.py
The default endpoint is:
http://127.0.0.1:8787/mcp
You should see output similar to:
Apple Music Remote MCP prototype
--------------------------------
Local MCP URL: http://127.0.0.1:8787/mcp
Public host: not configured
Exposed tools: playlist, library (read-only)
Leave this terminal running.
Terminal 2 — run the MCP test client
Activate the same virtual environment:
.\.venv\Scripts\Activate.ps1
Then run:
python test_mcp.py
Expected tool discovery:
Discovered MCP tools:
- playlist: ['folders', 'list', 'search', 'tracks']
- library: ['browse', 'favorites', 'recently_added', 'recently_played', 'search']
The script will then call:
playlist(action='list')
and should print your actual Apple Music playlists.
If that succeeds, the complete local path works:
test_mcp.py
->
remote_mcp.py
->
applemusic-mcp
->
Apple Music
Stop remote_mcp.py with:
Ctrl+C
before starting the public configuration below.
Expose the MCP server with Cloudflare
ChatGPT cannot directly connect to:
localhost
For this prototype, a Cloudflare Quick Tunnel provides a temporary public HTTPS endpoint.
Terminal 1 — start Cloudflare
Run:
cloudflared tunnel --url http://localhost:8787
Cloudflare will print a URL similar to:
https://random-words.trycloudflare.com
The hostname in this example is:
random-words.trycloudflare.com
Keep this terminal running.
Important
A Quick Tunnel URL is temporary.
If you stop and restart cloudflared, you will normally receive a different hostname.
Whenever that happens, you must:
- use the new hostname when starting
remote_mcp.py; - update the MCP Server URL in ChatGPT.
Start the server for public access
Terminal 2 — start remote_mcp.py
Activate the virtual environment:
.\.venv\Scripts\Activate.ps1
Take the hostname generated by Cloudflare and run:
python remote_mcp.py `
--port 8787 `
--public-host random-words.trycloudflare.com
Replace:
random-words.trycloudflare.com
with your actual current Cloudflare hostname.
Do not include:
https://
and do not include:
/mcp
after --public-host.
Correct:
--public-host random-words.trycloudflare.com
Incorrect:
--public-host https://random-words.trycloudflare.com/mcp
The server should now print:
Local MCP URL: http://127.0.0.1:8787/mcp
Public MCP URL: https://random-words.trycloudflare.com/mcp
Exposed tools: playlist, library (read-only)
Keep this terminal running as well.
Test the public endpoint
Before configuring ChatGPT, you can optionally test the complete public route.
Open another terminal, activate the virtual environment, and run:
python test_mcp.py https://random-words.trycloudflare.com/mcp
Replace the URL with your actual tunnel URL.
If this returns your playlists, the following full path is working:
MCP client
->
Cloudflare
->
remote_mcp.py
->
applemusic-mcp
->
Apple Music
Connect it to ChatGPT
Enable Developer Mode / custom MCP app creation in ChatGPT if it is not already enabled.
Create a new custom MCP app.
Suggested configuration:
Name
Apple Music Library
Description
Read-only access to my personal Apple Music playlists and library.
Server URL
https://random-words.trycloudflare.com/mcp
Use your own current Cloudflare hostname.
Authentication
For this prototype:
None / No authentication
Then select:
Scan Tools
ChatGPT should discover exactly two tools:
playlist
library
Verify the exposed actions
Inspect the discovered tool schemas.
ChatGPT should see:
playlist:
folders
list
search
tracks
and:
library:
browse
favorites
recently_added
recently_played
search
If mutation actions such as the following appear:
add
create
delete
move
remove
rename
rate
do not continue using that configuration until the proxy is checked.
The intended prototype is read-only.
Using it in ChatGPT
Once the custom app has been created, enable or select it in an ordinary ChatGPT conversation.
You can then use natural-language requests.
For example:
Show me my Apple Music playlists.
Look at my Mahler playlist.
What tracks are in my Bruckner playlist?
What have I listened to recently?
Show me my recently added music.
Search my library for Beethoven.
Show my favorite tracks.
ChatGPT decides which MCP action to call from the available read-only interface.
For example, asking for a specific playlist will commonly result in:
playlist(action="list")
|
v
identify playlist
|
v
playlist(action="tracks", playlist="...")
Available operations
Playlist operations
List playlists
playlist(action="list")
Returns playlists available in the user's Apple Music account/library.
List playlist folders
playlist(action="folders")
Folder support depends on the underlying platform and Apple Music environment.
Read tracks from a playlist
playlist(
action="tracks",
playlist="Gustav Mahler"
)
Search inside a playlist
playlist(
action="search",
playlist="Gustav Mahler",
query="Symphony No. 7"
)
Note that playlist.search searches tracks inside a selected playlist.
To find a playlist by name, list the playlists first rather than using playlist.search.
Library operations
Search the local/personal library
library(
action="search",
query="Mahler"
)
Browse the library
library(action="browse")
Optional parameters can be forwarded to the underlying applemusic-mcp implementation.
Recently played
library(action="recently_played")
This returns Apple Music's available recently-played data.
It should not be assumed to be a real-time playback log. Apple Music's server-side history may lag behind what was played most recently in the Music app.
Recently added
library(action="recently_added")
Returns recently added library content.
Favorites
library(action="favorites")
Availability may depend on the platform and Apple Music backend used by applemusic-mcp.
Running the prototype later
After the initial installation and Apple Music login, a normal future session requires only the runtime components.
You will usually need three terminals.
Terminal 1 — Cloudflare
cloudflared tunnel --url http://localhost:8787
Copy the newly generated hostname.
Terminal 2 — MCP server
.\.venv\Scripts\Activate.ps1
python remote_mcp.py `
--port 8787 `
--public-host YOUR-CURRENT-HOST.trycloudflare.com
Terminal 3 — optional testing
.\.venv\Scripts\Activate.ps1
python test_mcp.py
or:
python test_mcp.py https://YOUR-CURRENT-HOST.trycloudflare.com/mcp
Then update the ChatGPT custom app's Server URL if the Quick Tunnel hostname changed.
When is the server available?
The integration works only while both of these processes are running:
remote_mcp.py
cloudflared
If remote_mcp.py stops:
ChatGPT
->
Cloudflare
-X-> local MCP server
If cloudflared stops:
ChatGPT
-X-> public MCP endpoint
If the computer itself is shut down or disconnected from the internet, the local Apple Music MCP endpoint is also unavailable.
This is expected for the current local prototype.
Security model
Read-only boundary
This proxy intentionally exposes only personal-data read operations.
The permitted actions are hard-coded in:
READ_ONLY_ACTIONS
in remote_mcp.py.
Tool schemas are filtered before being sent to the client, and calls are independently validated at execution time.
Local binding
The HTTP MCP server binds to:
127.0.0.1
rather than directly exposing a network interface.
External access is provided through Cloudflare Tunnel.
DNS-rebinding protection
MCP transport security is enabled through:
TransportSecuritySettings
Only localhost plus the public hostname supplied with:
--public-host
are allowed.
This is also why a newly generated Cloudflare hostname must be passed to remote_mcp.py after restarting the tunnel.
No application authentication
The current Quick Tunnel configuration does not add authentication in front of the MCP endpoint.
The random Cloudflare hostname therefore acts as an address, not as a secret credential.
Anyone who obtains that URL while both the tunnel and local MCP server are running could potentially invoke the exposed read-only Apple Music tools.
The read-only restriction significantly limits what the endpoint can do, but it does not make the personal library data public-safe.
Do not treat the current setup as a production deployment.
Credentials
Your Apple Music login is managed locally by applemusic-mcp.
Do not commit authentication data, browser profiles, tokens, .env files, or virtual environments to Git.
The included .gitignore excludes:
.venv/
__pycache__/
*.pyc
.env
Troubleshooting
applemusic-mcp is not recognized
Make sure the project's virtual environment is active:
.\.venv\Scripts\Activate.ps1
Then verify:
applemusic-mcp status
If the command still does not exist:
pip install -r requirements.txt
Apple Music login does not open correctly
On Windows/Linux, verify that the browser runtime was installed:
playwright install chromium
Then try:
applemusic-mcp login
again.
test_mcp.py cannot connect locally
Check that:
python remote_mcp.py
is still running.
The default test endpoint is:
http://127.0.0.1:8787/mcp
ChatGPT cannot connect
Verify all of the following:
cloudflaredis still running;remote_mcp.pyis still running;- both use port
8787; - the ChatGPT Server URL ends in
/mcp; --public-hostcontains only the hostname;- the hostname in ChatGPT matches the current Quick Tunnel hostname.
The tunnel was restarted and ChatGPT stopped working
Quick Tunnel hostnames are temporary.
Restart remote_mcp.py with the new hostname:
python remote_mcp.py `
--port 8787 `
--public-host NEW-HOST.trycloudflare.com
Then update the custom MCP app to:
https://NEW-HOST.trycloudflare.com/mcp
and rescan or reconnect the app as necessary.
Local testing works but the public endpoint fails
A common cause is a mismatch between the current Cloudflare hostname and the value supplied through:
--public-host
Because the server enables Host/Origin validation, an old tunnel hostname will be rejected.
ChatGPT sees unexpected write actions
Stop using the endpoint and inspect:
READ_ONLY_ACTIONS
in remote_mcp.py.
The intended tool schemas contain only:
playlist:
folders
list
search
tracks
library:
browse
favorites
recently_added
recently_played
search
recently_played looks outdated
This action reflects the history returned by Apple Music / the underlying applemusic-mcp backend.
It can lag behind actual recent listening activity and should not be treated as a precise real-time activity log.
Custom upstream command
By default, the proxy starts the upstream server with:
applemusic-mcp serve
The executable can be overridden through the environment variable:
APPLE_MUSIC_MCP_COMMAND
For example, this can be useful if applemusic-mcp is installed in a non-standard environment.
Most users do not need to change this.
Current limitations
This is intentionally a small prototype.
It currently:
- supports reading only;
- exposes only two upstream tools;
- depends on a locally running computer;
- depends on a running Cloudflare Tunnel;
- uses a temporary public hostname;
- has no application-level authentication;
- does not expose playback control;
- does not expose Apple Music catalog/discovery tools;
- does not expose queue management;
- does not expose any playlist or library mutations.
These are design choices rather than missing protections.
The primary goal is to test a narrow flow:
ordinary ChatGPT conversation
->
custom remote MCP
->
private Apple Music data
while keeping the accessible surface as small and reversible as possible.
Possible next steps
A more permanent version could replace the Quick Tunnel with a stable authenticated deployment, for example:
- a persistent Cloudflare Tunnel with a stable hostname;
- an authenticated MCP endpoint;
- OAuth or another access-control layer;
- a continuously running host/server;
- more granular permission policies;
- optional additional read-only tools.
Write access should only be added deliberately and with additional confirmation and authorization safeguards.
Upstream project
This prototype is a small remote read-only wrapper around the open-source:
applemusic-mcp
project by epheterson.
The upstream project provides the Apple Music integration itself; this repository mainly adds:
- a restricted tool surface;
- server-side read-only enforcement;
- Streamable HTTP exposure;
- Cloudflare-compatible Host/Origin configuration;
- a simple MCP test client;
- a ChatGPT-oriented deployment path.
This project is not affiliated with or endorsed by Apple.
Prototype goal
If you can open an ordinary ChatGPT conversation and ask:
Show me my Apple Music playlists.
and ChatGPT returns the real contents of your private Apple Music library through the custom MCP app, the prototype has succeeded.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。