jerryhong1/lastfm-dxt
If you are the rightful owner of lastfm-dxt and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
An unofficial Desktop Extension (DXT) server that provides access to Last.fm music data and listening history.
Last.fm (Unofficial) DXT
An unofficial Desktop Extension (DXT) server that provides access to Last.fm music data and listening history.
Features
Tools
- 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
Installation
As a Desktop Extension (DXT)
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
Manual Setup
Prerequisites
- Node.js 18+
- Last.fm API key (get one at https://www.last.fm/api)
Installation
- 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 start
Usage
With Claude Desktop
Add 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"
}
}
}
}
Testing with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.js
API Reference
Time Periods
For tools that accept time periods:
overall- All time (default)7day- Last 7 days1month- Last month3month- Last 3 months6month- Last 6 months12month- Last 12 months
Time Range Filtering (get_recent_tracks)
all- No time filtering (default)today- Last 24 hoursweek- Last 7 daysmonth- Last 30 dayscustom- Custom time range usingcustom_hours,from_date, orto_date
Detail Levels
All tools support a detail_level parameter:
minimal- Just essential data (names, counts)standard- Excludes verbose metadata (default)full- Complete response with all data
Example Queries
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"
Development
Project Structure
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
Building
npm run build
Development Mode
npm run dev