Releases: rianvdm/lastfm-mcp
v2.2.0 - Security Hardening & MCP Server Review
What's New
This release addresses all P0 (critical) and P1 (important) findings from a comprehensive security and best-practices review of the MCP server against Cloudflare's MCP server building guidelines.
Security Improvements
- CSRF protection on login flow —
/loginnow sets a_csrf_tokensecure cookie that is validated on/callback, preventing cross-site request forgery attacks on the OAuth flow - Content Security Policy headers — The auth success page is now served with
Content-Security-Policy,X-Frame-Options: DENY, andX-Content-Type-Options: nosniffheaders. Username and session data are sanitized before rendering - Typed OAuth resource param fix — Replaced unsafe
(oauthReqInfo as any).resource = undefinedwith properly typed assertion to prevent audience mismatch when Claude.ai sends the full MCP endpoint URL
Reliability Improvements
- Error handling on all MCP tools — All 17 tool callbacks (6 public + 11 authenticated) are now wrapped in try/catch with user-friendly error messages via a
toolError()helper, preventing unhandled exceptions from crashing tool calls - Session lookup bug fix —
handleUnauthenticatedMcpnow checks KV for existing sessions viaMcp-Session-Idheader instead of generating a new UUID on every request. This fixes the issue where login worked but subsequent MCP tool calls couldn't find the session - Context-aware success page — Auth success page now shows "close this window" for users arriving from an MCP client session, and config instructions for manual
/loginvisitors
Code Quality
- Tool code deduplication — Eliminated ~500 lines of duplicated tool registration code between OAuth and non-OAuth paths. Single
registerAuthenticatedToolswith pluggableAuthMessageConfig, whereregisterAuthenticatedToolsWithOAuthis a 3-line wrapper - Deduplicated routes — Removed 5 duplicate route handlers from
oauth-handler.tsthat were already handled inindex-oauth.ts - OAuth server factory — Replaced per-request
McpServercreation in OAuth handler with sharedcreateMcpServer()factory - ABOUTME comments — All 29 source files now have standardized
// ABOUTME:header comments - Dynamic base URLs — Replaced hardcoded URLs with
new URL(request.url).originderivation - Bundle size reduced — From 2824 KiB to 2726 KiB (-98 KiB) by removing duplicate client imports
New Files
src/utils/security.ts— CSRF token generation/validation, CSP header builder, HTML sanitizationsrc/mcp/tools/error-handler.ts— ReusabletoolError()helper for MCP tool error responsesdocs/MCP-SERVER-REVIEW.md— Full assessment document with all findingsdocs/TODO.md— P2 cleanup items for future work
Full Changelog
v2.1.1
What's New
Unauthenticated MCP Access
MCP clients that don't support OAuth 2.1 (like Antigravity, Windsurf) can now connect and use public tools without authentication.
- Public tools work immediately - track info, artist info, album info, similar artists/tracks
- Authenticated tools prompt for login - when you try to access personal data, you'll get a helpful message with login instructions
- Session ID support - the server generates and returns an
Mcp-Session-Idheader for session continuity
Redesigned Setup Documentation
The marketing page setup section has been completely redesigned:
- Vertical list layout instead of cramped grid
- Complete JSON configs for each client (not just snippets)
- Added setup instructions for:
- Claude.ai / Claude Desktop
- Windsurf / Antigravity
- Claude Code
- OpenCode
- Cursor
- Continue.dev / Zed / Other MCP Clients
Other Changes
- Standardized test file naming (
*.test.ts) - Fixed
auth_status→lastfm_auth_statustypo in README - Added implementation plan documentation
Full Changelog
- Allow unauthenticated MCP initialization for non-OAuth clients
- Redesign setup section with complete client configurations
- Add OpenCode setup with correct config format
v2.1.0 - Marketing Page Redesign
What's New
- Dark theme with Last.fm red (#d51007) accents
- Updated setup instructions for Claude.ai, Windsurf, and other MCP clients
- Sample queries section in 2×2 grid layout
- Copy buttons on code blocks
- Red headphone SVG favicon
- Cleaner, more minimal design
v2.0.0 - OAuth 2.0 Support for All Clients
Major release with full OAuth 2.0 support for Claude.ai, Claude Desktop, Claude Code, and Windsurf.
What's New
OAuth 2.0 Authentication
- Full OAuth 2.0 support now works with all major MCP clients
- No more manual session URL workarounds needed
- Seamless browser-based authentication flow
- Persistent sessions across conversations
Bug Fixes
- Fixed OAuth token audience mismatch with Claude.ai
- Clear resource parameter in authorize handler to prevent audience being set
- Strip resource parameter from token requests
- Updated oauth-protected-resource to return base URL without path
Documentation
- Simplified README with unified setup instructions
- Custom domain: https://lastfm-mcp.com
Breaking Changes
- Old OAuth grants have been invalidated (users need to re-authenticate once)
Last.fm MCP Server v1.0.0 - Official Launch
Hey y'all, happy to call this the first stable release of the Last.fm MCP Server! This production-ready server bridges AI assistants with Last.fm's comprehensive music database.
🌟 What's Included
🎧 Personal Music Data
- Recent listening history with pagination
- Top artists, albums, and loved tracks
- Comprehensive listening statistics
- Personalized music recommendations
🕰️ Temporal Queries ⭐ New Feature
- Ask "When did I start listening to Led Zeppelin?"
- Explore "What was I obsessed with in summer 2023?"
- Access your complete Last.fm listening history by time period
- Weekly artist and track charts from any date range
🎵 Public Music Information
- Detailed track, artist, and album information
- Music discovery with similar artists and tracks
- Rich metadata and music recommendations
🔐 Secure & Reliable
- Last.fm Web Authentication with 7-day sessions
- Smart caching system optimized for different data types
- Rate limiting and retry logic built-in
- Global edge deployment on Cloudflare Workers
🚀 Getting Started
Add to your Claude Desktop config:
{
"mcpServers": {
"lastfm": {
"command": "npx",
"args": ["mcp-remote", "https://lastfm-mcp-prod.rian-db8.workers.dev/sse"]
}
}
}
Then ask Claude questions like:
- "What are my recent tracks?"
- "When did I start listening to [artist]?"
- "What was I listening to in [time period]?"
- "Find artists similar to my favorites"
🎯 Perfect For
- Music enthusiasts who want AI-powered music insights
- Developers building music-related AI applications
- Data analysts exploring personal listening patterns
- Anyone curious about their musical journey over time
📚 Full Documentation
See the README.md for complete setup instructions, API documentation, and examples.