# Last.fm MCP

> Last.fm. Audit your music listening habits, top artists, and tracks using your AI client. This server lets your agent pull detailed metadata—from top tags to recent plays—directly from your profile. Stop manually checking dashboards; your AI client handles all the querying and analysis of your entire music history.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** music-discovery, scrobbling, listening-habits, music-metadata, user-profile-analytics

## Description

**Last.fm MCP Server - Audit Your Music Listening Habits**

Your AI client connects directly to your Last.fm profile, letting you pull detailed metadata about your music history. Instead of clicking through dashboards, your agent handles all the querying and analysis of your entire listening profile. You'll get a full rundown of your top artists, albums, and tracks.

**Review Your Track History**

Your agent can pull a list of the tracks you listened to most recently using `get_recent_tracks`, and it'll tell you your overall top artists via `get_top_artists`, top albums with `get_top_albums`, and most popular songs using `get_top_tracks`. You can also check out the top tags and popular music categories using `get_top_tags`.

**Dive Deep into Artist and Album Details**

Need the nuts and bolts on a specific piece of music? You can grab detailed metadata for any artist with `get_artist_info`, or get the full scoop on an album using `get_album_info`. If you want to check out a specific track's info, `get_track_info` gives you the details on that too.

**See Your Personal Favorites and Profile Info**

Your agent knows what you love. It'll pull the list of tracks you marked as 'loved' using `get_loved_tracks`. You can also get general account and user profile details with `get_user_info`.

This server gives you the raw data. Your AI client uses this data to analyze your musical tastes and track trends. It lets you stop guessing about your music and start seeing the actual metrics.

## Tools

### get_album_info
Retrieves specific metadata for a given album.

### get_artist_info
Retrieves detailed metadata for a specific artist.

### get_loved_tracks
Fetches the list of tracks marked as 'loved' by the user.

### get_recent_tracks
Gets a list of the tracks the user listened to most recently.

### get_top_albums
Gets the albums that are most popular for the user.

### get_top_artists
Gets the top-performing artists based on the user's listening history.

### get_top_tags
Gets the current top tags and popular music categories on Last.fm.

### get_top_tracks
Gets the most popular tracks listened to by the user.

### get_track_info
Retrieves detailed metadata for a specific track.

### get_user_info
Retrieves general account and user profile information from Last.fm.

## Prompt Examples

**Prompt:** 
```
List my top 5 tracks this month on Last.fm.
```

**Response:** 
```
I've retrieved your top tracks for the last month. Your #1 song is 'Midnight Jam' by Virtual Band. Would you like the play counts for the rest of the list?
```

**Prompt:** 
```
Show me my recent tracks for user 'vinkius'.
```

**Response:** 
```
I've found your recent listening history. You just finished listening to 'Session 42'. I can provide the timestamps for the last 10 tracks if you like.
```

**Prompt:** 
```
Get information about the artist 'Radiohead'.
```

**Response:** 
```
I've retrieved the metadata for 'Radiohead'. They have over 5 million listeners on Last.fm. Would you like to see their top tags and summary biography?
```

## Capabilities

### Track History Review
List recent tracks and query your most-listened artists, albums, and songs across specific time periods.

### Artist/Album Data Retrieval
Pull detailed metadata for any artist or album to maintain a deep understanding of your music library.

### Music Trend Identification
Browse top tags and charts to identify global music trends and find new inspiration.

### Personal Highlights Retrieval
List your 'loved' tracks, giving you a quick overview of your personal musical favorites.

### User Profile Management
Retrieve detailed user metadata and account info to keep your listening profile organized.

## Use Cases

### Writing a 'Best Of' List
A music journalist needs to write an article on the biggest albums of the year. Instead of logging into Last.fm and manually checking the charts, they ask their agent to run `get_top_albums`. The agent fetches the list, and the journalist has the data points instantly.

### Investigating a Music Shift
A record label analyst notices a shift in popular genres. They ask their agent to check `get_top_tags` and cross-reference it with `get_top_artists`. The agent pulls both sets of data, allowing the analyst to prove a trend shift without leaving their workflow.

### Building a Recommendation Engine
A developer wants to build a tool that recommends music based on a user's history. They use the agent to call `get_recent_tracks` and `get_loved_tracks`. The agent aggregates this data, providing the necessary inputs for the next stage of development.

### Verifying Metadata for a Client
A content curator must confirm that all tracks used in a playlist are correctly cataloged. They ask the agent to run `get_track_info` for every song. The agent returns structured metadata, confirming accuracy instantly.

## Benefits

- See your most listened tracks immediately using `get_top_tracks`. No more wading through manual charts; your agent delivers the list straight up.
- Audit your entire library with `get_artist_info` and `get_album_info`. You get structured metadata for any artist or album, making verification simple.
- Identify emerging music trends by calling `get_top_tags`. Your agent pulls global data, so you don't have to manually browse the 'Top' pages.
- Keep track of your personal favorites with `get_loved_tracks`. This tool shows your most-liked songs, giving you a quick snapshot of your taste.
- Understand your listening journey by running `get_recent_tracks`. You get a chronological log of what you just played, which is key for research.
- Get a full picture of your account with `get_user_info`. This tool retrieves core user details, helping you maintain strict organizational control over your profile.

## How It Works

The bottom line is: you talk to your agent, and it pulls the specific music data you need from Last.fm.

1. Subscribe to the Last.fm server and enter your API Key.
2. Your AI client sends a natural language prompt (e.g., 'What were my top albums last year?').
3. The agent calls the necessary tools (e.g., `get_top_albums`) and returns the structured data to you.

## Frequently Asked Questions

**How do I check my recent listening history using get_recent_tracks?**
Use `get_recent_tracks`. This tool gives you a list of the tracks you played most recently. It's useful for quickly checking what you listened to over the last few days.

**Can I find out my top artists using get_top_artists?**
Yes, use `get_top_artists`. It fetches a list of the artists that are most popular based on your overall listening history. You'll get structured data for easy parsing.

**What is the difference between get_top_albums and get_top_tracks?**
`get_top_albums` provides the most popular albums you've listened to. `get_top_tracks` gives the individual songs that are most played. They cover different levels of granularity.

**Does get_user_info give me my music taste?**
No, `get_user_info` retrieves account details, like username and profile ID. To check your music taste, you need tools like `get_top_artists` or `get_loved_tracks`.

**How do I get detailed information about a specific artist using get_artist_info?**
It pulls all the metadata for a given artist. This includes things like the artist's full name, genre, and key members. You use this tool when you need more than just the name.

**What is the difference between get_top_tracks and get_loved_tracks?**
get_top_tracks pulls your most played songs over a period of time. get_loved_tracks, however, only lists the songs you have explicitly marked as favorites. They measure different types of engagement.

**Can I use get_album_info to find out the genre of a track?**
No, get_album_info only provides data about the entire album. To find genre or specific track details, you should use get_track_info instead.

**How does the get_top_tags tool work?**
This tool retrieves the most popular tags across the platform. It shows you what topics are trending in music right now. It’s useful for market research or finding new genres.

**How do I find my Last.fm API Key?**
Go to the [**Last.fm API account page**](https://www.last.fm/api/account/create), create an API account, and you will find your API Key there. Copy and paste it into the field below.

**Can the agent check my top artists for a specific period?**
Yes. Use the `get_top_artists` tool providing your username and the desired period (e.g., 'overall', '7day', '1month'). Your agent will return your most-listened artists instantly.

**Is it possible to retrieve metadata for a specific track via the agent?**
Yes. The `get_track_info` tool allows your agent to fetch complete metadata for any song by providing the artist and track names, including album and listener counts.