lastfm-mcp
Provides tools for interacting with the Last.fm API, enabling access to music metadata, user profiles, charts, tags, and scrobbling features.
Click on "Install 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-mcpWhat are the top tracks by Daft Punk?"
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
An MCP server for the Last.fm API, built on go-lastfm/v2 and the official Go MCP SDK.
It exposes the complete supported Last.fm surface as discoverable MCP tools over:
stdio, for local desktop and CLI clients;
Streamable HTTP, for local services and remote deployments.
Read-only tools are enabled by default. Writes, authentication helpers, and unsupported legacy methods require explicit opt-in.
Status
This project is prepared for its initial repository import. The module path is github.com/ndyakov/lastfm-mcp; change it before the first release if the repository will use a different owner or name.
Related MCP server: MusicBrainz MCP Server
Requirements
Go 1.25 or later
LASTFM_API_KEYLASTFM_API_SECRETandLASTFM_SESSION_KEYonly when write tools are enabled
Run with stdio
export LASTFM_API_KEY="your-api-key"
go run ./cmd/lastfm-mcpExample MCP client configuration:
{
"mcpServers": {
"lastfm": {
"command": "/absolute/path/to/lastfm-mcp",
"env": {
"LASTFM_API_KEY": "your-api-key"
}
}
}
}Never place credentials in a configuration file that will be committed.
Run with Streamable HTTP
export LASTFM_API_KEY="your-api-key"
export LASTFM_MCP_TRANSPORT="http"
export LASTFM_MCP_HTTP_ADDR="127.0.0.1:8080"
go run ./cmd/lastfm-mcpThe MCP endpoint is http://127.0.0.1:8080/mcp; health checks use GET /healthz.
Non-loopback binds are rejected unless LASTFM_MCP_HTTP_TOKEN is set. Clients then send:
Authorization: Bearer <token>The server applies Go's cross-origin protection around the MCP endpoint and sets conservative HTTP timeouts. Put TLS and production identity-aware authentication in a trusted reverse proxy.
Configuration
Environment variable | Default | Purpose |
| required | Last.fm API key |
| empty | Required for signed/authenticated methods |
| empty | Required for write tools |
|
| Outbound Last.fm user agent |
|
| Last.fm request timeout |
|
|
|
|
| HTTP listen address |
|
| Streamable HTTP endpoint |
| empty | HTTP bearer token; mandatory on non-loopback binds |
|
| Register mutating tools |
|
| Register credential/session tools |
|
| Register legacy methods absent from Last.fm's public index |
Equivalent command-line flags are available for transport, address, path, and feature gates. Run lastfm-mcp -h for details.
Tool coverage
The default server registers every stable read endpoint supported by go-lastfm/v2:
album: info, user tags, top tags, search;
artist: correction, info, similar, user tags, top albums/tracks/tags, search;
chart: top artists, tracks, tags;
geo: top artists and tracks;
library: artists;
tag: info, similar, top albums/artists/tracks/tags, weekly chart ranges;
track: correction, info, similar, user tags, top tags, search;
user: profile, friends, loved and recent tracks, personal tags, top albums/artists/tracks/tags, weekly charts and ranges.
LASTFM_ENABLE_WRITES=true adds album/artist/track tagging, love/unlove, now-playing, and scrobbling. These require an API secret and session key.
LASTFM_ENABLE_AUTH_TOOLS=true adds browser-token, authorization-URL, session-exchange, and mobile-session tools. These may expose session credentials to the MCP client and model; leave them disabled unless needed. Prefer completing authentication outside the MCP session and providing LASTFM_SESSION_KEY at process startup.
LASTFM_ENABLE_EXPERIMENTAL=true adds legacy tag search, metros, neighbours, artist/track top fans, and tasteometer comparison. Last.fm may change or disable these without notice.
Docker
docker build -t lastfm-mcp .
docker run --rm -p 127.0.0.1:8080:8080 \
-e LASTFM_API_KEY \
-e LASTFM_MCP_TRANSPORT=http \
-e LASTFM_MCP_HTTP_ADDR=0.0.0.0:8080 \
-e LASTFM_MCP_HTTP_TOKEN \
lastfm-mcpdocker compose up --build uses the same HTTP setup and reads values from the environment.
Development
go mod tidy
go test -race ./...
go vet ./...Until go-lastfm/v2 is published, use a temporary Go workspace containing this repository and the adjacent go-lastfm checkout. Do not commit a local replace directive.
See CONTRIBUTING.md, SECURITY.md, and ROADMAP.md.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceA Model Context Protocol (MCP) server for Last.fm. Gives AI assistants access to your listening history, music discovery, and detailed track/artist/album information.Last updated43MIT
- Alicense-qualityCmaintenanceA comprehensive MCP server for querying the MusicBrainz database, providing tools to search for artists, releases, recordings, and browse music metadata.Last updated4MIT
- AlicenseAqualityBmaintenanceAn MCP server that provides live access to MusicBrainz metadata and Cover Art Archive images, with optional OAuth-based submission of tags, ratings, and collection edits.Last updated9255MIT
- Alicense-qualityAmaintenanceSearch artists, releases, recordings, works, and labels; traverse relationships; resolve ISRC/ISWC/barcode; fetch cover art via MCP. STDIO or Streamable HTTP.Last updated861Apache 2.0
Related MCP Connectors
TheAudioDB MCP — community music metadata database.
Spotify MCP — Web API via client_credentials OAuth
A basic MCP server to operate on the Postman API.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ndyakov/lastfm-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server