Spotify MCP Server
Servidor MCP de Spotify
Este proyecto implementa un servidor de Protocolo de Contexto de Modelo (MCP) que permite controlar la reproducción de Spotify usando lenguaje natural a través de un cliente MCP, como Cursor o Claude para Desktop (solo macOS y Windows).
Características
Este servidor expone las siguientes herramientas:
play: reproducir una pista, un álbum o una lista de reproducción, o reanudar la reproducción.pause: Pausa la reproducción.next: Saltar a la siguiente pista.previous: Salta a la pista anterior.get_current_track: obtiene información sobre la pista que se está reproduciendo actualmente.search: busca pistas, álbumes, artistas o listas de reproducción.
Related MCP server: Vulpes Spotify MCP Server
Prerrequisitos
Bun (versión 1.0.0 o posterior)
Una cuenta Spotify Premium.
Una aplicación para desarrolladores de Spotify:
Crea uno en el Panel de desarrolladores de Spotify .
Obtenga su ID de cliente y secreto de cliente.
Agregue
http://localhost:8888/callbacka las URI de redireccionamiento en la configuración de su aplicación.
Un cliente MCP (por ejemplo, Cursor o Claude for Desktop).
Instalación y configuración
Clonar el repositorio:
git clone https://github.com/obre10off/spotify-mcp.git cd spotify-mcpInstalar dependencias:
bun installCrea un archivo
.env:Crea un archivo llamado
.enven la raíz del directorio del proyecto. Agrega lo siguiente, reemplazando los marcadores con tus credenciales de Spotify:SPOTIFY_CLIENT_ID=your_spotify_client_id SPOTIFY_CLIENT_SECRET=your_spotify_client_secret SPOTIFY_REDIRECT_URI=http://localhost:8888/callback # These will be filled in after running the auth script: SPOTIFY_ACCESS_TOKEN= SPOTIFY_REFRESH_TOKEN=Ejecute el script de autorización:
Este script abrirá su navegador, le solicitará que inicie sesión en Spotify y otorgue permisos, y luego recuperará su acceso inicial y sus tokens de actualización.
bun run authEl script imprimirá los valores
SPOTIFY_ACCESS_TOKENySPOTIFY_REFRESH_TOKENen la consola. Copie estos valores en su archivo.env.Configure su cliente MCP:
Cursor:
Abra la configuración del cursor (Cmd+ o Ctrl+).
Buscar "Protocolo de contexto de modelo".
Haga clic en "Editar en settings.json".
Agregue lo siguiente a la matriz
mcp.servers(reemplace/absolute/path/to/your/spotify-mcpcon la ruta absoluta a su directoriospotify-mcp):{ "mcp.servers": [ { "spotify": { "command": "bun", "args": ["/absolute/path/to/your/spotify-mcp/src/index.ts"], "env": { "SPOTIFY_CLIENT_ID": "your_spotify_client_id", "SPOTIFY_CLIENT_SECRET": "your_spotify_client_secret", "SPOTIFY_REDIRECT_URI": "http://localhost:8888/callback", "SPOTIFY_ACCESS_TOKEN": "your_spotify_access_token", "SPOTIFY_REFRESH_TOKEN": "your_spotify_refresh_token" } } } ] }Se recomienda utilizar un archivo
.envy solo colocar allí las variables de entorno relacionadas con Spotify, en lugar de agregar los valores al archivo settings.json.
Claude para escritorio (macOS/Windows):
Abra el archivo de configuración de Claude for Desktop:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonVentanas:
%APPDATA%\Claude\claude_desktop_config.json
Agregue lo siguiente al objeto
mcpServers(reemplace/absolute/path/to/your/spotify-mcpcon la ruta absoluta a su directoriospotify-mcp): GXP6
Importante: utilice siempre rutas absolutas en la configuración de su cliente.
Reinicie su cliente MCP
Asegúrese de reiniciar su cliente MCP (Cursor/Claude) para aplicar la configuración.
Ejecución del servidor
bun run start
This command starts the server with automatic reloading on file changes (thanks to Bun's --watch flag). Keep this terminal window open while you're using the server.
## Usage
Once the server is running and your MCP client is configured, you can start using natural language commands to control Spotify. Examples:
"Play Bohemian Rhapsody"
"Pause the music"
"What song is playing?"
"Search for Taylor Swift albums"
"Next track"
"Play spotify:track:4uLU6hMCjMI75M1A2tKUQC"This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Generate AI music via the Lacuna Music API from MCP clients like Claude Desktop & Code.
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- FlicenseBqualityCmaintenanceA lightweight Model Context Protocol server that enables AI assistants like Cursor & Claude to control Spotify playback and manage playlists.22479-
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants like Claude to interact with Spotify, allowing them to search for tracks, control playback, and manage playlists.1-
- FlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI assistants like Claude Desktop to interact with Spotify's music streaming service, supporting playback control, playlist management, music search, and user profile access.412-
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables searching and managing Spotify music, playlists, artists, albums, and audiobooks through natural language.2442 npmMIT