Skip to main content
Glama

pay_lightning_address

Send Bitcoin Lightning payments to addresses in user@domain.com format using the Lightning Wallet MCP server, enabling AI agents to execute transactions with specified amounts and optional comments.

Instructions

Pay to a Lightning address (user@domain.com format). REQUIRES AGENT KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesLightning address (user@domain.com)
amount_satsYesAmount in satoshis to send
commentNoOptional payment comment

Implementation Reference

  • Implementation of payLightningAddress in LightningFaucetClient, which sends a request to the Lightning Faucet API.
    async payLightningAddress(
      address: string,
      amountSats: number,
      comment?: string
    ): Promise<{
      amountSats: number;
      feeSats: number;
      paymentHash: string;
      newBalance: number;
      rawResponse: ApiResponse;
    }> {
      const data: Record<string, unknown> = {
        address,
        amount_sats: amountSats,
      };
      if (comment) data.comment = comment;
    
      const result = await this.request<ApiResponse & {
        amount_sats?: number;
        fee_sats?: number;
        payment_hash?: string;
        new_balance?: number;
      }>('pay_lightning_address', data);
    
      return {
        amountSats: result.amount_sats || amountSats,
        feeSats: result.fee_sats || 0,
        paymentHash: result.payment_hash || '',
        newBalance: result.new_balance || 0,
        rawResponse: result,
      };
    }
  • MCP tool handler registration for pay_lightning_address in index.ts.
    case 'pay_lightning_address': {
      const parsed = PayLightningAddressSchema.parse(args);
      const result = await session.requireClient().payLightningAddress(
        parsed.address,
        parsed.amount_sats,
        parsed.comment
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              message: `Paid ${parsed.amount_sats} sats to ${parsed.address}`,
              amount_sats: result.amountSats,
              fee_sats: result.feeSats,
              payment_hash: result.paymentHash,
              new_balance: result.newBalance,
            }, null, 2),
          },
        ],
      };
    }
  • Zod input schema for pay_lightning_address tool.
    const PayLightningAddressSchema = z.object({
      address: z.string().regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, 'Invalid Lightning address format (expected user@domain)')
        .describe('Lightning address (user@domain.com format)'),
      amount_sats: z.number().int().positive().max(10_000_000).describe('Amount in satoshis to send'),
      comment: z.string().max(144).optional().describe('Optional payment comment'),
    });

Latest Blog Posts

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/lightningfaucet/lightning-wallet-mcp'

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