mcpField
S
spotify_mcp

spotify_mcp

Local
github.com/jmoro0408Media & Design0Updated 77w ago

About spotify_mcp

spotify_mcp is an MCP server that connects to the Spotify API for playback control and access to user data. Its supported actions include playback controls, playlist playback, queue management, and listening-history statistics.

Key features

  1. 01Play and control tracks
  2. 02Play user and Spotify playlists
  3. 03Manage playback queue
  4. 04View recently played tracks
  5. 05Check most-played songs by time period

Use cases

  1. 01Control Spotify playback through an MCP client
  2. 02Play tracks from a user's playlists or liked songs
  3. 03Review listening history and top tracks

MCP support

The server exposes Spotify API tools and resources through MCP, allowing compatible clients to control playback and access user data.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

spotify_mcp

Project Description

This project is a Spotify integration built using the Model Context Protocol (MCP). It provides a set of tools and resources that allow interaction with the Spotify API, enabling control over playback, access to user data, and more, all through the MCP framework.

Setup

To get this project up and running, follow these steps:

  1. Clone the repository:

    git clone https://github.com/jmoro0408/spotify_mcp.git
    cd spotify_mcp
    
  2. Set up a virtual environment (recommended):

    python -m venv .venv
    source .venv/bin/activate
    
  3. Install dependencies:

    uv sync
    
  4. Set up Spotify API Credentials:

    • Go to the Spotify Developer Dashboard.
    • Log in and create a new application.
    • Note down your Client ID and Client Secret.
    • Add a Redirect URI. For local development, http://localhost:8888/callback is commonly used.
    • Create a .env file in the project root directory with the following content:
      SPOTIPY_CLIENT_ID='YOUR_CLIENT_ID'
      SPOTIPY_CLIENT_SECRET='YOUR_CLIENT_SECRET'
      SPOTIPY_REDIRECT_URI='YOUR_REDIRECT_URI'
      
      Replace the placeholder values with your actual credentials and redirect URI.
  5. Run the server:

    python src/server.py
    

    This will start the MCP server, making the Spotify tools and resources available.

Usage

Once the server is running and configured, you can interact with the Spotify API through the defined MCP tools. The specific methods for interacting with MCP tools will depend on the client application or framework you are using that supports MCP.

If using Claude as your MCP client, you need to edit your claude_desktop_config.json to include:

{
  "mcpServers": {
    "Spotify_MCP": {
      "command": "<FULL_UV_PATH>",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "--with",
        "spotipy",
        "mcp",
        "run",
        <FULL_PATH_TO_MAIN.py>
      ],
      "env": {
        "SPOTIFY_CLIENT_ID": "<CLIENT_ID>",
        "SPOTIFY_CLIENT_SECRET": "<CLIENT_SECRET>",
        "SPOTIFY_REDIRECT_URI": "<REDIRECT_URI>"
      }
    }
  }
}

Currently supported actions

  1. Play a song
  2. Get users playlists
  3. Play from user playlist
  4. Play from SP playlists like charts
  5. Pause Playback
  6. Skip to next
  7. Skip to previous
  8. Turn shuffle on
  9. Turn shuffle off
  10. Play a user's liked songs
  11. Get recently played song
  12. Add to queue
  13. Get most played songs this week/month/year

To Implement

  1. Add a song to a playlist
  2. Add tracks to playlist
  3. Create a playlist
  4. Get recently popular songs. i.e. songs that I discovered recently that I have been playing a lot of.
  5. Generate LLM powered playlists. i.e. "Create a dance workout playlist based on my recent favorite artists"

Project Structure

  • src/auth.py: Handles Spotify API authentication.
  • src/main.py: Likely the main entry point or core logic of the application.
  • src/resources.py: Defines MCP resources for accessing Spotify data.
  • src/server.py: The MCP server implementation.
  • src/tools.py: Defines MCP tools for interacting with the Spotify API (the supported actions listed above).
  • src/utils.py: Utility functions used across the project.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.