# onchain-mcp

> MCP Server

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

## Overview

- **Category:** Developer Tools
- **Language:** TypeScript
- **Stars:** 80
- **Forks:** 3
- **Owner:** Bankless
- **GitHub:** https://github.com/Bankless/onchain-mcp
- **Created:** 2025-03-10T13:26:32+00:00
- **Updated:** 2025-03-28T17:00:07+00:00
- **Source:** https://model-context-protocol.com/servers/bankless-onchain-api-model-context-protocol

## Setup

## Setup

1.  Install the package: `npm install @bankless/onchain-mcp`
2.  Set the Bankless API token: `export BANKLESS_API_TOKEN=your_api_token_here`
3.  Run the server: `npx @bankless/onchain-mcp`

## Tools

## Available Tools

1.  **Read Contract State** (`read_contract`): Read state from smart contracts on various blockchain networks.
2.  **Get Proxy** (`get_proxy`): Retrieve proxy implementation contract addresses.
3.  **Get ABI** (`get_abi`): Fetch the ABI (Application Binary Interface) for a contract.
4.  **Get Source** (`get_source`): Retrieve the source code for a verified contract.
5.  **Get Events** (`get_events`): Fetch event logs for a contract based on topics.
6.  **Build Event Topic** (`build_event_topic`): Generate an event topic signature from event name and argument types.
7.  **Get Transaction History** (`get_transaction_history`): Retrieve transaction history for a user address.
8.  **Get Transaction Info** (`get_transaction_info`): Get detailed information about a specific transaction.
