Skip to main content
Glama
lnfi-network

RGB Lightning Network MCP Server

by lnfi-network

rgb_sign_message

Sign messages using the RGB node to verify authenticity and ownership of RGB assets on the Lightning Network.

Instructions

Sign a message with the RGB node

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesThe message to sign

Implementation Reference

  • src/server.ts:269-284 (registration)
    Registration of the rgb_sign_message MCP tool, including input schema (message: string) and inline handler that delegates to rgbClient.signMessage() and handles response/error formatting.
    server.tool(
      'rgb_sign_message',
      'Sign a message with the RGB node',
      {
        message: z.string().describe('The message to sign'),
      },
      async ({ message }) => {
        try {
          const result = await rgbClient.signMessage(message);
          return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
        } catch (error) {
          const errorMessage = error instanceof Error ? error.message : String(error);
          return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true };
        }
      }
    );
  • Inline handler function for the rgb_sign_message tool.
    async ({ message }) => {
      try {
        const result = await rgbClient.signMessage(message);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return { content: [{ type: 'text', text: `Error: ${errorMessage}` }], isError: true };
      }
    }
  • Zod input schema for the tool: message as string.
      message: z.string().describe('The message to sign'),
    },
  • Helper method in RGBApiClientWrapper that wraps the external SDK's node.signMessage method.
    async signMessage(message: string) {
      return await this.client.node.signMessage({ message });
    }
  • TypeScript interface for the expected output of signMessage.
    export interface SignMessageResult {
      signature: string;
      [key: string]: any;
    }

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/lnfi-network/rgb-mcp-server'

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