home / mcp / bankless onchain mcp server
Bringing the bankless onchain API to MCP
Configuration
View docs{
"mcpServers": {
"bankless-onchain-mcp": {
"command": "npx",
"args": [
"@bankless/onchain-mcp"
],
"env": {
"BANKLESS_API_TOKEN": "your_api_token_here"
}
}
}
}You deploy the Bankless Onchain MCP Server to access blockchain state, contract data, events, and transactions through the Bankless API. It implements the Model Context Protocol (MCP), enabling AI models and tooling to query on-chain information in a structured, reliable way for analytics, risk assessment, and smarter decision making.
Set up your MCP client to communicate with the Bankless Onchain MCP Server. You will be able to read contract state, fetch ABIs and sources, retrieve event logs, and obtain transaction histories and details. Use the MCP endpoints to drive AI workflows, data ingestion, and contract analysis with clearly defined inputs and outputs.
Prerequisites: ensure you have Node.js and npm installed on your machine.
npm install @bankless/onchain-mcp
```
```
export BANKLESS_API_TOKEN=your_api_token_here
```
```
npx @bankless/onchain-mcpRead contract state from a blockchain network by specifying the network, contract address, method, inputs, and expected outputs to obtain typed results.
Retrieve the current proxy implementation address for a proxy contract on a given network.
Fetch the ABI (Application Binary Interface) for a specified contract on a chosen network.
Retrieve verified source code, ABI, and metadata for a contract on a network.
Fetch event logs for contracts on a network filtered by topics and optional topics to return matching logs.
Generate an event topic signature from an event name and argument types, returning the keccak256 hash.
Retrieve a user’s transaction history on a network with optional filters and an include data flag.
Get detailed information about a specific transaction, including block data and receipts.