register_operator
Create a new operator account for the Lightning Wallet MCP server to manage Bitcoin Lightning wallets, access paid APIs, and control agent spending limits. Returns API key and recovery code that must be saved immediately.
Instructions
Register a new operator account. Returns API key and recovery code. SAVE THESE - they cannot be retrieved later!
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name for the operator account (optional) | |
| No | Optional email for product updates and feature announcements |
Implementation Reference
- src/lightning-faucet.ts:1424-1464 (handler)The implementation of the `register_operator` tool, which is a standalone exported function that registers a new operator with the Lightning Faucet API.
export async function registerOperator(name?: string, email?: string): Promise<{ operatorId: number; apiKey: string; recoveryCode: string; }> { const payload: Record<string, string> = { action: 'register', name: name || 'AI Agent Operator', }; if (email) { payload.email = email; } const response = await fetch(API_BASE_URL, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(payload), }); if (!response.ok) { throw new Error(`Request failed (HTTP ${response.status})`); } const result = await response.json() as RegisterResponse; if (!result.success) { throw new Error(result.error || 'Registration failed'); } if (!result.api_key) { throw new Error('No API key returned'); } return { operatorId: result.operator_id || 0, apiKey: result.api_key, recoveryCode: result.recovery_code || '', }; }