lastfm-mcp
Provides access to Last.fm listening history, music discovery, and detailed track/artist/album information.
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 my recent tracks?"
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.
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 with OAuth 2.0 authentication. Public tools (track info, artist info, similar artists) work without signing in -- connect your Last.fm account to access personal listening data.
Quick start
Claude.ai / Claude Desktop
Open Settings -> Connectors -> Add Custom Connector
Enter
https://lastfm-mcp.com/mcpSign in to Last.fm when prompted
Claude Code
claude mcp add --transport http lastfm "https://lastfm-mcp.com/mcp"Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"lastfm": {
"serverUrl": "https://lastfm-mcp.com/mcp"
}
}
}Other MCP clients
For clients that don't support remote servers directly (Continue.dev, Zed, etc.), use mcp-remote:
{
"mcpServers": {
"lastfm": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://lastfm-mcp.com/mcp"]
}
}
}MCP Inspector
npx @modelcontextprotocol/inspector https://lastfm-mcp.com/mcpAuthentication
The server uses OAuth 2.0. When you connect from a supported client, your browser opens to Last.fm to authorize access. Tokens persist across sessions.
Public tools work without signing in. You only need to connect your account for personal listening data.
Available tools
Public tools
Tool | Description |
| Detailed information about a track |
| Artist information and bio |
| Album details and track listing |
| An artist's globally most-played tracks |
| An artist's globally most-played albums |
| Artists similar to a given artist |
| Tracks similar to a given track |
| Test connectivity |
| Server status and capabilities |
| Check authentication status |
Personal tools (requires sign-in)
Tool | Description |
| Recent listening history (paginated) |
| Top artists by time period |
| Top albums by time period |
| Top tracks by time period |
| Loved/favorited tracks |
| Last.fm profile information |
| Listening statistics |
| Personalized recommendations |
Temporal queries (requires sign-in)
Tool | Description |
| Available historical time periods |
| Artist charts for a specific time period |
| Track 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 tracks
lastfm://user/{username}/top-artists # Top artists
lastfm://user/{username}/top-albums # Top albums
lastfm://user/{username}/loved # Loved tracks
lastfm://user/{username}/profile # User profile
lastfm://track/{artist}/{track} # Track info
lastfm://artist/{artist} # Artist info
lastfm://album/{artist}/{album} # Album info
lastfm://artist/{artist}/similar # Similar artists
lastfm://track/{artist}/{track}/similar # Similar tracksPrompts
Prompt | Description | Arguments |
| Analyze listening habits and patterns |
|
| Discover music based on listening history |
|
| Detailed analysis of a track |
|
| Detailed analysis of an album |
|
| Detailed analysis of an artist |
|
| Summarize listening habits |
|
Development
Prerequisites
Node.js 18+
Cloudflare Workers account
Last.fm API key (create one here)
Local setup
git clone https://github.com/rianvdm/lastfm-mcp.git
cd lastfm-mcp
npm installCreate .dev.vars:
LASTFM_API_KEY=your_api_key
LASTFM_SHARED_SECRET=your_shared_secret
JWT_SECRET=your_jwt_secretnpm run devTest with the inspector:
npx @modelcontextprotocol/inspector http://localhost:8787/mcpDeployment
Set production secrets:
echo "your_api_key" | wrangler secret put LASTFM_API_KEY --env production
echo "your_shared_secret" | wrangler secret put LASTFM_SHARED_SECRET --env production
echo "your_jwt_secret" | wrangler secret put JWT_SECRET --env productionDeploy:
npm run deploy:prodTesting
npm test
npm run typecheck
npm run lintArchitecture
Runtime: Cloudflare Workers
Protocol: MCP (streamable HTTP)
Auth: OAuth 2.0 (RFC 9728)
Storage: Cloudflare KV for sessions, tokens, and caching
API: Last.fm Web API v2.0
Endpoints
Endpoint | Purpose |
| MCP JSON-RPC endpoint |
| OAuth 2.0 authorization |
| OAuth server metadata |
| OAuth resource metadata |
Contributing
Fork the repo
Create a feature branch
Commit your changes
Open a pull request
License
MIT
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.
Latest Blog Posts
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/rianvdm/lastfm-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server