Spotipy-MCP-with-dual-mode

vinay1359/Spotipy-MCP-with-dual-mode

3.1

If you are the rightful owner of Spotipy-MCP-with-dual-mode and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Spotipy MCP Server is a versatile tool for controlling Spotify via terminal or AI assistants.

Spotipy MCP Server

License: MIT License: Apache 2.0 Python Mode Spotipy


Spotipy MCP Server is a dual-mode tool server for controlling Spotify through your terminal or via AI assistants like Claude or ChatGPT.

Built in Python using spotipy, aiohttp, and rich, it supports both real-time manual use and seamless AI integration.


Supported Features

Depending on whether the Spotify account is free or premium, the available features differ

FeatureDescriptionFree AccountPremium Required
Spotify AuthenticationOAuth login using client credentialsāœ…āœ…
Search (songs, albums, etc)Search Spotify catalogāœ…āœ…
Get Playback InfoCurrent track, device, status infoāœ…āœ…
View PlaylistsFetch user playlistsāœ…āœ…
Create PlaylistCreate a new playlistāœ…āœ…
Add to PlaylistAdd tracks to an existing playlistāœ…āœ…
Play SongStart playing a specific songāŒāœ…
Pause / Resume PlaybackPause or resume musicāŒāœ…
Skip / Previous TrackSkip to next or previous songāŒāœ…
Set VolumeAdjust playback volumeāŒāœ…

Modes of Operation

1. Manual Mode (CLI)

python server.py --mode=manual

Launches an animated terminal UI to control your Spotify account without using the app.

2. AI Mode (Claude / ChatGPT / LangChain)

python server.py --mode=ai

Enables MCP tool server mode, allowing an AI agent to send structured tool calls and control your playback.


Installation & Setup

Requirements

  • Python 3.9+
  • Spotify Developer credentials (Client ID, Secret)

Install Dependencies

pip install -r requirements.txt

Configure Environment

Create a .env file in your root directory:

SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REDIRECT_URI=http://localhost:8888/callback

Spotify Developer Dashboard


Project Structure

spotipy-mcp-server/
ā”œā”€ā”€ server.py         # Main CLI + AI server
ā”œā”€ā”€ main.py           # Interactive terminal interface
ā”œā”€ā”€ requirements.txt  # Dependencies
ā”œā”€ā”€ .gitignore
ā”œā”€ā”€ README.md
└── .env              # (ignored)

Commands

CommandDescription
python server.py --mode=manualLaunch terminal UI
python server.py --mode=aiStart MCP server for AI

License

This project is open source and dual-licensed:

Use it freely with attribution. Choose the license that fits your use case best.

Star this repo if Spotipy MCP made your Spotify experience smarter.