RSK MCP Server - Rootstock Blockchain Tools

RSK MCP Server - Rootstock Blockchain Tools

Enables AI clients to interact with the Rootstock (RSK) blockchain through wallet management, balance queries, token transfers, smart contract deployment and verification, and transaction tracking operations.

Category
Visit Server

README

OpenSSF Scorecard CodeQL <img src="rootstock-logo.png" alt="RSK Logo" style="width:100%; height: auto;" />

RSK MCP Server - Rootstock Blockchain Tools

Rootstock MCP Server is a Model Context Protocol (MCP) server that provides advanced tools for interacting with the Rootstock (RSK) blockchain. This project enables AI clients to seamlessly connect and execute blockchain operations.

πŸš€ Key Features

  • πŸ’Ό Wallet Management: Create, import, switch and manage multiple wallets
  • πŸ’° Balance Queries: Check rBTC and ERC20 token balances
  • πŸ’Έ Transfers: Send rBTC and tokens to other addresses
  • πŸ” Transaction Tracking: Verify transaction status by hash
  • πŸš€ Contract Deployment: Deploy smart contracts on Rootstock
  • βœ… Contract Verification: Verify deployed contracts
  • πŸ“„ Contract Interaction: Read data from verified contracts
  • πŸ“Š History: Query transaction history

πŸ“‹ Prerequisites

  • Node.js v18 or higher
  • npm or yarn
  • TypeScript (included in dev dependencies)

Note: You will use this Model Context Protocol Server from a LLM Client (e.g Cursor, Claude, Warp, etc) which needs to be compatible with the MCP standard. Take into account there are 2 steps here:

  1. Installation and Build
  2. AI Client Configuration

IMPORTANT: You need to complete both settings to correctly use MCP within the Client.

πŸ› οΈ Installation and Build

1. Clone the Repository

git clone https://github.com/rsksmart/rsk-mcp-server
cd rsk-mcp-server

2. Install Dependencies

npm install

3. Build the Project

npm run build

This command:

  • Compiles TypeScript to JavaScript in the build/ folder
  • Makes the main file executable (build/index.js)

4. Verify Installation

node build/index.js

Important Note: For local running this MCP, your client will point to the index.js file created on the build folder after building it.

βš™οΈ AI Client Configuration

🏠 Remote Configuration

For Cursor IDE

In Cursor, go to Settings > Cursor Settings > Tools & Integrations

You will see an option to Add Custom MCP <img src="./doc/img/cursorSettings.png" alt="MCP View" style="width:100%; height: auto;" />

And add to the JSON file:

{
  "mcpServers": {
    "rsk-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@rsksmart/rsk-mcp-server"
      ]
    }
  }
}
// The Args field contains the path to the index.js file created by the build.

Note: For install reference on Cursor, please follow these instructions Here

Once it is installed into Cursor, you should see something like: <img src="./doc/img/cursorInstalled.png" alt="MCP View" style="width:100%; height: auto;" />

Green dot indicates it was installed correctly.

For Claude Desktop (Anthropic)

Edit your Claude Desktop configuration file:

Open your Claude client, and then click on Settings/Developer

<img src="./doc/img/claudeSettings.png" alt="Claude settings" style="width:100%; height: auto;" />

Click the β€œEdit Config” button to open the configuration file and add the following configuration:

Note: This action creates a new configuration file if one doesn’t exist, or opens your existing configuration. The file is located at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "rsk-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@rsksmart/rsk-mcp-server"
      ]
    }
  }
}
// The Args field contains the path to the index.js file created by the build.

Note: For install reference on Claude, please follow these instructions Here

Once you have installed this MCP on the Claude client, you will see it once you click on the Search and toolsoption under Web search option (see next image)

<img src="./doc/img/claudeApp.png" alt="MCP View" style="width:100%; height: auto;" />

🏠 Local Configuration

For Cursor IDE

In Cursor, go to Settings > Cursor Settings > Tools & Integrations

You will see an option to Add Custom MCP <img src="./doc/img/cursorSettings.png" alt="MCP View" style="width:100%; height: auto;" />

And add to the JSON file:

{
  "mcpServers": {
    "rsk-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/your/project/rsk-mcp-server/build/index.js"]
    }
  }
}
// The Args field contains the path to the index.js file created by the build.

Note: For install reference on Cursor, please follow these instructions Here

Once it is installed into Cursor, you should see something like: <img src="./doc/img/cursorInstalled.png" alt="MCP View" style="width:100%; height: auto;" />

Green dot indicates it was installed correctly.

For Claude Desktop (Anthropic)

Edit your Claude Desktop configuration file:

Open your Claude client, and then click on Settings/Developer

<img src="./doc/img/claudeSettings.png" alt="Claude settings" style="width:100%; height: auto;" />

Click the β€œEdit Config” button to open the configuration file and add the following configuration:

Note: This action creates a new configuration file if one doesn’t exist, or opens your existing configuration. The file is located at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "rsk-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/your/project/rsk-mcp-server/build/index.js"],
      "env": {}
    }
  }
}
// The Args field contains the path to the index.js file created by the build.

Note: For install reference on Claude, please follow these instructions Here

Once you have installed this MCP on the Claude client, you will see it once you click on the Search and toolsoption under Web search option (see next image)

<img src="./doc/img/claudeApp.png" alt="MCP View" style="width:100%; height: auto;" />

For Other MCP Implementations

Any MCP-compatible client can connect using:

node /path/to/project/rsk-mcp-server/build/index.js

🌐 Remote Configuration (URL)

Note: This functionality will be available when the server is deployed to a public endpoint.

Remote Client Configuration

{
  "mcpServers": {
    "rsk-mcp": {
      "url": "https://your-server.com/mcp-endpoint",
      "headers": {
        "Authorization": "Bearer your-api-key"
      }
    }
  }
}

πŸ”§ Detailed Functionality

Once this MCP is installed on the client, you will be able to interact with it by prompt, using chat box, for example, a good prompt to start interacting with this MCP is to write a prompt like: I would like to start interacting with Rootstock

Then it will require you to give permission to use the MCP tool, you click on accept, and then it should answer something like:

Perfect! The Rootstock CLI is now active and ready to help you interact with the Rootstock blockchain. Here are the available options:
Available Rootstock Operations:
πŸ’Ό wallet - Manage your wallet (create new, use existing, or import)
πŸ’° balance - Check wallet balances
πŸ’Έ transfer - Transfer RBTC or ERC20 tokens
πŸ” tx - Check transaction status
πŸš€ deploy - Deploy a smart contract
βœ… verify - Verify a contract
πŸ“„ contract - Interact with a contract
πŸ“Š history - Check transaction history
❓ help - Display help
What would you like to do? If you don't have a wallet yet, I'd recommend starting with option 1 (wallet management) to create or import a wallet first. Then you can proceed with other operations like checking balances, transferring tokens, or deploying contracts.
Which option interests you?

You can continue the flow according to what you need to do.

1. πŸ’Ό Wallet Management

Available Tools:

  • start-wallet-interaction: Initialize wallet management
  • create-wallet: Create/import/manage wallets

Supported Operations:

πŸ†• Create New Wallet

// Creates a wallet with secure password
{
  walletOption: "πŸ†• Create a new wallet",
  walletName: "MyWallet",
  walletPassword: "secure_password",
  replaceCurrentWallet: false
}

πŸ”‘ Import Existing Wallet

// Import using private key
{
  walletOption: "πŸ”‘ Import existing wallet",
  walletName: "ImportedWallet",
  privateKey: "0x...",
  walletPassword: "secure_password"
}

πŸ” List Saved Wallets

// List all available wallets
{
  walletOption: "πŸ” List saved wallets",
  walletData: "my-wallets.json_content"
}

πŸ” Switch Active Wallet

// Switch to another wallet
{
  walletOption: "πŸ” Switch wallet", 
  newMainWallet: "WalletName"
}

2. πŸ’° Balance Queries

Tool: check-balance

Supported Tokens:

  • rBTC - Rootstock native token
  • USDT - Tether USD
  • DOC - Dollar on Chain
  • BPRO - BitPro
  • RIF - RIF Token
  • FISH - Fish Token
  • Custom Token - Any ERC20 token

Example:

{
  testnet: true, // true for testnet, false for mainnet
  token: "rBTC",
  walletName: "MyWallet" // optional, uses current wallet if not specified
}

For Custom Tokens:

{
  testnet: true,
  token: "Custom Token",
  customTokenAddress: "0x...", // token contract address
  walletName: "MyWallet"
}

3. πŸ” Transaction Tracking

Tool: check-transaction

{
  testnet: true, // network to check
  txid: "0x..." // transaction hash (with or without 0x prefix)
}

Returned Information:

  • Transaction status (pending/confirmed/failed)
  • Block number
  • Gas used
  • Transfer details
  • Timestamps

4. πŸš€ Contract Deployment

Tool: deploy-contract

Requirements:

  • Contract ABI (JSON)
  • Compiled bytecode (hex)
  • Constructor arguments (optional)
  • Wallet with sufficient funds

Example:

{
  testnet: true,
  abiContent: `[{"inputs":[],"name":"myFunction"...}]`, // complete ABI
  bytecodeContent: "0x608060405234801561001057600080fd5b50...", // bytecode
  constructorArgs: ["arg1", "arg2"], // constructor arguments
  walletData: "my-wallets.json_content",
  walletPassword: "wallet_password"
}

5. βœ… Contract Verification

Tool: verify-contract

Requirements:

  • Deployed contract address
  • Solidity source code
  • Compilation metadata (JSON Standard Input)
  • Constructor arguments used

Example:

{
  testnet: true,
  contractAddress: "0x...", // contract address
  contractName: "MyContract", // exact name in source code
  jsonContent: `{"language":"Solidity","sources":{...}}`, // compilation metadata
  constructorArgs: ["arg1", "arg2"] // arguments used in deployment
}

6. πŸ“„ Contract Reading

Tool: read-contract

To List Available Functions:

{
  testnet: true,
  contractAddress: "0x..." // must be a verified contract
}

To Call a Function:

{
  testnet: true,
  contractAddress: "0x...",
  functionName: "balanceOf", // view/pure function name
  functionArgs: ["0x..."] // function arguments
}

7. 🌐 Supported Networks

Rootstock Mainnet

  • RPC URL: https://public-node.rsk.co
  • Chain ID: 30
  • Explorer: https://explorer.rsk.co

Rootstock Testnet

  • RPC URL: https://public-node.testnet.rsk.co
  • Chain ID: 31
  • Explorer: https://explorer.testnet.rsk.co

πŸ“ Project Structure

rsk-mcp-server/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ handlers/
β”‚   β”‚   └── responsesHandler.ts    # MCP response handling
β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”œβ”€β”€ constants.ts           # Constants and options
β”‚   β”‚   β”œβ”€β”€ handlers.ts            # Auxiliary handlers
β”‚   β”‚   β”œβ”€β”€ schemas.ts             # Zod validation schemas
β”‚   β”‚   └── types.ts               # TypeScript types
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── responses.ts           # Response utilities
β”‚   β”œβ”€β”€ index.ts                   # Main entry point
β”‚   └── types.d.ts                 # Type declarations
β”œβ”€β”€ build/                         # Compiled code (generated)
β”œβ”€β”€ package.json                  # Project configuration
β”œβ”€β”€ tsconfig.json                 # TypeScript configuration
└── README.md                     # This documentation

πŸ” Security

Private Key Management

  • Private keys are stored encrypted using AES-256
  • Each wallet has its own unique IV (initialization vector)
  • Passwords are never stored in plain text

Best Practices

  • Use strong and unique passwords
  • Maintain secure backups of my-wallets.json
  • Do not share configuration files
  • Use testnet for testing

πŸ› Troubleshooting

Error: "Module not found"

npm install
npm run build

MCP Connection Error

  • Verify absolute path in configuration
  • Ensure the project is compiled
  • Check MCP client logs

Wallet Issues

  • Verify my-wallets.json format
  • Check password in password.json (in case you managed the password in a file)
  • Ensure sufficient funds for transactions

Contributing

We welcome contributions from the community. Please fork the repository and submit pull requests with your changes. Ensure your code adheres to the project's main objective.

Support

For any questions or support, please open an issue on the repository or reach out to the maintainers.

Disclaimer

The software provided in this GitHub repository is offered β€œas is,” without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement.

  • Testing: The software has not undergone testing of any kind, and its functionality, accuracy, reliability, and suitability for any purpose are not guaranteed.
  • Use at Your Own Risk: The user assumes all risks associated with the use of this software. The author(s) of this software shall not be held liable for any damages, including but not limited to direct, indirect, incidental, special, consequential, or punitive damages arising out of the use of or inability to use this software, even if advised of the possibility of such damages.
  • No Liability: The author(s) of this software are not liable for any loss or damage, including without limitation, any loss of profits, business interruption, loss of information or data, or other pecuniary loss arising out of the use of or inability to use this software.
  • Sole Responsibility: The user acknowledges that they are solely responsible for the outcome of the use of this software, including any decisions made or actions taken based on the software’s output or functionality.
  • No Endorsement: Mention of any specific product, service, or organization does not constitute or imply endorsement by the author(s) of this software.
  • Modification and Distribution: This software may be modified and distributed under the terms of the license provided with the software. By modifying or distributing this software, you agree to be bound by the terms of the license.
  • Assumption of Risk: By using this software, the user acknowledges and agrees that they have read, understood, and accepted the terms of this disclaimer and assumes all risks associated with the use of this software.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured