rgb_generate_address
Create a new on-chain Bitcoin address for receiving RGB assets or Bitcoin through the RGB Lightning Network MCP Server.
Instructions
Generate a new on-chain address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:126-134 (handler)The MCP tool handler function for 'rgb_generate_address'. It calls rgbClient.generateAddress() and returns the result as JSON text or an error.async ({}) => { try { const address = await rgbClient.generateAddress(); return { content: [{ type: 'text', text: JSON.stringify(address, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true }; } }
- src/server.ts:122-135 (registration)Registration of the 'rgb_generate_address' MCP tool with empty input schema and inline handler.server.tool( 'rgb_generate_address', 'Generate a new on-chain address', {}, async ({}) => { try { const address = await rgbClient.generateAddress(); return { content: [{ type: 'text', text: JSON.stringify(address, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true }; } } );
- src/rgb-client.ts:69-71 (helper)Helper method in RGBApiClientWrapper that wraps the underlying SDK's onchain.getAddress() call.async generateAddress() { return await this.client.onchain.getAddress(); }