bankless onchain.com
bankless onchain.com logo

Bankless Onchain

Integrates with blockchain networks to enable smart contract interaction, transaction history access, and on-chain data...

Created byApr 22, 2025

Bankless Onchain MCP Server

MCP (Model Context Protocol) server for blockchain data interaction through the Bankless API.

Overview

The Bankless Onchain MCP Server provides a framework for interacting with on-chain data via the Bankless API. It implements the Model Context Protocol (MCP) to allow AI models to access blockchain state and event data in a structured way.

Features

The server provides the following onchain data operations:

Contract Operations

  • Read Contract State (read_contract): Read state from smart contracts on various blockchain networks.
  • Get Proxy (get_proxy): Retrieve proxy implementation contract addresses.
  • Get ABI (get_abi): Fetch the ABI (Application Binary Interface) for a contract.
  • Get Source (get_source): Retrieve the source code for a verified contract.

Event Operations

  • Get Events (get_events): Fetch event logs for a contract based on topics.
  • Build Event Topic (build_event_topic): Generate an event topic signature from event name and argument types.

Transaction Operations

  • Get Transaction History (get_transaction_history): Retrieve transaction history for a user address.
  • Get Transaction Info (get_transaction_info): Get detailed information about a specific transaction.

Tools

  • read_contract
  • get_proxy
  • get_events
  • build_event_topic

Installation

Usage

Environment Setup

Before using the server, set your Bankless API token. For details on how to obtain your Bankless API token, head to https://docs.bankless.com/bankless-api/other-services/onchain-mcp

Running the Server

The server can be run directly from the command line:

Usage with LLM Tools

This server implements the Model Context Protocol (MCP), which allows it to be used as a tool provider for compatible AI models. Here are some example calls for each tool:

read_contract

get_proxy

get_events

build_event_topic

Development

Building from Source

Debug Mode

Integration with AI Models

To integrate this server with AI applications that support MCP, add the following to your app's server configuration:

Error Handling

The server provides specific error types for different scenarios:
  • BanklessValidationError: Invalid input parameters
  • BanklessAuthenticationError: API token issues
  • BanklessResourceNotFoundError: Requested resource not found
  • BanklessRateLimitError: API rate limit exceeded

Prompting Tips

In order to guide an LLM model to use the Bankless Onchain MCP Server, the following prompts can be used:
Note: Code block was split into 2 parts due to size limits.

License

MIT

Bankless Onchain MCP Server

MCP (Model Context Protocol) server for blockchain data interaction through the Bankless API.

Overview

The Bankless Onchain MCP Server provides a framework for interacting with on-chain data via the Bankless API. It implements the Model Context Protocol (MCP) to allow AI models to access blockchain state and event data in a structured way.

Features

The server provides the following onchain data operations:

Contract Operations

  • Read Contract State (read_contract): Read state from smart contracts on various blockchain networks.
  • Get Proxy (get_proxy): Retrieve proxy implementation contract addresses.
  • Get ABI (get_abi): Fetch the ABI (Application Binary Interface) for a contract.
  • Get Source (get_source): Retrieve the source code for a verified contract.

Event Operations

  • Get Events (get_events): Fetch event logs for a contract based on topics.
  • Build Event Topic (build_event_topic): Generate an event topic signature from event name and argument types.

Transaction Operations

  • Get Transaction History (get_transaction_history): Retrieve transaction history for a user address.
  • Get Transaction Info (get_transaction_info): Get detailed information about a specific transaction.

Tools

  • read_contract
  • get_proxy
  • get_events
  • build_event_topic

Installation

Usage

Environment Setup

Before using the server, set your Bankless API token. For details on how to obtain your Bankless API token, head to https://docs.bankless.com/bankless-api/other-services/onchain-mcp

Running the Server

The server can be run directly from the command line:

Usage with LLM Tools

This server implements the Model Context Protocol (MCP), which allows it to be used as a tool provider for compatible AI models. Here are some example calls for each tool:

read_contract

get_proxy

get_events

build_event_topic

Development

Building from Source

Debug Mode

Integration with AI Models

To integrate this server with AI applications that support MCP, add the following to your app's server configuration:

Error Handling

The server provides specific error types for different scenarios:
  • BanklessValidationError: Invalid input parameters
  • BanklessAuthenticationError: API token issues
  • BanklessResourceNotFoundError: Requested resource not found
  • BanklessRateLimitError: API rate limit exceeded

Prompting Tips

In order to guide an LLM model to use the Bankless Onchain MCP Server, the following prompts can be used:
Note: Code block was split into 2 parts due to size limits.

License

MIT