Skip to main content
Glama
Last.fm MCP Server

Last.fm MCP Server

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 name

  • get_artist_info - Get detailed artist information and biography

  • get_artist_top_albums - Get an artist's most popular albums

  • get_artist_top_tracks - Get an artist's most popular tracks

Album Tools

  • search_albums - Search for albums by name

  • get_album_info - Get detailed album information and tracklist

  • get_album_top_tags - Get tags associated with an album

Track Tools

  • search_tracks - Search for tracks by name

  • get_track_info - Get detailed track information

  • get_similar_tracks - Find tracks similar to a given track

  • get_track_top_tags - Get tags associated with a track

User Tools

  • get_user_info - Get user profile information

  • get_user_recent_tracks - Get a user's recently played tracks

  • get_user_top_artists - Get a user's most played artists

  • get_user_top_albums - Get a user's most played albums

  • get_user_top_tracks - Get a user's most played tracks

  • get_user_loved_tracks - Get tracks a user has marked as loved

Chart Tools

  • get_top_artists - Get global top artists

  • get_top_tracks - Get global top tracks

  • get_top_tags - Get popular music tags

Tag Tools

  • get_tag_info - Get information about a music tag

  • get_tag_top_artists - Get top artists for a tag

  • get_tag_top_albums - Get top albums for a tag

  • get_tag_top_tracks - Get top tracks for a tag

  • get_tag_weekly_charts - Get weekly chart data for a tag

Write Operations (Authentication Required)

  • scrobble_track - Scrobble a track to user's profile

  • love_track - Mark a track as loved

  • unlove_track - Remove love from a track

  • update_now_playing - Update what's currently playing

  • add_track_tags - Add tags to a track

  • remove_track_tag - Remove a tag from a track

Authentication Tools

  • get_auth_token - Get authentication token for user login

  • get_auth_session - Convert token to session for API access

Related MCP server: music-mcp-agent

Setup

Prerequisites

  1. Get Last.fm API credentials at Last.fm API

  2. Copy .env.example to .env and add your credentials:

    LASTFM_API_KEY=your_actual_api_key_here
    LASTFM_SHARED_SECRET=your_actual_shared_secret_here

VS Code/Cursor Setup

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/uv with the actual path to your UV installation. Run which uv in your terminal to find the path (e.g., /usr/local/bin/uv, /home/user/.local/bin/uv, or just uv if it's in your PATH)

  • Replace /path/to/your/project with the actual absolute path to your project directory

Available Tools

34 tools
add_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

    B3.4/5.0

    Scored across 34 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count2/5

    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.

    Completeness5/5

    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

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Provides 41 read-only tools to search and browse Last.fm data, including artists, albums, tracks, user scrobble history, and charts.
      41
      7 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables 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.
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      59
      1
      MIT