tfmart/ScrobblerContext
If you are the rightful owner of ScrobblerContext 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.
ScrobblerContext is a Model Context Protocol (MCP) server that interfaces with Last.fm's music database, enabling AI assistants to perform music-related operations.
authenticate_browser
Start OAuth flow in browser
search_artist
Search for artists
scrobble_track
Submit single track play
get_user_info
Get user profile & stats
get_similar_artists
Find similar artists
ScrobblerContext - Last.fm MCP Server
A Model Context Protocol (MCP) server that provides access to Last.fm's music database. Built in Swift, it enables AI assistants to search for music, manage user libraries, and scrobble tracks.
Table of Contents
- Features
- Quick Start
- Setup with MCP Clients
- Usage Examples
- Manual Installation
- Available Tools
- Contributing
- Documentation
- Troubleshooting
- License
- Acknowledgments
Features
- Authentication: Secure browser OAuth flow with session persistence
- Artist Operations: Search artists, get detailed information, find similar artists
- Album Operations: Search albums, get track listings and metadata
- Track Operations: Search tracks, get details and recommendations
- User Data: Access listening history, statistics, and social features
- Scrobbling: Submit track plays, update now playing status, love/unlove tracks
Quick Start
Install via npm (Recommended)
# Install globally
npm install -g scrobblercontext-mcp
# Set up your Last.fm API credentials
export LASTFM_API_KEY="your_api_key_here"
export LASTFM_SECRET_KEY="your_secret_key_here"
# Run the server
scrobblercontext-mcp
Get Last.fm API Credentials
- Visit Last.fm API Account Creation
- Fill in the application details:
- Application Name: Your app name (e.g., "My MCP Server")
- Application Description: Brief description
- Application Homepage URL: Your website (can be GitHub repo)
- Callback URL:
http://localhost:8080/callback
(for OAuth)
- Save your API Key and Shared Secret
Setup with MCP Clients
Claude Desktop
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"lastfm": {
"command": "scrobblercontext-mcp",
"env": {
"LASTFM_API_KEY": "your_api_key_here",
"LASTFM_SECRET_KEY": "your_secret_key_here"
}
}
}
}
Configuration file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
Cursor
Add to your MCP settings:
{
"mcpServers": {
"lastfm": {
"command": "scrobblercontext-mcp",
"env": {
"LASTFM_API_KEY": "your_api_key_here",
"LASTFM_SECRET_KEY": "your_secret_key_here"
}
}
}
}
Other MCP Clients
The server communicates over stdio following the Model Context Protocol standard. Configure your client to:
- Execute
scrobblercontext-mcp
as the server command - Set the required environment variables
- Use stdio transport
Usage Examples
Authenticate with Last.fm:
User: "Authenticate with Last.fm"
Assistant: [Uses authenticate_browser tool to start OAuth flow]
Search for music:
User: "Find artists similar to Radiohead"
Assistant: [Uses get_similar_artists tool to find recommendations]
Scrobble tracks:
User: "Scrobble 'Bohemian Rhapsody' by Queen"
Assistant: [Uses scrobble_track tool to submit to your profile]
Manual Installation
Prerequisites:
- Swift 6.0+ (Download)
- macOS 13.0+ or Linux with Swift support
- Last.fm API credentials
Build from source:
git clone https://github.com/tfmart/ScrobblerContext
cd ScrobblerContext
swift build
export LASTFM_API_KEY="your_api_key_here"
export LASTFM_SECRET_KEY="your_secret_key_here"
swift run ScrobblerContext
Available Tools
Authentication Tools (5)
authenticate_browser
- Start OAuth flow in browserset_session_key
- Set existing session keycheck_auth_status
- Check authentication statusrestore_session
- Restore saved sessionlogout
- Clear authentication
Artist Tools (9)
search_artist
- Search for artistsget_artist_info
- Get artist details & biographyget_similar_artists
- Find similar artistsget_artist_correction
- Get corrected artist nameget_artist_tags
- Get artist tagsget_artist_top_albums
- Get artist's top albumsget_artist_top_tracks
- Get artist's top tracksadd_artist_tags
- Add personal tags (requires auth)remove_artist_tag
- Remove personal tag (requires auth)
Album Tools (6)
search_album
- Search for albumsget_album_info
- Get album details & tracklistget_album_tags
- Get album tagsget_album_top_tags
- Get popular album tagsadd_album_tags
- Add personal tags (requires auth)remove_album_tag
- Remove personal tag (requires auth)
Track Tools (8)
search_track
- Search for tracksget_track_info
- Get track detailsget_similar_tracks
- Find similar tracksget_track_correction
- Get corrected track infoget_track_tags
- Get track tagsget_track_top_tags
- Get popular track tagsadd_track_tags
- Add personal tags (requires auth)remove_track_tag
- Remove personal tag (requires auth)
User Tools (9)
get_user_info
- Get user profile & statsget_user_recent_tracks
- Get recent listening historyget_user_top_artists
- Get top artists by periodget_user_top_tracks
- Get top tracks by periodget_user_top_albums
- Get top albums by periodget_user_top_tags
- Get most used tagsget_user_friends
- Get friends listget_user_loved_tracks
- Get loved tracksget_user_personal_tags_for_artists
- Get tagged artists
Scrobble Tools (5)
scrobble_track
- Submit single track playscrobble_multiple_tracks
- Submit multiple playsupdate_now_playing
- Update current track statuslove_track
- Mark track as lovedunlove_track
- Remove from loved tracks
Contributing
Contributions are welcome! Please see for guidelines.
Documentation
- API Documentation - Auto-generated from code
- - Development setup and guidelines
- Model Context Protocol - MCP specification
- Last.fm API - Last.fm API documentation
Troubleshooting
Swift not found: Install Swift from swift.org
Invalid session key: Re-run authentication with authenticate_browser
API key errors: Verify your LASTFM_API_KEY
and LASTFM_SECRET_KEY
are correct
Server disconnects: Check environment variables are set in MCP client config
License
MIT License - see file for details.
Acknowledgments
- Last.fm for the music data API
- ScrobbleKit for the Swift Last.fm SDK
- Model Context Protocol for the communication standard