spotify-mcp

spotify-mcp

A local-first Spotify MCP server providing typed tools for music search, playback, playlists, audio analysis, and snapshot-safe DJ planning, with OAuth PKCE and no client secret stored.

Category
Visit Server

README

<div align="center">

🎡 Spotify for Codex

Ask Codex to play music, find old favourites, build playlists, or plan a DJ set.

Python 3.11+ MIT License Spotify MCP

Get started Β· Codex plugin guide Β· See what you can ask Β· Setup guide

</div>

[!NOTE] This open-source project has no connection to Spotify AB. Use it in line with the Spotify Developer Policy.

πŸ’¬ What can I ask?

Play something I’ll like.

Build me a road-trip playlist that rediscovers music from across my Liked Songs history.

You can also search for music and podcasts, control playback, review your Liked Songs, or turn a playlist into a DJ running order.

✨ What it can do

  • 🎢 Play naturally: resolve a precise track, album, artist, or playlist from a query, control seek, shuffle, repeat, volume, queue, and Spotify Connect devices.
  • 🎧 Find music from your library: search your full Liked Songs history, including tracks you saved years ago.
  • 🧩 Build with safeguards: bundled workflows preserve Spotify track identities. They stop after an uncertain write and preview DJ reorders before they change a playlist.

You can shape a playlist around a mood or journey, then open the result in Spotify.

πŸš€ Get started

You need Python 3.11+, uv, and a Spotify Web API app. The server uses your app’s Client ID. It does not need the Client Secret.

πŸ“¦ 1. Download the project

git clone https://github.com/martin-gomola/spotify-mcp.git
cd spotify-mcp
cp .env.example .env

πŸ”‘ 2. Configure Spotify

Create an app in the Spotify Developer Dashboard, add http://127.0.0.1:8888/callback as its Redirect URI, then put its Client ID in .env:

SPOTIFY_CLIENT_ID=your_client_id

The setup guide covers the dashboard steps and Spotify Development Mode limits.

πŸ”Œ 3. Install for Codex

make codex-install

Approve the Spotify page that opens, then start a new Codex task. Codex starts the local server when you use it, so you can close the setup terminal. The Codex plugin guide explains how the plugin starts the server, what it includes, and what to ask first.

πŸ›‘οΈ Safety by default

  • πŸ” Spotify tokens stay outside the repository in a private local file.
  • 🎚️ Audio analysis and the DJ fallback may send exact Spotify track IDs to ReccoBeats when Spotify lacks the required audio data.
  • β›” The server stops after a write with an uncertain outcome. It does not retry that write.
  • πŸ—‘οΈ Low-level removal tools apply changes at once and offer no undo. The library audit workflow shows exact recording IDs before removal.
  • βœ… After a playlist write, the workflow fetches the playlist and compares the result. Low-level tools return Spotify’s response without treating an ambiguous result as success.
  • 🧾 DJ apply and restore start with a dry run. Each command checks the live playlist before a write.

<details> <summary><strong>πŸ› οΈ Developing or connecting another MCP client?</strong></summary>

Complete authentication once:

make setup

Configure your MCP client to launch uv run spotify-mcp serve with this repository as its working directory. Each client uses its own configuration. This repository provides a guided installer for Codex. For local development and verification, follow the development guide.

</details>

πŸ“š Learn more

The source uses the MIT License. Spotify AB owns the Spotify trademark and does not sponsor or endorse this project.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured