Skip to main content
Glama

lnurl_auth

Authenticate to services using the LNURL-auth protocol with a Lightning wallet, enabling secure access to L402 and X402 APIs through cryptographic verification.

Instructions

Authenticate to a service using LNURL-auth protocol. REQUIRES AGENT KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lnurlYesLNURL-auth string to authenticate with

Implementation Reference

  • The implementation of lnurlAuth method in the client class.
    /**
     * Authenticate with LNURL-auth
     */
    async lnurlAuth(lnurl: string): Promise<{
      message: string;
      domain: string;
      rawResponse: ApiResponse;
    }> {
      const result = await this.request<ApiResponse & {
        message?: string;
        domain?: string;
      }>('lnurl_auth', { lnurl });
    
      return {
        message: result.message || 'Authentication successful',
        domain: result.domain || '',
        rawResponse: result,
      };
    }
  • The tool handler in the MCP server that invokes lnurlAuth.
    case 'lnurl_auth': {
      const parsed = LnurlAuthSchema.parse(args);
      const result = await session.requireClient().lnurlAuth(parsed.lnurl);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              message: result.message || 'Authentication successful',
              domain: result.domain,
            }, null, 2),
          },
        ],
      };
    }
  • Zod schema for lnurl_auth tool input validation.
    const LnurlAuthSchema = z.object({
      lnurl: z.string().min(1, 'LNURL string is required').describe('LNURL-auth string to authenticate with'),
    });
  • src/index.ts:1757-1766 (registration)
    Tool registration definition for lnurl_auth.
      };
    }
    
    default:
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({ success: false, error: `Unknown tool: ${name}` }),
          },

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