MCP server connecting LLMs to Spotify, with smart-batching and large-playlist tools
Project description
spotify-mcp MCP server
mcp-name: io.github.jamiew/spotify-mcp
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
- Create an app at developer.spotify.com/dashboard.
- Add redirect URI
http://127.0.0.1:8888— it must match exactly what you set below. - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spotify_mcp_jamiew-0.3.1.tar.gz.
File metadata
- Download URL: spotify_mcp_jamiew-0.3.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1fb7260f1d3b766bd2b890a32c4f858a88e294feaea39558c7ddeb9f7fb4157
|
|
| MD5 |
b45b7fb7624d3968475b1d79040d4ad4
|
|
| BLAKE2b-256 |
f74c0855710d0f3aeac0a841065b3461879546ab7bf8e1d977e729d303a15a21
|
Provenance
The following attestation bundles were made for spotify_mcp_jamiew-0.3.1.tar.gz:
Publisher:
publish.yml on jamiew/spotify-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spotify_mcp_jamiew-0.3.1.tar.gz -
Subject digest:
b1fb7260f1d3b766bd2b890a32c4f858a88e294feaea39558c7ddeb9f7fb4157 - Sigstore transparency entry: 1665383985
- Sigstore integration time:
-
Permalink:
jamiew/spotify-mcp@5953aee845a1bb1977ef9c45647a02959f3cdda9 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/jamiew
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5953aee845a1bb1977ef9c45647a02959f3cdda9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spotify_mcp_jamiew-0.3.1-py3-none-any.whl.
File metadata
- Download URL: spotify_mcp_jamiew-0.3.1-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61666f4efcc47b40d3e11966ecc8653f3e5d0b5183a92d48badb9c00acaaf8bf
|
|
| MD5 |
f1641a09d869e0e2d4daee2ddef6a3e0
|
|
| BLAKE2b-256 |
afcc07ed0274f3c6377a241e5669f168ab04ce0bb52db4188de15e8193bad9d2
|
Provenance
The following attestation bundles were made for spotify_mcp_jamiew-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on jamiew/spotify-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spotify_mcp_jamiew-0.3.1-py3-none-any.whl -
Subject digest:
61666f4efcc47b40d3e11966ecc8653f3e5d0b5183a92d48badb9c00acaaf8bf - Sigstore transparency entry: 1665384155
- Sigstore integration time:
-
Permalink:
jamiew/spotify-mcp@5953aee845a1bb1977ef9c45647a02959f3cdda9 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/jamiew
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5953aee845a1bb1977ef9c45647a02959f3cdda9 -
Trigger Event:
release
-
Statement type: