This repository provides a Spotify MCP (Model Context Protocol) server built with Python.
It exposes Spotify-related capabilities as MCP tools, enabling LLMs or other MCP-compatible clients to query Spotify data in a structured, programmatic way.
The server uses the Spotify Web API via spotipy and authenticates using OAuth. It currently supports:
- Fetching an artist’s top tracks by country
- Fetching the authenticated user’s top tracks
Returns the top tracks for a given artist in a specified country.
-
Inputs
artist_name(string, required)country(string, optional; default"DE")- ISO alpha-2 country code (e.g.
DE,US) - Or full English country name (e.g.
Germany,United States)
- ISO alpha-2 country code (e.g.
-
Output
- A list of objects containing:
track_nameartist_namealbum
- A list of objects containing:
Returns the authenticated user’s top tracks.
-
Inputs
limit(int, optional; default10)time_range(string, optional)- One of:
short_term,medium_term,long_term
- One of:
-
Output
- A list of objects containing:
songartist
- A list of objects containing:
The MCP server and the code is described in this blog post https://msauerberg.github.io/blog/2025/mcp_server/