← Projects
MIT · Open source

mcp-lastfm

MCP server for Last.fm — discover artists, albums and tracks, and browse scrobble history and charts

Features

  • 41 read-only tools — search, artist, album/track, user, chart, tag, geo, and library lookups, all backed by the official Last.fm API
  • Scrobble history at a glance — pull any user's recent tracks, loved tracks, friends, top artists/tracks/albums/tags, and weekly charts over a chosen time period
  • Global, tag, and country charts — surface what's trending on Last.fm overall, within a tag (e.g. shoegaze), or by country
  • Name corrections — check Last.fm's canonical-name correction data for misspelled artists and tracks
  • Just an API key — a single MCP_LASTFM_API_KEY, no OAuth flow or session handshake; set an optional MCP_LASTFM_USERNAME to default the user tools to your own account
  • Safe by design — read-only throughout; no scrobbling, no writes, nothing that touches a user's Last.fm account

Install

npm install -g @kud/mcp-lastfm

Or install as a Claude plugin from the kud marketplace:

/plugin install lastfm@kud

npm publish is pending — until @kud/mcp-lastfm lands on the registry, install from source (see Development).

Getting an API key

  1. Go to last.fm/api/account/create (you'll need to be signed in to a Last.fm account).
  2. Fill in Application name (e.g. mcp-lastfm) and a short description. Leave Callback URL blank — it's only used for the web login flow, which this read-only server doesn't need.
  3. Submit. Last.fm shows you an API key and a shared secret — you only need the API key. (The shared secret is for signed write calls like scrobbling, which aren't supported here.)

Configuration

Add it to your MCP client config:

{
  "mcpServers": {
    "lastfm": {
      "command": "mcp-lastfm",
      "env": {
        "MCP_LASTFM_API_KEY": "your-api-key",
        "MCP_LASTFM_USERNAME": "your-lastfm-username"
      }
    }
  }
}
VariableRequiredPurpose
MCP_LASTFM_API_KEYyesAuthenticates every request
MCP_LASTFM_USERNAMEnoDefault account for the get_user_* tools, so you can ask "what have I been listening to?" without repeating your username. An explicit user argument still overrides it, so you can look up anyone's public profile.

Usage

Once connected, ask your MCP client things like:

> Search for the artist "Slowdive"
> What are Radiohead's top tracks?
> Show me my recent scrobbles
> What's trending on the shoegaze tag right now?

Tools

ToolDescription
search_artistsSearch for artists by name
search_albumsSearch for albums by name
search_tracksSearch for tracks by name, optionally scoped to an artist

Artist

ToolDescription
get_artistArtist bio, listener/play stats, and tags
get_similar_artistsArtists similar to a given one, with match scores
get_artist_top_tracksAn artist's most-played tracks
get_artist_top_albumsAn artist's most-played albums
get_artist_top_tagsThe tags most applied to an artist
correct_artistLast.fm's canonical spelling for a misspelled artist name

Album & Track

ToolDescription
get_albumAlbum info, tracklist, and tags
get_album_top_tagsThe tags most applied to an album
get_trackTrack info, stats, and tags
get_similar_tracksTracks similar to a given one
get_track_top_tagsThe tags most applied to a track
correct_trackLast.fm's canonical spelling for a misspelled track/artist

User

ToolDescription
get_user_infoA user's profile and listening stats
get_user_recent_tracksRecent scrobbles, including the currently playing track
get_user_top_artistsMost-played artists over a time period
get_user_top_tracksMost-played tracks over a time period
get_user_top_albumsMost-played albums over a time period
get_user_loved_tracksTracks the user has marked as loved
get_user_friendsThe user's Last.fm friends
get_user_personal_tagsItems the user has tagged with a given tag
get_user_top_tagsThe user's most-used tags
get_user_weekly_album_chartAlbum play chart for a given week
get_user_weekly_artist_chartArtist play chart for a given week
get_user_weekly_track_chartTrack play chart for a given week
get_user_weekly_chart_listAvailable weekly-chart date ranges

Chart

ToolDescription
get_chart_top_artistsThe most popular artists on Last.fm right now
get_chart_top_tracksThe most popular tracks on Last.fm right now
get_chart_top_tagsThe most popular tags on Last.fm right now

Tag

ToolDescription
get_tag_top_artistsTop artists for a tag
get_tag_top_tracksTop tracks for a tag
get_tag_infoA tag's description and usage stats
get_similar_tagsTags similar to a given one
get_tag_top_albumsTop albums for a tag
get_top_tagsThe most popular tags globally
get_tag_weekly_chart_listAvailable weekly-chart date ranges for a tag

Geo

ToolDescription
get_geo_top_artistsTop artists in a given country
get_geo_top_tracksTop tracks in a given country

Library

ToolDescription
get_library_artistsArtists in a user's library, with play counts

Development

git clone https://github.com/kud/mcp-lastfm.git
cd mcp-lastfm
npm install
MCP_LASTFM_API_KEY=your-api-key MCP_LASTFM_USERNAME=your-username npm run dev

Inspect the server interactively with the MCP inspector:

npm run inspect:dev

📚 Full documentation → mcp-lastfm/docs