An unofficial Desktop Extension (DXT) server that provides access to Last.fm music data and listening history.
- Search Music (
search_music) - Search for tracks or artists - Get User Statistics (
get_user_stats) - Get comprehensive user listening statistics with configurable sections - Get Recent Tracks (
get_recent_tracks) - Get recently played tracks with time range filtering - Get Now Playing (
get_now_playing) - Get the currently playing track - Get Track Info (
get_track_info) - Get detailed information about a specific track - Get Artist Info (
get_artist_info) - Get detailed information about an artist - Get Top Artists (
get_top_artists) - Get a user's top artists for a specific time period - Get Top Tracks (
get_top_tracks) - Get a user's top tracks for a specific time period - Get Loved Tracks (
get_loved_tracks) - Get a user's loved/favorited tracks
The easiest way to use this server is to install it as a Desktop Extension in Claude Desktop.
- Download the
lastfm-dxt.dxtfile - In Claude Desktop, go to Settings → Developer → Install Desktop Extension
- Select the downloaded
.dxtfile - Enter your Last.fm API key when prompted (get one at https://www.last.fm/api)
- Optionally set a default username to avoid typing it repeatedly
- Node.js 18+
- Last.fm API key (get one at https://www.last.fm/api)
- Clone the repository:
git clone https://github.com/jerryhong1/lastfm-dxt.git
cd lastfm-dxt- Install dependencies:
npm install- Set your Last.fm API key:
export LASTFM_API_KEY="your-api-key-here"- Build the project:
npm run build- Start the server:
npm startAdd this server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"lastfm": {
"command": "node",
"args": ["/path/to/lastfm-dxt/dist/index.js"],
"env": {
"LASTFM_API_KEY": "your-api-key-here"
}
}
}
}npx @modelcontextprotocol/inspector node dist/index.jsFor tools that accept time periods:
overall- All time (default)7day- Last 7 days1month- Last month3month- Last 3 months6month- Last 6 months12month- Last 12 months
all- No time filtering (default)today- Last 24 hoursweek- Last 7 daysmonth- Last 30 dayscustom- Custom time range usingcustom_hours,from_date, orto_date
All tools support a detail_level parameter:
minimal- Just essential data (names, counts)standard- Excludes verbose metadata (default)full- Complete response with all data
Ask Claude things like:
- "What's my current music taste based on my Last.fm profile?"
- "Show me what [username] is currently listening to"
- "What were my top tracks last month?"
- "Search for tracks by Radiohead"
- "Get info about the song 'Bohemian Rhapsody' by Queen"
- "Show my listening stats for the past week"
src/
├── index.ts # Main server entry point
├── client/
│ └── lastfm.ts # Last.fm API client
├── types/
│ └── lastfm.ts # TypeScript type definitions
└── tools/
└── index.ts # MCP tool implementations
npm run buildnpm run dev