Music MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add music-mcp -- npx @pedrocid/music-mcp@latest
README.md

Control Apple Music on macOS using AppleScript

Music MCP

A Model Context Protocol (MCP) server for controlling Apple Music on macOS using AppleScript. This connector provides a structured interface for AI assistants like Claude to interact with the Music app, enabling playback control, library management, and music information retrieval.

Features

  • Playback Control: Play, pause, skip tracks, and control volume
  • Current Track Information: Get detailed track metadata and playback status
  • Library Management: Search tracks, albums, artists, and browse your library
  • Playlist Management: Create, manage, modify, and play playlists
  • Enhanced Queue Management: Add tracks to play next, view queue status, and control playback order
  • Smart "Play Next" Feature: Queue tracks to play after the current song using temporary playlists
  • Diagnostic Tools: Built-in info command for troubleshooting

Requirements

  • macOS (required for Apple Music and AppleScript)
  • Node.js 18.0.0 or higher
  • Apple Music app installed and accessible
  • Automation permissions granted to your terminal/app

Installation

Via npm (Recommended)

npx @pedrocid/music-mcp@latest

For Development

git clone https://github.com/pedrocid/music-mcp.git
cd music-mcp
npm install
npm run build

Building as Desktop Extension

If you want to create a Desktop Extension (.dxt) for distribution:

# Install the DXT CLI tool
npm install -g @anthropic-ai/dxt

# Initialize Desktop Extension (if not already done)
dxt init

# Build the project
npm run build

# Package the extension
dxt pack

This creates a music-mcp.dxt file that can be installed directly in Claude Desktop or submitted to the Anthropic extension directory.

Note: The .dxt file is not included in the repository as it's a build artifact. Users who want the Desktop Extension should build it themselves using the instructions above.

Quick Start with Claude Code

Add music control to Claude Code with a single command:

claude mcp add music -- npx @pedrocid/music-mcp@latest

That's it -- Claude Code will now have access to all music control tools.

Configuration

Claude Desktop Configuration

Add this to your Claude Desktop MCP configuration:

{
  "mcpServers": {
    "music": {
      "command": "npx",
      "args": ["@pedrocid/music-mcp@latest"]
    }
  }
}

Environment Variables (Optional)

All environment variables are optional. The server uses stderr logging by default and works without any configuration.

Variable Default Description
MUSIC_MCP_LOG_LEVEL info Log level (debug, info, warn, error)
MUSIC_MCP_FILE_LOGGING false Enable file logging (disabled by default)
MUSIC_MCP_LOG_FILE ~/Library/Logs/music-mcp.log Log file location (only used if file logging enabled)
MUSIC_MCP_CACHE_TTL 300 Cache timeout in seconds
MUSIC_MCP_MAX_SEARCH_RESULTS 50 Maximum search results
MUSIC_MCP_TIMEOUT_SECONDS 30 Default timeout for operations
MUSIC_MCP_ARTWORK_EXPORT true Enable album artwork export
MUSIC_MCP_LENIENT_PARSING true Accept variations in parameter names

Available Tools

`info`

Get diagnostic information about the MCP server status.

{
  "command": "info"
}

Returns version information, Music app availability, and configuration status.

`execute_music_command`

Execute music playback control commands.

{
  "command": "play|pause|next|previous|toggle_playback",
  "volume": 75,
  "position": 30,
  "shuffleMode": true,
  "repeatMode": "all",
  "rating": 4
}

`get_music_info`

Retrieve information about current playback or library.

{
  "infoType": "current_track|playback_status|queue|library_stats",
  "format": "simple|detailed"
}

`search_music`

Search the music library.

{
  "query": "artist name or song title",
  "searchType": "all|track|album|artist|playlist",
  "limit": 25
}

`manage_playlist`

Create and manage playlists.

{
  "action": "create|add_track|remove_track|rename|delete|list|get_tracks",
  "playlistName": "My Playlist",
  "trackId": "search term for track",
  "newName": "New Playlist Name"
}

`queue_music` ✨ **NEW**

Enhanced queue management and playlist control.

{
  "action": "view_queue|add_to_queue|play_queue|clear_queue|play_playlist",
  "trackSearchTerm": "song or artist name",
  "playlistName": "My Playlist",
  "shuffle": true
}

Queue Actions:

  • view_queue: See current track, playlist context, and playback status
  • add_to_queue: Add tracks to a temporary "Up Next" queue for sequential

Tools (6)

infoGet diagnostic information about the MCP server status.
execute_music_commandExecute music playback control commands.
get_music_infoRetrieve information about current playback or library.
search_musicSearch the music library.
manage_playlistCreate and manage playlists.
queue_musicEnhanced queue management and playlist control.

Environment Variables

MUSIC_MCP_LOG_LEVELLog level (debug, info, warn, error)
MUSIC_MCP_FILE_LOGGINGEnable file logging
MUSIC_MCP_LOG_FILELog file location
MUSIC_MCP_CACHE_TTLCache timeout in seconds
MUSIC_MCP_MAX_SEARCH_RESULTSMaximum search results
MUSIC_MCP_TIMEOUT_SECONDSDefault timeout for operations
MUSIC_MCP_ARTWORK_EXPORTEnable album artwork export
MUSIC_MCP_LENIENT_PARSINGAccept variations in parameter names

Configuration

claude_desktop_config.json
{"mcpServers": {"music": {"command": "npx", "args": ["@pedrocid/music-mcp@latest"]}}}

Try it

What song is currently playing on Apple Music?
Search for songs by Daft Punk and add them to my queue.
Create a new playlist called 'Focus' and add the current track to it.
Set the music volume to 50% and shuffle the current playlist.
Skip to the next track.

Frequently Asked Questions

What are the key features of Music MCP?

Playback control including play, pause, skip, and volume adjustment. Detailed track metadata retrieval and playback status. Library search for tracks, albums, artists, and playlists. Comprehensive playlist management (create, modify, delete). Enhanced queue management with smart 'Play Next' functionality.

What can I use Music MCP for?

Hands-free music control while working on a Mac. Automating playlist organization based on AI-generated suggestions. Quickly finding and queuing specific tracks without leaving the IDE. Managing music playback status during deep work sessions.

How do I install Music MCP?

Install Music MCP by running: npx @pedrocid/music-mcp@latest

What MCP clients work with Music MCP?

Music MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Music MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare