Back to Browse

Lightning Fm MCP Server

by Maml
Developer ToolsModerate5.2MCP RegistryLocal
Free

Server data from the Official MCP Registry

Search Lightning FM's Nostr music catalog, look up artists, and check what's live now.

About

Search Lightning FM's Nostr music catalog, look up artists, and check what's live now.

Security Report

5.2
Moderate5.2Moderate Risk

This is a well-structured MCP server for querying a Nostr-native music catalog with no authentication requirements (by design, as it reads public data). The codebase is clean, properly handles Nostr event verification, uses appropriate error handling, and permissions align well with its read-only purpose. Minor findings around error handling and input validation do not materially impact security. Supply chain analysis found 2 known vulnerabilities in dependencies (0 critical, 1 high severity). Package verification found 1 issue (1 critical, 0 high severity).

7 files analyzed · 7 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

HTTP Network Access

Connects to external APIs or services over the internet.

env_vars

Check that this permission is expected for this type of plugin.

Unverified package source

We couldn't verify that the installable package matches the reviewed source code. Proceed with caution.

What You'll Need

Set these up before or after installing:

Comma-separated relay URLs to query. Only add a relay here if it gates writes the way relay.lightning.fm does (allowlisted artists only) — an unrestricted public relay hands back every other app's kind-31337 events too, not just Lightning FM's.Optional

Environment variable: LFM_NOSTR_RELAYS

Blossom server audio/image hashes resolve against.Optional

Environment variable: LFM_BLOSSOM_URL

How long a fetched catalog/profile/now-playing snapshot is reused, in milliseconds, before the next tool call re-queries the relays.Optional

Environment variable: LFM_CACHE_TTL_MS

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-maml-lightning-fm-mcp": {
      "env": {
        "LFM_BLOSSOM_URL": "your-lfm-blossom-url-here",
        "LFM_CACHE_TTL_MS": "your-lfm-cache-ttl-ms-here",
        "LFM_NOSTR_RELAYS": "your-lfm-nostr-relays-here"
      },
      "args": [
        "-y",
        "lightning-fm-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

Lightning FM :: MCP Server

An MCP server for Lightning FM's music catalog: search tracks, look up artists, and check what's live on the station, all from an agent.

There is no separate agent API. This server reads exactly what a human client reads: kind 31337 track events and kind 0 profiles from public Nostr relays, audio and images from the public Blossom server, and the kind 30311 live activity event the station publishes on every track change. Every track is signed by the artist's own key. This is the canonical catalog, not a curated subset the platform maintains for agents. Artists keep their exit rights: the catalog lives in events they signed, and nothing this server returns depends on the platform's goodwill.

Who this is for

Use it

Add it to your MCP client's server config. For Claude Code or Claude Desktop:

{
  "mcpServers": {
    "lightning-fm": {
      "command": "npx",
      "args": ["-y", "lightning-fm-mcp"]
    }
  }
}

No install, no API key, no account. It talks to relay.lightning.fm and media.lightning.fm by default. See Configuration to point it elsewhere.

Tools

  • search_catalog: free-text search plus genre/tag filters over the full catalog. Leave every filter empty to browse newest-first.
  • get_artist: look up an artist by display name (partial match), hex pubkey, or npub. Returns their profile and full discography.
  • get_now_playing: what's currently on air, and the stream URL.

What works today

Verified against src/, not against ambition.

FeatureStatus
search_catalog: free text matched against title, artist, album, genre, and description, plus genre and tag filtersWorks
get_artist: partial display-name match, hex pubkey, or npub; returns profile plus discographyWorks
get_now_playing: reads the station's kind 30311 live activity event, returns the current track and stream URLWorks
Read-only guarantee: the server holds no keys, never signs, never publishes; there are no write toolsWorks, by construction
Relay snapshot caching (default 60s TTL) so repeated tool calls don't hammer relaysWorks
Transportstdio only; no HTTP transport yet
Writes of any kind (publishing tracks, zapping, tipping)Not built, and out of scope by design

Configuration

All environment variables are optional; defaults point at production. Nothing here is a secret. This server is read-only and never signs or publishes anything.

VariableDefaultWhat it does
LFM_NOSTR_RELAYSwss://relay.lightning.fmComma-separated relay URLs to query. Only add a relay here if it gates writes the way relay.lightning.fm does. Kind 31337 isn't exclusive to Lightning FM, and an unrestricted public relay hands back every other app's tracks too.
LFM_BLOSSOM_URLhttps://media.lightning.fmBlossom server audio/image hashes resolve against.
LFM_CACHE_TTL_MS60000How long a fetched snapshot is reused before the next tool call re-queries the relays.

What this sends

Nothing about you, ever. This server has no telemetry, no analytics, no phone-home, and no opt-in flag for any of the above. It reports nothing to Lightning FM.

The one thing it does send is a User-Agent header on its outbound relay connections:

User-Agent: lightning-fm-mcp/<version>

That is the software naming itself. It is byte-identical for every install, contains no identifier, and says nothing about you or your machine. Without it the underlying websocket library sends its own default User-Agent instead, so this replaces one generic string with a specific one; it does not add a channel. It exists so Lightning FM can tell agent catalog queries apart from browser traffic in its own relay logs.

If you would rather not send it, npm and a one-line edit to src/config.ts are all it takes. It is a measurement aid, not a control.

Development

npm install
npm run dev     # runs src/index.ts directly via tsx
npm run build   # tsc, emits dist/
npm test        # tsx --test tests/*.test.ts

Layout

  • src/index.ts server entry, stdio transport
  • src/tools.ts the three MCP tool registrations
  • src/nostr/ relay reads: catalog.ts, profiles.ts, now-playing.ts, and track.ts (kind 31337 parsing)
  • src/config.ts env handling and defaults
  • tests/ parsing and catalog tests

src/nostr/track.ts mirrors the kind 31337 parsing in station-server/src/catalog/track.ts (private repo) and app-desktop/src-tauri/src/relay.rs. All three must agree on tag names. This is the platform's public wire format, documented in full at lightning.fm/interop.

License

MIT

Reviews

No reviews yet

Be the first to review this server!