Get the FREE Ultimate OpenClaw Setup Guide →

ScrobblerContext

MCP Server for Last.FM APIs, built in Swift

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio tfmart-scrobblercontext swift run ScrobblerContext \
  --env LASTFM_API_KEY="your_api_key_here" \
  --env LASTFM_SECRET_KEY="your_secret_key_here"

How to use

ScrobblerContext is an MCP server written in Swift that provides programmatic access to Last.fm's music database. It exposes tools for authenticating users, searching for artists, albums, and tracks, retrieving detailed metadata, managing user libraries and listening history, and submitting scrobbles and status updates. Clients communicate via stdio following the MCP protocol, invoking specific tool commands (for example authenticate_browser, search_artist, get_track_info, scrobble_track) and receiving structured responses. To use it, run the server in your environment with the required Last.fm API credentials, then configure your MCP client to connect via stdio and point it to the scrobblercontext toolset.

How to install

Prerequisites

  • Swift 6.0+ (macOS 13.0+ or Linux with Swift support)
  • Git
  • Last.fm API credentials (API Key and Shared Secret)

Installation steps

  1. Clone the repository:
git clone https://github.com/tfmart/ScrobblerContext
cd ScrobblerContext
  1. Build the project (Swift Package Manager):
swift build
  1. Set your Last.fm API credentials in the environment (or export them in your shell):
export LASTFM_API_KEY="your_api_key_here"
export LASTFM_SECRET_KEY="your_secret_key_here"
  1. Run the server:
swift run ScrobblerContext

To run with MCP directly via a client, ensure the client is configured to start the server command and pass the required environment variables. The server outputs MCP messages over stdio as per the protocol.

Additional notes

Tips:

  • Ensure LASTFM_API_KEY and LASTFM_SECRET_KEY are kept secret and only exposed to trusted MCP clients.
  • If you see authentication errors, re-run the OAuth flow to refresh tokens as needed.
  • When configuring MCP clients, use stdio transport and point the command to the server executable (ScrobblerContext via SwiftPM) with the required env vars set.
  • For production deployments, consider running behind a process manager and securely rotating API credentials if exposed.

Related MCP Servers

Sponsor this space

Reach thousands of developers