hrishi0102 spotifyyy mcp

hrishi0102 spotifyyy mcp avatar

by hrishi0102

making playlists got fun and easier wohoo. chat with claude and build personalized playlists. a spotify mcp server

What is hrishi0102 spotifyyy mcp

Spotify MCP Server

A simple Model Context Protocol (MCP) server that lets you interact with Spotify through Claude. This server enables Claude to search for songs, create playlists, get recommendations, and more using your Spotify account.

Features

  • Search for tracks on Spotify
  • View your Spotify profile
  • Create playlists
  • Add tracks to playlists
  • Get personalized music recommendations

Tools Available

Tool Name Description
set-spotify-credentials Set your Spotify authentication credentials
check-credentials-status Check if your credentials are valid and who is logged in
search-tracks Search for tracks by name, artist, or keywords
get-current-user Get your Spotify profile information
create-playlist Create a new playlist on your account
add-tracks-to-playlist Add tracks to an existing playlist
get-recommendations Get recommendations based on seed tracks

Setup Instructions

1. Prerequisites

  • Node.js v16 or higher
  • npm
  • A Spotify account
  • A registered Spotify Developer application

2. Create a Spotify Developer App

  1. Go to Spotify Developer Dashboard
  2. Log in with your Spotify account
  3. Click "Create an App"
  4. Fill in the app name and description
  5. Add http://localhost:8888/callback as a Redirect URI
  6. Note your Client ID and Client Secret

3. Install the Project

# Clone or download the project first
cd spotify-mcp-server

# Install dependencies
npm install

4. Get Your Spotify Tokens

Edit the spotify-auth.js file to include your Client ID and Client Secret:

// Replace these with your Spotify app credentials
const CLIENT_ID = "your_client_id_here";
const CLIENT_SECRET = "your_client_secret_here";

Then run the authentication script:

node spotify-auth.js

This will:

  1. Open a URL in your browser
  2. Prompt you to log in to Spotify
  3. Ask for your permission to access your account
  4. Save the tokens to secrets.json

5. Build the MCP Server

npm run build

6. Configure Claude Desktop

Edit your Claude Desktop configuration file:

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

Add the following configuration:

{
  "mcpServers": {
    "spotify": {
      "command": "node",
      "args": ["/full/path/to/spotify-mcp-server/build/spotify-mcp-server.js"]
    }
  }
}

Replace /full/path/to/spotify-mcp-server with the actual path to your project directory.

7. Restart Claude Desktop

Close and reopen Claude Desktop to load the new configuration.

Usage

When you start a conversation with Claude, you'll first need to set your Spotify credentials:

  1. Look at your secrets.json file to get your credentials
  2. Use the set-spotify-credentials tool to authenticate
  3. Then use any of the other Spotify tools

Example Prompts

Setting Up Credentials

I want to connect to my Spotify account. Here are my credentials from secrets.json:

Tool: set-spotify-credentials
Parameters:
{
  "clientId": "your_client_id",
  "clientSecret": "your_client_secret",
  "accessToken": "your_access_token",
  "refreshToken": "your_refresh_token"
}

Basic Commands

Check your account:

Can you check who I'm logged in as on Spotify?

Tool: get-current-user
Parameters: {}

Search for tracks:

Search for songs by Weekend

Tool: search-tracks
Parameters:
{
  "query": "Taylor Swift",
  "limit": 5
}

Create a playlist:

Create a new playlist called "My Pretty pretty girlfriend"

Tool: create-playlist
Parameters:
{
  "name": "My Pretty pretty girlfriend",
  "description": "For my girlfriend. Created with Claude and the Spotify MCP server"
}

Multi-Step Tasks

Creating a playlist with songs:

I want to create a workout playlist with energetic songs. First, search for some high-energy songs. Then create a playlist called "Workout Mix" and add those songs to it.

Getting recommendations based on favorites:

I like the song "Blinding Lights" by The Weeknd. Can you search for it, then find similar songs, and create a playlist with those recommendations?

Troubleshooting

  • Error: No access token available: You need to set your credentials first using the set-spotify-credentials tool
  • Authentication failures: Your tokens may have expired. Run the auth script again to get fresh tokens
  • Invalid credentials: Double check that you're using the correct Client ID and Client Secret

Notes

  • The server stores credentials in memory only
  • You'll need to set credentials each time you start a new conversation
  • If Claude Desktop restarts, you'll need to set credentials again

Leave a Comment

Frequently Asked Questions

What is MCP?

MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.

What are MCP Servers?

MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.

How do MCP Servers work?

MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.

Are MCP Servers secure?

Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.

Related MCP Servers

chrisdoc hevy mcp avatar

chrisdoc hevy mcp

mcp
sylphlab pdf reader mcp avatar

sylphlab pdf reader mcp

An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.

pdf-parsetypescriptnodejs
aashari mcp server atlassian bitbucket avatar

aashari mcp server atlassian bitbucket

Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.

atlassianrepositorymcp
aashari mcp server atlassian confluence avatar

aashari mcp server atlassian confluence

Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.

atlassianmcpconfluence
prisma prisma avatar

prisma prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

cockroachdbgomcp
Zzzccs123 mcp sentry avatar

Zzzccs123 mcp sentry

mcp sentry for typescript sdk

mcptypescript
zhuzhoulin dify mcp server avatar

zhuzhoulin dify mcp server

mcp
zhongmingyuan mcp my mac avatar

zhongmingyuan mcp my mac

mcp
zhixiaoqiang desktop image manager mcp avatar

zhixiaoqiang desktop image manager mcp

MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)

mcp
zhixiaoqiang antd components mcp avatar

zhixiaoqiang antd components mcp

An MCP service for Ant Design components query | 一个减少 Ant Design 组件代码生成幻觉的 MCP 服务,包含系统提示词、组件文档、API 文档、代码示例和更新日志查询

designantdapi

Submit Your MCP Server

Share your MCP server with the community

Submit Now