music-mcp-agent
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@music-mcp-agentsearch for Beethoven's Symphony No. 5"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Music AI Agent — MCP Server - specialized in classical music recognition
A Python MCP server exposing music analysis tools: catalog search, track metadata, local tempo/key/energy detection, recommendations, and optional song recognition.
Why it's built this way
Spotify locked down its audio-features, audio-analysis, recommendations,
and related-artists endpoints for all new apps in November 2024, and hasn't
reopened them. So:
Search + track metadata → still Spotify (works great).
Tempo / key / energy → computed locally with
librosaon an actual audio file, instead of asking Spotify for numbers it no longer gives out.Recommendations → Last.fm's
track.getSimilar, which is still free and public."What song is this?" → a separate problem (audio fingerprinting), done via AudD's API — optional, only needed if you want that specific feature.
Related MCP server: Spotify MCP Server
Setup
cd music-mcp-agent
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .envFill in .env:
SPOTIFY_CLIENT_ID/SPOTIFY_CLIENT_SECRET— required for search & metadata. Create an app at https://developer.spotify.com/dashboard (takes ~2 minutes, no approval wait — client-credentials apps don't need extended access).LASTFM_API_KEY— required forget_similar_tracks. Free, instant: https://www.last.fm/api/account/createAUDD_API_KEY— optional, only foridentify_song. Free tier at https://audd.io/
Run it
python server.pyConnect it to Claude Desktop
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"music-agent": {
"command": "/absolute/path/to/venv/bin/python",
"args": ["/absolute/path/to/music-mcp-agent/server.py"]
}
}
}Restart Claude Desktop. The tools will show up under the 🔌 icon.
Tools
Tool | Input | What it does |
|
| Search Spotify catalog |
|
| Full metadata for a track |
|
| Tempo, key, energy — no API |
|
| Recommendations via Last.fm |
|
| Fingerprint recognition via AudD |
|
| Extracts composer, work, performers via MusicBrainz |
|
| Upcoming concerts via Songkick |
Classical music: why two extra steps
Spotify and Last.fm treat a classical recording as one flat string —
"Symphony No. 5 in C Minor, Op. 67: I. Allegro con brio" — with composer,
work, and performing orchestra mashed together inconsistently. Neither is a
good source for "what's this piece" or "who's performing it live," so:
resolve_classical_workuses MusicBrainz (free, no key needed beyond a descriptive User-Agent) to split that string into composer + canonical work title.find_live_performancestakes that composer/work/orchestra and searches Songkick's events database for upcoming concerts, optionally filtered by city.
Typical flow: search_music → resolve_classical_work on the result →
find_live_performances with the resolved composer or orchestra name.
Songkick access isn't instant — you have to apply at
https://www.songkick.com/developer and approval is manual (can take a
couple of weeks), so plan for that lead time before you rely on
find_live_performances.
Note on Bachtrack: it's the most classical-specific concert listings site, but it has no public developer API — only a searchable website — so it isn't wired in here.
Next steps to extend this
Add caching (the Spotify token, repeated searches, MusicBrainz lookups) with something like
diskcache— MusicBrainz in particular rate-limits to ~1 request/second per the terms of their free API.Add a
create_playlisttool if you get user-auth (Authorization Code flow) working instead of client-credentials — needed for anything that writes to a user's account.Swap
analyze_audio_fileto batch-process a folder for a full library scan.If AudD's free tier is too limited, ACRCloud is the other common choice for fingerprinting, similar integration shape.
Once Songkick access comes through, consider adding a
subscribe_orchestratool that periodically checks an orchestra's calendar and only surfaces new additions — more useful than re-querying the full calendar each time.
Structure: music-mcp-agent/ ├── config.py # loads all env vars, once ├── server.py # MCP registration only ├── clients/ │ ├── init.py # marks clients/ as a Python package │ ├── spotify.py # search + track info │ ├── audio_analysis.py # local librosa tempo/key/energy │ ├── lastfm.py # similar tracks │ ├── audd.py # song recognition │ ├── musicbrainz.py # classical work resolution │ └── songkick.py # live performances ├── requirements.txt ├── .env.example └── README.md
This server cannot be deployed
Maintenance
Related MCP Connectors
Search MusicBrainz artists, releases, works, labels; resolve ISRC/ISWC/barcode; fetch cover art.
Audio features + harmonic set-building for tracks by name/ISRC. Spotify audio-features replacement.
Last.fm artist/album/track metadata (free API key required)
The media memory layer for AI agents and their humans. Your AI client gets 29 tools to search your collection, add items, update ratings, preview music, and find patterns across everything you've read, watched, and listened to.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables interaction with Last.fm music data including searching for artists, albums, and tracks, accessing user listening history, and managing music preferences. Supports both read-only operations and authenticated write operations like scrobbling and loving tracks.345-
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Spotify through natural language for music discovery, playback control, library management, and playlist creation. Supports searching for music, controlling playback, managing saved tracks, and getting personalized recommendations based on mood and preferences.45 npm5MIT
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Spotify's music catalog through natural language conversations. Search for tracks and artists, get recommendations, explore playlists, and browse artist discographies using the Spotify Web API.-
- FlicenseAqualityDmaintenanceIntegrates Spotify with Claude to enable voice-controlled music playback, playlist management, and personalized recommendations through conversational AI. It provides comprehensive tools for searching tracks, managing liked songs, and analyzing listening habits.151-