Skip to main content

MCP server connecting LLMs to Spotify, with smart-batching and large-playlist tools

Project description

spotify-mcp MCP server

MCP server connecting Claude with Spotify. This fork of varunneal/spotify-mcp adds smart-batching tools and advanced playlist features that optimize API usage.

Features

Core Functionality

  • Playback Control: Start, pause, skip tracks, manage queue
  • Search & Discovery: Find tracks, albums, artists, playlists with pagination
  • Real-time State: Live user profile and playback status
  • Resources: Read user, playback, track, playlist, artist, and album state by URI

Modern MCP Protocol

  • Structured output: every tool returns a typed schema, not a bare dict
  • Tool annotations & icons: read-only/destructive hints, titles, and a Spotify glyph
  • Progress notifications: live updates while paginating large playlists
  • Elicitation: destructive playlist removals ask for confirmation on clients that support it

Enhanced Playlist Tools (New in this fork)

  • Smart Batch Operations: Add/remove up to 100 tracks in single API calls
  • Large Playlist Support: Efficiently handle playlists with 1000+ tracks using pagination
  • Advanced Playlist Management: Create, modify details, bulk track operations
  • API-Optimized Workflows: Intelligent batching reduces API calls by 60-80%

Installation

Requires a Spotify Premium account and uv >= 0.54.

1. Get Spotify API keys

  1. Create an app at developer.spotify.com/dashboard.
  2. Add redirect URI http://127.0.0.1:8888 — it must match exactly what you set below.
  3. Copy the Client ID and Client Secret.

2. Add the server to your MCP client

Every client runs the same command — uvx spotify-mcp-jamiew — with your three Spotify env vars. No clone, no local path.

Standard config (works in most clients):

{
  "mcpServers": {
    "spotify": {
      "command": "uvx",
      "args": ["spotify-mcp-jamiew"],
      "env": {
        "SPOTIFY_CLIENT_ID": "your_client_id",
        "SPOTIFY_CLIENT_SECRET": "your_client_secret",
        "SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8888"
      }
    }
  }
}
Claude Code
claude mcp add spotify \
  -e SPOTIFY_CLIENT_ID=your_client_id \
  -e SPOTIFY_CLIENT_SECRET=your_client_secret \
  -e SPOTIFY_REDIRECT_URI=http://127.0.0.1:8888 \
  -- uvx spotify-mcp-jamiew

Add -s user to install it globally across all projects. Verify with claude mcp list.

Claude Desktop

Add the standard config above to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows), then fully restart Claude Desktop.

Codex CLI
codex mcp add spotify \
  --env SPOTIFY_CLIENT_ID=your_client_id \
  --env SPOTIFY_CLIENT_SECRET=your_client_secret \
  --env SPOTIFY_REDIRECT_URI=http://127.0.0.1:8888 \
  -- uvx spotify-mcp-jamiew

Or add to ~/.codex/config.toml:

[mcp_servers.spotify]
command = "uvx"
args = ["spotify-mcp-jamiew"]

[mcp_servers.spotify.env]
SPOTIFY_CLIENT_ID = "your_client_id"
SPOTIFY_CLIENT_SECRET = "your_client_secret"
SPOTIFY_REDIRECT_URI = "http://127.0.0.1:8888"
Run from source (local dev)
git clone https://github.com/jamiew/spotify-mcp.git
cd spotify-mcp
uv sync

Then point your client at the checkout:

{
  "mcpServers": {
    "spotify": {
      "command": "uv",
      "args": ["--directory", "/path/to/spotify-mcp", "run", "spotify-mcp"],
      "env": {
        "SPOTIFY_CLIENT_ID": "your_client_id",
        "SPOTIFY_CLIENT_SECRET": "your_client_secret",
        "SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8888"
      }
    }
  }
}

To run the latest unpublished commit without cloning: uvx --from git+https://github.com/jamiew/spotify-mcp.git spotify-mcp.

On first use the server opens a browser for Spotify OAuth; the token is cached locally for later runs.

Usage Examples

  • "Create a chill study playlist with 20 tracks" → Search + playlist creation + bulk track addition
  • "Show me the first 50 tracks from my 'Liked Songs'" → Pagination for large playlists
  • "Find similar artists to Radiohead and add their top tracks to my queue" → Search + artist info + queue management

Development

Built with the FastMCP framework — focused single-purpose tools spanning playback, search, queue, and playlist management, with type-safe APIs and comprehensive test coverage.

Debug with MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory /path/to/spotify_mcp run spotify-mcp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotify_mcp_jamiew-0.3.0.tar.gz (5.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spotify_mcp_jamiew-0.3.0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file spotify_mcp_jamiew-0.3.0.tar.gz.

File metadata

  • Download URL: spotify_mcp_jamiew-0.3.0.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spotify_mcp_jamiew-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c7379c781ffa1ff05b77c56bf2c54b11880b2a7553afc4e570ce503fbde94945
MD5 8e142d9caa9e6241c2004e03fbac7cdf
BLAKE2b-256 5029bd92999343ea94b89af1b2355d60cfb770619db371915796258316d821c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for spotify_mcp_jamiew-0.3.0.tar.gz:

Publisher: publish.yml on jamiew/spotify-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spotify_mcp_jamiew-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for spotify_mcp_jamiew-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7491fe17d70842c30ade7061c1eebd2597cd6c190db08f713a53d99a7adb2f3
MD5 664698204e7c9855df379e31291d2815
BLAKE2b-256 6c1d3bc3311b0bd38101fd809c8a7b31e5092688dc08908109530d28e78e937b

See more details on using hashes here.

Provenance

The following attestation bundles were made for spotify_mcp_jamiew-0.3.0-py3-none-any.whl:

Publisher: publish.yml on jamiew/spotify-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page