home / mcp / bankless onchain mcp server

Bankless Onchain MCP Server

Bringing the bankless onchain API to MCP

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "bankless-onchain-mcp": {
      "command": "npx",
      "args": [
        "@bankless/onchain-mcp"
      ],
      "env": {
        "BANKLESS_API_TOKEN": "your_api_token_here"
      }
    }
  }
}

You deploy the Bankless Onchain MCP Server to access blockchain state, contract data, events, and transactions through the Bankless API. It implements the Model Context Protocol (MCP), enabling AI models and tooling to query on-chain information in a structured, reliable way for analytics, risk assessment, and smarter decision making.

How to use

Set up your MCP client to communicate with the Bankless Onchain MCP Server. You will be able to read contract state, fetch ABIs and sources, retrieve event logs, and obtain transaction histories and details. Use the MCP endpoints to drive AI workflows, data ingestion, and contract analysis with clearly defined inputs and outputs.

How to install

Prerequisites: ensure you have Node.js and npm installed on your machine.

npm install @bankless/onchain-mcp
```

```
export BANKLESS_API_TOKEN=your_api_token_here
```

```
npx @bankless/onchain-mcp

Available tools

read_contract

Read contract state from a blockchain network by specifying the network, contract address, method, inputs, and expected outputs to obtain typed results.

get_proxy

Retrieve the current proxy implementation address for a proxy contract on a given network.

get_abi

Fetch the ABI (Application Binary Interface) for a specified contract on a chosen network.

get_source

Retrieve verified source code, ABI, and metadata for a contract on a network.

get_events

Fetch event logs for contracts on a network filtered by topics and optional topics to return matching logs.

build_event_topic

Generate an event topic signature from an event name and argument types, returning the keccak256 hash.

get_transaction_history

Retrieve a user’s transaction history on a network with optional filters and an include data flag.

get_transaction_info

Get detailed information about a specific transaction, including block data and receipts.