spotifyMCP
Allows control of Spotify playback, management of playlists and library, searching music, and retrieving user profile and listening history via the Spotify Web API.
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., "@spotifyMCPplay 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.
spotifyMCP
MCP server for Spotify. Control playback, manage playlists, search music, and more — from any MCP-compatible AI client.
34 tools. 2 dependencies. Works locally or on a server.
Quick Start
git clone https://github.com/real-kijmoshi/SpotifyMCP.git
cd spotifyMCP
npm install # or bun install
npm run setup # or bun run setupThe setup script will:
Show you where to get a Spotify Developer app
Ask for your Client ID, Secret (optional), port, and webhook URL
Generate an API key to protect your server from unauthorized access
Open Spotify authorization in your browser
Handle the OAuth callback automatically
Optionally start the server with a public tunnel (cloudflared) and run it as a background service (pm2)
Related MCP server: Spotify MCP Server
Connect to Claude Desktop
Add one of these to claude_desktop_config.json:
Local (stdio):
{
"mcpServers": {
"spotify": {
"command": "node",
"args": ["/absolute/path/to/spotifyMCP/src/index.js", "--stdio"]
}
}
}HTTP (local or remote):
{
"mcpServers": {
"spotify": {
"url": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Via tunnel (public URL):
{
"mcpServers": {
"spotify": {
"url": "https://your-tunnel.trycloudflare.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Running
# Local stdio mode (for Claude Desktop)
node src/index.js --stdio
# HTTP server on port 3000
node src/index.js --port 3000
# HTTP server with public tunnel
node src/index.js --port 3000 --tunnel
# As a pm2 background service with tunnel
npm run service:installService Management
npm run service:logs # view logs (shows tunnel URL)
npm run service:status # check status
npm run service:restart # restart
npm run service:stop # stop
npm run service:remove # remove serviceGetting a Spotify Client ID
Log in with your Spotify account
Click Create App
Set a name (e.g. "spotifyMCP") and description
Add Redirect URI:
http://127.0.0.1:3080/callback(local) or the HTTPS URL shown during setup (server)Click Save
Copy your Client ID from the app settings page
Server Setup
When running on a remote server, the setup automatically starts a cloudflared tunnel for the OAuth callback. This gives you a real HTTPS URL (e.g. https://xxxx.trycloudflare.com/callback) that Spotify accepts.
cloudflared must be installed (
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/)The tunnel starts on port 3080, gets a temporary HTTPS URL, then closes after auth completes
No self-signed certs, no SSH tunnels needed
Tools (34)
Playback
Tool | Description |
| Get current playback state |
| Get currently playing track |
| Start or resume playback |
| Pause playback |
| Skip to next track |
| Skip to previous track |
| Seek to position (ms) |
| Set volume (0-100) |
| Toggle shuffle mode |
| Set repeat mode |
| Transfer to another device |
Search
Tool | Description |
| Search tracks, artists, albums, playlists |
| Search tracks only |
| Search artists only |
| Search albums only |
| Search playlists only |
Playlists
Tool | Description |
| List your playlists |
| Get playlist and its tracks |
| Create a new playlist |
| Add tracks to playlist |
| Remove tracks from playlist |
| Follow/save a playlist |
Profile & Discovery
Tool | Description |
| Get your Spotify profile |
| Get your top tracks |
| Get your top artists |
| List available devices |
| Get recently played tracks |
Library
Tool | Description |
| List saved/liked tracks |
| List saved albums |
| Check if tracks are in library |
| Save tracks to library |
| Remove tracks from library |
Queue
Tool | Description |
| Get current playback queue |
| Add track to queue |
Architecture
spotifyMCP/
├── setup.js # Interactive quickstart CLI
└── src/
├── index.js # Entry point (--stdio or --port N --tunnel)
├── create-server.js # McpServer factory + tool registration
├── http-handler.js # node:http + StreamableHTTPServerTransport
├── tunnel.js # Auto-detect cloudflared / localtunnel
├── auth/
│ ├── oauth.js # PKCE generation, token exchange/refresh
│ ├── auth-server.js # Ephemeral OAuth callback server
│ └── token-store.js # .spotify-auth.json persistence
├── spotify/
│ └── api.js # Spotify Web API fetch wrapper
└── tools/ # 7 tool modules, 34 tools totalConfig (.env)
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=optional
REDIRECT_URI=http://127.0.0.1:3080/callback
MCP_PORT=3000
MCP_API_KEY=auto_generated_key
LOCATION=local
# SERVER_IP=10.0.0.5
# WEBHOOK_URL=Authentication
When running in HTTP mode (especially with a public tunnel), the server is protected by an API key. The setup script generates one automatically.
For Claude Desktop, add the headers field:
{
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}The API key is required for all HTTP requests. Stdio mode (local) does not use API key auth since it's already protected by process isolation.
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
- Alicense-qualityDmaintenanceEnables interaction with Spotify through natural language for music discovery, playback control, library management, and playlist creation. Supports searching for music, controlling playback, managing saved tracks, and getting personalized recommendations based on mood and preferences.Last updated2025MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to control Spotify playback, search for music, manage playlists, and interact with your Spotify library through natural language commands.Last updated19
- 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 updated13202MIT
Related MCP Connectors
Manage SRG+ hubs, channels, content, assets, users, and workspaces from any MCP-aware AI agent.
Hosted MCP with 91 agent tools: X, domains, SEO, Maps, Trends, Search, YouTube, TikTok, and more.
MCP server for Suno AI music generation, lyrics, and covers
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/real-kijmoshi/SpotifyMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server