spotify-mcp-server
Provides tools to control Spotify playback, manage playlists, search tracks, and get recommendations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@spotify-mcp-serverplay something relaxing"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
spotify-mcp-server
A FastMCP 3.0 server that exposes Spotify controls as Model Context Protocol (MCP) tools. Use it in two ways:
Claude Desktop / Claude Code — let Claude control Spotify during a conversation ("play something relaxing", "create a jazz playlist for dinner")
Web app — a mobile-friendly player at
/appfor playback control, playlist management, and AI playlist generation
Tools
Tool | Description |
| Metadata for the currently playing track |
| Play, pause, or toggle playback |
| Skip to next or previous track |
| Add a track to the playback queue |
| Fetch track recommendations from seed tracks |
| List the user's playlists |
| Create a new empty playlist |
| Add tracks to an existing playlist |
| Search for a track and add it to a playlist |
| Start playback of a playlist, album, or artist |
| List available Spotify playback devices |
| Transfer playback to a specific device |
| Switch between pre-authenticated user profiles |
| Generate and populate a playlist from a natural-language prompt (requires Gemini API key) |
Related MCP server: Spotify MCP Server
Prerequisites
Requirement | Notes |
uv ≥ 0.4 | Python package manager |
Python ≥ 3.10 | Managed automatically by uv |
Spotify account | Free or Premium |
Spotify Developer App | |
Gemini API key | Optional — only needed for |
Quick Start
1. Clone the repo
git clone <repo-url> spotify-mcp-server
cd spotify-mcp-server2. Install dependencies
uv syncuv downloads Python 3.12, creates a virtual environment, and installs all locked dependencies automatically.
3. Create a Spotify Developer App
Click Create App
Add a Redirect URI — use
http://127.0.0.1:8888/callbackfor local use, orhttps://your-domain/callbackfor RailwayNote your Client ID and Client Secret
4. Configure credentials
cp .env.example .envEdit .env:
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_here
SPOTIFY_REDIRECT_URI=http://127.0.0.1:8888/callback
# Optional — for AI playlist generation
GEMINI_API_KEY=your_gemini_api_key_here
.envis gitignored. Never commit it.
5. Authenticate with Spotify (one-time)
uv run python scripts/authenticate.pyThis opens a browser for Spotify OAuth. After approving, the token is cached
in .cache for all subsequent runs.
Option A — Claude Desktop (local, stdio)
This runs the server locally on your machine. Claude Desktop launches it automatically when you start a conversation.
Add to claude_desktop_config.json:
{
"mcpServers": {
"spotify": {
"command": "uv",
"args": ["run", "fastmcp", "run", "src/server.py"],
"cwd": "/absolute/path/to/spotify-mcp-server",
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id",
"SPOTIFY_CLIENT_SECRET": "your_client_secret",
"SPOTIFY_REDIRECT_URI": "http://127.0.0.1:8888/callback"
}
}
}
}The config file is located at:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Restart Claude Desktop after saving. The Spotify tools will appear automatically in your next conversation.
Example prompts for Claude:
"What's playing on Spotify?"
"Skip this track"
"Create a playlist called Dinner Jazz and add 10 tracks"
"Generate a playlist of 10 summer hits from 2024"
Option B — Railway (cloud, web app + MCP)
Deploy to Railway to get a persistent URL accessible from any device, including mobile.
1. Fork and connect
Fork this repo to your GitHub account
Create a new Railway project and connect your fork
Railway will detect the
Dockerfileand deploy automatically
2. Set environment variables in Railway
Variable | Value |
| From Spotify Developer Dashboard |
| From Spotify Developer Dashboard |
|
|
|
|
| Optional — for AI playlist generation |
3. Add the redirect URI to Spotify
In your Spotify Developer App settings, add https://your-railway-domain/callback
as an allowed Redirect URI and click Save.
4. Authenticate
Visit https://your-railway-domain/auth/login in a browser to complete the
Spotify OAuth flow. The token is stored on the Railway volume at /data/.cache.
5. Access the web app
Open https://your-railway-domain/app on any device — desktop or mobile.
Web app features:
Now Playing card with album art and progress bar
Play / pause / skip / queue controls
Device picker — switch playback between laptop, phone, Bluetooth speakers
Search and add tracks to playlists
Create playlists and browse your library
AI playlist generation from natural-language prompts (requires Gemini API key)
Connect Claude Desktop to the Railway server
You can also point Claude Desktop at the Railway deployment instead of running the server locally:
{
"mcpServers": {
"spotify": {
"type": "http",
"url": "https://your-railway-domain/mcp"
}
}
}Multi-user / Family Accounts
The server supports multiple pre-authenticated Spotify accounts on the same deployment.
One-time setup per user:
Each family member visits:
https://your-railway-domain/auth/login?user=theirnameand logs in with their own Spotify account. Their token is stored as
.cache-theirname on the Railway volume.
Switching accounts:
Call the switch_user tool with the profile name, or ask Claude:
"Switch to mum's Spotify account"
Switch back to the default account with switch_user("default").
Note: Spotify limits development apps to 25 users. Beyond that, submit your app for extended quota mode (free, requires review).
Project Structure
.
├── src/
│ └── server.py # FastMCP server + all tool definitions
├── static/
│ └── index.html # Mobile web app (served at /app)
├── config/
│ └── settings.py # pydantic-settings config loader
├── scripts/
│ └── authenticate.py # One-time local OAuth helper
├── .env.example # Credential template
├── Dockerfile # Railway deployment
├── railway.json # Railway configuration
├── pyproject.toml # Dependencies (managed by uv)
├── uv.lock # Locked dependency graph
└── CLAUDE.md # Project conventionsLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/freddy24-7/MCP-Spotify'
If you have feedback or need assistance with the MCP directory API, please join our Discord server