onchain-mcp

The Bankless Onchain MCP Server enables interaction with blockchain data through the Bankless API, implementing the Model Context Protocol for AI models to access on-chain state and event data in

52
3

Bankless Onchain MCP Server

License: MIT
Version

The Bankless Onchain MCP Server facilitates blockchain data interaction through the Bankless API, implementing the Model Context Protocol (MCP) for AI models to access on-chain data in a structured manner.

Overview

This server provides a framework for interacting with on-chain data via the Bankless API. It enables AI models to access blockchain state and event data in a structured way.

Features

The server offers on-chain data operations, including:

  • Contract Operations: Reading contract state, retrieving proxy implementation addresses, fetching contract ABIs and source code.
  • Event Operations: Fetching event logs based on topics and building event topic signatures.
  • Transaction Operations: Retrieving transaction history for user addresses and detailed information about specific transactions.

Tools

Key tools include read_contract, get_proxy, get_events, and build_event_topic, each with specific input parameters and return values for interacting with blockchain data.

Installation & Usage

Installation is done via npm install @bankless/onchain-mcp. The server requires a Bankless API token, set via environment variable. It can be run from the command line using npx @bankless/onchain-mcp and integrated with LLM tools using MCP.

Development

The project can be built from source by cloning the repository, installing dependencies, and running npm run build. A debug mode is available via npm run debug.

Error Handling & Prompting Tips

The server provides specific error types for different scenarios. The README also includes prompting tips for guiding LLM models to effectively use the server.

Repository

BA
Bankless

Bankless/onchain-mcp

Created

March 10, 2025

Updated

March 28, 2025

Language

TypeScript

Category

Developer Tools