AI-powered blockchain analysis bot using Blockscout MCP. Ask questions, get insights! 🔍⛓️
BlockscoutLens is an AI-powered Telegram bot that makes blockchain data accessible through natural language conversations. Instead of navigating complex blockchain explorers, users simply ask questions and receive intelligent, contextual answers.
Traditional blockchain explorers present raw data (transaction hashes, hex values, gas fees) that requires technical expertise to interpret. Users must navigate multiple pages, understand complex terminology, and manually piece together information.
BlockscoutLens combines OpenAI's GPT-4o model with Blockscout's MCP (Model Context Protocol) server to provide:
The bot uses OpenAI's Responses API with native MCP support to connect to Blockscout's MCP server. This is crucial: we're using the Model Context Protocol (not raw REST APIs) which allows the AI to intelligently discover tools, chain multiple queries, and reason about blockchain data contextually.
Flow:
Why MCP matters: It's designed for AI consumption with structured schemas and clear tool descriptions, enabling better reasoning than raw API calls. Blockscout can track our MCP usage through their analytics, validating proper implementation.
Node.js, OpenAI Responses API (GPT-4o), Blockscout MCP Server, Model Context Protocol, Telegram Bot API
Makes blockchain data accessible to everyone - from newcomers learning about crypto to experienced traders needing quick analysis. Demonstrates practical AI reasoning over blockchain data using standardized protocols (MCP), not just API wrappers.
Core Technologies:
The bot follows a simple three-layer architecture:
Telegram User → Bot (Node.js) → OpenAI Responses API → Blockscout MCP Server → Blockchain Data
Key Implementation Detail: We use OpenAI's native MCP integration through the Responses API, not custom REST wrappers. This is critical because:
// Simple but powerful - OpenAI handles all MCP communication
const resp = await openai.responses.create({
model: "gpt-4o",
tools: [{
type: "mcp",
server_url: "https://mcp.blockscout.com/mcp",
// AI discovers and calls tools automatically
}],
input: userQuestion
});
The magic happens behind the scenes: OpenAI connects to the MCP server, discovers 18+ tools (get_address_info, get_transactions, get_tokens, etc.), and intelligently selects which ones to call based on the user's natural language query.
We crafted a system prompt that makes the AI context-aware:
This prevents the AI from over-explaining simple data points while ensuring complex questions get thorough analysis.
Using Blockscout's official MCP server (mcp.blockscout.com) gave us:
Markdown Fallback: Telegram's Markdown parsing can be strict. We try to send with Markdown formatting first, then gracefully fallback to plain text if it fails:
try {
await bot.sendMessage(chatId, answer, { parse_mode: 'Markdown' });
} catch {
await bot.sendMessage(chatId, answer); // Fallback to plain text
}
Zero Custom Blockchain Code: The entire bot is ~100 lines. No web3 libraries, no RPC calls, no chain-specific logic. Everything is handled through the MCP protocol - we just ask questions and get intelligent answers.
Traditional approach would require:
Our approach:
The result: more time building features, less time wrestling with blockchain infrastructure.

