spotify-mcp
spotify-mcp
Ein Model Context Protocol (MCP)-Server, der Claude mit Spotify verbindet. Steuern Sie Ihre Spotify-Wiedergabe, suchen Sie Musik, verwalten Sie Wiedergabelisten und mehr – alles durch natürliche Konversation mit Claude.
Fork-Hinweis: Dieses Projekt ist ein Fork von varunneal/spotify-mcp und wurde für die Änderungen der Spotify Web API vom Februar 2026 aktualisiert. Erstellt und gewartet mit Claude Code.
Was ist neu (v0.4.0)
Architektur-Rewrite
spotipyentfernt -- verwendethttpxasync direkt (natives Async, keinasyncio.to_thread-Wrapping)Einzelnes Modul --
server.py,spotify_api.py,utils.pywurden in einer Datei zusammengefasstFastMCP -- saubere
@mcp.tool()-Dekoratoren anstelle von manuellem ToolModel + match/case-Routing2 Abhängigkeiten -- nur
mcp+httpx(vorhermcp+spotipy+python-dotenv)Explizites OAuth --
spotify-mcp --authfür die Ersteinrichtung, automatische Aktualisierung bei nachfolgender Verwendung
Funktionen (aus v0.3.0 übernommen)
Wiedergabe starten, pausieren und überspringen
Suche nach Titeln, Alben, Künstlern und Wiedergabelisten
Detaillierte Informationen zu jedem Spotify-Element abrufen
Wiedergabewarteschlange verwalten
Vollständiges CRUD für Wiedergabelisten (Titel erstellen, lesen, aktualisieren, löschen)
Gelikte/gespeicherte Songs mit optionaler Genre-Anreicherung abrufen
Angepasst an die Spotify-API-Änderungen vom Februar 2026
Related MCP server: Spotify MCP Server
Funktionsweise
Claude <--MCP (stdio)--> spotify-mcp <--httpx async--> Spotify Web APIClaude sendet Tool-Aufrufe über das MCP-Protokoll
Der Server übersetzt diese in Spotify Web API-Anfragen mittels
httpxOAuth-Token werden automatisch aktualisiert; Erstauthentifizierung über
spotify-mcp --authErgebnisse werden in präzises JSON geparst und an Claude zurückgegeben
Verfügbare Tools
Tool | Aktionen | Beschreibung |
|
| Steuerung der Musikwiedergabe und Lautstärke |
| -- | Suche nach Titeln, Alben, Künstlern, Wiedergabelisten |
|
| Wiedergabewarteschlange anzeigen und verwalten |
| -- | Detaillierte Elementinformationen per Spotify-URI abrufen |
|
| Vollständige Verwaltung von Wiedergabelisten |
|
| Gespeicherte Songs verwalten und Bibliothek prüfen |
| -- | Kürzlich gespielte Titel mit Zeitstempeln abrufen |
|
| Geräte auflisten und Wiedergabe übertragen |
Architektur
src/spotify_mcp/
__init__.py # Entry point (stdio / --auth)
server.py # FastMCP server, API client, parsers — all in oneVoraussetzungen
Python 3.12+
Spotify Premium-Konto (erforderlich für den Dev-Mode-API-Zugriff seit Februar 2026)
Spotify Developer App-Anmeldedaten
Konfiguration
1. Spotify Developer App erstellen
Gehen Sie zu developer.spotify.com/dashboard
Erstellen Sie eine neue App
Setzen Sie den Redirect-URI auf
http://127.0.0.1:8080/callbackNotieren Sie sich Ihre Client ID und Ihr Client Secret
Wichtig (Februar 2026): Apps im Dev-Mode sind auf 5 autorisierte Benutzer begrenzt und erfordern, dass der App-Besitzer Spotify Premium besitzt.
2. Erstauthentifizierung
Führen Sie den Auth-Flow einmal aus, um Ihr OAuth-Token zu erhalten:
SPOTIFY_CLIENT_ID=your_id SPOTIFY_CLIENT_SECRET=your_secret uv run spotify-mcp --authDies öffnet einen Browser für den Spotify-Login und speichert das Token anschließend unter ~/.spotify_mcp_cache.json.
3. Zum MCP-Client hinzufügen
Lokal ausführen (empfohlen)
git clone https://github.com/verIdyia/spotify-mcp.gitFügen Sie dies zu Ihrer MCP-Konfiguration hinzu (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"spotify": {
"command": "uv",
"args": [
"--directory",
"/path/to/spotify-mcp",
"run",
"spotify-mcp"
],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id",
"SPOTIFY_CLIENT_SECRET": "your_client_secret",
"SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8080/callback"
}
}
}
}Mit uvx ausführen
{
"mcpServers": {
"spotify": {
"command": "uvx",
"args": [
"--python", "3.12",
"--from", "git+https://github.com/verIdyia/spotify-mcp",
"spotify-mcp"
],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id",
"SPOTIFY_CLIENT_SECRET": "your_client_secret",
"SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8080/callback"
}
}
}
}Umgebungsvariablen
Variable | Erforderlich | Standard | Beschreibung |
| Ja | -- | Spotify App Client ID |
| Ja | -- | Spotify App Client Secret |
| Nein |
| OAuth Redirect-URI |
| Nein |
| Pfad zur Token-Cache-Datei |
Fehlerbehebung
Erster Start: Führen Sie
spotify-mcp --authaus, um den OAuth-Flow abzuschließen, bevor Sie ihn mit einem MCP-Client verwendenToken abgelaufen: Token werden automatisch aktualisiert. Falls Probleme bestehen bleiben, führen Sie
--autherneut ausKein aktives Gerät: Stellen Sie sicher, dass Spotify geöffnet ist und auf mindestens einem Gerät spielt
Stellen Sie sicher, dass
uvaktualisiert ist -- Version>=0.54empfohlen
Debugging
Starten Sie den MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory /path/to/spotify-mcp run spotify-mcpZusammenfassung der Spotify API-Änderungen vom Februar 2026
Änderung | Auswirkung | Status |
Such- | Weniger Ergebnisse pro Suche | Angepasst |
Playlist-Endpunkte | Endpunkt-URLs geändert | Angepasst |
Antwortfeld | Parsing aktualisiert | Angepasst |
Batch-GET-Endpunkte entfernt | Muss einzeln abgerufen werden | Angepasst |
| Nicht mehr verfügbar | Behandelt |
Dev-Mode: 5-Benutzer-Limit, Premium erforderlich | Zugriffsbeschränkung | Dokumentiert |
Credits
Ursprüngliches Projekt: varunneal/spotify-mcp von Varun Srivastava (MIT-Lizenz)
Ursprüngliche Mitwirkende: @jamiew, @davidpadbury, @manncodes, @hyuma7, @aanurraj, @JJGO und andere
Gewartet mit: Claude Code (Anthropic)
Lizenz
MIT-Lizenz -- siehe LICENSE für Details.
Available Tools
6 toolsSpotifyGetInfoC
Get detailed information about a Spotify item...
Inputs: item_uri (required).
SpotifyLikedSongsC
Get user's liked (saved) songs from Spotify library.
Inputs: action (required), limit.
SpotifyPlaybackC
Manages the current playback...
Inputs: action (required), spotify_uri, num_skips.
SpotifyPlaylistC
Manage Spotify playlists.
Inputs: action (required), playlist_id, track_ids, name, +2 more.
SpotifyQueueC
Manage the playback queue - get the queue or add tracks.
Inputs: action (required), track_id.
SpotifySearchC
Search for tracks, albums, artists, or playlists on Spotify.
Inputs: query (required), qtype, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose targeting different Spotify resources: GetInfo for item details, LikedSongs for saved songs, Playback for current playback control, Playlist for playlist management, Queue for queue operations, and Search for finding content. There is no overlap or ambiguity between these functions.
All tools follow a consistent 'Spotify' prefix with descriptive noun-based naming (e.g., SpotifyGetInfo, SpotifyPlaylist). The pattern is uniform across all six tools, making them easily identifiable and predictable.
With 6 tools, this server is well-scoped for Spotify integration, covering key areas like playback, playlists, search, and user library. Each tool serves a specific, necessary function without bloat or redundancy.
The toolset covers core Spotify functionalities including search, playback control, playlist management, and user data access. Minor gaps might include operations like following artists or managing user profile settings, but the provided tools support most common workflows effectively.
Maintenance
Related MCP Connectors
MCP server for Producer/Riffusion AI music generation
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Official Todoist MCP server. Manage tasks and projects. Hosted, no API key needed.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceAn MCP server that enables users to control Spotify playback, search for music, and manage playlists through MCP-compatible clients. It supports features like track recommendations and playback management using secure OAuth authentication.MIT
- AlicenseAqualityBmaintenanceMCP server for the Spotify Web API — gives Claude and other AI assistants tools to search music, control playback, manage playlists, library, and podcasts.475MIT
- AlicenseNot gradedqualityDmaintenanceAn unofficial MCP server that provides access to Spotify's Web API through the Model Context Protocol, enabling AI assistants to search music, manage playlists, and control playback.29 npm9ISC
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables searching and managing Spotify music, playlists, artists, albums, and audiobooks through natural language.2493 npmMIT