This MCP server enables Claude to interact with your Spotify account, allowing you to search for songs, create playlists, get recommendations, and more through a simple interface.
http://localhost:8888/callback
as a Redirect URI# Clone or download the project first
cd spotify-mcp-server
# Install dependencies
npm install
Edit the spotify-auth.js
file to include your Client ID and Client Secret:
// Replace these with your Spotify app credentials
const CLIENT_ID = "your_client_id_here";
const CLIENT_SECRET = "your_client_secret_here";
Then run the authentication script:
node spotify-auth.js
This will:
secrets.json
npm run build
Edit your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"spotify": {
"command": "node",
"args": ["/full/path/to/spotify-mcp-server/build/spotify-mcp-server.js"]
}
}
}
Replace /full/path/to/spotify-mcp-server
with the actual path to your project directory.
Close and reopen Claude Desktop to load the new configuration.
When starting a conversation with Claude, you'll need to set your Spotify credentials first:
secrets.json
file to get your credentialsset-spotify-credentials
tool to authenticateset-spotify-credentials
- Set your Spotify authentication credentialscheck-credentials-status
- Check if your credentials are valid and who is logged insearch-tracks
- Search for tracks by name, artist, or keywordsget-current-user
- Get your Spotify profile informationcreate-playlist
- Create a new playlist on your accountadd-tracks-to-playlist
- Add tracks to an existing playlistget-recommendations
- Get recommendations based on seed tracksI want to connect to my Spotify account. Here are my credentials from secrets.json:
Tool: set-spotify-credentials
Parameters:
{
"clientId": "your_client_id",
"clientSecret": "your_client_secret",
"accessToken": "your_access_token",
"refreshToken": "your_refresh_token"
}
Can you check who I'm logged in as on Spotify?
Tool: get-current-user
Parameters: {}
Search for songs by Weekend
Tool: search-tracks
Parameters:
{
"query": "Taylor Swift",
"limit": 5
}
Create a new playlist called "My Pretty pretty girlfriend"
Tool: create-playlist
Parameters:
{
"name": "My Pretty pretty girlfriend",
"description": "For my girlfriend. Created with Claude and the Spotify MCP server"
}
You can ask Claude to perform complex operations combining multiple tools:
I want to create a workout playlist with energetic songs. First, search for some high-energy songs. Then create a playlist called "Workout Mix" and add those songs to it.
Or:
I like the song "Blinding Lights" by The Weeknd. Can you search for it, then find similar songs, and create a playlist with those recommendations?
set-spotify-credentials
toolNote that the server stores credentials in memory only, so you'll need to set credentials each time you start a new conversation or if Claude Desktop restarts.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "spotify" '{"command":"node","args":["/full/path/to/spotify-mcp-server/build/spotify-mcp-server.js"]}'
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": [
"/full/path/to/spotify-mcp-server/build/spotify-mcp-server.js"
]
}
}
}
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": [
"/full/path/to/spotify-mcp-server/build/spotify-mcp-server.js"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect