MCP AppleMusic Server
Enables control of Apple Music on macOS, providing tools to play/pause music, skip tracks, adjust volume, search for songs/albums/artists, and get information about the currently playing track.
Interfaces with macOS through AppleScript commands to control the Apple Music application, requiring the server to run directly on a macOS machine.
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., "@MCP AppleMusic Serverplay 'Blinding Lights' by The Weeknd"
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.
MCP AppleMusic Server
MCP server for controlling Apple Music on macOS.
Overview
This project provides a Model-Context-Protocol (MCP) server that allows you to control the Apple Music application on a macOS device. It works by executing AppleScript commands (osascript) under the hood.
The server is built with TypeScript, using Express.js to handle HTTP connections and the @modelcontextprotocol/sdk for MCP communication.
Note: This server is designed to run directly on a macOS machine, as it depends on osascript to interact with Apple Music.
Related MCP server: Sound
Features
Control Apple Music playback (play, pause, next track).
Adjust volume.
Search for songs, albums, and artists in your library.
Search and immediately play a song.
Get the currently playing track name.
Exposes functionality as MCP tools.
Requirements
Operating System: macOS
Runtime: Node.js v20+
⚙️ Setup and Installation
Clone the repository:
git clone https://github.com/samwang0723/mcp-applemusic.git cd mcp-applemusicInstall dependencies:
npm installConfigure environment variables: Create a
.envfile in the root of the project. You can copy the example if one is provided, or create it from scratch.# The port the server will listen on (default: 3000) PORT=3000 # The logging level (e.g., 'debug', 'info', 'warn', 'error') (default: 'info') LOG_LEVEL=info
🚀 Usage
Development
To run the server in development mode with hot-reloading (thanks to tsx):
npm run devProduction
To build and run the server for production:
# 1. Build the TypeScript source code
npm run build
# 2. Start the server
npm startOnce running, the server will be available at http://localhost:3000 (or your configured PORT).
🛠️ Available Tools
The server exposes the following tools for an MCP client to use:
Tool Name | Description | Parameters |
| Adjust Apple Music volume |
|
| Play next track | None |
| Pause music playback | None |
| Resume music playback | None |
| Search for tracks by album |
|
| Search and play a song |
|
| Search for specific songs |
|
| Search for tracks by artist |
|
| Get currently playing track | None |
🔌 API Endpoints
The server exposes the following HTTP endpoints:
GET /health: A health check endpoint. Returns{ "status": "ok", "service": "mcp-applemusic-server" }./mcp(GET, POST, DELETE): The primary endpoint for MCP communication.
🐳 Docker
A Dockerfile is included in this project. You can build a Docker image using:
docker build -t mcp-applemusic .However, please be aware of the following critical limitation:
⚠️ The Docker container will not function correctly. ⚠️
The server relies on osascript to control Apple Music, which is a macOS-specific utility. Standard Docker images are Linux-based and do not include this utility. Running the server in the provided Docker container will result in errors when any Apple Music tool is called.
This Dockerfile should be seen as a starting template for a generic Node.js application and would require a macOS-based environment to run successfully.
🔬 Development Scripts
npm run lint: Lint the code using ESLint.npm run lint:fix: Automatically fix linting issues.npm test: Run tests using Jest (test files need to be created).
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.
Related MCP Servers
- AlicenseAqualityDmaintenanceFacilitates controlling Apple Music on macOS via AppleScript through MCP commands, allowing users to manage playback, search for tracks, and create playlists.Last updated1088MIT
- Alicense-qualityBmaintenanceApple Music playback control, library search, playlist management, and queue operations via MCP.Last updated1MIT
- Alicense-qualityFmaintenanceMCP server for controlling Apple Music on macOS using JXA (JavaScript for Automation). Manage playback, search tracks, create playlists, and more without API keys.Last updated17MIT
- Alicense-qualityDmaintenanceEnables control of Apple Music on macOS, including playback, track info, volume, and more.Last updated17MIT
Related MCP Connectors
iTunes Search MCP — Apple's public catalog search
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/samwang0723/mcp-applemusic'
If you have feedback or need assistance with the MCP directory API, please join our Discord server