Sonora MCP
Provides tools for interacting with Spotify, including searching tracks, albums, artists, and playlists; checking the current track or episode and playback device; and, when playback mode is enabled, starting/resuming or pausing playback.
Click on "Deploy 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., "@Sonora MCP what song is playing on Spotify right now?"
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.
Sonora MCP
A small, security-first Model Context Protocol server for Spotify. Ask your AI assistant what is playing, search the catalogue and (optionally) play or pause music.
Español: README.es.md
OAuth Authorization Code + PKCE, no Client Secret. Nothing sensitive to leak from the repo or your MCP config.
Least privilege. Default
read-onlymode requests two read scopes. Write tools are not registered at all unless you opt intoplaybackmode.Tokens stay on your machine, outside any repo:
~/.config/sonora-mcp/(dir0700, file0600, atomic writes, automatic refresh).No telemetry. The only hosts contacted are
accounts.spotify.comandapi.spotify.com.Built for Spotify's 2026 API: search
limit≤ 10, Development Mode aware error messages.TypeScript (strict, ESM), official
@modelcontextprotocol/sdk, stdio transport, zod-validated inputs, mocked-HTTP test suite.
Status
Sprint 1 is implemented (see Roadmap). Not yet published to npm: install from source.
Related MCP server: Spotify MCP Node Server
Tools
Tool | Mode | Description |
| all | Search tracks, albums, artists, playlists ( |
| all | Current track/episode, progress and device |
|
| Start/resume playback: Spotify URI, |
|
| Pause playback |
| all | List Spotify Connect devices (id, name, type, active) |
|
| Move playback to a device ( |
|
| List the user's playlists (paged, limit ≤ 50) |
|
| Items of a playlist you own/collaborate on (id, URI or link; paged, limit ≤ 50) |
|
| Saved ("liked") tracks, newest first (paged, limit ≤ 50) |
|
| Which of up to 40 tracks are saved |
|
| Save up to 40 tracks ( |
|
| Un-save up to 40 tracks ( |
|
| Create an empty playlist (private by default; |
|
| Add up to 100 tracks/episodes to a playlist you own/collaborate on ( |
|
| Recently played tracks, newest first (cursor-based: |
|
| Top tracks or artists ( |
Modes and scopes
Modes are additive and can be combined with commas, for example --mode library,playback.
Design and trade-offs: ADR 0001.
Mode (default first) | Scopes added on top of the base | Tools |
| base: |
|
|
| + library, recently played, top items, read playlists (see the Tools table) |
|
| + create playlists and add items (see the Tools table) |
|
| + |
Choose with SONORA_MODE or --mode (applies to both login and serve). Spotify grants scopes at login,
so after changing the mode run sonora-mcp login --mode <modes> again (it replaces the stored login) and
restart your MCP client. Your existing read-only and playback logins keep working unchanged. If the stored
login lacks a scope a tool needs, that tool returns a clear message with the exact login --mode ... command;
tools that do not need the scope keep working. Write tools of a mode that is not enabled are not registered at all.
Requirements
Node.js ≥ 24
A Spotify account. Spotify's Development Mode (Feb 2026 rules) requires the app owner to have Premium, allows up to 5 authorised users and a single Client ID per developer. Playback control also needs Premium.
Install (from source)
git clone https://github.com/encodi/sonora-mcp.git
cd sonora-mcp
npm ci
npm run buildConfigure Spotify (step by step)
Open the Spotify Developer Dashboard and log in.
Create app.
App name / App description: anything (e.g. "Sonora MCP", "Personal MCP server").
Redirect URIs: add exactly
http://127.0.0.1:8888/callbackand click Add. Use the IP literal127.0.0.1, notlocalhost— Spotify only allows HTTP for loopback IPs. To use another port, setSPOTIFY_REDIRECT_PORTand registerhttp://127.0.0.1:<port>/callback.Which API/SDKs are you planning to use? → Web API.
Accept the terms and Save.
Open the app → Settings and copy the Client ID. You do not need (and must not use) the Client Secret.
In Settings → User management, make sure your own Spotify account (name + email) is listed (Development Mode only works for allow-listed users).
Export the Client ID in the shell where you will log in:
export SPOTIFY_CLIENT_ID=<your client id>
Log in
# read-only (default)
node dist/index.js login
# or, to enable play/pause
node dist/index.js login --mode playback
# modes combine (library + playlists + playback)
node dist/index.js login --mode library,playlists,playbackThe command prints an authorization URL (and tries to open your browser; add --no-open to skip that).
Approve the request in Spotify; the browser is redirected to http://127.0.0.1:8888/callback, the server
validates state, exchanges the code with the PKCE verifier and stores the tokens in
$XDG_CONFIG_HOME/sonora-mcp/tokens.json (or ~/.config/sonora-mcp/tokens.json).
Other commands:
node dist/index.js status # who/what is stored (never prints tokens)
node dist/index.js logout # deletes the token file
node dist/index.js --helpUse with an MCP client
Claude Desktop, Cursor, and any stdio MCP client (use absolute paths):
{
"mcpServers": {
"sonora": {
"command": "node",
"args": ["/absolute/path/to/sonora-mcp/dist/index.js"],
"env": {
"SPOTIFY_CLIENT_ID": "<your client id>",
"SONORA_MODE": "read-only"
}
}
}
}The Client ID is not a secret, but keep it in your local client config, not in a repository.
Configuration reference
Variable | Default | Description |
| – (required) | Client ID of your Spotify app |
|
| Loopback callback port (register the matching redirect URI) |
|
|
|
|
|
|
|
| Base directory for |
Troubleshooting
play says ok but the phone (Android) stays silent
Spotify answers 204 as soon as it accepts the command; it does not wait for the device to obey. Mobile
apps that are idle or backgrounded can ignore a remote play, while the Web Player and desktop apps usually
do not (investigation in #34). Things to try, in order:
Open the Spotify app on the phone and start any track for a few seconds, then call
playwhile it is active.Call
list_devices, copy the phone'sid, and callplaywithdevice_idandtransfer_first: true(it transfers playback to the phone without autoplay, waits ~0.8 s, then plays).Or do it by hand:
transfer_playbackwithplay: true, thenplay.Always confirm with
now_playing: it tells "no active device" apart from "device active, nothing loaded".
play only reports that Spotify accepted the command, so a silent device is not an error on our side.
Security
See SECURITY.md for the policy and private reporting. In short: PKCE (S256) without a secret,
constant-time state check, loopback-only one-shot callback server, tokens 0600 in a 0700 directory outside
the repo, redacted logs, minimal scopes, write tools opt-in, no telemetry, no hosts besides Spotify's.
Development
npm ci
npm run format:check && npm run lint && npm run typecheck && npm test && npm run buildContributing: CONTRIBUTING.md · Process: docs/WORKFLOW.md · Board: docs/BOARD.md.
Roadmap
Tracked in milestones and issues.
Sprint 1 – Fundamentos: skeleton, CI, PKCE login/logout, token storage, HTTP client,
search,now_playing,play/pause, modes. ✅Sprint 2 – Biblioteca y playlists: playlists and their items, saved tracks, library save/remove, create playlists (new opt-in modes/scopes).
Sprint 3 – Cola, dispositivos y robustez: queue, devices/transfer, skip/seek/volume/shuffle/repeat, rate-limit backoff, error catalogue.
v0.1.0: npm publishing with provenance, changelog, client setup guides, security review.
License
MIT © 2026 Enrique Coronado. Not affiliated with Spotify AB. "Spotify" is a trademark of Spotify AB.
Available Tools
3 toolslist_devicesList devicesARead-only
List the user's available Spotify Connect devices (phone, computer, speaker). Returns the id to pass as device_id to play or transfer_playback. A device only appears while its Spotify app is open.
Inputs: no named parameters.
now_playingNow playingARead-only
Get what is currently playing on the user's Spotify account (track or episode, progress and device).
Inputs: no named parameters.
searchSearch SpotifyBRead-onlyIdempotent
Search the Spotify catalog for tracks, albums, artists or playlists. Returns names, URIs and links.
Inputs: query (required), type, limit, types, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct target: catalog search, current playback state, and device enumeration. There is no plausible confusion between them, and their scopes (catalog vs. playback vs. devices) do not overlap.
The set mixes conventions: `search` is a bare verb, `list_devices` is verb_noun, and `now_playing` is a noun phrase describing state. It is still readable, but there is no predictable pattern an agent could generalize from.
Three tools is thin for a Spotify integration whose apparent purpose is playback control and discovery. The surface feels like a partial slice rather than a well-scoped toolset.
`list_devices` explicitly tells the agent to pass a device_id to `play` or `transfer_playback`, but neither tool exists in this server, creating a hard dead end. There is also no pause/skip, queue, or playlist management, so the playback lifecycle is largely uncovered.
Maintenance
Related MCP Connectors
Full Spotify Web API coverage - albums, artists, playlists, player controls, and more.
Spotify MCP server for ChatGPT, Claude and any AI agent: search songs and artists, list playlists, read playlist songs, create playlist, add songs to playlist, remove songs from playlist, set playlist public or private and save to Liked Songs in your own Spotify account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Spotify yourself; Cotlet does not store your password and you need no Spotify API key. About the official Spotify API: Spotify has a full Web API and, since 23 Apr 2026, an official connector for Claude (checked 5 Nov 2026). The API needs an app you register, and in development mode the app owner must have Premium and the app allows 5 users; unlimited users need a registered business with at least 250,000 monthly users. Setup and FAQ: https://cotlet.dev/integrations/spotify-api-mcp-server
Spotify MCP — Web API via client_credentials OAuth
Query your Twitch streams, events, supporters, raids & rankings from an AI assistant via OAuth.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables AI assistants to control Spotify playback, search for music, manage playlists, and interact with your Spotify library through natural language commands.19-
- AlicenseBqualityDmaintenanceEnables AI assistants to control Spotify playback, manage playlists, search music, and access listening history. Requires Spotify Premium and uses secure OAuth 2.0 with PKCE authentication.13133 npmMIT
- AlicenseAqualityDmaintenanceConnects AI assistants to a self-hosted Your Spotify instance and Spotify's Web API for deep listening analytics and playback control. It enables users to query unlimited listening history, generate custom Wrapped summaries, and manage playlists through natural language.18Apache 2.0
- AlicenseBqualityDmaintenanceConnects AI assistants to the Spotify Web API, enabling playback control, search, and recommendations.8MIT