Spotify MCP server

Integrates with Spotify Web API to enable music search, playback control, and playlist management for applications needing music data and content access.
Back to servers
Setup instructions
Provider
Thomas Wawra
Release date
Jan 27, 2025
Language
TypeScript
Package
Stats
1.5K downloads
12 stars

ArtistLens is a Model Context Protocol (MCP) server that provides seamless access to the Spotify Web API. It allows you to search music catalogs, access artist information, retrieve top tracks, find related artists, and perform many other Spotify-related operations directly from your AI assistant.

Installation Options

Via Smithery

For Claude Desktop users, the simplest installation method is via Smithery:

npx -y @smithery/cli install @superseoworld/artistlens --client claude

Manual Installation

You can install the package globally:

npm install -g @thomaswawra/artistlens

Or run it directly with npx (no installation required):

npx -y @thomaswawra/artistlens

Configuration

After installation, you need to add the ArtistLens configuration to your MCP settings file:

  1. Find your MCP settings file (typically claude_desktop_config.json or cline_mcp_settings.json)
  2. Add the following configuration:
{
  "mcpServers": {
    "spotify": {
      "command": "npx",
      "args": ["-y", "@thomaswawra/artistlens"],
      "env": {
        "SPOTIFY_CLIENT_ID": "your_client_id",
        "SPOTIFY_CLIENT_SECRET": "your_client_secret"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Setting Up Spotify API Credentials

To use ArtistLens, you'll need Spotify API credentials:

  1. Visit the Spotify Developer Dashboard
  2. Create a new application
  3. Copy your Client ID and Client Secret
  4. Add them to the configuration as shown above

Available Tools

ArtistLens provides access to numerous Spotify API endpoints through the following tools:

Authentication

  • get_access_token: Retrieve a valid Spotify access token

Searching

  • search: Look for tracks, albums, artists, or playlists

Artist Information

  • get_artist: Get detailed artist information
  • get_artist_top_tracks: Retrieve an artist's most popular tracks
  • get_artist_related_artists: Find artists similar to a specified artist
  • get_artist_albums: Get all albums by an artist

Albums and Tracks

  • get_album: Get detailed album information
  • get_album_tracks: Retrieve all tracks on an album
  • get_track: Get detailed track information
  • get_new_releases: Discover newly released albums

Recommendations

  • get_available_genres: List all available genres for recommendations
  • get_recommendations: Get track recommendations based on seeds (tracks, artists, genres)

Audiobooks

  • get_audiobook: Get audiobook information with market-specific options
  • get_multiple_audiobooks: Retrieve information for up to 50 audiobooks
  • get_audiobook_chapters: Access audiobook chapters with pagination

Playlists

  • get_playlist: Access a playlist owned by any Spotify user
  • get_playlist_tracks: Get detailed information about playlist tracks
  • get_playlist_items: Get all items in a playlist with pagination
  • modify_playlist: Change playlist details (name, description, visibility)
  • add_tracks_to_playlist: Add one or more tracks to a playlist
  • remove_tracks_from_playlist: Remove tracks from a playlist
  • get_current_user_playlists: View playlists owned or followed by the current user
  • get_featured_playlists: Access Spotify's featured playlists
  • get_category_playlists: Get playlists in a specific category

Updating ArtistLens

To update to the latest version:

# If installed globally
npm update -g @thomaswawra/artistlens

# If using npx, it will automatically use the latest version
npx -y @thomaswawra/artistlens

Usage Examples

Searching for Music

To search for tracks by an artist:

Tool: search
Parameters: {"q": "Taylor Swift", "type": "track", "limit": 5}

Getting Artist Information

To get details about an artist:

Tool: get_artist
Parameters: {"id": "06HL4z0CvFAxyc27GXpf02"}

Finding Similar Artists

To discover artists similar to your favorites:

Tool: get_artist_related_artists
Parameters: {"id": "06HL4z0CvFAxyc27GXpf02"}

Managing Playlists

To add tracks to a playlist:

Tool: add_tracks_to_playlist
Parameters: {
  "playlist_id": "5iK97V5C4TMrh4vAccYrGl",
  "uris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]
}

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "spotify" '{"command":"npx","args":["-y","@thomaswawra/artistlens"],"env":{"SPOTIFY_CLIENT_ID":"your_client_id","SPOTIFY_CLIENT_SECRET":"your_client_secret"},"disabled":false,"autoApprove":[]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "spotify": {
            "command": "npx",
            "args": [
                "-y",
                "@thomaswawra/artistlens"
            ],
            "env": {
                "SPOTIFY_CLIENT_ID": "your_client_id",
                "SPOTIFY_CLIENT_SECRET": "your_client_secret"
            },
            "disabled": false,
            "autoApprove": []
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "spotify": {
            "command": "npx",
            "args": [
                "-y",
                "@thomaswawra/artistlens"
            ],
            "env": {
                "SPOTIFY_CLIENT_ID": "your_client_id",
                "SPOTIFY_CLIENT_SECRET": "your_client_secret"
            },
            "disabled": false,
            "autoApprove": []
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later