Skip to main content
Glama
Spotify MCP Server for macOS

Spotify MCP Server for macOS

Spotify MCP Server for macOS

Control the Spotify app on macOS through the Model Context Protocol. This server exposes tools for playback, navigation, volume, shuffle, repeat, and context playback so LLM clients can fully manage Spotify using MCP.

Features

  • ✅ Launch Spotify automatically when commands require it

  • ✅ Read player status (state, track metadata, position, shuffle/repeat, volume)

  • ✅ Playback controls: play, pause, play/pause toggle, next, previous

  • ✅ Volume controls: absolute level or relative adjustments

  • ✅ Seek within the current track

  • ✅ Shuffle and repeat controls

  • ✅ Play arbitrary Spotify URIs or URLs with optional seek offset

  • ✅ Resource endpoint that returns Spotify status as JSON

macOS-only: Spotify automation relies on AppleScript (JXA) which is only available on macOS. Spotify must be installed locally.

Related MCP server: Apple Music

Prerequisites

  • macOS with Spotify installed

  • Node.js v18 or newer

  • An MCP-compatible client (e.g. Claude Desktop, Cursor, Windsurf, etc.)

  • Automation permissions in System Settings → Privacy & Security → Automation allowing your MCP host (e.g. "Terminal", "Claude Desktop") to control Spotify

When you run the server for the first time, macOS will prompt for permission. If you deny it, revisit the Automation pane to enable it manually.

Installation

npm install
npm run build

During development you can run the TypeScript sources directly:

npm run dev

Running the server

The server communicates over stdio, so you typically let your MCP host spawn it. To run it by hand:

npm run start

The process will stay alive and exchange JSON-RPC messages over stdio until terminated.

Example Claude Desktop configuration

Add this snippet to ~/Library/Application Support/Claude/claude_desktop_config.json (create the file if it doesn’t exist) and restart Claude Desktop:

{
  "mcpServers": {
    "spotify": {
      "command": "node",
      "args": ["/Users/teephopdisawas/0.at/vs-code/project-3/dist/server.js"],
      "env": {}
    }
  }
}

Replace the path with the absolute location of your dist/server.js build. When working from TypeScript directly you can use npx tsx /path/to/src/server.ts instead of the compiled JS.

Windsurf / Cursor example

Add an MCP server entry pointing to the same command and arguments. Both editors support stdio transports and will request tool discovery automatically.

Available tools

Tool name

Description

Input schema

spotify.get_status

Fetch the latest player status

—

spotify.play / spotify.pause / spotify.play_pause

Playback controls

—

spotify.next / spotify.previous

Track navigation

—

spotify.set_volume

Set absolute volume (0–100)

{ "volume": number }

spotify.adjust_volume

Adjust volume relative to current level

{ "delta": number }

spotify.seek

Seek within the current track

{ "positionMs": number }

spotify.set_shuffle / spotify.toggle_shuffle

Control shuffle state

{ "enabled": boolean } or —

spotify.set_repeat

Set repeat mode (off, context, track)

`{ "mode": "off"

spotify.play_uri

Play a specific Spotify URI/URL with optional offset

{ "uri": string, "positionMs"?: number }

Resources

  • spotify://status – Returns the current player status as prettified JSON

Manual smoke test

To verify Spotify automation outside of MCP, run the status helper:

npm run status

That command prints the raw status JSON to stdout and will surface any automation permission problems immediately.

Development tips

  • npm run typecheck – Validate TypeScript types without emitting output

  • npm run build – Produce dist/ artifacts for deployment

  • npm run dev – Run the server directly via tsx

AppleScript debugging

If you encounter automation issues, run the helper in a Node REPL:

node -e "import('./dist/server.js');"

macOS may prompt for permission; accept it so future commands succeed.

Troubleshooting

  • Spotify isn’t running: Most tools attempt to launch Spotify automatically. If it still fails, open Spotify manually to confirm it is installed.

  • Automation denied: Enable the Automation checkbox for your MCP host in System Settings.

  • Volume commands do nothing: Ensure Spotify is the active output device; some macOS audio setups bypass the Spotify sound volume control.

License

MIT – see LICENSE for details.

Available Tools

13 tools
spotify.adjust_volumeAdjust VolumeC

Adjust the Spotify volume up or down

Inputs: delta (required).

spotify.get_statusGet Spotify StatusB

Returns the latest playback status from Spotify

Inputs: no named parameters.

spotify.nextNext TrackB

Skip to the next track

Inputs: no named parameters.

spotify.pausePauseB

Pause playback

Inputs: no named parameters.

spotify.playPlayB

Start playback (launches Spotify if necessary)

Inputs: no named parameters.

spotify.play_pauseToggle Play/PauseB

Toggle between play and pause

Inputs: no named parameters.

spotify.play_uriPlay URIC

Play a specific Spotify URI or URL

Inputs: uri (required), positionMs.

spotify.previousPrevious TrackB

Return to the previous track

Inputs: no named parameters.

spotify.seekSeekC

Seek to a position in the current track

Inputs: positionMs (required).

spotify.set_repeatSet RepeatC

Set the repeat mode

Inputs: mode (required).

spotify.set_shuffleSet ShuffleC

Enable or disable shuffle mode

Inputs: enabled (required).

spotify.set_volumeSet VolumeB

Set the Spotify volume to an explicit level (0-100)

Inputs: volume (required).

spotify.toggle_shuffleToggle ShuffleC

Toggle shuffle mode

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 13 tools

    Disambiguation4/5

    Each tool maps to a distinct playback action, and the set/ toggle pairs (set_volume vs adjust_volume, set_shuffle vs toggle_shuffle) are clarified by their descriptions. The only mild overlap is play/pause/play_pause, where an agent must decide between explicit state control and toggling, but the boundaries are still readable.

    Naming Consistency4/5

    All names use a consistent spotify.<snake_case> prefix, and the set_/toggle_/adjust_ verb prefixes are used predictably. Minor deviation: several tools are bare verbs (play, pause, next, previous, seek) rather than verb_noun, though still unambiguous.

    Tool Count5/5

    Thirteen tools is well within a healthy range for a playback-control server. Every tool corresponds to a real player operation (status, transport, volume, seek, modes, URI playback) with no filler.

    Completeness3/5

    Transport, volume, seek, shuffle, and repeat are fully covered, but common Spotify workflows are absent: search/browse, queue management (add to queue, list queue), track/artist metadata retrieval, and saved-track or playlist operations. An agent can control playback but hits dead ends for anything beyond the current track.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Gives MCP clients control of Apple Music playlists, library, catalog, discovery, playback, and the Up Next queue across macOS, Windows, and Linux, using Music.app, Safari, the Apple Music API, or Chrome.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP clients to search and browse the Apple Music catalog, manage library items, ratings, favorites and playlists with nested folders, and control playback, volume, shuffle, repeat and the Up Next queue. Runs via native Music.app, Safari, Chrome, or the Apple Music web API, so it works on macOS, Windows and Linux with just a Mac or an Apple Music subscription.
      -