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.
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 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
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP server to control your Android phone from AI assistants with per-app permissions.
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
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.213MIT
- FlicenseNot 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.9-
- FlicenseAqualityDmaintenanceA lightweight MCP server that enables AI assistants like Cursor and Claude to control Spotify playback, playlists, and manage tokens via OAuth.152-
- AlicenseAqualityCmaintenanceMCP server to control Spotify conversationally from Claude, Cursor, and other AI clients.11142 npm2MIT