![🎵 MCP Claude Spotify [Node.js - Spotify API - Claude Desktop]](/images/assets/mcp-claude-spotify-preview.png)
🎵 MCP Claude Spotify [Node.js - Spotify API - Claude Desktop]
- Ivan Luna
- AI Agents , Node.js , MCP , Spotify API , Claude Desktop , Web API , OAuth , Integration
- 15 Apr, 2025
MCP Claude Spotify is an integration that allows Claude Desktop to interact with Spotify using the Model Context Protocol (MCP). This powerful integration enables AI-assisted control over your Spotify playback and library management directly from the Claude Desktop interface.
Demo
Key Features:
- Seamless Spotify Authentication: Secure OAuth flow for connecting your Spotify account
- Comprehensive Search: Find tracks, albums, artists, and playlists with natural language queries
- Playback Control: Play, pause, skip tracks, all through conversational commands
- Playlist Management: Create playlists and add tracks based on your preferences
- Personalized Recommendations: Get AI-curated music suggestions based on your listening habits
Technical Overview:
- Node.js Backend: Handles authentication, API interactions, and Claude Desktop integration
- Model Context Protocol (MCP): Enables Claude to manage API calls and state across sessions
- Spotify Web API: Provides access to Spotify’s full feature set and user data
- OAuth 2.0 Authentication: Ensures secure access to user accounts with proper scopes
- Automatic MCP Server Management: Server can be manually started or auto-launched by Claude Desktop
Installation Guide:
# Clone repository
git clone https://github.com/imprvhub/mcp-claude-spotify
cd mcp-claude-spotify
# Install dependencies
npm install
# Optional: Build from source
npm run build
Spotify API Configuration:
- Get your Spotify API credentials from the Spotify Developer Dashboard
- Set up a Spotify app with the redirect URI:
http://127.0.0.1:8888/callback
- Configure the MCP server with your Client ID and Secret:
{
"mcpServers": {
"spotify": {
"command": "node",
"args": ["PATH_TO_DIRECTORY/mcp-claude-spotify/build/index.js"],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id_here",
"SPOTIFY_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}
Available Tools:
The integration provides a comprehensive set of tools for interacting with Spotify:
- auth-spotify: Authenticate with your Spotify account
- search-spotify: Find music content with natural language queries
- play-track: Start playback of specific tracks
- get-current-playback: View your currently playing track and playback state
- pause-playback: Pause your current music
- next-track/previous-track: Navigate through your queue
- get-user-playlists: View your Spotify playlists
- create-playlist: Create new playlists with custom names and descriptions
- add-tracks-to-playlist: Add tracks to existing playlists
- get-recommendations: Get personalized music recommendations based on seeds
- get-top-tracks: Gets the user’s most played tracks over a specified time range.
System Requirements:
- Node.js 16 or higher
- Spotify Premium account for full playback functionality
- Claude Desktop application
Security Considerations:
- Access tokens are stored only in memory during sessions
- No user data is stored on disk for privacy protection
- Easy access revocation through Spotify account settings
Use Cases:
- Creating mood-based playlists through conversational AI
- Controlling music playback hands-free
- Discovering new music with personalized AI recommendations
- Managing your Spotify library with natural language commands
- Analyzing personal music trends to understand listening patterns
- Generating retrospective playlists based on specific time periods
- Identifying preferred genres and artists to optimize recommendations
This integration showcases the power of combining AI assistants with music services, creating a seamless experience for controlling and exploring your music through conversation rather than traditional interfaces.