Introduction
CATO is a Model Context Protocol (MCP) server that provides AI agents with comprehensive access to the Cronos blockchain ecosystem. It enables Large Language Models to autonomously interact with Cronos chains, query blockchain data, access documentation, and assist developers with DApp development.
What is MCP?
The Model Context Protocol (MCP) is an open standard that enables seamless integration between AI models and external data sources. CATO implements MCP to provide Claude and other LLMs with:
Tools - Executable functions the AI can call (e.g., check portfolio, find yields)
Resources - Data sources the AI can read (e.g., transaction history)
Prompts - Reusable templates for common tasks
Why CATO?
Multi-Chain Support Query EVM, zkEVM, and POS chains simultaneously
Knowledge Integration 150+ SDK examples, contract templates, and guides
AI-Native Designed for autonomous agent interaction
Developer Tools Error debugging, yield comparison, bridge routing
Features
πͺ Portfolio Management
Unified Portfolio View - Aggregate balances across all Cronos chains
Multi-Format Support - Works with both EVM (0xβ¦) and Bech32 (cro1β¦) addresses
Token Detection - Automatically fetches top ERC-20 tokens
IBC Support - Tracks cross-chain assets on Cronos POS
π° DeFi Analytics
Yield Comparison - Compare APYs across Tectonic, VVS Finance, and Fulcrom
Risk Assessment - Each opportunity rated by security and TVL
Protocol Coverage - Lending, liquidity pools, and perpetuals vaults
Smart Filtering - Filter by minimum APY and risk tolerance
Transaction Debugger - Decode revert reasons from failed transactions
Error Explanations - Human-readable error messages with fixes
Gas Analysis - Detailed gas usage and cost breakdown
Protocol Detection - Automatically identify interacted contracts
π Knowledge Base
SDK Documentation - 150+ code examples in TypeScript, Python, and Rust
Smart Contracts - 15+ production-ready contract templates
Bridge Guides - Step-by-step instructions for cross-chain transfers
x402 Payments - Gasless payment integration examples
Official Guides - Getting started, MetaMask setup, wallet configuration
π Cross-Chain Support
Bridge Routing - Find optimal paths between chains
Fee Estimation - Accurate cost calculations
Multi-Protocol - Supports both Gravity Bridge and IBC
Asset Tracking - Monitor tokens across chains
π Historical Data
Transaction History - Query past transactions via BigQuery
Token Transfers - Track ERC-20 transfer events
Blockchain Analytics - Extract insights from on-chain data
Installation
Prerequisites
Node.js >= 18.0.0
npm or yarn
Claude Desktop (or any MCP-compatible client)
Optional: Google Cloud SDK (for BigQuery historical data)
Step 1: Clone Repository
git clone https://github.com/charlesms1246/CATO.git
cd cato
Step 2: Install Dependencies
Step 3: Build Project
Add CATO to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers" : {
"cato" : {
"command" : "node" ,
"args" : [ "d: \\ Cato \\ build \\ index.js" ],
"env" : {
"CRONOS_EVM_RPC" : "https://evm.cronos.org" ,
"CRONOS_ZKEVM_RPC" : "https://mainnet.zkevm.cronos.org"
}
}
}
}
Step 5: Restart Claude Desktop
Close and reopen Claude Desktop to load the CATO MCP server.
Configuration
Environment Variables
CATO supports the following environment variables:
Variable Default Description CRONOS_EVM_RPChttps://evm.cronos.orgCronos EVM RPC endpoint CRONOS_ZKEVM_RPChttps://mainnet.zkevm.cronos.orgCronos zkEVM RPC endpoint CRONOS_POS_RPChttps://rpc.cronos.org:26657Cronos POS RPC endpoint
BigQuery Setup (Optional)
For historical transaction data, authenticate with Google Cloud:
gcloud auth application-default login
If not configured, historical queries will return a helpful error message.
Custom RPC Endpoints
To use custom RPC endpoints (e.g., for rate limiting):
In claude_desktop_config.json:
{
"mcpServers" : {
"cato" : {
"command" : "node" ,
"args" : [ "d: \\ Cato \\ build \\ index.js" ],
"env" : {
"CRONOS_EVM_RPC" : "https://your-custom-rpc.cronos.org" ,
"CRONOS_ZKEVM_RPC" : "https://your-zkevm-rpc.cronos.org"
}
}
}
}
Example Queries in Claude Desktop
Once configured, you can ask Claude natural language questions that will use CATOβs tools:
"What tokens does 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0 hold on Cronos?"
"Show me the portfolio for cro1wsknttrxv0q4y4jh3hj4ulg0avgraa4s..."
"Which chain has the most CRO for this address: 0x123..."
"What's the best yield for USDC on Cronos?"
"Find me safe yield opportunities above 5% APY"
"Compare staking options for CRO"
"Why did this transaction fail: 0xabc123..."
"Decode the error for transaction 0xdef456... on zkEVM"
"What went wrong with my swap transaction?"
"Show me how to send CRO using TypeScript"
"I need a smart contract template for an ERC-721 NFT"
"How do I bridge tokens from Cronos POS to EVM?"
"Give me examples of x402 payment integration"
"How do I bridge CRO from POS to EVM?"
"What's the fastest way to bridge to Osmosis?"
"Show me IBC bridge instructions"
Architecture
System Overview
βββββββββββββββββββββββββββββββββββββββββββ
β Claude Desktop (MCP Client) β
βββββββββββββββββ¬ββββββββββββββββββββββββββ
β MCP Protocol (stdio)
β
βββββββββββββββββΌββββββββββββββββββββββββββ
β CATO MCP Server (index.ts) β
β ββββββββββββββββββββββββββββββββββββββ β
β β 6 Tools + 1 Resource β β
β ββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββ¬ββββββββββββββββββββββββββ
β
βββββββββββΌβββββββββββ
β β β
βββββββΌβββββ βββΌββββββ ββββΌβββββββ
β Tools β βResourcesβ β Utils β
β(6 files) β β(1 file) β β(3 files)β
βββββββ¬βββββ βββββ¬ββββββ ββββ¬βββββββ
β β β
ββββββββ¬ββββ΄βββββββ¬βββββ
β β
βββββββΌββββββ ββββΌβββββββ
β Adapters β β Lib β
β(3 files) β β(9 files)β
βββββββββββββ βββββββββββ
β
ββββββββΌβββββββ
β β β
βββββΌβββββ β ββββΌβββββββ
βBigQueryβ β βKnowledgeβ
β(Historyβ β β Base β
β Data) β β β(Docs) β
ββββββββββ β βββββββββββ
β
ββββββββΌβββββββ
βviem/ethers β
β(Blockchain) β
βββββββββββββββ
Directory Structure
src/
βββ index.ts # MCP server entry point
β
βββ tools/ # MCP Tool Handlers
β βββ portfolio.ts # Multi-chain portfolio aggregation
β βββ yield.ts # DeFi yield comparison
β βββ debugger.ts # Transaction error decoder
β βββ sdk-lookup.ts # Documentation search
β βββ contract-helper.ts # Contract template retrieval
β βββ bridge-helper.ts # Bridge guide lookup
β
βββ resources/ # MCP Resource Handlers
β βββ history.ts # BigQuery transaction history
β
βββ adapters/ # Blockchain Adapters
β βββ evm.ts # Cronos EVM + zkEVM (viem)
β βββ pos.ts # Cronos POS (Cosmos SDK)
β βββ bigquery.ts # Historical data queries
β
βββ lib/ # Knowledge Bases
β βββ ts-sdk.ts # TypeScript SDK examples
β βββ py-sdk.ts # Python SDK examples
β βββ rs-sdk.ts # Rust SDK examples
β βββ cronos-guides.ts # Official guides
β βββ contract-templates.ts # Smart contract templates
β βββ bridge-guides.ts # Cross-chain bridges
β βββ x402-tech.ts # x402 payment examples
β βββ network-configs.ts # RPC endpoints, chain IDs
β βββ contract-addresses.ts # Protocol contracts
β βββ hardhat-configs.ts # Deployment configs
β
βββ utils/ # Shared Utilities
β βββ config.ts # Configuration constants
β βββ errors.ts # Error signatures & handling
β βββ format.ts # Address conversion, formatting
β
βββ schemas/ # Type Definitions
βββ types.ts # Shared TypeScript interfaces
Key Design Patterns
1. Three-Layer Architecture
// Layer 1: MCP Interface (index.ts)
server . tool ( "get_unified_portfolio" , ... , async ({ address }) => {
const portfolio = await handlePortfolio ({ address });
return { content: [{ type: "text" , text: JSON . stringify ( portfolio ) }] };
});
// Layer 2: Business Logic (tools/portfolio.ts)
export async function handlePortfolio ( args ) {
const evmBalance = await getBalance ( address , 'evm' );
const posBalance = await getPOSBalance ( address );
return aggregateResults ( evmBalance , posBalance );
}
// Layer 3: Infrastructure (adapters/evm.ts)
export async function getBalance ( address , chain ) {
const client = createPublicClient ({ chain , transport: http () });
return await client . getBalance ({ address });
}
2. Adapter Pattern
All blockchain interactions go through adapters, making it easy to:
Swap RPC providers
Add new chains
Mock for testing
Handle rate limiting
3. Knowledge Base Modularity
Each knowledge domain is isolated in lib/:
SDK examples - Language-specific code snippets
Guides - Tutorials and walkthroughs
Templates - Reusable contract code
Configurations - Network and protocol data
This separation enables:
Independent updates to each knowledge base
Easy addition of new documentation
Clear ownership of content
Development
Project Setup
# Install dependencies
npm install
# Start in development mode with auto-rebuild
npm run dev
# Build production bundle
npm run build
# Type checking
npm run typecheck
# Linting
npm run lint
Create handler in tools/
// tools/my-new-tool.ts
export async function handleMyTool ( args : { param : string }) {
// Implementation
return { result: "success" };
}
Register in index.ts
import { handleMyTool } from "./tools/my-new-tool.js" ;
server . tool (
"my_new_tool" ,
"Description of what this tool does" ,
{
param: z . string (). describe ( "Parameter description" )
},
async ({ param }) => {
const result = await handleMyTool ({ param });
return {
content: [{ type: "text" , text: JSON . stringify ( result ) }]
};
}
);
Update documentation
Add entry to API Reference
Update feature list in README
Adding Knowledge Base Content
To add new SDK examples, contract templates, or guides:
// lib/my-knowledge-base.ts
export const MY_EXAMPLES = [
{
title: "Example Title" ,
description: "What this example demonstrates" ,
category: "category-name" ,
code: `// Your code here` ,
notes: [ "Important note" ]
}
];
export function searchMyExamples ( query : string ) {
// Search logic
}
Then import in tools/sdk-lookup.ts to make searchable.
Testing Strategy
# Run all tests
npm test
# Run specific test file
npm test -- portfolio.test.ts
# Watch mode for development
npm test -- --watch
Test coverage targets:
Tools: 80%+ coverage
Adapters: 90%+ coverage
Utils: 95%+ coverage
Testing
Manual Testing with Claude Desktop
Start Claude Desktop
Launch Claude Desktop with CATO configured
Test each tool
Portfolio: "Check portfolio for 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0"
Yield: "Find best yield for USDC"
Debugger: "Debug transaction 0x..."
SDK Docs: "Show me TypeScript examples for sending CRO"
Contracts: "Get ERC-20 token template"
Bridge: "How do I bridge CRO to EVM?"
Verify responses
Check responses are formatted correctly
Review MCP logs in Claude Desktop developer tools
Automated Testing
Create test files in tests/:
// tests/portfolio.test.ts
import { handlePortfolio } from '../src/tools/portfolio' ;
describe ( 'Portfolio Tool' , () => {
it ( 'should aggregate balances across chains' , async () => {
const result = await handlePortfolio ({
address: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0'
});
expect ( result . chains ). toHaveLength ( 3 );
expect ( result . total_value_cro ). toBeDefined ();
});
});
Integration Testing
Test against live Cronos networks:
# Set test address with known balance
export TEST_ADDRESS = "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0"
# Run integration tests
npm run test:integration
Troubleshooting
"Server not responding" in Claude Desktop
Solution: # Verify build
npm run build
# Check paths in config
cat ~/Library/Application \ Support/Claude/claude_desktop_config.json
# Test server manually
node build/index.js
Cause: Slow or rate-limited RPC endpointSolution: {
"env" : {
"CRONOS_EVM_RPC" : "https://faster-rpc-endpoint.cronos.org"
}
}
"BigQuery authentication failed"
Solution: # Authenticate with Google Cloud
gcloud auth application-default login
# Verify credentials
gcloud auth list
"Cannot find module" errors
Solution: # Clean and rebuild
rm -rf build node_modules
npm install
npm run build
Check:
Address format is correct (0xβ¦ or cro1β¦)
Address has transactions on Cronos
RPC endpoints are reachable
# Test RPC manually
curl https://evm.cronos.org \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
Debugging Tips
Enable verbose logging:
Add console.error() statements in tools
Logs appear in Claude Desktop developer console
Test tools independently:
// Create test script: test-tool.ts
import { handlePortfolio } from './build/tools/portfolio.js' ;
handlePortfolio ({ address: '0x...' })
. then ( console . log )
. catch ( console . error );
Check MCP connection:
Open Claude Desktop
Press Cmd/Ctrl + Shift + I (developer tools)
Check Console tab for MCP server logs
Contributing
We welcome contributions! Hereβs how to get involved:
Contribution Guidelines
Fork the repository
Create your own fork of the CATO repository
Create a feature branch
git checkout -b feature/my-feature
Make changes
Write clear commit messages and add tests
Update documentation
Add documentation in docs/ for new features
Submit a pull request
Open a PR with a clear description of changes
Areas for Contribution
New Tools Additional MCP tools for Cronos
Knowledge Base More SDK examples, guides, templates
Chain Support Support for additional Cronos chains
Bug Fixes Improve reliability and error handling
Documentation Tutorials, examples, translations
Testing Increase test coverage
Code Style
TypeScript - Use strict typing
ESLint - Follow configured rules
Prettier - Auto-format code
Comments - Document complex logic
# Format code
npm run format
# Check style
npm run lint
Support
Documentation Official Cronos documentation
Discord Join the community
GitHub Issues Report bugs and request features
Acknowledgments
Built by:
Powered by:
Last Updated: January 23, 2026
Version: 1.0.0
License: MIT