BrunoPessoa22/chiliz-mcp
If you are the rightful owner of chiliz-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Chiliz MCP is an advanced Model Context Protocol server designed for the Chiliz blockchain ecosystem, offering tools for fan token management, DeFi operations, sports analytics, and social sentiment tracking.
Chiliz MCP
Advanced Model Context Protocol (MCP) server for the Chiliz blockchain ecosystem. Features comprehensive tools for fan token management, DeFi operations, sports analytics, and social sentiment tracking.
Features
Core Blockchain Tools
- Real-time Price Tracking: Live prices for all Chiliz fan tokens
- Wallet Management: Balance checking, transaction history, portfolio analytics
- Transaction Capabilities: Send CHZ, swap tokens, approve spending
- Smart Contract Deployment: Deploy ERC-20 tokens, NFT collections, and custom contracts
- Blockchain Analytics: Network stats, gas prices, block explorer integration
- WebSocket Monitoring: Real-time block updates, pending transactions, contract events
Advanced Analytics
- Smart Money Tracking: Whale movements, unusual patterns detection
- Token Velocity Analysis: Trading volume, liquidity metrics
- Social Sentiment: Twitter/Reddit sentiment analysis for fan tokens
- Sports Correlation: Team performance impact on token prices
Supported Fan Tokens
Support for major Chiliz fan tokens including:
- European clubs: PSG, Barcelona, Juventus, Manchester City, AC Milan, Inter Milan
- Brazilian clubs: Flamengo (MENGO), Corinthians (SCCP), Sรฃo Paulo (SPFC), Palmeiras (VERDAO)
- Esports: OG, Natus Vincere, Team Heretics
- Sports: UFC, PFL
FanX DEX Integration
- Liquidity pool analytics
- Optimal swap routing
- APY calculations
- Impermanent loss tracking
๐ Enterprise Security
- KeyManager: AES-256-GCM encrypted private key storage
- TransactionSigner: Secure transaction signing with confirmation callbacks
- Key Rotation: Support for multiple encrypted keys with ID-based management
- Environment Protection: Secure key handling from environment or encrypted storage
๐ Advanced Error Handling & Resilience
- Automatic Retry: Exponential backoff for transient failures
- Circuit Breaker: Fast-fail pattern for persistent errors
- Custom Error Types: Comprehensive error hierarchy (NetworkError, RPCError, ValidationError, etc.)
- Error Context: Detailed error information with retryable status and metadata
โก Real-time Streaming
- PriceStream: Live price updates with WebSocket auto-reconnection
- Whale Alerts: Configurable threshold for large transaction notifications
- DEX Activity: Real-time swap and liquidity event monitoring
- Event-Driven: EventEmitter-based architecture for flexible subscriptions
๐ 1inch DEX Aggregation
- Multi-DEX Routing: Find best prices across multiple DEXes
- Swap Optimization: Automatic path finding for optimal execution
- Gas Estimation: Pre-execution cost analysis
- Token Approvals: Simplified approval transaction generation
๐ Advanced Analytics Tools
- GasEstimator: Real-time gas price recommendations (slow/standard/fast)
- Transaction Cost Analysis: Comprehensive cost breakdowns with network congestion detection
- PortfolioTracker: Complete portfolio analytics with ROI, diversity scores, and performance metrics
- Portfolio Comparison: Multi-wallet analysis and benchmarking
๐งช Production-Ready Testing
- Jest Framework: Comprehensive unit and integration tests
- 70% Coverage Target: Enforced code coverage thresholds
- ESM Support: Modern JavaScript module testing
- CI Integration: Automated testing on every commit
๐ CI/CD Pipelines
- Automated Testing: Matrix testing across Node 18.x and 20.x
- Build Verification: TypeScript compilation and type checking
- Automated Publishing: npm and GitHub Packages deployment on release
- Release Automation: Changelog generation and GitHub releases
๐ Monitoring & Observability
- Telemetry System: Comprehensive metrics collection (requests, errors, response times)
- Performance Tracking: p95/p99 response time monitoring
- Health Checks: Automated system health status
- Prometheus Export: Standard metrics format for monitoring tools
๐ณ Production Deployment
- Docker Support: Multi-stage optimized builds
- Docker Compose: Full stack with Redis, Prometheus, and Grafana
- Health Checks: Container health monitoring
- Non-root User: Security-hardened container execution
Installation
Quick Start
- Clone the repository
git clone https://github.com/BrunoPessoa22/chiliz-mcp.git
cd chiliz-mcp
- Install dependencies
npm install
- Configure environment
cp .env.example .env
# Edit .env with your configuration
- Build the project
npm run build
- Start the MCP server
npm start
Using with Claude Desktop
- Install the MCP server globally:
npm install -g chiliz-mcp
- Add to Claude Desktop configuration (
~/Library/Application Support/Claude/claude_desktop_config.json
):
{
"mcpServers": {
"chiliz-mcp": {
"command": "node",
"args": ["/path/to/chiliz-mcp/dist/index.js"],
"env": {
"CHILIZ_RPC_URL": "https://rpc.ankr.com/chiliz",
"NETWORK": "mainnet"
}
}
}
}
- Restart Claude Desktop
Configuration
Required Environment Variables
Variable | Description | Example |
---|---|---|
CHILIZ_RPC_URL | Chiliz mainnet RPC endpoint | https://rpc.ankr.com/chiliz |
CHILIZ_WSS_URL | WebSocket endpoint for real-time monitoring | wss://rpc.ankr.com/chiliz/ws |
NETWORK | Network to connect to | mainnet or testnet |
COINGECKO_API_KEY | CoinGecko API key (optional) | Your API key |
Optional Configuration
Variable | Description | Default |
---|---|---|
CACHE_TTL | Cache time-to-live (seconds) | 300 |
RATE_LIMIT_REQUESTS | Max requests per window | 100 |
PRIVATE_KEY | Wallet private key for transactions | None |
Available Tools
Price Tools
get_token_price
- Get current price for any fan tokenget_price_history
- Historical price data with chartsget_market_overview
- Market cap rankings and trends
Wallet Tools
get_wallet_balance
- Check CHZ and token balancesget_transaction_history
- Transaction history for addressesget_portfolio_value
- Total portfolio valuation
Transaction Tools
send_chz
- Send CHZ to another addresssend_fan_token
- Transfer fan tokensswap_tokens
- Swap between fan tokens via DEXapprove_token
- Approve token spending
Smart Contract Deployment Tools
deploy_erc20_token
- Deploy custom ERC-20 tokensdeploy_nft_collection
- Deploy ERC-721 NFT collectionsdeploy_custom_contract
- Deploy arbitrary Solidity contracts
Analytics Tools
track_whale_movements
- Monitor large transactionsanalyze_token_velocity
- Trading volume analysisdetect_unusual_patterns
- Anomaly detectionget_liquidity_metrics
- DEX liquidity analyticsestimate_gas
- Advanced gas estimation with cost analysisget_gas_price_recommendations
- Get slow/standard/fast gas pricesanalyze_transaction_cost
- Comprehensive transaction cost breakdowncalculate_optimal_gas_price
- Calculate optimal gas by urgencytrack_portfolio
- Track portfolio value and analyticsget_portfolio_performance
- ROI and performance metricsget_portfolio_diversity
- Diversity score and recommendationscompare_portfolios
- Compare multiple wallet portfolios
1inch DEX Tools
get_1inch_quote
- Get swap quote from 1inch aggregatorget_1inch_swap
- Get swap transaction dataget_1inch_tokens
- List supported tokensget_1inch_liquidity_sources
- Get available DEX sourcesfind_best_route
- Find optimal swap route across DEXes
Social & Sports Tools
get_social_sentiment
- Twitter/Reddit sentimentget_team_performance
- Sports results correlationanalyze_fan_engagement
- Community metrics
WebSocket Real-time Monitoring
start_block_monitoring
- Monitor new blocks in real-timestart_log_monitoring
- Track contract events/logsstart_pending_tx_monitoring
- Watch pending transactionsmonitor_fan_token_transfers
- Real-time token transfer alertsget_recent_blocks
- Retrieve recent block historyget_recent_logs
- Get recent contract eventsget_recent_pending_transactions
- View pending tx poolget_websocket_status
- Check connection statusstop_all_monitoring
- Stop all real-time subscriptions
Development
Project Structure
chiliz-mcp/
โโโ src/
โ โโโ tools/ # MCP tool implementations
โ โโโ api/ # External API clients
โ โโโ security/ # KeyManager & TransactionSigner
โ โโโ errors/ # Error handling & retry logic
โ โโโ streaming/ # Real-time PriceStream
โ โโโ dex/ # 1inch DEX integration
โ โโโ monitoring/ # Telemetry & metrics
โ โโโ config/ # Configuration & validation
โ โโโ types/ # TypeScript definitions
โ โโโ index.ts # Main MCP server
โโโ tests/
โ โโโ unit/ # Unit tests
โ โโโ integration/ # Integration tests
โโโ .github/workflows/ # CI/CD pipelines
โโโ docs/ # Documentation
โโโ landing-page/ # Documentation website
โโโ Dockerfile # Docker deployment
Running Tests
# Run all tests
npm test
# Run unit tests only
npm run test:unit
# Run integration tests only
npm run test:integration
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage
Building from Source
npm run build
npm run dev # Development mode with watch
Deployment
Deploy Landing Page to Vercel
cd landing-page
npx vercel
Deploy to Production
- Set up production environment variables
- Build for production:
npm run build:prod
- Deploy using your preferred method (Docker, PM2, systemd)
Docker Deployment
Using Docker Compose (Recommended):
# Start all services (MCP + Redis)
docker-compose up -d
# Start with monitoring stack (includes Prometheus + Grafana)
docker-compose --profile monitoring up -d
# View logs
docker-compose logs -f chiliz-mcp
# Stop all services
docker-compose down
Using Docker directly:
# Build image
docker build -t chiliz-mcp .
# Run container
docker run -d --name chiliz-mcp \
-p 9090:9090 \
-e CHILIZ_RPC_URL=https://rpc.ankr.com/chiliz \
-e NETWORK=mainnet \
chiliz-mcp
# Check health
docker ps
docker logs chiliz-mcp
Documentation
Full documentation available at: https://chiliz-mcp.vercel.app
Example Usage
// Get Flamengo token price
const price = await mcp.callTool('get_token_price', {
symbol: 'MENGO'
});
// Check wallet balance
const balance = await mcp.callTool('get_wallet_balance', {
address: '0x...',
tokens: ['MENGO', 'SCCP']
});
// Swap tokens via FanX DEX
const swap = await mcp.callTool('swap_tokens', {
tokenIn: 'CHZ',
tokenOut: 'MENGO',
amount: '100'
});
// Deploy ERC-20 token
const token = await mcp.callTool('deploy_erc20_token', {
name: 'Flamengo Fan Token',
symbol: 'MENGO',
initialSupply: 1000000
});
// Deploy NFT collection
const nft = await mcp.callTool('deploy_nft_collection', {
name: 'Match Highlights',
symbol: 'HIGHLIGHT',
maxSupply: 10000,
baseTokenURI: 'ipfs://QmXxx/'
});
Contributing
We welcome contributions! See for guidelines.
Recently Completed โ
- โ 1inch DEX integration
- โ WebSocket real-time updates
- โ Advanced error handling & retry logic
- โ Security features (KeyManager, TransactionSigner)
- โ Portfolio tracking & analytics
- โ Testing suite with 70% coverage
- โ CI/CD pipelines
- โ Docker deployment
- โ Monitoring & telemetry
Current Priority Areas
- High Priority: Multi-chain support (expand beyond Chiliz)
- High Priority: GraphQL API layer
- Medium Priority: Historical data storage & analytics
- Medium Priority: Advanced NFT marketplace integration
- Low Priority: UI dashboard for monitoring
License
MIT License - see file
Links
Quick Commands
# Install
npm install -g chiliz-mcp
# Check version
chiliz-mcp --version
# Run server
chiliz-mcp start
# Run tests
chiliz-mcp test
# View logs
chiliz-mcp logs
Acknowledgments
Built with love for the Chiliz community. Special thanks to all Brazilian football fans!
Note: This is an independent project and is not officially affiliated with Chiliz. Always verify smart contract addresses and exercise caution when handling private keys.