lastfm-taste-mcp
Provides read-only access to Last.fm listening data, including recent tracks, top tracks/artists/albums, loved tracks, weekly charts, user tags, and music discovery through similar tracks/artists and tag-based lookups.
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., "@lastfm-taste-mcp play something like what I've been into lately, but nothing I've heard before"
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.
lastfm-taste-mcp
A read-only MCP server that lets an AI agent look at your Last.fm listening history: what you played this week, your most-played songs, what you loved, and what other music sounds like it.
The idea: you ask your agent something like "play something like what I've been into lately, but nothing I've heard before". The agent uses these tools to check your taste on Last.fm, picks the music, and then plays it using whatever music tool it has (Spotify, for example). This server only reads data. It doesn't play anything and can't change your Last.fm account.
Spotify / any player --scrobbles--> Last.fm
Agent --MCP (stdio)--> lastfm-taste-mcp --HTTPS + API key--> Last.fm API
Agent --its own music tool--> plays the pickWhat you can ask
"What were my top songs this week?"
"Have I listened to more Radiohead this month than last month?"
"Play something similar to my favourite track, but not something I've already played."
"I want something chill. What do I already like that fits, and what's new?"
"What genre is this artist?"
The agent decides which tools to call. Each tool returns a short plain-text answer (not raw Last.fm JSON), so a few calls don't fill up the agent's context.
Related MCP server: Claud-Ear
Requirements
Python 3.11 or newer and uv
A Last.fm account that is collecting your plays (scrobbling)
A Last.fm API key (free)
Setup
1. Make sure Last.fm is recording your plays
For Spotify: on last.fm go to Settings → Applications and connect Spotify Scrobbling. Last.fm only sees plays from the moment you connect, so a new account starts empty.
The Spotify connection expires every 6 months. When it does, scrobbling stops without any warning, and the data goes stale. The Applications page shows how many days are left. To renew it, click Disconnect and then Connect.
2. Get an API key
Create an API account at https://www.last.fm/api/account/create. The app name can be anything, and you can leave the callback URL empty. You only need the API key. This server never uses the shared secret.
3. Store the key in an env file
The server reads two environment variables:
Variable | Required | Meaning |
| yes | Your Last.fm API key |
| no | Default user for the |
The username is the one in your profile URL (last.fm/user/<name>). It can differ from the
Spotify name shown on Last.fm's settings page.
git clone https://github.com/nurasik14/lastfm-taste-mcp
cd lastfm-taste-mcp
(umask 077; printf 'LASTFM_API_KEY=%s\nLASTFM_USERNAME=%s\n' 'your-api-key' 'your-lastfm-name' > .env).env is in .gitignore. The umask 077 makes the file readable only by you.
4. Register it with your MCP client
hermes mcp add lastfm --command uv --args run --directory "$PWD" --env-file "$PWD/.env" lastfm-taste-mcp
hermes mcp test lastfm--args must come last. Start a new Hermes session afterwards so the tools load. Hermes gives
stdio servers only a filtered environment, so pass the key through --env-file (as above) or
--env. Exporting it in your shell isn't enough.
Other MCP clients (Claude Desktop, Cursor, and others) use a JSON entry like this:
{
"mcpServers": {
"lastfm": {
"command": "uv",
"args": ["run", "--directory", "/path/to/lastfm-taste-mcp", "--env-file", "/path/to/lastfm-taste-mcp/.env", "lastfm-taste-mcp"]
}
}
}Without cloning, uv can run it straight from GitHub. Your client then has to pass the
variables in an env block:
{
"mcpServers": {
"lastfm": {
"command": "uvx",
"args": ["--from", "git+https://github.com/nurasik14/lastfm-taste-mcp", "lastfm-taste-mcp"],
"env": { "LASTFM_API_KEY": "your-api-key", "LASTFM_USERNAME": "your-lastfm-name" }
}
}
}The server starts and lists its tools even without a key. Tool calls then return "LASTFM_API_KEY is not set". If you see that after adding the key, restart the client: a server that was already running won't re-read the file.
Tools
All 24 tools are read-only and marked with MCP's readOnlyHint. Most take limit (default
10–20, max 200), and the list-style ones also take page.
Your listening. Every one takes an optional user and falls back to LASTFM_USERNAME.
Tool | What it returns |
| Total scrobbles, artist/track/album counts, country, signup date |
| Individual plays with timestamps, newest first; |
| Most-played tracks for |
| Most-played artists for a period |
| Most-played albums for a period |
| Tracks you hearted, with the date |
| Past weeks that have charts, with their |
| Track chart for one week (latest by default) |
| Artist chart for one week |
| Album chart for one week |
| Tags you applied on Last.fm (not the genre of your music) |
| Items you tagged with a given tag |
| Your Last.fm friends |
What music sounds like.
Tool | What it returns |
| Genre/mood tags listeners gave a track |
| Tags for an artist (use it when a single track has none) |
| Tags for an album |
| Album, length, global popularity, tags, and your play count and loved status for that track |
Finding music.
Tool | What it returns |
| Similar tracks with a 0–1 match score |
| Similar artists with a 0–1 match score |
| An artist's most popular tracks across all listeners |
| Most popular tracks with a tag (e.g. |
| Most popular artists with a tag |
| What a tag means and how widely it's used |
| Related tags |
Things to know
Similar-track data is patchy.
track_get_similaroften returns nothing for remixes, covers, and lesser-known tracks.artist_get_similarplusartist_get_top_tracksusually works as a fallback.tag_get_similaris often empty as well.Only finished listens count. Last.fm scrobbles a track once it has played for half its length or 4 minutes, so skipped songs never show up.
Results are artist + title, not Spotify links. To play a pick, the agent has to look the song up in its music tool first.
Errors come back as readable text for the agent: a misspelled name or unknown user (Last.fm error 6), a private profile (17), a rate limit (29), or a bad key (10).
Rate limits. Last.fm limits how many requests each IP can make and asks clients not to make excessive calls. Every tool call is one API request.
Privacy and security
Read-only. The server has no Last.fm login, so it can't scrobble, love tracks, or edit your profile.
The API key is only read from the environment, never from the code. It travels in request URLs (that's how the Last.fm API works), so the server silences httpx's request logging. That log would otherwise write the key into your MCP client's log files.
Last.fm listening data is public by default: anyone with an API key can read it. If you turn on "Hide recent listening information" in your Last.fm privacy settings, some
user_*calls may be refused (error 17).
Development
uv sync # create .venv with the runtime and dev dependencies
uv run pytest -q # 25 tests; they use a fake Last.fm, so no network or key is needed
uv run lastfm-taste-mcp # run the server by hand (it speaks JSON-RPC on stdin/stdout)src/lastfm_taste_mcp/
client.py Last.fm HTTP client, error translation, helpers for Last.fm's JSON quirks
server.py the 24 MCP tools (plain async functions registered with @server.tool)
__init__.py main(): start the server on stdio
tests/
conftest.py FakeLastfm, built on httpx.MockTransport
test_client.py request shape, errors, JSON quirks
test_server.py tool list, reply trimming and errors, via an in-process MCP client
test_stdio_smoke.py starts the real server over stdio, the way a client doesBuilt with the official MCP Python SDK (v2) and httpx. Data comes from the Last.fm API. This project isn't affiliated with Last.fm.
License
Available Tools
24 toolsalbum_get_top_tagsBRead-only
Genre/mood tags listeners gave an album, strongest first; count is relative weight 0-100.
Inputs: album (required), artist (required), limit.
artist_get_similarBRead-only
Artists similar to one artist, with a 0-1 similarity score.
Inputs: artist (required), limit.
artist_get_top_tagsARead-only
Genre/mood tags listeners gave an artist, strongest first; count is relative weight 0-100.
Inputs: artist (required), limit.
artist_get_top_tracksARead-only
An artist's most popular tracks across all Last.fm listeners (not the user's plays).
Inputs: artist (required), limit.
tag_get_infoBRead-only
What a tag means: short description and how widely it is used.
Inputs: tag (required).
tag_get_similarARead-only
Tags related to a tag (e.g. chill → chillout, downtempo). Last.fm often returns nothing here.
Inputs: tag (required).
tag_get_top_artistsARead-only
The most popular artists carrying a tag across all listeners. Not the user's own plays.
Inputs: tag (required), page, limit.
tag_get_top_tracksARead-only
The most popular tracks carrying a tag across all listeners (good for mood/genre requests and discovering new songs). Not the user's own plays.
Inputs: tag (required), page, limit.
track_get_infoBRead-only
Details for one track: album, length, global popularity, top tags, and how many times the user played it and whether they loved it.
Inputs: track (required), artist (required), user.
track_get_similarARead-only
Tracks similar to one track (good for "more like this"), with a 0-1 similarity score.
Inputs: track (required), artist (required), limit.
track_get_top_tagsARead-only
Genre/mood tags listeners gave a track (e.g. chill, sad, rock), strongest first; count is relative weight 0-100. Single tracks are often untagged; fall back to artist_get_top_tags.
Inputs: track (required), artist (required), limit.
user_get_friendsARead-only
The user's Last.fm friends. Their usernames can be passed to the other user_* tools.
Inputs: page, user, limit.
user_get_infoBRead-only
Profile overview: total scrobbles, number of artists/tracks/albums, country and signup date.
Inputs: user.
user_get_loved_tracksBRead-only
Tracks the user marked as loved (hearted) on Last.fm, newest first, with the date loved.
Inputs: page, user, limit.
user_get_personal_tagsARead-only
Items the user personally tagged with a given tag (see user_get_top_tags for their tags).
Inputs: tag (required), page, user, limit, +1 more.
user_get_recent_tracksARead-only
Individual plays with timestamps, newest first, optionally within a date range. Use for "what did I listen to on Tuesday", listening times, or counting plays yourself.
Inputs: page, user, limit, since, +1 more.
user_get_top_albumsBRead-only
The user's most played albums in a time window, with play counts.
Inputs: page, user, limit, period.
user_get_top_artistsARead-only
The user's most played artists in a time window, with play counts.
Inputs: page, user, limit, period.
user_get_top_tagsARead-only
Tags the user has applied themselves on Last.fm, by how often they used them. This is NOT the genre/mood of their music; for that use track_get_top_tags or artist_get_top_tags.
Inputs: user, limit.
user_get_top_tracksARead-only
The user's most played tracks in a time window (their personal favourites), with play counts. Not the same as artist_get_top_tracks (an artist's popular songs) or tag_get_top_tracks (songs with a tag).
Inputs: page, user, limit, period.
user_get_weekly_album_chartARead-only
The user's album chart for one specific week (most recent by default), with play counts.
Inputs: user, limit, week_to, week_from.
user_get_weekly_artist_chartARead-only
The user's artist chart for one specific week (most recent by default), with play counts.
Inputs: user, limit, week_to, week_from.
user_get_weekly_chart_listARead-only
Which past weeks have charts, newest first, with the from/to values needed by the user_get_weekly_*_chart tools. Use it to compare specific weeks.
Inputs: user, limit.
user_get_weekly_track_chartBRead-only
The user's track chart for one specific week (most recent by default), with play counts.
Inputs: user, limit, week_to, week_from.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
The tool set has many similar-sounding families (user_get_top_tracks, artist_get_top_tracks, tag_get_top_tracks; user_get_top_tags vs track/artist/album_get_top_tags), but descriptions explicitly distinguish scopes. A few weekly/top/list variants could still be misselected by a hurried agent, so it is mostly but not perfectly distinct.
Names consistently follow an entity_action_object snake_case pattern, such as user_get_recent_tracks, track_get_similar, and tag_get_top_artists. Minor structural variation in user_get_weekly_chart_list does not break the predictable convention.
Twenty-four tools is on the heavy side, but the Last.fm taste domain spans users, tracks, artists, albums, tags, weekly charts, and similarity relationships. Each tool maps to a distinct read operation, so the count is reasonable though slightly over-scoped.
The surface covers core taste workflows: user stats, recent/top/loved tracks, weekly charts, friends, personal tags, similar tracks/artists, tag discovery, and track info. Minor gaps like artist_get_info or album_get_info exist, but they are not critical dead ends for the stated taste-analysis purpose.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for Producer/Riffusion AI music generation
Read-only MCP server exposing a user ORANO library to their own AI agent.
Read-only search over 2,065+ AI agent tools and 276 MCP servers. Free, no sign-up needed.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceUnofficial, read-only access to your Last.fm listening history, charts, loved tracks, and artist, album and track lookups. Connect to https://lastfm-mcp.com/mcp and sign in with Last.fm. Not affiliated with Last.fm.53MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents the ability to listen to and understand music/audio files, enabling semantic analysis, stem separation, lyrics transcription, and signal processing via tool calls.1MIT
- AlicenseAqualityDmaintenanceAn MCP server for the Last.fm API that enables LLM agents to access music data including user profiles, listening history, top charts, search, and artist/album/track metadata.16MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server for the Last.fm API, exposing artist, album, track, chart, and user data as read-only tools. Supports optional writes, auth, and experimental methods over stdio or HTTP.MIT