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
| Name | Required | Description | Default |
|---|---|---|---|
| lnurl | Yes | LNURL-auth string to authenticate with |
Implementation Reference
- src/lightning-faucet.ts:1181-1199 (handler)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, }; } - src/index.ts:1638-1653 (handler)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), }, ], }; } - src/index.ts:264-266 (schema)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}` }), },