spotify-mcp
Provides tools for searching Spotify, managing playlists (create, update, add/remove/reorder tracks), managing liked songs library, controlling playback (play, pause, next, previous, queue), and retrieving user profile and playback state.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
spotify-mcp
A remote MCP (Model Context Protocol) server for Spotify, running on Cloudflare Workers. It lets an AI assistant search Spotify and manage your playlists, library and playback — including moving tracks around inside playlists.
Auth is handled entirely over the web: the server is its own OAuth provider to
the MCP client, and performs the Spotify OAuth flow upstream. There is no local
binary and no authenticate tool — connecting the server in your MCP client
opens the Spotify consent screen in your browser.
Architecture
McpAgent(SpotifyMCP, a Durable Object) hosts the MCP server and tools, served over Streamable HTTP at/mcp(and legacy SSE at/sse).@cloudflare/workers-oauth-providerwraps the Worker. It issues tokens to MCP clients and stores the upstream Spotify tokens (access + refresh) encrypted in the grantprops.SpotifyHandler(Hono app) implements/authorizeand/callback, driving the Spotify authorization-code flow and showing the consent dialog.The agent persists a working access token in its Durable Object state and refreshes it automatically using the stored refresh token.
MCP client ──/mcp──▶ OAuthProvider ──▶ SpotifyMCP (Durable Object)
│ │ │
/authorize /callback Spotify Web API
└────── Spotify consent (browser) ────────┘Related MCP server: Cloudflare Remote MCP Server
Tools
Tool | What it does |
| Current user profile |
| Search tracks / albums / artists / playlists |
| Your playlists |
| Playlist details + tracks with their positions |
| Create a playlist |
| Rename / re-describe / change public state |
| Add tracks, optionally at a specific position |
| Remove tracks |
| Move a track (or range of tracks) to a new position |
| Unfollow / delete a playlist |
| Liked-songs library |
| What's playing, on which device |
| play / pause / next / previous (Premium + active device) |
| Queue a track |
Deploy it yourself
Runs on the Cloudflare Workers free tier.
Prerequisites
A Cloudflare account and the Wrangler CLI logged in (
npx wrangler login).A Spotify Developer account.
Node.js 18+.
0. Get the code
git clone https://github.com/lassejlv/spotify-mcp.git
cd spotify-mcp
npm install --ignore-scripts # --ignore-scripts avoids an unused native build (sharp)1. Create a Spotify app
At https://developer.spotify.com/dashboard, create an app and note the Client ID and Client Secret. Under Redirect URIs, add your Worker's callback URL:
https://spotify-mcp.<your-subdomain>.workers.dev/callback(The workers.dev subdomain is shown after the first wrangler deploy. Add the
URI, then deploy again if needed. A custom domain's /callback works too.)
2. Create the KV namespace
The OAuth provider stores grants, tokens and clients in KV.
npx wrangler kv namespace create OAUTH_KVCopy the returned id into wrangler.jsonc, replacing the existing OAUTH_KV
id value (the checked-in one belongs to the original author's account and won't
work for you).
3. Set secrets
npx wrangler secret put SPOTIFY_CLIENT_ID # your Spotify Client ID
npx wrangler secret put SPOTIFY_CLIENT_SECRET # your Spotify Client Secret
npx wrangler secret put COOKIE_ENCRYPTION_KEY # any random string, e.g. `openssl rand -hex 32`Optional — restrict who can use the server:
# Comma-separated allowlist of Spotify account emails. Only these accounts can
# authorize; everyone else is rejected at the callback (no token issued).
# Leave unset to allow any Spotify account.
npx wrangler secret put ALLOWED_EMAILS # e.g. me@example.com,friend@example.com4. Deploy
npx wrangler deployYour server is now live at https://spotify-mcp.<your-subdomain>.workers.dev/mcp.
Connect an MCP client
Point any remote-MCP-capable client at the /mcp URL. Clients that only speak
stdio can bridge via mcp-remote:
{
"mcpServers": {
"spotify": {
"command": "npx",
"args": ["mcp-remote", "https://spotify-mcp.<your-subdomain>.workers.dev/mcp"]
}
}
}On first connect, your browser opens: approve the MCP client, then log in and grant Spotify access. Tokens are refreshed automatically thereafter.
Local development
cp .dev.vars.example .dev.vars # then fill in the three values
npx wrangler devwrangler dev simulates KV locally. Use http://localhost:8788/callback as an
additional Spotify redirect URI for local testing.
Notes
Tracks and playlists can be referenced by bare ID or full
spotify:URI in any tool.reorder_playlist_tracksuses zero-based positions; callget_playlist_tracksfirst to see current positions.Playback control endpoints require Spotify Premium and an active device.
Requested scopes: playlist read/modify (public + private), library read/modify, playback read/modify,
user-read-private, anduser-read-email(used for theALLOWED_EMAILSaccess gate).Access control: set the
ALLOWED_EMAILSsecret to a comma-separated list to restrict the server to specific Spotify accounts; leave it unset to allow anyone.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Spotify MCP server for ChatGPT, Claude and any AI agent: search songs and artists, list playlists, read playlist songs, create playlist, add songs to playlist, remove songs from playlist, set playlist public or private and save to Liked Songs in your own Spotify account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Spotify yourself; Cotlet does not store your password and you need no Spotify API key. About the official Spotify API: Spotify has a full Web API and, since 23 Apr 2026, an official connector for Claude (checked 5 Nov 2026). The API needs an app you register, and in development mode the app owner must have Premium and the app allows 5 users; unlimited users need a registered business with at least 250,000 monthly users. Setup and FAQ: https://cotlet.dev/integrations/spotify-api-mcp-server
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Official Fibery MCP server: query and update your workspace from any AI client via OAuth.
Zero-dependency Cloudflare Worker gateway turning websites and REST APIs into MCP tools.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables remote interaction with Spotify through the Model Context Protocol, allowing users to search tracks, control playback, and manage playlists with per-user OAuth authentication. It is hosted on Cloudflare Workers and supports remote MCP over HTTP for compatible clients.2-
- FlicenseNot gradedqualityNot gradedmaintenanceEnables running a remote MCP server on Cloudflare Workers with OAuth login, allowing AI clients like Claude to interact with tools via SSE.15-
- AlicenseNot gradedqualityDmaintenanceEnables deploying a remote MCP server on Cloudflare Workers without authentication, and connecting it to Cloudflare AI Playground or Claude Desktop.919 npm9MIT
- FlicenseNot gradedqualityCmaintenanceEnables deploying a remote MCP server without authentication on Cloudflare Workers, and connecting to it from Cloudflare AI Playground or Claude Desktop.1-