lastfm-mcp
Provides tools for accessing Last.fm music data, including user profiles, listening history, top charts, search, and artist/album/track metadata.
Click on "Deploy 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-mcp show recent tracks for user 'marcus'"
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
An MCP server for the Last.fm API. Enables LLM agents to access music data: user profiles, listening history, top charts, search, and artist/album/track metadata.
Features
User Tools
lastfm_get_user_info— User profile: country, scrobble count, registration date.lastfm_get_recent_tracks— Recently played tracks (including now playing).lastfm_get_user_top_artists— Top artists for a time period.lastfm_get_user_top_albums— Top albums for a time period.lastfm_get_user_top_tracks— Top tracks for a time period.lastfm_get_user_loved_tracks— Loved (favorited) tracks.
Search Tools
lastfm_search_artist— Search artists by name.lastfm_search_album— Search albums by name.lastfm_search_track— Search tracks by name.
Artist Tools
lastfm_get_artist_info— Artist details: bio, tags, listener/scrobble stats, similar artists.lastfm_get_similar_artists— Similar artists with match scores.lastfm_get_artist_top_tracks— Artist's top tracks.lastfm_get_artist_top_albums— Artist's top albums.
Album Tools
lastfm_get_album_info— Album details: tracklist, tags, description.
Track Tools
lastfm_get_track_info— Track details: duration, tags, listener/scrobble stats.lastfm_get_similar_tracks— Similar tracks with match scores.
Related MCP server: Claud-Ear
Configuration
You will need a Last.fm API key. Get one for free at last.fm/api/account/create.
Claude Desktop
Open the Claude Desktop configuration file located at:
On macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonOn Windows:
%APPDATA%/Claude/claude_desktop_config.json
Add the following:
{
"mcpServers": {
"lastfm": {
"command": "uv",
"args": [
"run",
"--with",
"lastfm-mcp",
"--python",
"3.10",
"lastfm-mcp"
],
"env": {
"LASTFM_API_KEY": "<your-api-key>"
}
}
}
}Locate the command entry for
uvand replace it with the absolute path to theuvexecutable. This ensures that the correct version ofuvis used when starting the server. On a Mac, you can find this path usingwhich uv.Restart Claude Desktop to apply the changes.
Cursor
Add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"lastfm": {
"command": "uv",
"args": [
"run",
"--with",
"lastfm-mcp",
"--python",
"3.10",
"lastfm-mcp"
],
"env": {
"LASTFM_API_KEY": "<your-api-key>"
}
}
}
}Claude Code
claude mcp add lastfm -- uv run --with lastfm-mcp --python 3.10 lastfm-mcpMake sure LASTFM_API_KEY is set in your environment.
Running Without uv (Using System Python)
If you prefer to use the system Python installation instead of uv, you can install the package from PyPI and run it directly:
Install the package using pip:
pip install lastfm-mcpUpdate your configuration to use the installed script directly:
{
"mcpServers": {
"lastfm": {
"command": "lastfm-mcp",
"env": {
"LASTFM_API_KEY": "<your-api-key>"
}
}
}
}Note: Make sure to use the full path to the lastfm-mcp script if it is not in your system PATH. You can find the path using which lastfm-mcp.
Environment Variables
LASTFM_API_KEY(required): Your Last.fm API key.
Parameters
Top chart tools (lastfm_get_user_top_artists, lastfm_get_user_top_albums, lastfm_get_user_top_tracks) support a period parameter:
Value | Period |
| All time (default) |
| Last 7 days |
| Last month |
| Last 3 months |
| Last 6 months |
| Last year |
All list tools support pagination via limit and page.
Development
Clone the repository and install dependencies:
git clone https://github.com/dkfancska/mcp-lastfm.git cd mcp-lastfm pip install -e .Copy
.env.exampleto.envand add your API key:cp .env.example .envFor testing with the MCP Inspector:
npx @modelcontextprotocol/inspector lastfm-mcp
License
MIT
Available Tools
16 toolslastfm_get_album_infoBRead-onlyIdempotent
Get detailed information about an album.
Returns tracklist, tags, listener stats, and wiki summary.
Inputs: params (required). Returns: result
lastfm_get_artist_infoARead-onlyIdempotent
Get detailed information about an artist.
Returns bio, stats, tags, and similar artists.
Inputs: params (required). Returns: result
lastfm_get_artist_top_albumsBRead-onlyIdempotent
Get the top albums for an artist on Last.fm.
Inputs: params (required). Returns: result
lastfm_get_artist_top_tracksARead-onlyIdempotent
Get the top tracks for an artist on Last.fm.
Inputs: params (required). Returns: result
lastfm_get_recent_tracksARead-only
Get a user's recently played tracks.
Returns the most recent scrobbles, including currently playing track if any.
Inputs: params (required). Returns: result
lastfm_get_similar_artistsBRead-onlyIdempotent
Get artists similar to the specified artist.
Inputs: params (required). Returns: result
lastfm_get_similar_tracksARead-onlyIdempotent
Get tracks similar to the specified track.
Inputs: params (required). Returns: result
lastfm_get_track_infoARead-onlyIdempotent
Get detailed information about a track.
Returns listener stats, tags, album info, and wiki summary.
Inputs: params (required). Returns: result
lastfm_get_user_infoARead-onlyIdempotent
Get profile information for a Last.fm user.
Returns user profile data including playcount, registration date, country, and profile URL.
Inputs: params (required). Returns: result
lastfm_get_user_loved_tracksBRead-onlyIdempotent
Get a user's loved (favorited) tracks.
Inputs: params (required). Returns: result
lastfm_get_user_top_albumsARead-onlyIdempotent
Get a user's top albums for a given time period.
Inputs: params (required). Returns: result
lastfm_get_user_top_artistsARead-onlyIdempotent
Get a user's top artists for a given time period.
Inputs: params (required). Returns: result
lastfm_get_user_top_tracksARead-onlyIdempotent
Get a user's top tracks for a given time period.
Inputs: params (required). Returns: result
lastfm_search_albumBRead-onlyIdempotent
Search for albums on Last.fm by name.
Inputs: params (required). Returns: result
lastfm_search_artistBRead-onlyIdempotent
Search for artists on Last.fm by name.
Inputs: params (required). Returns: result
lastfm_search_trackBRead-onlyIdempotent
Search for tracks on Last.fm by name.
Inputs: params (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool targets a distinct resource (album, artist, track, user) and action (get info, get top, search, similar), with no overlap in purpose. An agent can clearly distinguish between them.
All tools follow a consistent 'lastfm_<verb>_<resource>' pattern in snake_case, making it predictable and easy to navigate.
16 tools is appropriate for a music discovery service covering albums, artists, tracks, and users, though slightly more than the typical 3-15 range. Still well-scoped.
Covers core read operations for artists, albums, tracks, and users including search and top lists. Lacks write operations (like love/unlove tracks) and some niche endpoints (e.g., tags, events), but the read surface is solid.
Maintenance
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Hosted MCP server for live public-data APIs and Skills for AI agents.
An MCP server that gives any LLM or agent clean YouTube transcripts on demand: a single video, a whole channel, or a playlist, plus AI cleanup of auto-generated captions. API-key auth, credit-based, same backend as the public v1 API. Get a free API key with 25 free credits at youtubetranscriptdownload.com/account.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceUnofficial, read-only access to your Last.fm listening history, charts, loved tracks, and artist, album and track lookups. Connect to https://lastfm-mcp.com/mcp and sign in with Last.fm. Not affiliated with Last.fm.53MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents the ability to listen to and understand music/audio files, enabling semantic analysis, stem separation, lyrics transcription, and signal processing via tool calls.1MIT
- AlicenseAqualityCmaintenanceMCP server for Spotify that enables playlist building and music discovery through 19 tools, allowing LLM agents to search tracks/artists/albums, manage playlists, control playback, and access personal listening data.2046 PyPI1MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server for the Last.fm API, exposing artist, album, track, chart, and user data as read-only tools. Supports optional writes, auth, and experimental methods over stdio or HTTP.MIT