MCP (Model Context Protocol) server that exposes the Bankless on-chain API as a tool-compatible MCP server.
https://github.com/Bankless/onchain-mcpYou're building AI tools that need blockchain data, but you're tired of juggling multiple APIs, handling proxy contracts manually, and writing custom parsers for every network you support. The Bankless Onchain MCP Server eliminates all of that friction by providing a single, AI-friendly interface to comprehensive blockchain data.
Every time you want to give your AI model access to onchain data, you end up:
This server wraps the Bankless onchain API into MCP tools that your AI models can use directly. Instead of you handling the complexity, your AI agent gets clean, structured access to:
Smart Contract Operations:
Event Analysis:
Transaction Intelligence:
DeFi Research Assistant: Your AI can now analyze yield farming strategies by reading vault contracts, tracking deposit/withdrawal events, and calculating historical returns without you writing a single API integration.
// AI can directly call:
read_contract("ethereum", "0x123...", "getReserves", [], [{"type": "uint112"}, {"type": "uint112"}])
get_events("ethereum", ["0x123..."], transfer_topic, [user_address_topic])
Smart Contract Auditing Bot: Give your AI the ability to fetch source code, analyze proxy patterns, and trace transaction flows across complex DeFi protocols automatically.
Portfolio Tracking Agent: Let your AI read token balances, track transaction history, and analyze trading patterns across multiple wallets without managing dozens of different APIs.
Add this to your MCP configuration and you're done:
{
"mcpServers": {
"bankless": {
"command": "npx",
"args": ["@bankless/onchain-mcp"],
"env": {
"BANKLESS_API_TOKEN": "your_token_here"
}
}
}
}
Your AI models immediately gain access to eight powerful blockchain tools without you writing any integration code. The server handles proxy resolution, type conversion, error handling, and network abstraction.
This isn't some generic API wrapper. Bankless has been in the trenches of DeFi analysis for years, and they've built this server to handle the real-world complexity you encounter when working with blockchain data at scale.
The server includes intelligent proxy handling (it tries multiple detection methods), proper event topic generation, and comprehensive error handling for all the edge cases that trip up typical blockchain integrations.
# Get your API token from https://docs.bankless.com/bankless-api/
export BANKLESS_API_TOKEN=your_token
# Run the server
npx @bankless/onchain-mcp
That's it. Your AI models can now read smart contracts, analyze transaction patterns, and track events across Ethereum, Polygon, Base, and other major networks without you managing any of the underlying complexity.
Perfect for developers building AI agents that need blockchain context, DeFi research tools, or any application where you want to give AI models direct access to onchain data without the usual API integration headaches.