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.
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.
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
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
Spotify MCP server for ChatGPT, Claude and any AI agent: search songs and artists, list playlists, read playlist songs, create playlist, add songs to playlist, remove songs from playlist, set playlist public or private and save to Liked Songs in your own Spotify account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Spotify yourself; Cotlet does not store your password and you need no Spotify API key. About the official Spotify API: Spotify has a full Web API and, since 23 Apr 2026, an official connector for Claude (checked 5 Nov 2026). The API needs an app you register, and in development mode the app owner must have Premium and the app allows 5 users; unlimited users need a registered business with at least 250,000 monthly users. Setup and FAQ: https://cotlet.dev/integrations/spotify-api-mcp-server
Full Spotify Web API coverage - albums, artists, playlists, player controls, and more.
Control Android TV from any AI. 38 MCP tools: playback, recap, recommend, smart-home, schedules.
Automate 1,000+ services from any MCP-compatible AI agent: build Applets, run actions and queries.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables AI assistants to control Spotify playback, search for music, manage playlists, and interact with your Spotify library through natural language commands.19-
- 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-
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Spotify through MCP, providing tools for searching tracks, artists, albums, playlists, and accessing user data like top tracks and recently played.-
- FlicenseAqualityDmaintenanceExposes Spotify controls as MCP tools for playback, playlist management, and AI playlist generation; includes a web app and supports multi-user profiles.14-