Back to MCP Catalog

Bankless Onchain MCP Server

Finance & FintechTypeScript
Access and interact with blockchain data through the Bankless API
Available Tools

read_contract

Read contract state from a blockchain network

networkcontractmethodinputsoutputs

get_proxy

Gets the proxy implementation address for a given network and contract

networkcontract

get_events

Fetches event logs for a given network and filter criteria

networkaddressestopicoptionalTopics

build_event_topic

Builds an event topic signature based on event name and arguments

networknamearguments

get_abi

Fetch the ABI (Application Binary Interface) for a contract

networkcontract

get_source

Retrieve the source code for a verified contract

networkcontract

get_transaction_history

Retrieve transaction history for a user address

networkaddresscontractmethodIdstartBlockincludeData

get_transaction_info

Get detailed information about a specific transaction

networkhash

Bankless Onchain provides a powerful interface for AI models to access and interact with blockchain data across multiple networks. Through the Bankless API, it enables reading contract states, retrieving event logs, accessing transaction history, and more - all in a structured format that's easy for AI models to process. This MCP server bridges the gap between AI and blockchain technology, allowing models to query real-time on-chain data without requiring deep blockchain expertise. Whether you need to check token balances, monitor smart contract events, or analyze transaction history, Bankless Onchain provides the tools to access this data efficiently.

Introduction

Bankless Onchain MCP Server provides a framework for AI models to interact with blockchain data through the Bankless API. It implements the Model Context Protocol (MCP) to enable structured access to blockchain state and event data across various networks including Ethereum, Polygon, Base, and others.

Installation

To use the Bankless Onchain MCP Server, you'll need to install the package and obtain a Bankless API token.

  1. Install the package:
npm install @bankless/onchain-mcp
  1. Obtain a Bankless API token by visiting https://docs.bankless.com/bankless-api/other-services/onchain-mcp

  2. Set your API token as an environment variable:

export BANKLESS_API_TOKEN=your_api_token_here

Configuration

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

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

Usage

The Bankless Onchain MCP Server provides several tools for interacting with blockchain data:

Contract Operations

  • Use read_contract to read state from smart contracts
  • Use get_proxy to retrieve proxy implementation contract addresses
  • Use get_abi to fetch the ABI for a contract
  • Use get_source to retrieve the source code for a verified contract

Event Operations

  • Use get_events to fetch event logs for a contract based on topics
  • Use build_event_topic to generate an event topic signature

Transaction Operations

  • Use get_transaction_history to retrieve transaction history for a user address
  • Use get_transaction_info to get detailed information about a specific transaction

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

When working with AI models, you can guide them to use the Bankless Onchain MCP Server effectively by providing context about blockchain operations. For example:

  • For proxy contracts: Suggest checking if a contract is a proxy first using get_proxy
  • For events: Recommend getting the ABI and source of relevant contracts, then constructing the correct topics for events
  • For transactions: Provide guidance on how to retrieve and analyze transaction history

By providing clear instructions, you can help AI models leverage the full capabilities of the Bankless Onchain MCP Server for blockchain data analysis.

Related MCPs

TastyTrade Portfolio Manager
Finance & FintechPython

Manage your TastyTrade brokerage account through Claude

Investor Agent
Finance & FintechPython

Financial analysis and investment insights for LLMs

EVM Blockchain Interaction
Finance & FintechTypeScript

Interact with 30+ EVM-compatible blockchain networks

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.