Skip to main content
Glama

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

Related MCP server: Maximum Sats MCP

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.

Feature

Status

search_catalog: free text matched against title, artist, album, genre, and description, plus genre and tag filters

Works

get_artist: partial display-name match, hex pubkey, or npub; returns profile plus discography

Works

get_now_playing: reads the station's kind 30311 live activity event, returns the current track and stream URL

Works

Read-only guarantee: the server holds no keys, never signs, never publishes; there are no write tools

Works, by construction

Relay snapshot caching (default 60s TTL) so repeated tool calls don't hammer relays

Works

Transport

stdio 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.

Variable

Default

What it does

LFM_NOSTR_RELAYS

wss://relay.lightning.fm

Comma-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_URL

https://media.lightning.fm

Blossom server audio/image hashes resolve against.

LFM_CACHE_TTL_MS

60000

How 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

Available Tools

3 tools
get_artistLook up a Lightning FM artistA

Look up an artist by display name or Nostr pubkey (hex or npub) and return their profile plus every track they have published to Lightning FM.

ParametersJSON Schema
NameRequiredDescriptionDefault
artistYesArtist display name (partial match ok), hex pubkey, or npub.

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description takes on the full burden. It discloses accepted input formats (display name, hex, npub) and return contents (profile + every published track). It does not describe error handling or what happens on ambiguous matches, and the read-only nature is implied rather than explicit, so a 5 is not warranted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, efficiently worded sentence that front-loads the action and target, then conveys return value without filler. Every phrase earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter lookup with no output schema, the description adequately covers what will be returned (profile + tracks). It leaves a few edge cases unaddressed (e.g., ambiguous names, empty results), but the tool is simple enough that these are minor gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the schema already explains the parameter well (partial match ok, formats). The description essentially repeats that information without adding extra semantic context about the parameter, so it meets the baseline but does not exceed it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('Look up'), the resource ('artist'), and the accepted identifiers (display name or Nostr pubkey), and further specifies that it returns the profile plus all published tracks. However, it does not explicitly differentiate from sibling tools like search_catalog, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use is clear: when you need an artist's profile and tracks by name or pubkey, this is the tool. It does not explicitly address when not to use it or mention alternatives, leaving sibling differentiation to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_now_playingWhat's playing on Lightning FM right nowA

Read the current live activity (NIP-53, kind 30311) Lightning FM publishes on every track change: the track currently on air, the stream URL, and station status.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It clearly labels the operation as a read, exposes the live/NIP-53 protocol detail, and states what information is returned. It does not mention failure modes, latency, or auth, but for a zero-parameter public read that is a minor gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single tight sentence that front-loads the verb and resource, then adds protocol and return details. Every clause earns its place with no repetition or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter read with no output schema, the description needs to explain what the tool returns and does, and it does so concretely (track, stream URL, station status). It could slightly improve by noting what happens when no track is currently on air, but the station status detail partially covers that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so the schema holds no parameter information for the description to enhance. According to the baseline for zero-parameter tools, this is a Strong case: nothing is missing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ('Read'), a specific resource ('current live activity ... Lightning FM publishes'), and the exact data elements returned (track, stream URL, station status). It clearly distinguishes this from sibling search-oriented tools like search_catalog and get_artist by focusing on live, current state rather than catalog lookup.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description says it reads current live activity and the track currently on air, which gives clear context for when to use it. It does not explicitly name sibling alternatives or say when not to use it, but the 'current' vs. search distinction is strong enough that an agent should route correctly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_catalogSearch Lightning FM catalogA

Search or browse Lightning FM's Nostr-native music catalog (kind 31337 track events, fetched live from wss://relay.lightning.fm). Every result is signed by the artist's own Nostr key — this is the canonical catalog, not a curated subset. Leave all filters empty to browse the whole catalog, newest first.

ParametersJSON Schema
NameRequiredDescriptionDefault
tagNoMatch a single free-form keyword tag.
genreNoExact or partial genre match, case-insensitive.
limitNoMax tracks to return (default 20, max 100).
queryNoFree-text match against title, artist name, album, genre, and description.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It discloses the live-fetching behavior, the Nostr signature guarantee, the canonical nature of the data, and the default ordering. It does not mention potential latency, relay availability, or result shape, but for a search tool the disclosed traits are substantive and useful.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences with no filler. It front-loads the core purpose, then efficiently adds key contextual facts (live source, signed results, canonical scope, browse behavior). Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search/browse tool with no output schema and no annotations, the description covers purpose, usage, data source, trust properties, and default ordering. It is missing explicit return-format details and error behavior, but the schema covers parameters and the description gives enough context for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are already documented in the schema. The description adds one meaningful behavioral hint—that leaving all filters empty browses the whole catalog—but does not add meaning for individual parameters beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Search or browse') and resource ('Lightning FM's Nostr-native music catalog'), and further distinguishes it by specifying the event kind (31337) and the live relay source. This makes it clearly distinct from the sibling tools get_artist and get_now_playing, which focus on singular or current-state data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear usage context: filters can be left empty to browse the entire catalog newest first, and the catalog is live and canonical rather than curated. However, it does not explicitly state when to prefer this tool over the sibling tools or provide exclusion criteria, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.5
    • First observedget_artist
    • First observedget_now_playing
    • First observedsearch_catalog

TDQS

A4.3/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a distinct purpose: searching the catalog, looking up an artist, and reading live now-playing data. There is no practical overlap in what an agent would select them for.

Naming Consistency5/5

All three tools follow a clear verb_noun convention: search_catalog, get_artist, get_now_playing. The naming pattern is predictable and consistent.

Tool Count5/5

Three tools is a tight, well-scoped set for a read-only music catalog API. Each tool covers a distinct high-level user need without unnecessary bloat.

Completeness4/5

The core domain is covered: catalog browsing/search, artist lookup with tracks, and live playback status. A direct track-by-ID detail lookup is a minor gap, but the other tools can work around it through search or artist queries.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    Enables interaction with Last.fm music data including searching for artists, albums, and tracks, accessing user listening history, and managing music preferences. Supports both read-only operations and authenticated write operations like scrobbling and loving tracks.
    34
    5
    -
  • A
    license
    A
    quality
    F
    maintenance
    Provides tools for AI agents to access Bitcoin, Lightning Network, and Nostr knowledge, including real-time network statistics and Web of Trust reputation data. It features an integrated Lightning Network payment system for micro-transactions and query-based interactions.
    12
    9
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to query the MusicBrainz music database for artists, albums, recordings, and labels. It provides tools for advanced searches, detailed metadata retrieval, and accessing cover art information.
    17
    12
    GPL 3.0