bymarcelmarais· 1 MCP server
A lightweight Model Context Protocol (MCP) server that enables AI assistants like Cursor & Claude to control Spotify playback and manage playlists.
$git clone https://github.com/marcelmarais/spotify-mcp-serverInstalls into the current project.
Install spotify-mcp-server by running `git clone https://github.com/marcelmarais/spotify-mcp-server`, then use it for the current task and follow its documentation at https://github.com/marcelmarais/spotify-mcp-server.
| 1 | <div align="center" style="display: flex; align-items: center; justify-content: center; gap: 10px;"> |
| 2 | <img src="https://upload.wikimedia.org/wikipedia/commons/8/84/Spotify_icon.svg" width="30" height="30"> |
| 3 | <h1>Spotify MCP Server</h1> |
| 4 | </div> |
| 5 | |
| 6 | A lightweight [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that enables AI assistants like Cursor & Claude to control Spotify playback and manage playlists. |
| 7 | |
| 8 | <details> |
| 9 | <summary>Contents</summary> |
| 10 | |
| 11 | - [Example Interactions](#example-interactions) |
| 12 | - [Tools](#tools) |
| 13 | - [Read Operations](#read-operations) |
| 14 | - [Album Operations](#album-operations) |
| 15 | - [Play / Create Operations](#play--create-operations) |
| 16 | - [Playlist Operations](#playlist-operations) |
| 17 | - [Setup](#setup) |
| 18 | - [Prerequisites](#prerequisites) |
| 19 | - [Installation](#installation) |
| 20 | - [Creating a Spotify Developer Application](#creating-a-spotify-developer-application) |
| 21 | - [Spotify API Configuration](#spotify-api-configuration) |
| 22 | - [Authentication Process](#authentication-process) |
| 23 | - [Integrating with Claude Desktop, Cursor, and VsCode (Cline)](#integrating-with-claude-desktop-and-cursor) |
| 24 | </details> |
| 25 | |
| 26 | ## Example Interactions |
| 27 | |
| 28 | - _"Play Elvis's first song"_ |
| 29 | - _"Create a Taylor Swift / Slipknot fusion playlist"_ |
| 30 | - _"Copy all the techno tracks from my workout playlist to my work playlist"_ |
| 31 | - _"Turn the volume down a bit"_ |
| 32 | |
| 33 | ## Tools |
| 34 | |
| 35 | ### Read Operations |
| 36 | |
| 37 | 1. **searchSpotify** |
| 38 | |
| 39 | - **Description**: Search for tracks, albums, artists, or playlists on Spotify |
| 40 | - **Parameters**: |
| 41 | - `query` (string): The search term |
| 42 | - `type` (string): Type of item to search for (track, album, artist, playlist) |
| 43 | - `limit` (number, optional): Maximum number of results to return (10-50) |
| 44 | - **Returns**: List of matching items with their IDs, names, and additional details |
| 45 | - **Example**: `searchSpotify("bohemian rhapsody", "track", 20)` |
| 46 | |
| 47 | 2. **getNowPlaying** |
| 48 | |
| 49 | - **Description**: Get information about the currently playing track on Spotify, including device and volume info |
| 50 | - **Parameters**: None |
| 51 | - **Returns**: Object containing track name, artist, album, playback progress, duration, playback state, device info, volume, and shuffle/repeat status |
| 52 | - **Example**: `getNowPlaying()` |
| 53 | |
| 54 | 3. **getMyPlaylists** |
| 55 | |
| 56 | - **Description**: Get a list of the current user's playlists on Spotify |
| 57 | - **Parameters**: |
| 58 | - `limit` (number, optional): Maximum number of playlists to return (default: 20) |
| 59 | - `offset` (number, optional): Index of the first playlist to return (default: 0) |
| 60 | - **Returns**: Array of playlists with their IDs, names, track counts, and public status |
| 61 | - **Example**: `getMyPlaylists(10, 0)` |
| 62 | |
| 63 | 4. **getPlaylistTracks** |
| 64 | |
| 65 | - **Description**: Get a list of tracks in a specific Spotify playlist |
| 66 | - **Parameters**: |
| 67 | - `playlistId` (string): The Spotify ID of the playlist |
| 68 | - `limit` (number, optional): Maximum number of tracks to return (default: 100) |
| 69 | - `offset` (number, optional): Index of the first track to return (default: 0) |
| 70 | - **Returns**: Array of tracks with their IDs, names, artists, album, duration, and added date |
| 71 | - **Example**: `getPlaylistTracks("37i9dQZEVXcJZyENOWUFo7")` |
| 72 | |
| 73 | 5. **getRecentlyPlayed** |
| 74 | |
| 75 | - **Description**: Retrieves a list of recently played tracks from Spotify. |
| 76 | - **Parameters**: |
| 77 | - `limit` (number, optional): A number specifying the maximum number of tracks to return. |
| 78 | - **Returns**: If tracks are found it returns a formatted list of recently played tracks else a message stating: "You don't have any recently played tracks on Spotify". |
| 79 | - **Example**: `getRecentlyPlayed({ limit: 10 })` |
| 80 | |
| 81 | 6. **getUsersSavedTracks** |
| 82 | |
| 83 | - **Description**: Get a list of tracks saved in the user's "Liked Songs" library |
| 84 | - **Parameters**: |
| 85 | - `limit` (number, optional): Maximum number of tracks to return (1-50, default: 50) |
| 86 | - `offset` (number, optional): Offset for pagination (0-based index, default: 0) |
| 87 | - **Returns**: Formatted list of saved tracks with track names, artists, |