lastfm-mcp
Provides tools for accessing Last.fm listening history, including recent scrobbles, top artists/albums/tracks, artist history, and rediscovery candidates based on scrobbles.
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-mcp What are my top artists from the past month?"
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-mcp
A small, open-source, read-only MCP server for Last.fm listening history. It is designed to support music discovery and rediscovery in MCP clients and can be packaged as a ChatGPT/Codex plugin.
What v0.3 does
recent scrobbles;
top artists, albums and tracks over Last.fm's standard periods;
check whether a listener has heard a named artist and roughly how much;
identify rediscovery candidates: historically important artists with little recent listening;
support multiple public Last.fm profiles without asking end users for API credentials;
run over stdio or Streamable HTTP;
include a portable plugin manifest, MCP configuration template, and music-discovery skill.
The server is read-only. It does not use Last.fm write APIs and does not require a Last.fm shared secret.
Related MCP server: mcp-lastfm
Requirements
Node.js 20 or newer
one Last.fm API key for the server/operator
Personal/local setup
Copy .env.example to .env and set:
LASTFM_API_KEY=your_real_api_key
LASTFM_USERNAME=WJMonde
LASTFM_USER_AGENT=lastfm-mcp/0.3.0LASTFM_USERNAME is optional in v0.3. Keeping it set gives personal/local use the same convenient behaviour as v0.2. If it is omitted, every tool call must include a username.
Install dependencies:
npm.cmd installTypecheck:
npm.cmd run typecheckRun locally over stdio
npm.cmd run devRun locally over HTTP
npm.cmd run dev:httpDefault endpoint:
http://127.0.0.1:3000/mcpFor a cloud/container host, the platform will often require:
HOST=0.0.0.0Terminate TLS at the hosting platform and expose a stable HTTPS /mcp URL for plugin use.
Tools
Each tool now accepts an optional username. If LASTFM_USERNAME is configured locally, it is used as the fallback.
recent_scrobbles
Returns recent scrobbles, optionally bounded by UNIX timestamps.
top_items
Returns top artist, album or track items for overall, 7day, 1month, 3month, 6month or 12month.
artist_history
Uses Last.fm's artist information endpoint with the requested username to report whether that listener has scrobbled an artist and the approximate play count.
rediscovery_candidates
Compares all-time top artists against a recent period and surfaces historically significant artists with little or no recent listening. The heuristic is deliberately explainable.
Plugin packaging
The repository includes:
plugin.json
mcp.json
skills/lastfm-music-discovery/SKILL.mdBefore using the package against a deployed server, replace the placeholder URL in mcp.json:
"url": "https://YOUR-PUBLIC-DOMAIN.example/mcp"with the real stable HTTPS MCP endpoint.
See docs/PUBLIC-PLUGIN-ROADMAP.md for the path from this prototype to public submission.
Build and test
npm.cmd run typecheck
npm.cmd run build
npm.cmd testSecurity and privacy
Never commit
.env.Keep the Last.fm API key server-side.
End users should provide only a public Last.fm username.
Do not request users' Last.fm password, shared secret, session key, or API key.
See
docs/PRIVACY.mdbefore deploying publicly.
Available Tools
4 toolsartist_historyARead-onlyIdempotent
Check whether a Last.fm user has listened to an artist and return the approximate total scrobble count. Pass a username unless the server has a local default.
Inputs: artist (required), username.
recent_scrobblesARead-onlyIdempotent
Get a Last.fm user’s most recent scrobbles. Read-only. Pass a username unless the server has a local default.
Inputs: to, from, limit, username.
rediscovery_candidatesARead-onlyIdempotent
Find historically significant artists with little or no listening in a recent Last.fm period. Uses an explainable heuristic, not a Last.fm recommendation endpoint.
Inputs: limit, username, recentPeriod, historicalPool, +1 more.
top_itemsBRead-onlyIdempotent
Get top artists, albums, or tracks for a Last.fm user over a selectable period. Pass a username unless the server has a local default.
Inputs: kind (required), limit, period, username.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a clearly distinct purpose: top_items returns rankings, recent_scrobbles returns a listening stream, artist_history checks a specific artist, and rediscovery_candidates surfaces overlooked artists. There is little risk of an agent selecting the wrong tool for a given task.
All four tool names follow the same lowercase snake_case noun-phrase pattern. Though not verb_noun, the convention is perfectly consistent and predictable across the set.
Four tools form a compact, purposeful set for a niche Last.fm listening-history server. Each tool earns its place and the scope feels appropriately focused rather than bloated or thin.
The set covers the core Last.fm user-listening workflow: top items, recent activity, specific artist checks, and rediscovery candidates. Minor gaps like user profile info or detailed artist metadata are absent, but agents can still complete meaningful tasks without major dead ends.
Maintenance
Related MCP Connectors
Unofficial, read-only access to your Last.fm listening history, charts, and music lookups.
Read-only product MCP for robskan.nl — public profile and Spotify listening APIs.
Read public AT Protocol profiles, records, threads, backlinks and lexicons. No API key required.
Find Bizzy radio stations, read station cards and public author information. Read-only; no playback.
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-
- AlicenseBqualityCmaintenanceProvides 41 read-only tools to search and browse Last.fm data, including artists, albums, tracks, user scrobble history, and charts.419 npmMIT
- AlicenseNot gradedqualityCmaintenanceProvides Last.fm listening analytics and recommendations by combining Last.fm and MusicBrainz metadata, maintaining a local listening index, and recording explicit preferences. Enables queries for listening summaries, taste profiles, artist context, and evidence-backed recommendations via MCP tools.67 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables music discovery and recommendations through the free Last.fm API by exposing tools for artist and track search, similarity-based suggestions, genre or mood-based discovery, and personalized recommendations built from a Last.fm user's listening history.-