Spotify MCP Server
Provides tools for interacting with the Spotify Web API, enabling AI assistants to search the catalog, control playback and volume, manage the queue, and edit playlists, albums, saved tracks, and library items.
Click on "Deploy 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 lightweight Model Context Protocol (MCP) server that lets AI assistants like Claude, Codex and Cursor control Spotify playback and manage your library and playlists.
About β’ Examples β’ Tools β’ Getting started β’ MCP clients β’ Credits
π About
This server exposes the Spotify Web API as 30 MCP tools, so an AI assistant can search the catalog, see whatβs playing, control playback and volume, manage the queue and edit your playlists and library, all in natural language.
Based on marcelmarais/spotify-mcp-server. This version keeps the original implementation and adds:
π³ a Docker-first workflow with Docker Compose
βοΈ configuration through a local
.envfileπ persisted OAuth tokens in a mounted volume, with proactive refresh every 45 minutes
π extra tools:
getTopTracks,getTopArtistsandunfollowPlaylistπ€ a setup that works out of the box with Codex, Claude and Cursor
Related MCP server: spotify-mcp-server
π¬ Example prompts
"Play Elvisβs first song"
"Create a Taylor Swift / Slipknot fusion playlist"
"Copy all the techno tracks from my workout playlist to my work playlist"
"What have I been listening to the most this month?"
"Turn the volume down a bit"
π§° Tools
Tool | Description |
| Search for tracks, albums, artists or playlists |
| Current track, progress, device, volume and shuffle/repeat state |
| The current userβs playlists |
| Tracks in a playlist |
| Recently played tracks |
| Tracks in "Liked Songs" (paginated) |
| The userβs most-played tracks over a time range |
| The userβs most-played artists over a time range |
| Current track and upcoming items in the queue |
| Available Spotify Connect devices |
| Remove tracks from "Liked Songs" (max 40) |
Tool | Description |
| Play a track, album, artist or playlist (by URI or type + ID) |
| Pause playback |
| Resume playback |
| Skip to the next track |
| Go back to the previous track |
| Add an item to the playback queue |
| Set the volume to a percentage (Premium) |
| Raise or lower the volume by a relative amount (Premium) |
Tool | Description |
| Details for one or more albums (max 20) |
| Tracks from an album (paginated) |
| Save or remove albums from "Your Music" |
| Check whether albums are saved in the library |
Tool | Description |
| Create a new playlist |
| Playlist details: owner, track count, visibility, description |
| Change name, description, public or collaborative settings |
| Add tracks to a playlist |
| Remove tracks from a playlist (max 100) |
| Move a range of tracks to a new position |
| Remove a playlist from the userβs library |
π Getting started
Prerequisites
Docker Desktop (recommended) or Node.js 20+
A Spotify Premium account (required for playback controls)
An app in the Spotify Developer Dashboard
1. Create a Spotify app
Open the Spotify Developer Dashboard and click Create app.
Add
http://127.0.0.1:8888/callbackas a Redirect URI.Copy the appβs Client ID and Client Secret.
2. Run with Docker (recommended)
# Clone the repository
git clone https://github.com/agustinhopneto/spotify-mcp-server.git
cd spotify-mcp-server
# Create your .env and fill SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET
cp .env.example .env
# Build the image
npm run docker:build
# Authorize your Spotify account (opens the OAuth flow on port 8888)
npm run docker:auth
# Start the server in the background
npm run docker:upTokens are saved to data/spotify-config.json. Never commit or share this file. If Spotify revokes the token or the automatic refresh fails, run npm run docker:auth again.
Command | Description |
| Build or update the image |
| Connect your Spotify account in the browser |
| Start the container in the background |
| Follow the container logs |
| Stop the container |
Alternative: run with Node.js
npm install
cp spotify-config.example.json spotify-config.json # add your clientId, clientSecret and redirectUri
npm run auth # authorize your account; tokens are saved to spotify-config.json
npm run buildπ Connecting an MCP client
MCP talks over stdio, so the client starts one MCP process per connection.
With Docker: the process runs inside the persistent container. Run npm run docker:up first and replace the path with your own:
{
"mcpServers": {
"spotify": {
"command": "docker",
"args": [
"compose", "-f", "/absolute/path/to/spotify-mcp-server/compose.yaml",
"exec", "-T", "spotify-mcp", "node", "build/index.js"
]
}
}
}With Node.js:
{
"mcpServers": {
"spotify": {
"command": "node",
"args": ["/absolute/path/to/spotify-mcp-server/build/index.js"]
}
}
}This configuration works with Claude Desktop, Codex, Cursor (Settings β MCP) and Cline (cline_mcp_settings.json).
π§± Architecture
flowchart LR
AI[AI assistant<br/><sub>Claude Β· Codex Β· Cursor</sub>] <-->|MCP over stdio| S[Spotify MCP Server]
S -->|Spotify Web API SDK| SP[(Spotify)]
S <--> T[(spotify-config.json<br/><sub>OAuth tokens</sub>)]src/
βββ index.ts # MCP server bootstrap + token refresh
βββ auth.ts # OAuth authorization flow
βββ read.ts # Read tools
βββ play.ts # Playback tools
βββ albums.ts # Album tools
βββ playlist.ts # Playlist tools
βββ utils.ts # Spotify client, token handling, helpers
βββ types.tsπ οΈ Development
Command | Description |
| Compile TypeScript to |
| Lint with Biome |
| Fix lint issues |
| Type check |
CI runs lint and type checking on every push and pull request, and Dependabot keeps the dependencies up to date.
π Credits
This project is based on marcelmarais/spotify-mcp-server. All credit for the original implementation goes to its author and contributors. β Go give the original a star!
Maintained with π by Agustinho Neto
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Producer/Riffusion AI music generation
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for AI dialogue using various LLM models via AceDataCloud
An MCP server that gives your AI access to the source code and docs of all public github repos
Related MCP Servers
- AlicenseBqualityDmaintenanceA simple MCP server that allows AI assistants like Cursor or Claude Desktop to search for and play tracks on YouTube Music through natural language commands.221 npm12MIT
- AlicenseNot gradedqualityDmaintenanceAn unofficial MCP server that provides access to Spotify's Web API through the Model Context Protocol, enabling AI assistants to search music, manage playlists, and control playback.5 npm9ISC
- FlicenseAqualityDmaintenanceA lightweight MCP server that enables AI assistants like Cursor and Claude to control Spotify playback, playlists, and manage tokens via OAuth.152-
- AlicenseAqualityDmaintenanceMCP server to control Spotify conversationally from Claude, Cursor, and other AI clients.1199 npm1MIT