Enables interaction with ResilientDB's GraphQL API for creating accounts, managing transactions, and querying blockchain data through a high-performance blockchain platform.
ResilientDB MCP Server
A Model Context Protocol (MCP) server for interacting with ResilientDB, a high-performance blockchain platform. This server allows Large Language Models (LLMs) like Claude to interact with ResilientDB through smart contract operations and GraphQL queries.
Overview
This MCP server bridges the gap between AI agents (like Claude Desktop) and ResilientDB by providing a standardized interface for:
Smart Contract Operations: Compile, deploy, and execute smart contracts using ResContract CLI
GraphQL Operations: Create accounts, manage transactions, and query data
Key-Value Operations: Store and retrieve data using ResilientDB's key-value store
Features
Smart Contract Operations
compileContract: Compile smart contracts using ResContract CLIdeployContract: Deploy compiled contracts to the ResilientDB blockchainexecuteContract: Execute contract methods (read/write operations)getContractState: Retrieve the current state of a deployed contract
GraphQL Operations
createAccount: Create new accounts in ResilientDBgetTransaction: Retrieve transaction details by IDpostTransaction: Post new transactions to the blockchainupdateTransaction: Update existing transactions
Key-Value Operations
get: Retrieve values by keyset: Store key-value pairs
Installation
Prerequisites
Python 3.11 or higher
ResilientDB instance running (see ResilientDB Installation)
ResContract CLI installed (for smart contract operations)
Access to ResilientDB GraphQL endpoint
Local Installation
Clone the repository:
Install dependencies:
Configure environment variables:
Update
.envfile with your settings:
Docker Installation
Build the Docker image:
Run the container:
Configuration
Environment Variables
Variable | Description | Default |
| GraphQL endpoint URL |
|
| Path to ResContract CLI executable |
|
| Optional API key for authentication | None |
| Optional auth token | None |
| Request timeout in seconds |
|
| Polling interval for transactions |
|
| Maximum polling attempts |
|
Usage with Claude Desktop
Add the MCP server to your Claude Desktop configuration:
Open Claude Desktop settings
Edit the MCP servers configuration file (usually
claude_desktop.json)Add the following configuration:
For Local Installation:
For Docker Installation:
Restart Claude Desktop
Available Tools
createAccount
Create a new account in ResilientDB.
Parameters:
accountId(optional): Account ID. If not provided, server will generate one.
Example:
compileContract
Compile a smart contract using ResContract CLI.
Parameters:
contractPath(required): Path to the contract fileoutputDir(optional): Output directory for compiled contract
Example:
deployContract
Deploy a compiled smart contract to ResilientDB.
Parameters:
contractPath(required): Path to the compiled contractaccountId(optional): Account ID for deploymentconstructorArgs(optional): Constructor arguments
Example:
executeContract
Execute a method on a deployed smart contract.
Parameters:
contractAddress(required): Address of the deployed contractmethodName(required): Name of the method to executemethodArgs(optional): Method argumentsaccountId(optional): Account ID for executiontransactionType(optional): "call" for read operations, "send" for write operations (default: "call")
Example:
getTransaction
Get transaction details by transaction ID.
Parameters:
transactionId(required): Transaction ID to retrieve
Example:
postTransaction
Post a new transaction to ResilientDB.
Parameters:
data(required): Transaction data as key-value pairs
Example:
updateTransaction
Update an existing transaction.
Parameters:
transactionId(required): Transaction ID to updatedata(required): Updated transaction data
Example:
get
Retrieve a value from ResilientDB by key.
Parameters:
key(required): Key to retrieve
Example:
set
Store a key-value pair in ResilientDB.
Parameters:
key(required): Key to storevalue(required): Value to store
Example:
getContractState
Get the current state of a deployed smart contract.
Parameters:
contractAddress(required): Address of the deployed contract
Example:
Architecture
The MCP server acts as a mediator between the MCP host (Claude Desktop) and ResilientDB backend services:
Routing Logic
The server automatically routes requests to the appropriate service:
Smart Contract Operations → ResContract CLI
Data Operations → GraphQL API
Hybrid Operations → Tries GraphQL first, falls back to ResContract CLI
Development
Project Structure
Running Tests
Contributing
Fork the repository
Create a feature branch
Make your changes
Submit a pull request
Troubleshooting
ResContract CLI Not Found
If you get an error about ResContract CLI not being found:
Ensure ResContract CLI is installed
Add it to your PATH, or
Set
RESCONTRACT_CLI_PATHenvironment variable to the full path
GraphQL Connection Errors
If you encounter GraphQL connection errors:
Verify ResilientDB is running
Check the
RESILIENTDB_GRAPHQL_URLis correctEnsure network connectivity to the GraphQL endpoint
Check firewall settings
Transaction Timeouts
If transactions timeout:
Increase
REQUEST_TIMEOUTin.envCheck ResilientDB blockchain status
Verify network latency
References
License
Apache 2.0 License
Authors
Team 10 - ECS 265 Project
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables interaction with ResilientDB blockchain through smart contract operations, GraphQL queries, and key-value storage operations.