# bankless/onchain-mcp [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/Bankless/onchain-mcp/  
**GitHub Stars:** 78  
**npm Downloads (last month):** 280  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/bankless-onchain-mcp

## Description
Bankless Onchain API to interact with smart contracts, query transaction and token information

## Tools
Capabilities this server exposes over MCP:

- **read_contract** — Read contract state from a blockchain. important:  
                
                In case of a tuple, don't use type tuple, but specify the inner types (found in the source) in order. For nested structs, include the substructs types.
    
    Example: 
    struct DataTypeA {
    DataTypeB b;
    //the liquidity index. Expressed in ray
    uint128 liquidityIndex;
    }
    
    struct DataTypeB {
    address token;
    }
    
    results in outputs for function with return type DataTypeA (tuple in abi): outputs: [{"type": "address"}, {"type": "uint128"}]
- **get_proxy** — Gets the proxy address for a given network and contract
- **get_abi** — Gets the ABI for a given contract on a specific network
- **get_source** — Gets the source code for a given contract on a specific network
- **get_events** — Fetches event logs for a given network and filter criteria
- **build_event_topic** — Builds an event topic signature based on event name and arguments
- **get_transaction_history_for_user** — Gets transaction history for a user and optional contract
- **get_transaction_info** — Gets detailed information about a specific transaction
- **get_token_balances_on_network** — Gets all token balances for a given address on a specific network
- **get_block_info** — Gets detailed information about a specific block by number or hash

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "onchain-mcp": {
    "command": "npx",
    "args": ["-y","@bankless/onchain-mcp"],
    "env": {
      "BANKLESS_API_TOKEN": ""
    }
  }
}
```

**Requires environment variables:** `BANKLESS_API_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What bankless/onchain-mcp does

The bankless/onchain-mcp MCP server exposes blockchain data operations through the Bankless API. It is intended for applications that support the Model Context Protocol and need structured access to contract state, contract metadata, event logs, or transaction records.

Contract operations include reading a method on a deployed contract, finding a proxy's implementation address, retrieving a contract ABI, and fetching source and related metadata for a verified contract. Contract reads require a network, address, method name, typed inputs, and expected output types.

Event operations retrieve logs for selected contract addresses using a primary topic and optional topic filters. The server can also calculate an event signature topic from an event name and its argument types. Transaction operations cover address history and detailed information for an individual transaction, including block, timestamp, addresses, value, gas, status, and receipt data.

## How it works

The bankless/onchain-mcp MCP server runs as a command-line Node.js process and communicates with an MCP-compatible AI application. Requests are sent to the server as tool calls, with blockchain network names and operation-specific parameters. Results are returned as typed contract values, implementation addresses, JSON ABI data, source metadata, event log objects, or transaction records.

The event-topic workflow is useful when an application has an event signature but needs the corresponding topic hash before querying logs. Proxy-aware workflows can first resolve the implementation address, then inspect its ABI or verified source while continuing to call the proxy address for state reads.

The project reports validation, authentication, missing-resource, and rate-limit error types. It is no longer receiving updates, so developers should account for that maintenance status when evaluating it for a new production dependency.

## Setup and configuration

Install the package from npm:

```bash
npm install @bankless/onchain-mcp
```

Set the required `BANKLESS_API_TOKEN` environment variable with a token obtained from the Bankless API documentation. The server can then be started with:

```bash
npx @bankless/onchain-mcp
```

For an MCP client configuration, use `npx` as the command, pass `@bankless/onchain-mcp` as an argument, and provide the token in the server's environment. Developers building from source can clone the repository, install dependencies, and run the documented build command.

## Tools and capabilities

The bankless/onchain-mcp MCP server supports these documented operations:

- Read contract state with typed arguments and outputs.
- Retrieve proxy implementation addresses.
- Fetch contract ABIs and verified source metadata.
- Query event logs by address and topics.
- Create keccak256 event signature topics.
- Retrieve address transaction history and transaction details.

Networks and contract addresses are supplied per request. Examples in the project include Ethereum, Polygon, and Base, but the material does not define a complete supported-network list.

## Limitations and notes

The server requires a valid Bankless API token and is subject to API authentication and rate limits. Invalid parameters and unavailable resources are also reported as distinct error conditions. Its documented contract-source operation applies to verified contracts.

The repository states that development has stopped. The README includes examples for contract reads, proxy lookup, event filtering, and topic construction; use of transaction operations is documented in the feature descriptions. Confirm current Bankless API availability and network coverage before depending on it.

_Full upstream README: https://allmcps.com/mcp/bankless-onchain-mcp/readme_

