Observed since 20 Oct, 22:41 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xbarandiaran/spotify-mcp-server
A Model Context Protocol server for Spotify integration - Updated for Spotify's February 2026 API migration
A lightweight Model Context Protocol (MCP) server that enables AI assistants like Cursor & Claude to control Spotify playback and manage playlists.
Note: This version (2.0.x) has been updated to comply with Spotify's February 2026 API migration. The server now uses direct HTTP calls to the new Spotify API endpoints instead of the deprecated SDK.
# 1. Create config directory and file
mkdir -p ~/.spotify-mcp
cat > ~/.spotify-mcp/config.json << 'EOF'
{
"clientId": "YOUR_SPOTIFY_CLIENT_ID",
"clientSecret": "YOUR_SPOTIFY_CLIENT_SECRET",
"redirectUri": "http://127.0.0.1:8888/callback"
}
EOF
# 2. Authenticate with Spotify (opens browser)
npx @0xbarandiaran/spotify-mcp-server auth
# 3. Add to your Claude/Cursor config and restart
See Creating a Spotify Developer Application to get your Client ID and Secret.
searchSpotify
query (string): The search termtype (string): Type of item to search for (track, album, artist, playlist)limit (number, optional): Maximum number of results to return (1-10, max 10 due to API limits)searchSpotify("bohemian rhapsody", "track", 10)getNowPlaying
getNowPlaying()getMyPlaylists
limit (number, optional): Maximum number of playlists to return (default: 20)offset (number, optional): Index of the first playlist to return (default: 0)getMyPlaylists(10, 0)getPlaylistTracks
playlistId (string): The Spotify ID of the playlistlimit (number, optional): Maximum number of tracks to return (default: 100)offset (number, optional): Index of the first track to return (default: 0)getPlaylistTracks("37i9dQZEVXcJZyENOWUFo7")getRecentlyPlayed
limit (number, optional): A number specifying the maximum number of tracks to return.getRecentlyPlayed({ limit: 10 })getUsersSavedTracks
limit (number, optional): Maximum number of tracks to return (1-50, default: 50)offset (number, optional): Offset for pagination (0-based index, default: 0)getUsersSavedTracks({ limit: 20, offset: 0 })getQueue
limit (number, optional): Maximum number of upcoming items to show (1-50, default: 10)getQueue({ limit: 20 })getAvailableDevices
getAvailableDevices()playMusic
uri (string, optional): Spotify URI of the item to play (overrides type and id)type (string, optional): Type of item to play (track, album, artist, playlist)id (string, optional): Spotify ID of the item to playdeviceId (string, optional): ID of the device to play onplayMusic({ uri: "spotify:track:6rqhFgbbKwnb9MLmUQDhG6" })playMusic({ type: "track", id: "6rqhFgbbKwnb9MLmUQDhG6" })pausePlayback
deviceId (string, optional): ID of the device to pausepausePlayback()resumePlayback
deviceId (string, optional): ID of the device to resume playback onresumePlayback()skipToNext
deviceId (string, optional): ID of the deviceskipToNext()skipToPrevious
deviceId (string, optional): ID of the deviceskipToPrevious()createPlaylist
name (string): Name for the new playlistdescription (string, optional): Description for the playlistpublic (boolean, optional): Whether the playlist should be public (default: false)createPlaylist({ name: "Workout Mix", description: "Songs to get pumped up", public: false })addTracksToPlaylist
playlistId (string): ID of the playlisttrackUris (array): Array of track URIs or IDs to addposition (number, optional): Position to insert tracksaddTracksToPlaylist({ playlistId: "3cEYpjA9oz9GiPac4AsH4n", trackUris: ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh"] })addToQueue
uri (string, optional): Spotify URI of the item to add to queue (overrides type and id)type (string, optional): Type of item to queue (track, album, artist, playlist)id (string, optional): Spotify ID of the item to queuedeviceId (string, optional): ID of the device to queue onaddToQueue({ uri: "spotify:track:6rqhFgbbKwnb9MLmUQDhG6" })addToQueue({ type: "track", id: "6rqhFgbbKwnb9MLmUQDhG6" })setVolume
volumePercent (number): The volume to set (0-100)deviceId (string, optional): ID of the device to set volume onsetVolume({ volumePercent: 50 })adjustVolume
adjustment (number): The amount to adjust volume by (-100 to 100). Positive values increase volume, negative values decrease it.deviceId (string, optional): ID of the device to adjust volume onadjustVolume({ adjustment: 10 }) (increase by 10%)adjustVolume({ adjustment: -20 }) (decrease by 20%)getAlbums
albumIds (string|array): A single album ID or array of album IDs (max 20)getAlbums("4aawyAB9vmqN3uQ7FjRGTy") or getAlbums(["4aawyAB9vmqN3uQ7FjRGTy", "1DFixLWuPkv3KT3TnV35m3"])getAlbumTracks
albumId (string): The Spotify ID of the albumlimit (number, optional): Maximum number of tracks to return (1-50)offset (number, optional): Offset for pagination (0-based index)getAlbumTracks("4aawyAB9vmqN3uQ7FjRGTy", 10, 0)saveOrRemoveAlbumForUser
albumIds (array): Array of Spotify album IDs (max 20)action (string): Action to perform: "save" or "remove"saveOrRemoveAlbumForUser(["4aawyAB9vmqN3uQ7FjRGTy"], "save")checkUsersSavedAlbums
albumIds (array): Array of Spotify album IDs to check (max 20)checkUsersSavedAlbums(["4aawyAB9vmqN3uQ7FjRGTy", "1DFixLWuPkv3KT3TnV35m3"])Important: As of February 2026, Spotify requires the app owner to maintain an active Spotify Premium subscription for Development Mode apps. The app will stop functioning if the Premium subscription lapses.
http://127.0.0.1:8888/callbackThe server looks for configuration in these locations (in order):
~/.spotify-mcp/config.json (recommended for npx users)./spotify-config.json (current directory, for local development)Create your config file:
# Create the config directory
mkdir -p ~/.spotify-mcp
# Create the config file
cat > ~/.spotify-mcp/config.json << 'EOF'
{
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"redirectUri": "http://127.0.0.1:8888/callback"
}
EOF
Or if you prefer, edit ~/.spotify-mcp/config.json manually with your favorite editor.
The Spotify API uses OAuth 2.0 for authentication. Run the authentication command:
# Using npx (recommended)
npx @0xbarandiaran/spotify-mcp-server auth
# Or if cloned locally
npm run auth
This will:
Your config file will now include the tokens:
{
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"redirectUri": "http://127.0.0.1:8888/callback",
"accessToken": "BQAi9Pn...kKQ",
"refreshToken": "AQDQcj...7w",
"expiresAt": 1677889354671
}
Automatic Token Refresh: The server automatically refreshes the access token when it expires (typically after 1 hour). If refresh fails, run the auth command again.
Add to your Claude configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json{
"mcpServers": {
"spotify": {
"command": "npx",
"args": ["-y", "@0xbarandiaran/spotify-mcp-server"]
}
}
}
Then restart Claude Desktop.
Go to the MCP tab in Cursor Settings (command + shift + J). Add a server with this command:
npx -y @0xbarandiaran/spotify-mcp-server
Add to your cline_mcp_settings.json:
{
"mcpServers": {
"spotify": {
"command": "npx",
"args": ["-y", "@0xbarandiaran/spotify-mcp-server"],
"autoApprove": ["getNowPlaying", "getMyPlaylists", "searchSpotify"]
}
}
}
git clone https://github.com/gabrielbarandiaran/spotify-mcp-server.git
cd spotify-mcp-server
npm install
npm run build
# Run the MCP server
node build/index.js
# Run authentication
node build/auth.js
MIT
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
@modelcontextprotocol/sdkEnvironment{
"local_name": "@modelcontextprotocol/sdk",
"alias": false,
"peer_metadata": null
} | ^1.10.1 | runtime |
openEnvironment{
"local_name": "open",
"alias": false,
"peer_metadata": null
} | ^10.1.0 | runtime |
zodEnvironment{
"local_name": "zod",
"alias": false,
"peer_metadata": null
} | ^3.24.2 | runtime |
@biomejs/biomeEnvironment{
"local_name": "@biomejs/biome",
"alias": false,
"peer_metadata": null
} | ^1.9.4 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^22.13.8 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.8.2 | development |
Source distribution
{
"integrity": "sha512-gyZOnZpVFW/HezY8t7eIsq4rqjHSDvzhdY6EKS08q49qqqrM0hbgAwpdwzUMxrTQRjdW0Leon/UZfElavu6rEg==",
"shasum": "b2add593e89e3831130e3e3cf66ca8aca2342497",
"tarball": "https://registry.npmjs.org/@0xbarandiaran/spotify-mcp-server/-/spotify-mcp-server-2.0.5.tgz",
"fileCount": 10,
"unpackedSize": 73610,
"signatures": [
{
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
"sig": "MEUCIQCGTadLyFI99joLRdQkIa+7iEnKoMlq40UybBL1SY/7eAIgIj170Y4yaygdGoH3jmoTGGpGoaU6cO4M1wXjKYVwjZo="
}
]
}Shared repository data · GitHub
Observed since 20 Oct, 22:41 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:1bd4241c2b11e68885ccaf2f9a9c816f7189d38eb0f281e1242c737313bbd47d