- Home
- MCP servers
- Spotify
Spotify
- typescript
5
GitHub Stars
typescript
Language
4 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"nicklaustrup-mcp-spotify": {
"command": "node",
"args": [
"C:\\path\\to\\mcp-spotify\\build\\index.js"
]
}
}
}You can connect Claude Desktop to Spotify through a dedicated MCP server that exposes search, playback, library, playlist, and recommendation capabilities. This MCP server handles authentication, talks to Spotify on your behalf, and lets you control playback, manage your library, and discover new music from your Claude prompts and conversations.
How to use
Use the MCP server by adding it as a local process that Claude Desktop can talk to. You’ll interact with it through prompts and tool calls that map to Spotify actions like searching for tracks, playing or pausing music, saving tracks to your library, managing playlists, and getting recommendations. Typical workflows include discovering music by mood, starting playback, saving interesting tracks, and creating themed playlists.
How to install
Prerequisites: ensure you have Node.js installed on your system and a working Claude Desktop setup.
Clone the MCP Spotify project, install dependencies, and build the server.
# Install dependencies
npm install
# Build the MCP Spotify server
npm run build
Configuration and run
Configure Claude Desktop to connect to the MCP server. You’ll specify a stdio-based server that runs locally and exposes the built MCP index.
{
"mcpServers": {
"spotify_mcp": {
"command": "node",
"args": [
"C:\\path\\to\\mcp-spotify\\build\\index.js"
]
}
}
}
First run authentication
When you start Claude Desktop with the MCP server configured, the server will open a browser window to authenticate with Spotify. Log in, authorize the app, and the server will save tokens to your local token store.
Troubleshooting
Spotify API errors can mean tokens expired or misconfigurations. If you run into a 401, delete the token cache at the default path and restart the client. Double-check your SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET, and SPOTIFY_REDIRECT_URI are correctly set in your environment or .env file.
Notes on behavior and features
The server offers search for tracks, albums, artists, and playlists; playback control (play/pause/skip/volume/shuffle/seek); library management (save/remove tracks, get saved tracks, recently played); playlists (get, create, add/remove tracks, details); and recommendations based on seeds and mood preferences. It also provides themed prompts for discovery, analysis of currently playing tracks, and themed playlist creation.
Security and data
OAuth 2.0 Authorization Code Flow with refresh tokens is used for authentication. Tokens are stored locally and auto-refreshed as needed.
Technical details
Language: TypeScript. Runtime: Node.js. MCP SDK: @modelcontextprotocol/sdk. Transport: stdio. Token storage: ~/.mcp-spotify/tokens.json.
Available tools
search_tracks
Search for tracks by query and retrieve matching results.
search_albums
Search for albums by query and retrieve matching results.
search_artists
Search for artists by query and retrieve matching results.
search_playlists
Search for playlists by query and retrieve matching results.
get_playback_state
Get the current playback state including track, device, and progress.
playback_control
Control playback actions such as play, pause, skip, previous, shuffle, volume, and seek.
get_saved_tracks
Retrieve the user’s saved tracks from their Spotify library.
save_tracks
Save given tracks to the user’s library.
remove_saved_tracks
Remove given tracks from the user’s library.
get_recently_played
Fetch tracks recently played by the user to inform recommendations.
get_playlists
Retrieve the user’s playlists.
create_playlist
Create a new playlist in the user’s account.
add_tracks_to_playlist
Add tracks to a specified playlist.
get_recommendations
Get track recommendations based on seeds and preferences.
get_genre_seeds
Retrieve available genre seeds for recommendations.
discover_music
Discover new music based on mood and preferences.
analyze_now_playing
Analyze the currently playing track and provide insights.
create_themed_playlist
Create a playlist around a theme or activity.