Last.fm MCP Server
Provides comprehensive access to Last.fm's music database and user data, enabling music discovery, scrobbling, user profile management, and interaction with charts, tags, and music recommendations.
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., "@Last.fm MCP Server what 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 that provides access to Last.fm music data and discovery capabilities.
Available Tools
Artist Tools
search_artists- Search for artists by nameget_artist_info- Get detailed artist information and biographyget_artist_top_albums- Get an artist's most popular albumsget_artist_top_tracks- Get an artist's most popular tracks
Album Tools
search_albums- Search for albums by nameget_album_info- Get detailed album information and tracklistget_album_top_tags- Get tags associated with an album
Track Tools
search_tracks- Search for tracks by nameget_track_info- Get detailed track informationget_similar_tracks- Find tracks similar to a given trackget_track_top_tags- Get tags associated with a track
User Tools
get_user_info- Get user profile informationget_user_recent_tracks- Get a user's recently played tracksget_user_top_artists- Get a user's most played artistsget_user_top_albums- Get a user's most played albumsget_user_top_tracks- Get a user's most played tracksget_user_loved_tracks- Get tracks a user has marked as loved
Chart Tools
get_top_artists- Get global top artistsget_top_tracks- Get global top tracksget_top_tags- Get popular music tags
Tag Tools
get_tag_info- Get information about a music tagget_tag_top_artists- Get top artists for a tagget_tag_top_albums- Get top albums for a tagget_tag_top_tracks- Get top tracks for a tagget_tag_weekly_charts- Get weekly chart data for a tag
Write Operations (Authentication Required)
scrobble_track- Scrobble a track to user's profilelove_track- Mark a track as lovedunlove_track- Remove love from a trackupdate_now_playing- Update what's currently playingadd_track_tags- Add tags to a trackremove_track_tag- Remove a tag from a track
Authentication Tools
get_auth_token- Get authentication token for user loginget_auth_session- Convert token to session for API access
Related MCP server: music-mcp-agent
Setup
Prerequisites
Get Last.fm API credentials at Last.fm API
Copy
.env.exampleto.envand add your credentials:LASTFM_API_KEY=your_actual_api_key_here LASTFM_SHARED_SECRET=your_actual_shared_secret_here
VS Code/Cursor Setup
Option 1: Docker (Recommended)
First build the image:
docker build -t lastfm-mcp .Then add to your VS Code/Cursor MCP configuration:
{
"mcpServers": {
"lastfm-mcp": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--env-file",
"/path/to/your/.env",
"lastfm-mcp"
]
}
}
}Important: Replace /path/to/your/.env with the actual path to your .env file.
Option 2: UV
Add to your VS Code/Cursor MCP configuration:
{
"mcpServers": {
"lastfm-mcp": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/your/project",
"run",
"--env-file",
".env",
"mcp_server.py"
]
}
}
}Important:
Replace
/path/to/uvwith the actual path to your UV installation. Runwhich uvin your terminal to find the path (e.g.,/usr/local/bin/uv,/home/user/.local/bin/uv, or justuvif it's in your PATH)Replace
/path/to/your/projectwith the actual absolute path to your project directory
Available Tools
34 toolsadd_tagsA
Add tags to a track on your Last.fm profile. Requires authentication - use authenticate_user() and get_session() first.
Args: artist: Artist name track: Track name tags: Comma-separated list of tags (max 10)
Returns: Confirmation of tag addition
Inputs: artist (required), track (required), tags (required). Returns: result
authenticate_userB
Starts the authentication process - sets the token in the environment variable and returns an auth URL for the user to visit.
Inputs: no named parameters. Returns: result
check_auth_statusA
Check if the user is authenticated. Authentication is required to use the following tools:
scrobble_track
update_now_playing
love_track
unlove_track
add_tags
remove_tag
Args: None
Returns: "Authenticated" if the user is authenticated, "Not authenticated" otherwise
Inputs: no named parameters. Returns: result
get_album_infoB
Get detailed information about an album
Args: artist: Artist name album: Album name mbid: Optional MBID (MusicBrainz ID) of the album autocorrect: Whether to use autocorrection for the names username: Username for personalized info (playcount, etc.) lang: Language code for wiki content
Returns: Formatted detailed album information
Inputs: artist (required), album (required), mbid, autocorrect, +2 more. Returns: result
get_album_top_tagsB
Get tags associated with an album
Args: artist: Artist name album: Album name mbid: Optional MBID (MusicBrainz ID) of the album autocorrect: Whether to use autocorrection for the names
Returns: Formatted list of top tags for the album
Inputs: artist (required), album (required), mbid, autocorrect. Returns: result
get_artist_infoA
Get detailed information about an artist by name or MBID. You can get a user's playcount, etc. by providing a username.
Args: artist: Artist name to search for (optional if mbid is provided) mbid: Optional MBID (MusicBrainz ID) of the artist (optional if artist is provided) lang: Language code for the artist info (as an ISO 639 alpha-2 code) autocorrect: Whether to use autocorrection for the artist name username: If the username is provided, the artist info will be personalized with the user's playcount, etc.
Returns: Formatted detailed artist information
Inputs: artist, mbid, lang, autocorrect, +1 more. Returns: result
get_artist_top_albumsB
Get an artist's most popular albums
Args: artist: Artist name mbid: Optional MBID (MusicBrainz ID) of the artist autocorrect: Whether to use autocorrection for the artist name limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of the artist's top albums
Inputs: artist (required), mbid, autocorrect, limit, +1 more. Returns: result
get_artist_top_tracksA
Get an artist's most popular tracks
Args: artist: Artist name mbid: Optional MBID (MusicBrainz ID) of the artist autocorrect: Whether to use autocorrection for the artist name limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of the artist's top tracks
Inputs: artist (required), mbid, autocorrect, limit, +1 more. Returns: result
get_sessionA
Complete the authentication process by getting a session key from the authorized token. This should be called after the user has visited the authorization URL from authenticate_user().
Inputs: no named parameters. Returns: result
get_similar_tracksB
Find tracks similar to a given track
Args: artist: Artist name track: Track name mbid: Optional MBID (MusicBrainz ID) of the track autocorrect: Whether to use autocorrection for the names limit: Maximum number of similar tracks to return (1-30, default: 10)
Returns: Formatted list of similar tracks
Inputs: artist (required), track (required), mbid, autocorrect, +1 more. Returns: result
get_tag_infoC
Get information about a music tag
Args: tag: Tag name lang: Language code for wiki content (optional)
Returns: Formatted tag information
Inputs: tag (required), lang. Returns: result
get_tag_top_albumsB
Get top albums for a tag
Args: tag: Tag name limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of top albums for the tag
Inputs: tag (required), limit, page. Returns: result
get_tag_top_artistsB
Get top artists for a tag
Args: tag: Tag name limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of top artists for the tag
Inputs: tag (required), limit, page. Returns: result
get_tag_top_tracksB
Get top tracks for a tag
Args: tag: Tag name limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of top tracks for the tag
Inputs: tag (required), limit, page. Returns: result
get_tag_weekly_chartsB
Get weekly chart data for a tag
Args: tag: Tag name
Returns: Formatted list of available weekly chart periods
Inputs: tag (required). Returns: result
get_top_artistsB
Get global top artists chart
Args: limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of global top artists
Inputs: limit, page. Returns: result
get_top_tagsB
Get global top tags chart
Args: limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of global top tags
Inputs: limit, page. Returns: result
get_top_tracksB
Get global top tracks chart
Args: limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of global top tracks
Inputs: limit, page. Returns: result
get_track_infoB
Get detailed information about a track
Args: artist: Artist name track: Track name mbid: Optional MBID (MusicBrainz ID) of the track autocorrect: Whether to use autocorrection for the names username: Username for personalized info (playcount, etc.)
Returns: Formatted detailed track information
Inputs: artist (required), track (required), mbid, autocorrect, +1 more. Returns: result
get_track_top_tagsC
Get tags associated with a track
Args: artist: Artist name track: Track name mbid: Optional MBID (MusicBrainz ID) of the track autocorrect: Whether to use autocorrection for the names
Returns: Formatted list of top tags for the track
Inputs: artist (required), track (required), mbid, autocorrect. Returns: result
get_user_infoC
Get user profile information
Args: user: Username to get info for
Returns: Formatted user profile information
Inputs: user (required). Returns: result
get_user_loved_tracksB
Get tracks a user has marked as loved
Args: user: Username limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of user's loved tracks
Inputs: user (required), limit, page. Returns: result
get_user_recent_tracksB
Get a user's recently played tracks
Args: user: Username limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1) from_timestamp: Unix timestamp to start from (optional) to_timestamp: Unix timestamp to end at (optional) extended: Include extended data (optional)
Returns: Formatted list of user's recent tracks
Inputs: user (required), limit, page, from_timestamp, +2 more. Returns: result
get_user_top_albumsA
Get a user's most played albums
Args: user: Username period: Time period (7day, 1month, 3month, 6month, 12month, overall) limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of user's top albums
Inputs: user (required), period, limit, page. Returns: result
get_user_top_artistsB
Get a user's most played artists
Args: user: Username period: Time period (7day, 1month, 3month, 6month, 12month, overall) limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of user's top artists
Inputs: user (required), period, limit, page. Returns: result
get_user_top_tracksA
Get a user's most played tracks
Args: user: Username period: Time period (7day, 1month, 3month, 6month, 12month, overall) limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of user's top tracks
Inputs: user (required), period, limit, page. Returns: result
love_trackA
Love a track on your Last.fm profile. Requires authentication - use authenticate_user() and get_session() first.
Args: artist: Artist name track: Track name
Returns: Confirmation of love action
Inputs: artist (required), track (required). Returns: result
remove_tagA
Remove a tag from a track on your Last.fm profile. Requires authentication - use authenticate_user() and get_session() first.
Args: artist: Artist name track: Track name tag: Tag to remove
Returns: Confirmation of tag removal
Inputs: artist (required), track (required), tag (required). Returns: result
scrobble_trackA
Scrobble a track to your Last.fm profile. It can be used for a specific timestamp or current time. Requires authentication - use authenticate_user() and get_session() first.
Args: artist: Artist name track: Track name timestamp: Unix timestamp when track was played (optional, defaults to current time) album: Album name (optional) duration: Track duration in seconds (optional) mbid: MusicBrainz Track ID (optional, more accurate than name)
Returns: Confirmation of scrobble action
Inputs: artist (required), track (required), timestamp, album, +2 more. Returns: result
search_albumsB
Search for albums on Last.fm by name
Args: query: Album name or search query limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of matching albums with their stats
Inputs: query (required), limit, page. Returns: result
search_artistsA
Search for artists on Last.fm by name
Args: query: Artist name or search query limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1) Returns: Formatted list of matching artists with their stats
Inputs: query (required), limit, page. Returns: result
search_tracksB
Search for tracks on Last.fm by name
Args: query: Track name or search query artist: Optional artist name to narrow search limit: Maximum number of results to return (1-50, default: 10) page: Page number to retrieve (default: 1)
Returns: Formatted list of matching tracks with their stats
Inputs: query (required), artist, limit, page. Returns: result
unlove_trackA
Remove love from a track on your Last.fm profile. Requires authentication - use authenticate_user() and get_session() first.
Args: artist: Artist name track: Track name
Returns: Confirmation of unlove action
Inputs: artist (required), track (required). Returns: result
update_now_playingA
Update your "now playing" status on Last.fm. Requires authentication - use authenticate_user() and get_session() first.
Args: artist: Artist name track: Track name album: Album name (optional) duration: Track duration in seconds (optional) mbid: MusicBrainz Track ID (optional)
Returns: Confirmation of now playing update
Inputs: artist (required), track (required), album, duration, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 34 tools
Most tools have distinct purposes targeting specific resources (e.g., get_artist_info vs. get_album_info), but some overlap exists in 'top' retrieval tools (e.g., get_top_artists vs. get_tag_top_artists) which could cause minor confusion. Descriptions help clarify the scope, but the high number of similar-sounding tools increases cognitive load.
All tools follow a consistent verb_noun pattern with snake_case (e.g., get_artist_info, search_tracks, love_track). The naming is predictable and readable, making it easy to understand each tool's function at a glance.
With 34 tools, this server feels overloaded for a music scrobbling and discovery service. While Last.fm has a broad API, many tools are variations of the same pattern (e.g., get_X_top_Y for different X and Y), creating redundancy that could overwhelm agents and increase selection errors.
The tool set comprehensively covers the Last.fm domain, including user actions (scrobble, love, tag), information retrieval (artist, album, track, tag, user), search, and charts. There are no obvious gaps; all major API endpoints appear to be represented with full lifecycle coverage.
Maintenance
Related MCP Connectors
Unofficial, read-only access to your Last.fm listening history, charts, and music lookups.
Search MusicBrainz artists, releases, works, labels; resolve ISRC/ISWC/barcode; fetch cover art.
Search, analyze, and discover commercially released music using sonic intelligence.
Spotify: Spotify Data API for Millions of songs & podcasts, artists, albums, playlists and more.
Related MCP Servers
- AlicenseBqualityCmaintenanceProvides 41 read-only tools to search and browse Last.fm data, including artists, albums, tracks, user scrobble history, and charts.417 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables music search, metadata retrieval, local audio analysis (tempo, key, energy), recommendations, song recognition, and classical work resolution via Spotify, Last.fm, AudD, MusicBrainz, and Songkick APIs.-
- FlicenseNot gradedqualityCmaintenanceEnables music discovery and recommendations through the free Last.fm API by exposing tools for artist and track search, similarity-based suggestions, genre or mood-based discovery, and personalized recommendations built from a Last.fm user's listening history.-
- AlicenseAqualityBmaintenanceEnables reading and writing Last.fm data from Claude, with all 44 read methods and 10 write methods exposed as tools, including scrobbling, loving tracks, and tagging.591MIT