A comprehensive blockchain analytics platform built with FastMCP (Model Context Protocol) server that provides four specialized AI agents, created using Pydantic AI for blockchain data analysis. The system integrates seamlessly with Claude Desktop to enable natural language interactions with blockchain data through cross-agent workflows.
Our HUB features real-time blockchain queries, account analysis, transaction monitoring, and advanced analytics, all through natural language interaction.
Apollo consists of four specialized Pydantic AI agents that work together through an MCP server:
- Chain Agent - Real-time blockchain information (latest blocks, network status)
- Account Agent - Address analysis (native & ERC-20 token balances)
- Transaction Agent - Transaction monitoring and fee estimation
- Analytics Agent - Advanced analytics and holder analysis
All agents are connected through cross-agent workflows, allowing complex blockchain analysis through simple natural language queries in Claude Desktop.
blockchain-explorer-hub/
ββ src/
β ββ server.py # FastMCP server (registers tools/agents)
β ββ web3_client.py # Web3 helper functions (web3.py + Alchemy)
β ββ models.py # Pydantic models for inputs/outputs
β ββ agents/
β β ββ chain_agent.py # Chain information agent
β β ββ account_agent.py # Account balance agent
β β ββ tx_agent.py # Transaction status agent
β β ββ analytics_agent.py # Analytics & holder analysis
β ββ db.py # Supabase client helpers
ββ requirements.txt
ββ .env
ββ README.md
- Real-time Blockchain Data: Latest block information, gas prices, network status
- Multi-Token Balance Tracking: Native ETH and ERC-20 token balances for any address
- Transaction Monitoring: Real-time transaction status (pending/confirmed/failed)
- Advanced Analytics: Token holder analysis with rankings and insights
- Cross-Agent Workflows: Agents work together for complex analysis tasks
- Natural Language Interface: Interact with all features through Claude Desktop
- Persistent Storage: Analytics results stored in Supabase database
- Python 3.8+
- Node.js (for Claude Desktop)
- Alchemy API key (or other Web3 provider)
- Supabase account and project
- Claude Desktop application
# Create virtual environment
python -m venv venv
# Activate virtual environment
venv\Scripts\activate
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install all required packages
pip install -r requirements.txt
Create a .env
file in the root directory:
# Web3 Provider (Alchemy recommended)
WEB3_PROVIDER_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY
# Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-key
# MCP Server Configuration (optional)
MCP_HOST=127.0.0.1
MCP_PORT=4000
Create the following tables in your Supabase project:
-- Analytics results table
CREATE TABLE analytics (
id SERIAL PRIMARY KEY,
result JSONB NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Transfer tracking table
CREATE TABLE transfers (
id SERIAL PRIMARY KEY,
from_address TEXT,
to_address TEXT,
amount DECIMAL,
token_address TEXT,
tx_hash TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
- Download Claude Desktop from Claude's official website
- Install the application following the platform-specific instructions
- Create an account and sign in
- Open Claude Desktop
- Go to Settings (gear icon)
- Navigate to the "Developer" section
- Enable "Developer Mode"
- This allows MCP server connections
Navigate to your Apollo project directory and run:
# Install FastMCP integration with Claude Desktop
fastmcp install claude-desktop src/server.py
If the automatic installation doesn't work, manually edit Claude Desktop's configuration:
Edit ~/Library/Application Support/Claude/claude_desktop_config.json
Edit %APPDATA%\Claude\claude_desktop_config.json
Edit ~/.config/claude/claude_desktop_config.json
Add this configuration (replace paths with your actual project location):
{
"mcpServers": {
"Apollo Blockchain Explorer": {
"command": "/Users/username/Desktop/Apollo/venv/bin/python",
"args": [
"-m",
"src.server"
],
"cwd": "/Users/username/Desktop/Apollo",
"env": {
"PYTHONPATH": "/Users/username/Desktop/Apollo"
},
"transport": "stdio"
}
}
}
Important: Replace /Users/username/Desktop/Apollo
with your actual project path.
# Ensure virtual environment is activated
source venv/bin/activate # macOS/Linux
# or
venv\Scripts\activate # Windows
# Start the Apollo MCP server
python -m src.server
You should see output confirming the server is running:
FastMCP server "Blockchain Explorer Hub" running on 127.0.0.1:4000
- Exit Claude Desktop completely if it's already running
- Restart Claude Desktop fresh
- Wait for the MCP connection to establish (check for Apollo tools in the interface)
In Claude Desktop, you should see the Apollo Blockchain Explorer tools available. You can test with queries like:
- "What's the latest block number?"
- "Check the ETH balance for address 0x..."
- "Get the top 10 holders of USDC token"
"What's the current block number and gas usage?"
"Show me the latest block information"
"Check the ETH balance for 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
"Get USDC and USDT balances for vitalik.eth"
"Check the status of transaction 0x..."
"What are the current network fees?"
"Find the top 10 USDC holders from these addresses: [list]"
"Analyze token distribution for contract 0x..."
"Get the latest block, check if address 0x... has any recent transactions, and analyze their token holdings"
-
MCP Server Not Connecting:
- Ensure virtual environment is activated
- Check that all dependencies are installed
- Verify
.env
file configuration - Restart both the server and Claude Desktop
-
Web3 Provider Errors:
- Verify your Alchemy API key is valid
- Check network connectivity
- Ensure the Web3 provider URL is correct
-
Database Connection Issues:
- Verify Supabase URL and API key
- Check that required tables exist
- Test Supabase connection independently
-
Claude Desktop Config:
- Ensure JSON syntax is valid
- Verify all file paths are absolute and correct
- Check that Python virtual environment path is accurate
-
Path Issues:
- Use absolute paths in configuration
- Ensure
PYTHONPATH
includes your project directory - Verify the virtual environment Python executable path
- Slow Responses:
- Check your Web3 provider rate limits
- Consider upgrading your Alchemy plan
- Optimize database queries if needed
- Never commit your
.env
file to version control - Keep your API keys secure and rotate them regularly
- Use read-only database credentials when possible
- Consider implementing rate limiting for production use
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
If you encounter issues:
- Check the troubleshooting section above
- Ensure all prerequisites are met
- Verify your environment configuration
- Check the FastMCP and Claude Desktop documentation (Please try it on Mac or windows, as Linux does not have Claude Desktop Yet).
- Create an issue with detailed error logs
Happy Blockchain Exploring with Apollo! π