MCP Claude Spotify is an integration that allows Claude Desktop to interact with Spotify using the Model Context Protocol. It enables features like searching for music, controlling playback, managing playlists, and getting personalized recommendations directly from Claude.
To install automatically via Smithery:
npx -y @smithery/cli install @imprvhub/mcp-claude-spotify --client claude
git clone https://github.com/imprvhub/mcp-claude-spotify
cd claude-spotify-mcp
npm install
npm run build
To use this MCP, you need to obtain Spotify API credentials:
http://127.0.0.1:8888/callback
Save these credentials for the configuration steps.
node build/index.js
Keep this terminal window open while using Claude Desktop.
Claude Desktop can automatically start the MCP server when needed:
Edit the Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add the Spotify MCP configuration:
{
"mcpServers": {
"spotify": {
"command": "node",
"args": ["ABSOLUTE_PATH_TO_DIRECTORY/mcp-claude-spotify/build/index.js"],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id_here",
"SPOTIFY_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}
Important: Replace:
ABSOLUTE_PATH_TO_DIRECTORY
with the complete absolute path where you installed the MCPyour_client_id_here
with your Spotify Client IDyour_client_secret_here
with your Spotify Client Secretauth-spotify
command to start the authentication processInitiates the Spotify authentication process.
Searches for tracks, albums, artists, or playlists.
Parameters:
query
: Search texttype
: Type of search (track, album, artist, playlist)limit
: Number of results (1-50)Plays a specific track.
Parameters:
trackId
: Spotify track IDdeviceId
: (Optional) Spotify device ID to play onGets information about the current playback.
Pauses the playback.
Skips to the next track.
Returns to the previous track.
Gets the user's playlists.
Creates a new playlist.
Parameters:
name
: Playlist namedescription
: (Optional) Descriptionpublic
: (Optional) Whether it's public or privateAdds tracks to a playlist.
Parameters:
playlistId
: Playlist IDtrackIds
: Array of track IDsGets recommendations based on seeds.
Parameters:
seedTracks
: (Optional) Array of track IDsseedArtists
: (Optional) Array of artist IDsseedGenres
: (Optional) Array of genreslimit
: (Optional) Number of recommendations (1-100)Gets the user's most played tracks over a specified time range.
Parameters:
limit
: (Optional) Number of tracks to return (1-50, default: 20)offset
: (Optional) Index of the first track to return (default: 0)time_range
: (Optional) Time frame for calculating affinity:
short_term
: Approximately last 4 weeksmedium_term
: Approximately last 6 months (default)long_term
: Several years of dataIf you see "MCP Spotify: Server disconnected" in Claude Desktop:
Verify the server is running:
node build/index.js
from the project directoryCheck your configuration:
claude_desktop_config.json
is correct\\
) for Windows pathsIf the browser doesn't open during authentication, manually visit:
http://127.0.0.1:8888/login
Make sure you've correctly configured the redirect URI in your Spotify Developer dashboard:
http://127.0.0.1:8888/callback
If the Spotify tools don't appear in Claude after authentication:
To check if the server is running:
ps aux | grep node
If you don't see the server running, start it manually or use the auto-start method.
~/.spotify-mcp/tokens.json
To revoke access:
This invalidates all access and refresh tokens. The next time you use the auth-spotify
command, you'll need to authorize the application again.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "spotify" '{"command":"node","args":["ABSOLUTE_PATH_TO_DIRECTORY/mcp-claude-spotify/build/index.js"],"env":{"SPOTIFY_CLIENT_ID":"your_client_id_here","SPOTIFY_CLIENT_SECRET":"your_client_secret_here"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"spotify": {
"command": "node",
"args": [
"ABSOLUTE_PATH_TO_DIRECTORY/mcp-claude-spotify/build/index.js"
],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id_here",
"SPOTIFY_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"spotify": {
"command": "node",
"args": [
"ABSOLUTE_PATH_TO_DIRECTORY/mcp-claude-spotify/build/index.js"
],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id_here",
"SPOTIFY_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect