SuperAPIAI Directory

onchain-mcp

github.com · AI developer platforms

Interact with smart contracts and query transaction and token information via the Bankless Onchain API.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Bankless Onchain MCP Server is an MCP (Model Context Protocol) server for blockchain data interaction, enabling AI models to access onchain state and event data in a structured way through the Bankless API. The server implements the MCP protocol, allowing AI models to access blockchain data as a tool provider.

Its main capabilities fall into three categories:

  1. Contract operations
  • read_contract: Read smart contract state from multiple blockchain networks (such as ethereum, polygon, base). Input parameters include network, contract (contract address), method (the contract method to call), inputs (array of input parameters, each containing type and value), and outputs (array of expected output types). Returns an array of contract call results with typed values.
  • get_proxy: Get the proxy implementation contract address for a given network and contract. Input network and contract, and return the implementation contract address.
  • get_abi: Get the contract's ABI (Application Binary Interface), returning the contract ABI in JSON format. Input network and contract.
  • get_source: Get the source code of a verified contract. Input network and contract, and return the source code, ABI, compiler version, and other contract metadata.
  1. Event operations
  • get_events: Get event logs for a specified network based on filter conditions. Input network, addresses (list of contract addresses to filter events by), topic (primary topic), and optional optionalTopics (which may contain null values). Returns event log objects matching the filter conditions.
  • build_event_topic: Build an event topic signature based on the event name and parameters. Input network, name (event name, such as Transfer(address,address,uint256)), and arguments (array of event parameter types, each containing type). Returns the keccak256 hash string of the event signature.
  1. Transaction operations
  • get_transaction_history: Get a user's address transaction history. Input network, user address, optional contract, optional method ID, optional starting block, and a flag for whether to include data. Returns a transaction list containing hash, data, network, and timestamp.
  • get_transaction_info: Get detailed information about a specific transaction. Input network and transaction hash, and return transaction details, including block number, timestamp, from/to addresses, value, gas information, status, and receipt data.

Usage:

  • Environment setup: Before use, you need to set the Bankless API token. For how to obtain it, seeaddress transaction history. Input network, user address, optional contract, optional method ID, optional starting block, and a flag for whether to include data. Returns a transaction list containing hash, data, network, and timestamp.
  • get_transaction_info: Get detailed information about a specific transaction. Input network and transaction hash, and return transaction details, including block number, timestamp, from/to addresses, value, gas information, status, and receipt data.

Usage:

  • Environment setup: Before use, you need to set the Bankless API token. For how to obtain it, see https://docs.bankless.com/bankless-api/other-services/onchain-mcp
  • Run the server: It can be run directly from the command line.
  • Work with LLM tools: This server implements MCP and can serve as a tool provider compatible with AI models.
  • Build from source: Building from source is supported.
  • Integrate with AI models: Add the corresponding configuration to the AI application server configuration that supports MCP.

Error types:

  • BanklessValidationError: Invalid input parameters
  • BanklessAuthenticationError: API token issue
  • BanklessResourceNotFoundError: Requested resource not found
  • BanklessRateLimitError: API rate limit exceeded

Use cases: Blockchain data interaction scenarios that require AI models to access onchain contract state, event logs, transaction history, and transaction details.

Limitation: This project no longer receives updates.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools