spotify-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_TRANSPORT | No | Transport mode for MCP server (e.g., 'sse' for Railway; defaults to stdio). | |
| GEMINI_API_KEY | No | Optional Gemini API key for AI playlist generation. | |
| SPOTIFY_CLIENT_ID | Yes | Your Spotify Developer App client ID. | |
| SPOTIFY_REDIRECT_URI | Yes | The redirect URI for Spotify OAuth (e.g., http://127.0.0.1:8888/callback). | |
| SPOTIFY_CLIENT_SECRET | Yes | Your Spotify Developer App client secret. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_devicesA | List all available Spotify playback devices for the current user. Returnsdict
Keys: |
| transfer_playbackA | Transfer Spotify playback to a specific device. Parametersdevice_id : str The Spotify device ID to transfer playback to. Returnsdict
RaisesValueError
If |
| get_current_trackA | Retrieve information about the track currently playing on Spotify. Returns structured metadata including the track URI, which is needed by
other tools such as Returnsdict
Keys: Raisesspotipy.SpotifyException Propagated if the Spotify API returns a non-2xx response. |
| play_pauseA | Control Spotify playback – play, pause, or toggle the current state. Parametersaction : str, optional
One of Returnsdict
RaisesValueError
If |
| skip_trackA | Skip to the next or previous track on the active Spotify device. Parametersdirection : str, optional
Returnsdict
RaisesValueError
If |
| add_to_queueA | Add a track to the user's active Spotify playback queue. Parametersuri : str
Spotify track URI ( Returnsdict
Raisesspotipy.SpotifyException Propagated if the Spotify API returns a non-2xx response. |
| get_recommendationsA | Fetch track recommendations based on a list of seed track URIs or IDs. NoteSpotify deprecated the public recommendations endpoint in November 2024. This tool works for apps created before that date or granted continued access. Parametersseed_tracks : list[str] Spotify track URIs or bare IDs (max 5 seeds; excess are truncated). limit : int, optional Number of recommendations to return (1–100, default: 5). Returnsdict
Keys: RaisesValueError
If |
| get_user_playlistsA | Fetch a paginated list of the current user's Spotify playlists. Parameterslimit : int, optional Maximum number of playlists to return (1–50, default: 20). offset : int, optional Zero-based index of the first playlist to return (default: 0). Returnsdict
Keys: RaisesValueError
If |
| create_playlistA | Create a new empty private playlist for the current user. Parametersname : str Display name for the new playlist. description : str, optional Short description shown in Spotify clients (default: empty string). Returnsdict
Keys: RaisesValueError
If |
| add_to_playlistA | Add one or more tracks to an existing Spotify playlist. Handles batching automatically (Spotify API limit: 100 tracks per request). Parametersplaylist_id : str Spotify playlist ID or full URI. track_uris : list[str] Spotify track URIs or bare track IDs. Returnsdict
Keys: RaisesValueError
If |
| search_and_addA | Search for a track and add the top result to a playlist in one step. Parametersquery : str
Free-text search query (e.g. Returnsdict
Keys: RaisesValueError
If |
| switch_userA | Switch the active Spotify user profile. Updates the server's internal state so all subsequent tool calls use the
token cache for name. Each user's token lives in Parametersname : str
User profile name. Must have a corresponding cache file or be
Returnsdict
RaisesValueError
If |
| play_contextA | Start playback of a Spotify context (playlist, album, or artist). Parameterscontext_uri : str
Spotify URI (e.g. Returnsdict
Raisesspotipy.SpotifyException Propagated if the Spotify API returns a non-2xx response. |
| generate_playlistA | Generate and populate a Spotify playlist from a natural-language prompt. Uses Claude to interpret the prompt and produce a tracklist, then creates a new playlist and searches for each track on Spotify. Parametersprompt : str
Natural-language description, e.g. Returnsdict
Keys: RaisesEnvironmentError
If |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| now_playing_ui | HTML snippet showing the current track with Skip / Play / Queue buttons. Buttons carry ``data-mcp-tool`` / ``data-mcp-args`` attributes for thin clients that can dispatch MCP tool calls directly from the DOM. Returns ------- str Self-contained HTML fragment with inline CSS. |
| spotify_mini_player | A fully interactive now-playing card for SSE-connected clients. Includes the MCP JS SDK so the Play/Pause, Skip, and Queue buttons dispatch real tool calls back to this server over the active SSE connection. The ``_meta`` block advertises a dependency on ``get_current_track`` so MCP clients can refresh the card when playback changes. Returns ------- str Self-contained HTML page with inline CSS and embedded JS. |
TDQS
Scored across 14 tools
Every tool serves a distinct resource or action: playback control (play_pause, skip_track, transfer_playback), queue management (add_to_queue), context playback (play_context), and playlist operations (create, list, add, search_and_add, generate). No two tools have overlapping purposes, and the descriptions make each tool's role clear.
All tool names follow a consistent lowercase snake_case pattern with a verb-first structure (e.g., get_devices, create_playlist, add_to_queue). Compound names like play_pause and search_and_add remain readable and do not break the overall convention.
With 14 tools, the server is well-scoped for its purpose: it provides essential playback controls, playlist management, and a few convenience functions like generate_playlist and switch_user. The count feels appropriate for a Spotify MCP server without being bloated or too thin.
Core workflows are covered: playback (play/pause/skip/queue/devices) and playlist creation/listing/adding tracks. However, notable gaps exist, such as removing tracks from a playlist, deleting/updating playlists, and missing playback features like seek, volume, or shuffle. These would require external workarounds.