spotify-mcp
Provides tools for interacting with Spotify's catalog and user account, enabling search of tracks by track, artist, or album terms and retrieval of a connected user's recently played listening history.
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-mcpwhat have I been listening to recently?"
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
A Model Context Protocol (MCP) server that lets an MCP client search Spotify's track catalog and access the connected user's recently played tracks.
Requirements
Node.js and npm
A Spotify account
A Spotify app created in the Spotify Developer Dashboard
In your Spotify app settings, add this exact Redirect URI:
http://127.0.0.1:8080/callbackThe server uses Spotify's client credentials flow to search the catalog, and
OAuth authorization with the user-read-recently-played permission to read
listening history.
Related MCP server: Spotify MCP Server (Python)
Setup
Install dependencies and compile the TypeScript source:
npm ci npm run buildProvide your Spotify app's client ID and client secret to the MCP server as
SPOTIFY_CLIENT_IDandSPOTIFY_CLIENT_SECRET.This repository includes a VS Code MCP configuration at
.vscode/mcp.json. When VS Code prompts for the server inputs, enter the client ID and secret from your Spotify app. The secret input is masked.For another MCP client, configure a stdio server that runs
node /absolute/path/to/spotify-mcp/build/index.jsand pass both variables in that server's environment. Do not commit credentials or put them in source files.Start the
spotify-mcpserver from your MCP client. The first time you need listening history, callspotify_connectand open the returned URL in a browser. Once Spotify confirms the connection, return to your MCP client.
The refresh token is saved locally at
~/.config/spotify-mcp/token.json with restrictive file permissions. You
normally only need to connect once; use spotify_connect again if access
needs to be restored.
Available tools
spotify_connect
Starts Spotify account authorization and returns a URL to open in a browser.
The local callback listener uses 127.0.0.1:8080.
search_tracks
Searches Spotify's track catalog by track, artist, or album terms.
query(string, required): Search terms.limit(integer, optional): Number of results, from 1 to 10; defaults to 5.
Requires both Spotify environment variables. Does not require connecting a user account.
get_recently_played
Returns recently played tracks for the connected Spotify account, including artist, play time, and Spotify link.
limit(integer, optional): Number of results, from 1 to 50; defaults to 20.after(integer, optional): Unix timestamp in milliseconds; return plays after this time.before(integer, optional): Unix timestamp in milliseconds; return plays before this time.
Specify at most one of after and before. This tool requires the user to
have completed spotify_connect.
Development
The TypeScript source is in src/; npm run build emits runnable JavaScript
into build/. The server communicates over stdio, so start it through an MCP
client rather than as an interactive command-line application.
License
This project is licensed under the MIT License. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Spotify MCP — Web API via client_credentials OAuth
Create, inspect, and manage Wubble music, speech, voice, and sound-effect requests through MCP.
Spotify: Spotify Data API for Millions of songs & podcasts, artists, albums, playlists and more.
Full Spotify Web API coverage - albums, artists, playlists, player controls, and more.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables control of Spotify playback, track search, and user profile retrieval via MCP tools with automatic OAuth token management.31 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.-
- FlicenseNot gradedqualityDmaintenanceEnables controlling Spotify playback, managing playlists, searching music, and accessing library features through any MCP-compatible AI client. Provides 34 tools for full Spotify integration.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search Spotify tracks and control playback (play, pause, skip, queue, volume) through the Spotify Web API.31 npm2MIT