Skip to main content
Glama
SpotifyMCP

SpotifyMCP

by carllapierre

SpotifyMCP MCP Server

This is a TypeScript-based MCP server for Spotify based on the Model Context Protocol.

Features

Tools

  • create_playlist - Create a new Spotify playlist.

    • Takes name, description, tracks, and public status as parameters.

    • Returns the URI of the created playlist.

Prompts

  • search_songs - Search for songs on Spotify.

    • Takes a search query and an optional limit for results.

Related MCP server: MCP Spotify Player

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "SpotifyMCP": {
      "command": "node",
      "args": [
        "/Users/your_username/Documents/SideProjects/MCPs/spotify-mcp/build/index.js"
      ],
      "env": {
        "SPOTIFY_CLIENT_ID": "your_client_id_here",
        "SPOTIFY_CLIENT_SECRET": "your_client_secret_here",
        "SPOTIFY_REFRESH_TOKEN": "your_refresh_token_here"
      }
    },
  }
}

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

Setup Instructions

  1. Create a Spotify Developer Account
    Visit Spotify Developer and create an account.

  2. Create a New Application
    After logging in, create a new application to obtain your Client ID and Client Secret.

  3. Set Up Redirect URI
    In your Spotify application settings, configure the redirect URI to:

    http://localhost:8888/callback
  4. Create a .env File
    In the root of your project, create a .env file and add the following environment variables:

    SPOTIFY_CLIENT_ID=your_client_id_here
    SPOTIFY_CLIENT_SECRET=your_client_secret_here
    SPOTIFY_REDIRECT_URI=http://localhost:8888/callback
  5. Get Your Spotify Token
    Run the following command to obtain your Spotify token:

    npx ts-node src/scripts/get-spotify-token.ts
  6. Login to Your Application
    Visit http://localhost:8888/login in your browser Copy the refresh token and set it in your environment variables: SPOTIFY_REFRESH_TOKEN=your_refresh_token_here

Available Tools

2 tools
create_playlistB

Create a new Spotify playlist and return the URI to ALWAYS present to the user as a hyperlink

Inputs: name (required), tracks (required), description, public.

search_songsC

Search for songs on Spotify

Inputs: query (required), limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: one creates playlists, the other searches for songs. There is no overlap or ambiguity.

    Naming Consistency5/5

    Both tool names follow a consistent verb_noun pattern (create_playlist, search_songs) with clear and predictable structure.

    Tool Count3/5

    With only 2 tools, the surface is too thin for a comprehensive music service like Spotify. This falls in the borderline range for tool count.

    Completeness2/5

    The set lacks many essential operations such as playing music, managing playlists (get, update, delete), and user library actions, leaving significant gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables searching, managing playlists, getting recommendations, and downloading music from TIDAL through natural language commands via the Model Context Protocol.
      16
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables searching and managing Spotify music, playlists, artists, albums, and audiobooks through natural language.
      24
      57 npm
      MIT