mcpField
L
Last.fm

Last.fm

Local
github.com/ndyakovGames & Entertainment0Updated 3w ago

About Last.fm

Last.fm is an MCP server for accessing Last.fm API data, for music listeners and AI clients. It covers stable read endpoints by default, with writes and authentication tools gated behind opt-in settings.

Key features

  1. 01Artist, album, and track details
  2. 02Charts, tags, and search
  3. 03User profiles and listening history
  4. 04Optional tagging and scrobbling
  5. 05stdio and Streamable HTTP transports

Use cases

  1. 01Look up an artist’s similar acts and top tracks
  2. 02Review a user’s recent and loved tracks
  3. 03Search charts and music tags
  4. 04Enable scrobbling through write tools

MCP support

Exposes supported Last.fm API methods as discoverable tools for MCP clients. It supports stdio and Streamable HTTP; mutating and authentication tools are disabled by default.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"ndyakov-lastfm": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"LASTFM_API_KEY",
"-e",
"LASTFM_API_SECRET",
"-e",
"LASTFM_ENABLE_WRITES",
"ghcr.io/ndyakov/lastfm-mcp:0.2.0"
],
"env": {
"LASTFM_API_KEY": "<LASTFM_API_KEY>",
"LASTFM_API_SECRET": "<LASTFM_API_SECRET>",
"LASTFM_ENABLE_WRITES": "<LASTFM_ENABLE_WRITES>"
}
}
}
}
Run commanddocker run -i --rm -e LASTFM_API_KEY -e LASTFM_API_SECRET -e LASTFM_ENABLE_WRITES ghcr.io/ndyakov/lastfm-mcp:0.2.0
Environment variables to set
LASTFM_API_KEYSecretLast.fm API key (https://www.last.fm/api/account/create)
LASTFM_API_SECRETSecretLast.fm API secret; only needed for authenticated/write methods
LASTFM_ENABLE_WRITESSet to 1 to enable scrobbling/write tools

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
ocighcr.io/ndyakov/lastfm-mcp:0.2.0

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

lastfm-mcp — Last.fm MCP server

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.

Requirements

  • Go 1.25 or later
  • A Last.fm API account
  • LASTFM_API_KEY
  • LASTFM_API_SECRET and LASTFM_SESSION_KEY only when write tools are enabled

Run with stdio

export LASTFM_API_KEY="your-api-key"
go run ./cmd/lastfm-mcp

Example 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-mcp

The 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 variableDefaultPurpose
LASTFM_API_KEYrequiredLast.fm API key
LASTFM_API_SECRETemptyRequired for signed/authenticated methods
LASTFM_SESSION_KEYemptyRequired for write tools
LASTFM_USER_AGENTlastfm-mcp/<version>Outbound Last.fm user agent
LASTFM_REQUEST_TIMEOUT30sLast.fm request timeout
LASTFM_MCP_TRANSPORTstdiostdio or http
LASTFM_MCP_HTTP_ADDR127.0.0.1:8080HTTP listen address
LASTFM_MCP_HTTP_PATH/mcpStreamable HTTP endpoint
LASTFM_MCP_HTTP_TOKENemptyHTTP bearer token; mandatory on non-loopback binds
LASTFM_ENABLE_WRITESfalseRegister mutating tools
LASTFM_ENABLE_AUTH_TOOLSfalseRegister credential/session tools
LASTFM_ENABLE_EXPERIMENTALfalseRegister 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-mcp

docker 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

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.