Last.fm MCP

com.lastfm-mcpPublished by lastfm-mcp.comOfficial publisherv2.8.0Updated Nov 14, 2026

Unofficial, read-only access to your Last.fm listening history, charts, and music lookups.

VerifiedStreamable HTTPWeb executableKnowledge & MemoryMedia & Design

Overview

AI-generated overview

Read-only Last.fm access that lets an assistant look up tracks, artists and albums and analyze your listening history and charts.

What you can do
  • Look up tracks, artists and albums, including bios, track listings, top tracks and albums, and similar artists or tracks
  • Read your listening data: recent tracks, top artists, albums and tracks by period, loved tracks, profile, stats and recommendations
  • Explore listening history over time through weekly chart periods and per-period artist and track charts
  • Expose music data as MCP resources for user, track, artist and album URIs
  • Run built-in prompts for listening insights, music discovery, and track, album or artist analysis
  • Check connectivity, server status and authentication state
When to use it
Useful when you want an assistant to answer questions about your own music taste, such as what you played recently, your top artists of a period, or when a listening habit started, and to explore artists and albums related to what you already play.
Requirements
Remote MCP endpoint at lastfm-mcp.com over streamable HTTP; no local install. OAuth 2.0 sign-in with your Last.fm account is required on first connect, and sign-ins expire after 30 days. Clients without remote server support need the mcp-remote bridge via npx.
Before you install
Access is read-only and cannot scrobble or change your Last.fm data. Signing in grants the server access to your listening history and profile, which it reads through the Last.fm API; the approval page names the requesting app and destination address. Self-hosting requires Last.fm API credentials and a consent secret.

Installation

In SourceWeft

  1. Open Last.fm MCP in the dashboard and add it to a workspace.
  2. Connect the required credentials. They are stored privately and never shown on public pages.
  3. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/com.lastfm-mcp%2Flastfm/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config. The client completes OAuth sign-in on first connect.

{
  "mcpServers": {
    "last-fm": {
      "type": "http",
      "url": "https://lastfm-mcp.com/mcp"
    }
  }
}

README

Last.fm MCP Server

A Model Context Protocol (MCP) server for Last.fm. Gives AI assistants access to your listening history, music discovery, and detailed track/artist/album information.

Runs on Cloudflare Workers. Your MCP client signs you in with OAuth the first time it connects, and after that every tool is available, from track and artist lookups to your own listening history.

Quick start

lastfm-mcp.com has setup steps for each app, including ChatGPT, Codex, Cursor, Devin Desktop (formerly Windsurf) and OpenCode. If an AI agent is setting it up for you, point it at lastfm-mcp.com/llms.txt.

Claude.ai / Claude Desktop

  1. Go to Customize -> Connectors
  2. Click Add, then Add custom connector. Name it Last.fm, enter https://lastfm-mcp.com/mcp and click Continue
  3. Leave the sign-in settings as they are, click Add, then Connect, and sign in to Last.fm

Claude Code

bash
claude mcp add --scope user --transport http lastfm "https://lastfm-mcp.com/mcp"

Then start Claude Code, run /mcp, choose lastfm, then Authenticate, and sign in to Last.fm in your browser.

Other MCP clients

For clients that don't support remote servers directly (Continue.dev, Zed, etc.), use mcp-remote:

json
{	"mcpServers": {		"lastfm": {			"command": "npx",			"args": ["-y", "mcp-remote", "https://lastfm-mcp.com/mcp"]		}	}}

MCP Inspector

bash
npx @modelcontextprotocol/inspector https://lastfm-mcp.com/mcp

Authentication

The server uses OAuth 2.0. The first time your client connects, your browser opens a short page on lastfm-mcp.com that names the app asking for access and the address that access will go to. Approve it, then sign in to Last.fm. That browser remembers the approval for a year, so reconnecting the same app skips the page.

Access is read-only: the server can read your listening history and profile, but it can't scrobble or change anything. Sign-ins expire after 30 days, and your client then asks you to sign in again.

Available tools

Lookups and diagnostics

ToolDescription
get_track_infoDetailed information about a track
get_artist_infoArtist information and bio
get_album_infoAlbum details and track listing
get_artist_top_tracksAn artist's globally most-played tracks
get_artist_top_albumsAn artist's globally most-played albums
get_similar_artistsArtists similar to a given artist
get_similar_tracksTracks similar to a given track
pingTest connectivity
server_infoServer status and capabilities
lastfm_auth_statusCheck authentication status

Your listening data

ToolDescription
get_recent_tracksRecent listening history (paginated)
get_top_artistsTop artists by time period
get_top_albumsTop albums by time period
get_top_tracksTop tracks by time period
get_loved_tracksLoved/favorited tracks
get_user_infoLast.fm profile information
get_listening_statsListening statistics
get_music_recommendationsPersonalized recommendations

Your listening history over time

ToolDescription
get_weekly_chart_listAvailable historical time periods
get_weekly_artist_chartArtist charts for a specific time period
get_weekly_track_chartTrack charts for a specific time period

Good for questions like "when did I start listening to Led Zeppelin?" or "what was I into last March?"

Resources

The server exposes MCP resource URIs:

lastfm://user/{username}/recent          # Recent trackslastfm://user/{username}/top-artists     # Top artistslastfm://user/{username}/top-albums      # Top albumslastfm://user/{username}/loved           # Loved trackslastfm://user/{username}/profile         # User profilelastfm://track/{artist}/{track}          # Track infolastfm://artist/{artist}                 # Artist infolastfm://album/{artist}/{album}          # Album infolastfm://artist/{artist}/similar         # Similar artistslastfm://track/{artist}/{track}/similar  # Similar tracks

Prompts

PromptDescriptionArguments
listening_insightsAnalyze listening habits and patternsusername, period?
music_discoveryDiscover music based on listening historyusername, genre?
track_analysisDetailed analysis of a trackartist, track
album_analysisDetailed analysis of an albumartist, album
artist_analysisDetailed analysis of an artistartist
listening_habitsSummarize listening habitsusername, timeframe?

Development

Prerequisites

  • Node.js 22 (see .nvmrc; CI runs 22)
  • Cloudflare Workers account
  • Last.fm API key (create one here)

Local setup

bash
git clone https://github.com/rianvdm/lastfm-mcp.gitcd lastfm-mcpnpm install

Create .dev.vars (or copy .dev.vars.example):

LASTFM_API_KEY=your_api_keyLASTFM_SHARED_SECRET=your_shared_secretCONSENT_SECRET=any_random_string_of_32_or_more_characters
bash
npm run dev

Test with the inspector:

bash
npx @modelcontextprotocol/inspector http://localhost:8787/mcp

Deployment

Set production secrets (or run npm run setup:prod, which creates the KV namespaces, prompts for the two Last.fm values and generates CONSENT_SECRET):

bash
echo "your_api_key" | wrangler secret put LASTFM_API_KEY --env productionecho "your_shared_secret" | wrangler secret put LASTFM_SHARED_SECRET --env productionopenssl rand -base64 32 | wrangler secret put CONSENT_SECRET --env production

CONSENT_SECRET signs the cookie that remembers which apps a browser approved. Rotating it shows the consent page again to everyone; if it's missing or shorter than 32 characters, approvals aren't remembered, but sign-ins still work.

Upgrading a deployment from v2.6.0 or earlier: v2.7.0 added the consent page and the CONSENT_SECRET secret. Set it with the openssl line above before you deploy, or right after. Until it's set, the consent page shows on every sign-in.

Deploy:

bash
npm run deploy:prod

Testing

bash
npm test          # vitest, in workerd via @cloudflare/vitest-pool-workersnpm run lintnpm run build     # wrangler deploy --dry-run: catches type and binding errors

Architecture

  • Runtime: Cloudflare Workers
  • Protocol: MCP (streamable HTTP)
  • Auth: OAuth 2.0 (RFC 9728) via @cloudflare/workers-oauth-provider; the provider owns sessions and tokens
  • Storage: Cloudflare KV for OAuth state, sessions, caching, and rate-limit counters
  • Rate limiting: per-IP on /mcp, so one client can't exhaust the shared Last.fm API key's budget
  • API: Last.fm Web API v2.0

Endpoints

EndpointPurpose
/mcpMCP JSON-RPC endpoint (rate-limited per IP)
/authorizeOAuth 2.0 authorization
/oauth/tokenOAuth 2.0 token exchange
/oauth/registerOAuth 2.0 dynamic client registration
/.well-known/oauth-authorization-serverOAuth server metadata
/.well-known/oauth-protected-resourceOAuth resource metadata
/.well-known/mcp.jsonMCP server card (name, version, transport)
/llms.txtSetup instructions for AI agents
/healthHealth check
/Landing page

Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Commit your changes
  4. Open a pull request

License

MIT

Source: README.md at commit 07cbc8c

Tools

0
This server asks you to sign in, so SourceWeft could not read its tools without an account and has not indexed them. What a connected account sees can depend on that account and its permissions.

Version history

1
  1. v2.8.0LatestNov 14, 2026

Score

85% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

Other Lastfm-Mcp integrations