Last.fm(非官方)DXT
一个非官方的桌面扩展(DXT)服务器,提供对Last.fm音乐数据和收听历史的访问。
特性
工具
- 搜索音乐 (
search_music)-搜索曲目或艺术家 - 获取用户统计信息 (
get_user_stats)-通过可配置的部分获取全面的用户收听统计数据 - 获取最新曲目 (
get_recent_tracks)-通过时间范围过滤获取最近播放的曲目 - 现在开始玩 (
get_now_playing)-获取当前播放的曲目 - 获取赛道信息 (
get_track_info)-获取特定赛道的详细信息 - 获取艺术家信息 (
get_artist_info)-获取艺术家的详细信息 - 获取顶尖艺术家 (
get_top_artists)-获取特定时间段内用户的顶级艺术家 - 获取热门曲目 (
get_top_tracks)-获取用户在特定时间段内的热门曲目 - 获得喜爱的曲目 (
get_loved_tracks)-获取用户喜爱/喜爱的曲目
安装
作为桌面扩展(DXT)
使用此服务器的最简单方法是将其作为桌面扩展安装在Claude Desktop中。
- 下载
lastfm-dxt.dxt文件 - 在Claude Desktop中,转到设置→ 开发者→ 安装桌面扩展
- 选择已下载的
.dxt文件 - 提示时输入您的Last.fm API密钥(在https://www.last.fm/api)
- 可选择设置默认用户名以避免重复键入
手动设置
先决条件
- Node.js 18+
- Last.fm API密钥(在https://www.last.fm/api)
安装
- 克隆存储库:
git clone https://github.com/jerryhong1/lastfm-dxt.git
cd lastfm-dxt- 安装依赖项:
npm install- 设置您的Last.fm API密钥:
export LASTFM_API_KEY="your-api-key-here"- 构建项目:
npm run build- 启动服务器:
npm start用法
使用克劳德桌面
将此服务器添加到您的Claude Desktop配置文件中:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 视窗: %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"
}
}
}
}MCP检验员测试
npx @modelcontextprotocol/inspector node dist/index.jsapi参考
时间段
对于接受时间段的工具:
overall-所有时间(默认)7day-过去7天1month-上个月3month-过去3个月6month-过去6个月12month-过去12个月
时间范围过滤(get_cent_tracks)
all-无时间过滤(默认)today-过去24小时week-过去7天month-过去30天custom-使用自定义时间范围custom_hours,from_date,或to_date
细节级别
所有工具均支持 detail_level 参数:
minimal-只有基本数据(姓名、计数)standard-排除详细元数据(默认)full-包含所有数据的完整响应
查询示例
问克劳德这样的问题:
- “根据我的Last.fm个人资料,我目前的音乐品味是什么?”
- “显示\[用户名\]当前正在收听的内容”
- “上个月我最喜欢的曲目是什么?”
- “通过Radiohead搜索曲目”
- “获取女王歌曲《波西米亚狂想曲》的信息”
- “显示我过去一周的收听统计数据”
发展
项目结构
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 build开发模式
npm run dev