Skip to content
Entertainment
Skill

/applemusic-mcp

Apple Music integration — AppleScript (local Music.app) and the Apple Music API / web player (cross-platform library, playlists, playback, and queue)

From plugin
applemusic-mcp
1231 skill

Claude Code

$ npx -y skills add epheterson/applemusic-mcp --skill applemusic-mcp --agent claude-code

SKILL.md

applemusic-mcp.SKILL.md
name: apple-music
version: 0.21.0
description: Apple Music integration — AppleScript (local Music.app) and the Apple Music API / web player (cross-platform library, playlists, playback, and queue)

Apple Music Integration

Guide for integrating with Apple Music. Three approaches: AppleScript (direct control), UI automation (catalog without API), and MusicKit API (cross-platform).

When to Use

Invoke when users ask to:

  • Manage playlists (create, add/remove tracks, list)
  • Control playback (play, pause, skip, volume)
  • Play an Apple Music URL (album, playlist, or song)
  • Search catalog or library
  • Add songs to library
  • Access listening history or recommendations

Permission Levels (MCP server)

The applemusic-mcp server runs at a level the user picks in their MCP client config: `music` (Music.app only), `api` (+ Apple's music APIs), `web` (+ web players), or `full` (everything), optionally with `--allow-ui` (Accessibility clicks). If the server refuses something because of its level, tell the user what it needs and where to change it. Don't work around the refusal with `osascript`, a browser, or anything in this guide: the user chose that limit.

Critical Rule: Library-First Workflow

**You CANNOT add catalog songs directly to playlists.**

Songs must be in the user's library first:

  • ❌ Catalog ID → Playlist (fails)
  • ✅ Catalog ID → Library → Playlist (works)

**Why:** Playlists use library IDs (`i.abc123`), not catalog IDs (`1234567890`).

This applies to both AppleScript and API approaches.

---

AppleScript (macOS)

Zero setup. Works immediately with the Music app.

**Run via Bash:**

osascript -e 'tell application "Music" to playpause'
osascript -e 'tell application "Music" to return name of current track'

**Multi-line scripts:**

osascript <<'EOF'
tell application "Music"
    set t to current track
    return {name of t, artist of t}
end tell
EOF

Available Operations

| Category | Operations | |----------|------------| | **Playback** | play, pause, stop, resume, next track, previous track, fast forward, rewind, play URL | | **Player State** | player position, player state, sound volume, mute, shuffle enabled/mode, song repeat | | **Current Track** | name, artist, album, duration, time, rating, loved, disliked, genre, year, track number | | **Library** | search, list tracks, get track properties, set ratings | | **Playlists** | list, create, delete, rename, add tracks, remove tracks, get tracks | | **AirPlay** | list devices, select device, current device |

Track Properties (Read)

tell application "Music"
    set t to current track
    -- Basic info
    name of t           -- "Hey Jude"
    artist of t         -- "The Beatles"
    album of t          -- "1 (Remastered)"
    album artist of t   -- "The Beatles"
    composer of t       -- "Lennon-McCartney"
    genre of t          -- "Rock"
    year of t           -- 1968

    -- Timing
    duration of t       -- 431.0 (seconds)
    time of t           -- "7:11" (formatted)
    start of t          -- start time in seconds
    finish of t         -- end time in seconds

    -- Track info
    track number of t   -- 21
    track count of t    -- 27
    disc number of t    -- 1
    disc count of t     -- 1

    -- Ratings
    rating of t         -- 0-100 (20 per star)
    loved of t          -- true/false
    disliked of t       -- true/false

    -- Content rating. DO NOT trust this for filtering.
    -- On Apple Music (cloud) tracks this property is unset, and reading it
    -- RAISES "A descriptor type mismatch occurred" rather than returning
    -- false. Catching that and defaulting to false is what turns "I could
    -- not tell" into "this is clean": on a real 463-track playlist Music.app
    -- yielded zero explicit tracks where the catalog rated eight of them
    -- explicit. If a caller asked for clean content, resolve the rating
    -- against the catalog (`contentRating == "explicit"`, matching on name
    -- AND artist) and report anything you could not verify as unknown.
    explicit of t       -- true/false, RAISES on most cloud tracks

    -- Playback
    played count of t   -- 42
    played date of t    -- date last played
    skipped count of t  -- 3
    skipped date of t   -- date last skipped

    -- IDs
    persistent ID of t  -- "ABC123DEF456"
    database ID of t    -- 12345
end tell

Track Properties (Writable)

tell application "Music"
    set t to current track
    set rating of t to 80          -- 4 stars
    set loved of t to true
    set disliked of t to false
    set name of t to "New Name"    -- rename track
    set genre of t to "Alternative"
    set year of t to 1995
end tell

Player State Properties

tell application "Music"
    player state          -- stopped, playing, paused, fast forwarding, rewinding
    player position       -- current position in seconds (read/write)
    sound volume          -- 0-100 (read/write)
    mute                  -- true/false (read/write)
    shuffle enabled       -- true/false (read/write)
    shuffle mode          -- songs, albums, groupings
    song repeat           -- off, one, all (read/write)
    current track         -- track object
    current playlist      -- playlist object
    current stream URL    -- URL if streaming
end tell

Playback Commands

tell application "Music"
    -- Play controls
    play                          -- play current selection
    pause
    stop
    resume
    playpause                     -- toggle play/pause
    next track
    previous track
    fast forward
    rewind

    -- Play specific content
    play (first track of library playlist 1 whose name contains "Hey Jude")
    play user playlist "Road Trip"

    -- Settings
    set player position to 60     -- seek to 1:00
    set sound volume to 50        -- 0-100
    set mute to true
    set shuffle enabled to true
    set song repeat to all        -
Read more
@epheterson
Ships withapplemusic-mcp

MCP server for Apple Music. It gives any MCP client (Claude, Cursor, Cline, Windsurf) control of your playlists, library, catalog, discovery, playback, and the Up Next queue. Runs on macOS, Windows, and Linux.

Stars on GitHub

Momentum

stars in total
123
Star history of epheterson/applemusic-mcp on GitHub, a chart by star-history.com

More skills from other plugins.

bazi-skill
Skill

bazi-skill

四柱八字命理分析。通过交互式步骤收集出生信息(姓名、曾用名、阳历/农历生日、时辰、性别、出生地), 排出四柱八字,参照经典命理典籍(穷通宝典、三命通会、滴天髓、渊海子平、子平真诠等)进行专业分析。 Use this skill whenever the…

@jinchenma94@jinchenma94Install Skill

Questions about applemusic-mcp.

Which coding agents can use applemusic-mcp?
applemusic-mcp installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.