authenticate_spotifyLABSCO SUMMARY
Playlist building as a conversation, once you are through OAuth.
The useful shape is the round trip: search for tracks by description, then create the playlist and add the URIs in the same turn, rather than moving between a search UI and a playlist editor. The friction to plan for is authentication — every tool including search needs the OAuth flow completed, and the token expires after an hour, so a long session will ask you to re-authenticate.
What it is
An MCP server over the official Spotify Web API for finding music and managing playlists. It uses stdio transport and works with any MCP client. Authentication is OAuth 2.0 against your own Spotify app, driven from inside the conversation.
What you get
- Search and lookup:
search_trackswith a query, a result limit between 1 and 50, and an optional ISO country code to filter by market, andget_track_detailsfor one track by ID - Playlist creation and editing —
create_playlistwith a name, description, public flag and collaborative flag;edit_playlistto change any of those afterwards, requiring at least one field to actually change - Track management:
add_to_playlistwith an array of track URIs and an optional insert position, andremove_from_playlistwith an optional snapshot ID for version control - Reading what you have —
list_playlistsandget_playlist_tracks, both with limit and offset for paging - An authentication flow you drive through the tools themselves:
authenticate_spotifyreturns the authorization URL, then takes the code back, andget_auth_statusreports the current state - Stated limits: access tokens expire after 1 hour and need refreshing, some tracks are unavailable in some markets, and the OAuth scope determines what operations are permitted
Requirements
A Spotify Developer account and an app created in the Spotify Developer Dashboard, with http://localhost:8888/callback added to its redirect URIs. Two environment variables from that app, SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET, set either in the client config or system-wide. Node.js 18 or higher; clone, npm install, npm run build, then point your client at the built entry point. Everything, including search, requires completing the OAuth flow first: call the authenticate tool for the URL, approve in the browser, and pass the resulting code back. MIT licensed.
Setup effort
Build from source — git clone https://github.com/danisss9/spotify-playlist-generator-mcp-server
USE CASES
Turning a description into a playlist
Search for tracks matching the mood or genre, create the playlist, and add the results in the same conversation.
Cleaning up a playlist that has drifted
Read its current tracks with paging, then remove the ones that no longer fit, using the snapshot ID to avoid clobbering a concurrent change.
Checking a track is actually playable where you are
Pass a market country code on the search or the track lookup so unavailable tracks do not end up in the list.
Renaming or unlisting a playlist
Edit the name, description, public flag or collaborative flag in place.
10 tools
Listed in project docs. Your client may show a different list.
get_auth_statussearch_tracksget_track_detailscreate_playlistedit_playlistadd_to_playlistlist_playlistsget_playlist_tracksremove_from_playlistBEFORE YOU INSTALL
What to know first
Tools you get
10 tools named in the project's documentation. Every tool requires OAuth: nothing works until authenticate_spotify has completed.
Requires
- Node.js 18 or later
- SPOTIFY_CLIENT_ID in your environment
- SPOTIFY_CLIENT_SECRET in your environment
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
You clone and build this one yourself.
Server setup
git clone https://github.com/danisss9/spotify-playlist-generator-mcp-server
cd spotify-playlist-generator-mcp-server
npm install
npm run buildMCP Clients
Claude Desktop
{
"mcpServers": {
"spotify-playlist-generator": {
"command": "node",
"args": [
"<YOUR_PATH_TO_SPOTIFY_PLAYLIST_GENERATOR_MCP>/build/index.js"
],
"env": {
"SPOTIFY_CLIENT_ID": "<YOUR_SPOTIFY_CLIENT_ID>",
"SPOTIFY_CLIENT_SECRET": "<YOUR_SPOTIFY_CLIENT_SECRET>"
}
}
}
}VS Code
{
"servers": {
"spotify-playlist-generator": {
"command": "node",
"args": [
"<YOUR_PATH_TO_SPOTIFY_PLAYLIST_GENERATOR_MCP>/build/index.js"
],
"env": {
"SPOTIFY_CLIENT_ID": "<YOUR_SPOTIFY_CLIENT_ID>",
"SPOTIFY_CLIENT_SECRET": "<YOUR_SPOTIFY_CLIENT_SECRET>"
}
}
}
}