spotify-mcp
Provides tools for searching tracks and controlling Spotify playback, including play, pause, skip, queue, current track information, device management, and volume control.
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-mcpPlay Everlong by Foo Fighters"
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
Model Context Protocol (MCP) server for Spotify. Let AI agents like Cursor, Claude Code, and Codex search tracks and control playback through the Spotify Web API.
Features
Search tracks by title, artist, or natural language
Play, pause, resume, skip, and go previous
Search-and-play / search-and-queue in one step
Read what’s currently playing
List Spotify Connect devices and transfer playback
Set volume (0–100%)
OAuth login with automatic token refresh
Related MCP server: Spotify MCP Server
Requirements
Node.js 18+
A Spotify Premium account (playback control requires Premium)
A Spotify Developer app (Dashboard)
Quick start
1. Clone and install
git clone https://github.com/AndreaZero/spotify-mcp.git
cd spotify-mcp
npm install2. Create a Spotify app
Open the Spotify Developer Dashboard.
Create an app.
Under Redirect URIs, add:
http://127.0.0.1:8888/callbackCopy the Client ID and Client Secret.
3. Configure environment
cp .env.example .envEdit .env:
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
SPOTIFY_REDIRECT_URI=http://127.0.0.1:8888/callback4. Authenticate
npm run authOpen the printed URL in your browser, approve access, then wait until you see Spotify authentication successful. Tokens are saved to .spotify-token.json (gitignored) and refreshed automatically.
5. Run
npm startCursor setup
Add the server to your MCP config (e.g. ~/.cursor/mcp.json or project .cursor/mcp.json):
{
"mcpServers": {
"spotify": {
"command": "npx",
"args": ["tsx", "src/index.ts"],
"cwd": "/absolute/path/to/spotify-mcp",
"env": {
"SPOTIFY_CLIENT_ID": "your_spotify_client_id",
"SPOTIFY_CLIENT_SECRET": "your_spotify_client_secret",
"SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8888/callback"
}
}
}
}On Windows, use a full path for cwd, for example:
C:\\Users\\you\\Documents\\cursor-projects\\spotify-mcpYou can omit env if credentials already live in the project .env and the process starts with that working directory.
After saving, restart Cursor (or reload MCP servers), then try:
Play Everlong by Foo Fighters
What’s playing right now?
Set volume to 30
Claude Desktop / other MCP clients
Same idea: run npx tsx src/index.ts with cwd set to this repo and the Spotify env vars available.
Tools
Tool | Description |
| Search tracks ( |
| Play a track URI on the active (or given) device |
| Search and play the best match |
| Pause playback |
| Resume playback |
| Skip to next track |
| Go to previous track |
| Queue a track URI |
| Search and queue the best match |
| Current track and progress |
| List Spotify Connect devices |
| Transfer playback to another device |
| Set volume 0–100% |
Scripts
Command | Description |
| Browser OAuth login; writes |
| Start the MCP server on stdio |
| Open the MCP Inspector against this server |
| Run TypeScript checks |
Project layout
spotify-mcp/
├── src/
│ ├── index.ts # MCP server & tools
│ ├── auth.ts # OAuth authorization flow
│ └── spotify.ts # Spotify Web API client + token refresh
├── .env.example
├── package.json
└── tsconfig.jsonOAuth scopes
The auth flow requests:
user-read-playback-stateuser-read-currently-playinguser-modify-playback-state
For a longer walkthrough, see docs/SETUP.md.
Troubleshooting
“Spotify not authenticated”
Run npm run auth again from the project root.
“No active device” / playback errors
Open Spotify on a phone, desktop, or web player so a Connect device is available, then call spotify_devices or spotify_transfer.
Redirect URI mismatch
The URI in the Dashboard must match SPOTIFY_REDIRECT_URI exactly (default http://127.0.0.1:8888/callback).
Token expired
Refresh is automatic when a refresh token exists. If refresh fails, delete .spotify-token.json and run npm run auth again.
Security
Do not commit
.envor.spotify-token.json.Keep your Client Secret private.
See SECURITY.md for reporting issues.
Contributing
See CONTRIBUTING.md.
License
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.142MIT
- 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.4
- Alicense-qualityDmaintenanceEnables AI agents to create, manage, and populate Spotify playlists using the Spotify Web API.3MIT
- Flicense-qualityDmaintenanceEnables AI assistants to control Spotify playback, search music, manage playlists and library, and access user listening insights via the Spotify Web API.
Related MCP Connectors
15 media & data tools for AI agents: search, transcribe, subtitles, voiceover, translate & more.
Generate AI music via the Lacuna Music API from MCP clients like Claude Desktop & Code.
The best web search for your AI Agent
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/AndreaZero/spotify-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server