npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xavifabregat/spotify-mcp

v0.1.2

Published

MCP server to control Spotify conversationally from Claude, Cursor, and other AI clients

Readme

spotify-mcp

npm CI license node

Control Spotify by talking to your AI. An MCP server for Claude Desktop, Claude Code, Cursor, and any other MCP client.

You: play something like early Bill Evans AI: ▶ Now playing: "Peace Piece" — Bill Evans · Everybody Digs Bill Evans

You: perfect, queue the whole album and save this one AI: ➕ Queued Everybody Digs Bill Evans · ❤️ Saved "Peace Piece" to your library

Built against the current (post-February-2026) Spotify Web API — many older Spotify MCP servers predate those changes and are partially broken.

Requirements

  • Spotify Premium — Spotify requires it for playback control and (since Feb 2026) for creating the developer app you'll use.
  • Node.js ≥ 20

Quick start

npx -y @xavifabregat/spotify-mcp init

The wizard walks you through creating your own (free) Spotify developer app, asks for its Client ID, and opens a browser to connect your account — about 2 minutes total.

Why your own app? Spotify caps third-party apps at a handful of users, so every user brings their own; the wizard makes that painless. No client secret is involved (PKCE). Tokens stay in ~/.spotify-mcp/ on your machine and refresh silently.

The one detail that must be exact — your app's Redirect URI:

http://127.0.0.1:8888/callback

Add to your MCP client

Claude Code

claude mcp add -s user spotify -- npx -y @xavifabregat/spotify-mcp

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json) or Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "spotify": {
      "command": "npx",
      "args": ["-y", "@xavifabregat/spotify-mcp"]
    }
  }
}

Restart the client and start talking.

Tools

| Tool | What it does | |---|---| | play | Play by free-text query (search → best match → play) or Spotify URI | | playback | pause / resume / next / previous / seek / volume / shuffle / repeat | | now_playing | Current track, progress, device, mode | | queue | Add a track to the queue; show up next | | devices | List devices; transfer playback | | search | Browse tracks/albums/artists/playlists (max 10 per type — API cap) | | get_playlists | List your playlists | | get_playlist_items | Show a playlist's tracks (own/collaborative only — API restriction) | | modify_playlist | Create a playlist; add tracks | | library | Save / remove / check items in your library | | authenticate | Run the Spotify login from inside a conversation |

Design

  • Tools are intents, not endpoints. "Play some Radiohead" is one tool call — the server searches, picks the best match, starts playback, and reports what it chose so you can correct it. No search → choose → play round trips.
  • Small surface. 11 tools instead of one per API endpoint keeps tool selection accurate across different AI clients and context lean.
  • Responses are compact text with Spotify URIs, so follow-ups ("queue that") chain without re-searching. Raw API payloads never reach the model.
  • Errors are instructions. No active device? The response lists your devices and says how to pick one. Not logged in? It points at the authenticate tool. The model relays the fix instead of a stack trace.

Troubleshooting

  • "No active Spotify device" — Spotify's API can only steer a running app. Open Spotify anywhere; if it just woke up, tap play/pause once. With exactly one device online, the tools target it automatically.
  • INVALID_CLIENT: Invalid redirect URI during login — the Redirect URI in your app settings isn't exactly http://127.0.0.1:8888/callback (localhost is rejected by Spotify).
  • Port 8888 in use during login — set SPOTIFY_REDIRECT_PORT to a free port and register the matching redirect URI.
  • "Token refresh failed" — run npx -y @xavifabregat/spotify-mcp auth to log in again (e.g. after changing the Client ID).
  • Config precedence — the SPOTIFY_CLIENT_ID env var overrides ~/.spotify-mcp/config.json (written by init).

Development

git clone https://github.com/XavierFabregat/spotify-mcp.git
cd spotify-mcp
npm install
npm run build
npm run inspect   # MCP Inspector against the local build

Layout: src/auth.ts (OAuth PKCE + token store) · src/spotify.ts (typed API client) · src/tools/ (tool implementations) · src/format.ts (compact output).

License

MIT © Xavi Fabregat