This Model Context Protocol (MCP) server allows you to access your Spotify playlist information through Claude Desktop. It provides seamless integration between your Spotify account and the Claude AI interface.
Clone the repository:
git clone https://github.com/your-username/MCP-spotify.git
cd MCP-spotify
Install dependencies:
npm install
Create a Spotify Developer application:
http://localhost:3000/callback
as a Redirect URIConfigure environment variables:
# Create a .env file in the root directory
echo "SPOTIFY_CLIENT_ID=your_client_id" > .env
echo "SPOTIFY_CLIENT_SECRET=your_client_secret" >> .env
Run the server using the following command:
npm start
The server will start running on localhost, typically on port 3000.
Once connected, you can interact with your Spotify account through Claude using natural language. Examples:
Asking about playlists:
You: What playlists do I have on Spotify?
Claude: I can see you have 5 playlists:
1. Workout Mix (32 tracks)
2. Relaxing Evening (18 tracks)
3. Focus Time (45 tracks)
4. Party Favorites (27 tracks)
5. New Discoveries (12 tracks)
Exploring playlist contents:
You: What songs are in my Focus Time playlist?
Claude: Your "Focus Time" playlist contains 45 tracks including:
1. "Deep Focus" by Brain.fm
2. "Concentration" by Ambient Music Therapy
3. "Study Session" by ChillHop Music
...and 42 more tracks
If you encounter authentication issues, try:
npm run refresh-auth
This will clear existing tokens and prompt for a new authentication flow.
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.