# Spotify Music MCP

> Spotify Music MCP Server lets your agent control everything on Spotify. Use it to search millions of tracks by name, get deep audio analytics (like tempo and energy), manage your entire queue, or discover new music based on existing favorites. It's built for agents that need reliable playback control and detailed metadata access—everything from playing a track to checking out the artist’s whole catalog.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** music-streaming, audio-analytics, playlist-management, playback-control, media-api

## Description

You need your agent to handle music, right? This **Spotify Music MCP Server** gives it full control over the Spotify API—it's like handing your AI client the master keys to everything: playback, deep analytics, and discovery. Forget using the native app; you'll let your agent do all the heavy lifting.

When you use `search`, your agent can look up tracks, artists, albums, or entire playlists across millions of entries by just typing in a keyword. If you need to know what’s playing right now on the user’s device, running `get_current_track` checks that for you; it returns empty if nothing's active.

For controlling the music itself, your agent can start or resume playback immediately using `play`, and it'll stop everything dead with a simple call to `pause`. You don't even have to end the session to pause. If you want to manage the queue, calling `add_to_queue` lets your agent drop any specified track ID right into the current line-up.

When it comes to digging up metadata, the server is loaded. To get full details on a specific song, your agent uses `get_track`, which returns comprehensive info like the title and duration. Want deep data on an entire album? `get_album` pulls all that metadata for you, including every track name and when it dropped. You can also get all the scoop on any artist using `get_artist`. For managing your personal collections, calling `get_user_playlists` lists every playlist belonging to the connected account, while `get_playlist` lets you fetch specific details—like track counts or who made it—for a defined list.

The analytical capabilities are nuts. To get quantifiable metrics for any given song ID, your agent uses `get_audio_features`, which returns scores like energy, valence, and danceability. You can also pull technical data points by using `get_track`'s metadata access. Need new music? Your agent runs `get_recommendations`, generating fresh song suggestions based on seed artists, genres, or initial tracks you specify. If you just wanna see what’s dropping right now, calling `get_new_releases` pulls a list of albums and singles recently added to Spotify.

Finally, building lists is simple. Besides adding specific songs with `add_to_queue`, your agent can fetch details about all your existing music collections using `get_user_playlists` and then get the contents of those playlists via `get_playlist`. It's built for agents that need reliable playback control and detailed metadata access—everything from playing a track to checking out an artist’s whole catalog.

## Tools

### add_to_queue
Adds a specified track ID directly into the current playback queue.

### get_album
Retrieves detailed metadata for an entire album, including its tracks and release date.

### get_artist
Fetches all available information about a specific recorded artist.

### get_audio_features
Returns quantifiable metrics (like energy, valence, and danceability) for any given track ID.

### get_current_track
Checks what song is playing right now on the user's device. Returns empty if nothing is active.

### get_new_releases
Pulls a list of albums and singles that were recently added to Spotify.

### get_playlist
Retrieves specific details, including track counts and creator info, for a user-defined playlist.

### get_recommendations
Generates new song suggestions based on input genres, artists, or existing tracks.

### get_track
Gets comprehensive metadata for a single track ID (title, duration, etc.).

### get_user_playlists
Lists all the playlists belonging to the currently connected user account.

### pause
Stops playback on the user's device without ending the session.

### play
Starts or resumes music playback immediately.

### search
Searches Spotify for tracks, artists, albums, or entire playlists by keyword.

## Prompt Examples

**Prompt:** 
```
Play some energetic Jazz for studying.
```

**Response:** 
```
Found some high-energy Jazz tracks. Adding to queue and resuming playback.
```

**Prompt:** 
```
What are the audio features for 'Blinding Lights'?
```

**Response:** 
```
Blinding Lights: Danceability 51%, Energy 73%, Tempo 171 BPM, Valence 33%. It's a very fast, energetic song but with a somewhat melancholic vibe.
```

**Prompt:** 
```
Show me the top 5 new releases.
```

**Response:** 
```
Top New Releases: 1. New Album - Artist A. 2. Single Release - Artist B. 3. EP - Artist C. 4. Album - Artist D. 5. Single - Artist E.
```

## Capabilities

### Search the full catalog
Find any track, artist, album, or playlist across millions of entries.

### Analyze audio metrics
Retrieve specific data points for a track, including its danceability score, energy level, and tempo (BPM).

### Control playback state
Start or pause the music currently playing on your connected device.

### Build queues and playlists
Add specific tracks to the current queue or fetch details about existing user-created playlists.

### Get recommendations
Generate a list of new, related songs based on seed artists, genres, or initial tracks you specify.

## Use Cases

### Curating a themed party playlist
A host needs 3 hours of music that stays high energy (Energy > 70). The agent first calls `get_audio_features` on several potential tracks, filtering for minimum energy. It then uses `get_recommendations` based on the best-scoring genre and feeds the results into `add_to_queue`, maintaining flow without manual adjustments.

### Analyzing a competitor's sound profile
A music marketer wants to know what makes Artist X popular. The agent uses `get_artist` first, then focuses on key tracks using `get_track` and repeatedly calls `get_audio_features`. This allows them to quantify the ideal 'sonic sweet spot' for their own branding.

### Emergency background music control
A developer is recording a voiceover and needs quiet, ambient music that can be instantly paused. The agent first checks `get_current_track` to confirm status, then calls `pause` when the voiceover starts, and resumes playback with one simple command.

### Building a travel discovery list
A user wants music from a specific region they're visiting. The agent uses `search` for local genres (e.g., 'Kyoto folk') and then calls `get_user_playlists` to see if the user already has related collections, compiling everything into one manageable list.

## Benefits

- You stop guessing what works. By calling `get_audio_features`, you get hard numbers—like danceability or tempo—so you know exactly if a track fits the mood before adding it to the queue.
- Never manually search again. The `search` tool lets your agent pinpoint any specific song, album, or artist across the entire library in seconds.
- Automate mix building. Need a playlist that flows? Use `get_recommendations` with seed artists and genres; it builds out curated suggestions you can then manage via `add_to_queue`.
- Instant playback control. The agent can pause or resume music immediately using the `pause` and `play` tools, making real-time interaction possible without needing the native app open.
- Deep library insight. You don't just see tracks; you get context. Tools like `get_album` and `get_artist` give structured data about the creator or the release structure.
- Stay current on hits. The dedicated `get_new_releases` tool keeps your agent updated, so it always knows what major albums are dropping this week.

## How It Works

The bottom line is: your agent speaks music commands, and this server translates them into Spotify actions.

1. First, subscribe to the server and provide your Spotify Access Token via the developer dashboard.
2. Next, your AI client uses natural language prompts to call specific tools (e.g., `search` or `get_audio_features`).
3. The MCP Server executes the API calls, returns the structured data payload, and updates your agent's state.

## Frequently Asked Questions

**How do I get a Spotify Access Token?**
Go to the Spotify Developer Dashboard, log in with your Spotify account, click 'Create App', and generate a token. The token expires every hour.

**What are 'Audio Features'?**
Audio features are data points Spotify calculates for every track, including Danceability (0-100%), Energy (0-100%), Tempo (BPM), and Valence (Positivity). You can use `get_audio_features` to analyze a song's vibe.

**Can I control playback on any device?**
Yes! The player tools (`play`, `pause`, `add_to_queue`) work on your currently active Spotify device, whether it's your phone, computer, or smart speaker.

**Does it support podcasts?**
This integration currently focuses on music and library management. Podcast playback is not directly exposed as native commands.

**What happens if I run `get_track` for an ID that doesn't exist?**
The server returns a structured error response. This allows your agent to know exactly why the request failed, like invalid track IDs or restricted content. You can build logic around these explicit failure states.

**Are there rate limits when using `search` frequently in a short time?**
Yes, API calls are subject to Spotify's rate limits. The MCP server catches standard throttling errors and sends a specific status code. Your agent can pause its actions or implement a retry mechanism based on this feedback.

**How do I handle large playlist data using `get_user_playlists`?**
The tool retrieves your list of playlists first. If you need detailed information about tracks within a very large playlist, you must pass appropriate pagination parameters to the relevant detail tools.

**What should my agent do if `get_current_track` returns nothing?**
It returns an empty data set or null status when no music is playing. Your agent needs to check for this zero-state response before attempting playback commands like adding tracks or pausing.