Skip to main content
Glama
cuongpo

Rootstock MCP Server

by cuongpo

create_wallet

Generate a new Hyperion wallet with a mnemonic phrase using Rootstock MCP Server. Optionally assign a name to the wallet for easy management.

Instructions

Create a new Hyperion wallet with a generated mnemonic phrase

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoOptional name for the wallet

Implementation Reference

  • Core implementation of wallet creation: generates BIP39 mnemonic, creates ethers HD wallet, stores it, and returns WalletInfo including address, privateKey, mnemonic.
    createWallet(_name?: string): WalletInfo {
      try {
        // Generate a random mnemonic
        const mnemonic = bip39.generateMnemonic();
        const wallet = ethers.Wallet.fromPhrase(mnemonic);
        
        // Store the wallet
        this.wallets.set(wallet.address.toLowerCase(), wallet);
        
        // Set as current wallet if it's the first one
        if (!this.currentWallet) {
          this.currentWallet = wallet.address.toLowerCase();
        }
    
        return {
          address: wallet.address,
          privateKey: wallet.privateKey,
          mnemonic,
          publicKey: wallet.publicKey,
        };
      } catch (error) {
        throw new Error(`Failed to create wallet: ${error}`);
      }
    }
  • MCP server handler for 'create_wallet' tool call: delegates to walletManager.createWallet and formats the success response with address and mnemonic.
    private async handleCreateWallet(params: CreateWalletParams) {
      const walletInfo = this.walletManager.createWallet(params.name);
      return {
        content: [
          {
            type: 'text',
            text: `Wallet created successfully!\n\nAddress: ${walletInfo.address}\nMnemonic: ${walletInfo.mnemonic}\n\n⚠️ IMPORTANT: Save your mnemonic phrase securely. It's the only way to recover your wallet!`,
          },
        ],
      };
    }
  • src/index.ts:165-177 (registration)
    Registration of 'create_wallet' tool in getAvailableTools(): defines name, description, and inputSchema for list tools request.
    {
      name: 'create_wallet',
      description: 'Create a new Hyperion wallet with a generated mnemonic phrase',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Optional name for the wallet',
          },
        },
      },
    },
  • TypeScript interface defining parameters for create_wallet handler (name optional, mnemonic optional but unused in create).
    export interface CreateWalletParams {
      name?: string;
      mnemonic?: string;
    }
  • Alternative handler and registration in Smithery server using McpServer.tool() with Zod schema, delegates to walletManager.createWallet.
    server.tool(
      "create_wallet",
      "Create a new Rootstock wallet with a generated mnemonic phrase",
      {
        name: z.string().optional().describe("Optional name for the wallet"),
      },
      async ({ name }) => {
        try {
          const walletInfo = walletManager.createWallet(name);
          return {
            content: [
              {
                type: "text",
                text: `Wallet created successfully!\n\nAddress: ${walletInfo.address}\nMnemonic: ${walletInfo.mnemonic}\n\n⚠️ IMPORTANT: Save your mnemonic phrase securely. It's the only way to recover your wallet!`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error creating wallet: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );

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/cuongpo/rootstock-mcp'

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