Spotify MCP Server
Integrates with the Spotify Web API to search music, control playback (play, pause, next, previous, set volume), manage Spotify Connect devices, and retrieve user profile and playback state.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Spotify MCP Serverplay my Discover Weekly playlist"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Spotify MCP Server
A Streamable HTTP Model Context Protocol (MCP) server for Spotify Web API integrations. It gives AI agents a clean tool surface for Spotify search, playback state, devices, queue inspection, playlist playback and basic playback control without browser automation.
Status
Stable v1.0.0 release.
This project supports two authentication modes:
local-token: local single-user OAuth for personal agents, demos and local development.delegated-token: host backends manage users, OAuth, refresh and encryption, then delegate a Spotify access token to this MCP server per request/session.
The server is intentionally a Spotify tool runtime. It does not manage host users, persist delegated tokens or store multi-user credentials.
Related MCP server: Spotify MCP Server
Features
Streamable HTTP MCP transport.
Official Spotify Authorization Code OAuth for local single-user usage.
Delegated access-token mode via
x-spotify-access-token.Automatic access-token refresh for local OAuth tokens.
Spotify profile, search, devices, playback state, current track and queue tools.
Playlist listing, playlist track listing and playlist playback.
Album track listing for public Spotify catalog albums.
Playback controls: play, search-and-play, pause, next, previous, volume, queue add and playback transfer.
Dockerfile and Compose example for containerized deployments.
Requirements
Spotify account.
Spotify Developer application.
Spotify Premium for Spotify playback-control endpoints.
Node.js
>=22for local development.Docker for containerized runtime.
Quick Start
Install dependencies:
npm installCopy the environment example:
cp .env.example .envCreate a Spotify Developer application and add this redirect URI:
http://127.0.0.1:11070/auth/callbackThen set SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET in .env.
Build and start:
npm run build
npm startOpen the local OAuth login URL:
http://localhost:11070/auth/loginAfter authorization, check status:
curl http://localhost:11070/auth/statusMCP endpoint:
http://localhost:11070/mcpEnvironment Variables
Variable | Required | Default | Purpose |
| No |
| HTTP server port. |
| No |
| HTTP bind host. |
| Local OAuth | none | Spotify Developer application client id. |
| Local OAuth | none | Spotify Developer application client secret. |
| Local OAuth |
| Spotify OAuth callback URI. |
| No |
| Local single-user token file. |
| No | v1 scope set | Comma-separated scopes requested by local OAuth. |
Do not commit .env or .spotify-token.json.
Running With Docker
Build and run with the example Compose file:
cp .env.example .env
docker compose -f docker-compose.example.yml up --buildThe example binds the server to loopback:
127.0.0.1:11070Authentication Modes
Local Token Mode
Use this mode for personal agents and local demos. The MCP server owns the local OAuth flow, stores one local token file and refreshes that token when needed.
Relevant endpoints:
GET /auth/loginGET /auth/callbackGET /auth/status
See Local Spotify OAuth Setup.
Delegated Token Mode
Use this mode when another backend owns users and Spotify OAuth. The host backend passes a valid Spotify access token to MCP HTTP requests:
x-spotify-access-token: <spotify-access-token>Bearer form is also accepted:
x-spotify-access-token: Bearer <spotify-access-token>The delegated token is kept only in memory for the active MCP session. It is not written to disk.
See Delegated Token Mode.
MCP Tool Surface
v1.0.0 exposes these tools:
Tool | Purpose |
| Validates MCP transport without calling Spotify. |
| Reads the authenticated Spotify profile. |
| Searches tracks, artists, albums and playlists. |
| Lists current-user playlists. |
| Lists Spotify Connect devices. |
| Reads current playback state. |
| Reads the current track or episode. |
| Reads current item and upcoming queue. |
| Reads the next queued item only. |
| Lists tracks from a playlist. |
| Lists tracks from an album. |
| Starts or resumes playback from an exact Spotify URI. |
| Searches a track and plays the best match. |
| Adds a track or episode to the queue. |
| Starts playlist playback, optionally from a position. |
| Transfers playback to a Spotify Connect device. |
| Pauses playback. |
| Skips to the next track. |
| Skips to the previous track. |
| Sets playback volume. |
See Tool Contract for schemas, scopes and output shape.
HTTP Surface
Route | Purpose |
| Process healthcheck. |
| Readiness check for local OAuth token availability. |
| Liveness check. |
| Starts local Spotify OAuth. |
| Handles local Spotify OAuth callback. |
| Reports local OAuth status. |
| Streamable HTTP MCP requests. |
| Streamable HTTP SSE stream for an MCP session. |
| Terminates an MCP session. |
Security Notes
Use the official Spotify Web API, not browser automation.
Never commit client secrets, access tokens or refresh tokens.
Keep
.envand.spotify-token.jsonout of git and Docker build context.Request only the scopes required by enabled tools.
Treat playback commands as user-visible side effects.
Host backends should own user identity, authorization policy, token encryption and refresh when using delegated mode.
Documentation
Non-Goals For v1.0.0
Multi-user token storage inside this MCP server.
Host application user management.
Playlist write operations.
Browser automation.
Bypassing CAPTCHAs or platform safety systems.
Reverse engineering Spotify clients.
License
MIT.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables interaction with Spotify through LLMs using OAuth2 authentication. Supports music search, playback control, playlist management, and device management through natural language commands.Last updated142MIT
- Flicense-qualityDmaintenanceEnables control of Spotify playback through OAuth authentication, including play/pause, track navigation, volume control, device management, and searching/playing songs by artist or track name.Last updated1
- FlicenseAqualityDmaintenanceEnables AI assistants to control Spotify playback, search for music, manage playlists, and access library information through the Spotify API. Requires Spotify Premium for playback control features.Last updated4
- AlicenseBqualityDmaintenanceEnables AI assistants to control Spotify playback, manage playlists, search music, and access listening history. Requires Spotify Premium and uses secure OAuth 2.0 with PKCE authentication.Last updated13170MIT
Related MCP Connectors
15 media & data tools for AI agents: search, transcribe, subtitles, voiceover, translate & more.
Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.
Connect AI agents to bank accounts, transactions, balances, and investments.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AlexanderMolano-spec/spotify-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server