Spotify MCP Server
The Spotify MCP Server enables natural language control of Spotify through the Model Context Protocol, allowing comprehensive music playback and management via voice or text commands.
Capabilities:
Play Content - Play specific playlists, albums, or tracks by name with optional artist filtering
Search Music - Find tracks, albums, and artists using queries with customizable result limits
Playback Control - Play, pause, skip forward/backward, and adjust volume (0-100%)
Now Playing Info - Get details about the currently playing track
Sleep Timer - Set automatic playback pause after a specified duration in minutes
Timer Management - Cancel (specific or all) and list active sleep timers
Multi-Device Support - Target specific Spotify devices for playback control
Enables Siri voice command integration through Apple Shortcuts via an HTTP bridge, allowing voice-controlled Spotify operations on iOS devices.
Provides comprehensive Spotify control including playlist/album/track playback, music search, playback control (play, pause, skip, volume), current track information, and sleep timer functionality.
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 Server play 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 for Gemini CLI
A Model Context Protocol (MCP) server that enables Google Gemini CLI to control Spotify through natural language commands.
Features
Play Control: Play playlists, albums, and tracks
Search: Find music by song, artist, or album
Playback Control: Play, pause, skip, and adjust volume
Sleep Timer: Automatically pause playback after a specified duration
Related MCP server: Spotify MCP Server (Python)
Prerequisites
Node.js 18+
npm or yarn
Spotify Developer account
Google Gemini CLI installed (
npm install -g @google/gemini-cli)
Quick Start
1. Install Dependencies
npm install
npm run build2. Spotify Developer Setup
Create a new app
Copy your Client ID and Client Secret
Click "Edit Settings" → Add redirect URI:
http://127.0.0.1:3000/callbackClick "Save"
Important: Spotify requires 127.0.0.1 (not localhost) for redirect URIs.
3. Configure Environment
Create a .env file in the project root:
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_here
SPOTIFY_REDIRECT_URI=http://127.0.0.1:3000/callback4. Authenticate
npm run authThis opens your browser for Spotify authorization and saves tokens to tokens.json (one-time setup).
5. Configure Gemini CLI
Generate .gemini/settings.json from your .env file:
npm run setup:geminiThis script automatically:
Reads your
.envfileCreates
.gemini/settings.jsonwith the correct paths and API keysPopulates all environment variables from your
.envfile
Note: Run npm run setup:gemini again whenever you update your .env file or after building the project.
6. Use It!
Once configured, start Gemini CLI and ask:
"Play my Discover Weekly playlist"
"Search for songs by The Beatles"
"Pause Spotify"
"Set a 30 minute sleep timer"
"What's currently playing?"
Available MCP Tools
play_playlist- Play a playlist by nameplay_album- Play an album by nameplay_track- Play a track by namesearch_music- Search for musiccontrol_playback- Control playback (play, pause, skip, volume)get_current_playing- Get currently playing trackset_sleep_timer- Set a sleep timercancel_sleep_timer- Cancel active timersget_active_timers- List active timers
Troubleshooting
Authentication Issues
Redirect URI mismatch: Ensure
.envand Spotify Dashboard have the exact same URI (http://127.0.0.1:3000/callback)Invalid redirect URI: Must use
127.0.0.1notlocalhost(Spotify requirement)Token expired: Delete
tokens.jsonand runnpm run authagain
Gemini CLI Not Finding Server
Verify absolute path to
dist/server.jsis correctCheck environment variables are set (if using Method 2)
Ensure Node.js is in PATH
Test server manually:
node dist/server.js(should start without errors)
Server Errors
Make sure Spotify app is open and a device is active
Verify
tokens.jsonexists and is validCheck network connectivity
Development
# Build TypeScript
npm run build
# Run MCP server (for testing)
npm start
# Authenticate with Spotify
npm run auth
# Development mode (auto-reload)
npm run devProject Structure
src/
server.ts # MCP server entry point
auth-helper.ts # Authentication helper script
spotify/
auth.ts # OAuth authentication
client.ts # Spotify API client
tools/ # MCP tool implementations
timer.ts # Timer managerAvailable Tools
12 toolscancel_sleep_timerC
Cancel an active sleep timer
Inputs: timerId.
control_playbackA
Control Spotify playback (play, pause, skip, volume). Note: skip-next and skip-previous will only skip once per call.
Inputs: action (required), value, deviceId.
get_active_timersB
Get list of active sleep timers
Inputs: no named parameters.
get_current_playingB
Get information about the currently playing track
Inputs: no named parameters.
get_devicesA
Get list of available Spotify devices and the current default device
Inputs: no named parameters.
play_albumC
Play a Spotify album by name and optional artist
Inputs: albumName (required), artistName, deviceId.
play_playlistC
Play a Spotify playlist by name
Inputs: playlistName (required), deviceId.
play_random_songC
Play a random song from Spotify
Inputs: deviceId.
play_trackC
Play a specific track by name and optional artist
Inputs: trackName (required), artistName, deviceId.
search_musicC
Search for music (tracks, albums, artists) on Spotify
Inputs: query (required), limit.
set_default_deviceB
Set the default Spotify device ID to use for all playback operations
Inputs: deviceId (required).
set_sleep_timerB
Set a sleep timer to automatically pause playback after specified minutes
Inputs: durationMinutes (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools have distinct purposes, but there is some potential overlap between playback control tools. The 'control_playback' tool handles play/pause/skip/volume, while 'play_track', 'play_album', 'play_playlist', and 'play_random_song' are all specific play initiation tools that could potentially be confused with the play function within 'control_playback'. However, the descriptions clarify their specific use cases well enough to avoid major confusion.
All tool names follow a consistent verb_noun pattern with snake_case throughout. The naming is highly predictable and readable, with clear action-object pairs like 'get_current_playing', 'set_sleep_timer', 'play_album', and 'search_music'. There are no deviations from this consistent convention.
With 12 tools, this server is well-scoped for Spotify control functionality. The count is appropriate for covering playback control, device management, search capabilities, and sleep timer features. Each tool appears to serve a distinct purpose that justifies its inclusion in the set.
The tool set provides excellent coverage of core Spotify functionality including playback control, device management, search, and sleep timers. The only minor gap is the lack of tools for playlist/library management (creating playlists, adding/removing tracks) and user profile operations, but the existing tools cover the most essential workflows for music playback and control.
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
Spotify MCP — Web API via client_credentials OAuth
Full Spotify Web API coverage - albums, artists, playlists, player controls, and more.
Sonos MCP server: control your Sonos speakers from any MCP client. Play songs, artists and playlists, set volume, group rooms, move music to another room, switch to TV, spoken announcements and reminders. 27 tools, English and Chinese. Works through the official Sonos cloud, so there is no home bridge to install; sign in with OAuth. Requires the free ZoneFoundry iOS app.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables control of Spotify playback, track search, and user profile retrieval via MCP tools with automatic OAuth token management.118 npm3MIT
- 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-
- AlicenseNot gradedqualityBmaintenanceExposes Spotify search, playlist, library, discovery, and playback tools to AI assistants over MCP Streamable HTTP. Supports Spotify OAuth, multi-client MCP OAuth with PKCE and dynamic client registration, encrypted token storage, and self-hosted Docker deployment.1AGPL 3.0