📇 ☁️ - Interact with smart contracts and query transaction and token information via the Bankless Onchain API
Bankless Onchain MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
This project is no longer receiving updates
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.
https://github.com/user-attachments/assets/95732dff-ae5f-45a6-928a-1ae17c0ddf9d
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.
- Parameters: network, contract address, method, inputs, outputs
- Returns: Contract call results with typed values
- **Get Proxy** (get_proxy): Retrieve proxy implementation contract addresses.
- Parameters: network, contract address
- Returns: Implementation contract address
- **Get ABI** (get_abi): Fetch the ABI (Application Binary Interface) for a contract.
- Parameters: network, contract address
- Returns: Contract ABI in JSON format
- **Get Source** (get_source): Retrieve the source code for a verified contract.
- Parameters: network, contract address
- Returns: Source code, ABI, compiler version, and other contract metadata
Event Operations
- **Get Events** (get_events): Fetch event logs for a contract based on topics.
- Parameters: network, addresses, topic, optional topics
- Returns: Filtered event logs
- **Build Event Topic** (build_event_topic): Generate an event topic signature from event name and argument types.
- Parameters: network, event name, argument types
- Returns: Event topic hash
Transaction Operations
- **Get Transaction History** (get_transaction_history): Retrieve transaction history for a user address.
- Parameters: network, user address, optional contract, optional method ID, optional start block, include data flag
- Returns: List of transactions with hash, data, network, and timestamp
- **Get Transaction Info** (get_transaction_info): Get detailed information about a specific transaction.
- Parameters: network, transaction hash
- Returns: Transaction details including block number, timestamp, from/to addresses, value, gas info, status, and receipt data
Tools
- **read_contract**
- Read contract state from a blockchain
- Input:
- network (string, required): The blockchain network (e.g., "ethereum", "polygon")
- contract (string, required): The contract address
- method (string, required): The contract method to call
- inputs (array, required): Input parameters for the method call, each containing:
- type (string): The type of the input parameter (e.g., "address", "uint256")
- value (any): The value of the input parameter
- outputs (array, required): Expected output types, each containing:
- type (string): The expected output type
- Returns an array of contract call results
- **get_proxy**
- Gets the proxy address for a given network and contract
- Input:
- network (string, required): The blockchain network (e.g., "ethereum", "base")
- contract (string, required): The contract address