Skip to main content
Glama

Lightning Tools MCP Server

by getAlby
index.ts1.47 kB
#!/usr/bin/env node import "websocket-polyfill"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import dotenv from "dotenv"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { registerRequestInvoiceTool } from "./tools/request_invoice.js"; import { registerFiatToSatsTool } from "./tools/fiat_to_sats.js"; import { registerParseInvoiceTool } from "./tools/parse_invoice.js"; import { registerFetchL402Tool } from "./tools/fetch_l402.js"; import { webln } from "@getalby/sdk"; // Load environment variables from .env file dotenv.config(); class LightningToolsServer { private _server: McpServer; constructor() { this._server = new McpServer( { name: "lightning-tools-mcp-server", version: "1.1.0", }, {} ); registerRequestInvoiceTool(this._server); registerFiatToSatsTool(this._server); registerParseInvoiceTool(this._server); const NWC_CONNECTION_STRING = process.env.NWC_CONNECTION_STRING; if (!NWC_CONNECTION_STRING) { console.warn("NWC URL not set, some tools are unavailable"); return; } registerFetchL402Tool( this._server, new webln.NostrWebLNProvider({ nostrWalletConnectUrl: NWC_CONNECTION_STRING, }) ); } async run() { const transport = new StdioServerTransport(); await this._server.connect(transport); } } new LightningToolsServer().run().catch(console.error);

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/getAlby/lightning-tools-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server