Skip to main content
Glama

NWC MCP Server

by getAlby
pay_invoice.ts1.02 kB
import { nwc } from "@getalby/sdk"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; export function registerPayInvoiceTool( server: McpServer, client: nwc.NWCClient ) { server.tool( "pay_invoice", "Pay a lightning invoice", { invoice: z.string().describe("The lightning invoice to pay"), amount: z .number() .describe("Optional amount in millisats to pay a zero-amount invoice") .nullish(), metadata: z .object({}) .passthrough() .describe("Optional metadata to include with the payment") .nullish(), }, async (params) => { const result = await client.payInvoice({ invoice: params.invoice, amount: params.amount || undefined, metadata: params.metadata || undefined, }); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } ); }

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/nwc-mcp-server'

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