cryptomcp/crypto-mcp-server
If you are the rightful owner of crypto-mcp-server 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.
MCP Crypto Bot is a production-ready Model Context Protocol (MCP) server designed for automating crypto trading with AI decision support.
MCP Crypto Bot (Python)
Production-ready Model Context Protocol (MCP) server for crypto trading automation with AI decision support.
๐ Features
Core Functionality
- Multi-Exchange Support: CEX (Binance, etc.), EVM chains, Solana
- AI Decision Engine: OpenAI GPT-4, Google Gemini, DeepSeek integration
- Telegram Bot: Real-time management and notifications
- Risk Management: Configurable limits and safety checks
- Wallet Management: EVM and Solana wallet creation/import/export
- Portfolio Tracking: Real-time balance and position monitoring
Trading Features
- CEX Trading: Spot orders, OHLCV data, balance management
- DEX Integration: 0x swaps on EVM, Jupiter swaps on Solana
- Token Transfers: ERC20 and SPL token transfers
- AI Trading Assistant: Intelligent trade recommendations with risk assessment
- News Trading: Real-time news monitoring, sentiment analysis, and AI-powered trading decisions
๐ Requirements
- Python 3.11+
- Linux/macOS/Windows
- API keys for exchanges and AI providers
๐ ๏ธ Installation
Option 1: One-liner Installation (Recommended)
# Install with pipx (isolated environment)
pipx install mcp-crypto-bot
# Or with uv (fast package manager)
uvx install mcp-crypto-bot
# Run from anywhere
mcp-crypto-bot
Option 2: Manual Installation
# Clone repository
git clone https://github.com/cryptomcp/crypto-ai-mcp-server.git
cd crypto-ai-mcp-server
# Install in development mode
pip install -e .
# Or using uv (recommended)
uv pip install -e .
Environment Configuration
cp .env.example .env
# Edit .env with your API keys and settings
๐ Usage
Quick Start
# Start the MCP server
mcp-crypto-bot
# Or with custom environment
TELEGRAM_BOT_TOKEN=your_token mcp-crypto-bot
MCP Inspector Integration
# Install MCP Inspector
npm install -g @modelcontextprotocol/inspector
# Run with Inspector
npx @modelcontextprotocol/inspector -- mcp-crypto-bot
# With environment injection
npx @modelcontextprotocol/inspector --env-file .env -- mcp-crypto-bot
๐ ๏ธ MCP Tools & Resources
Available Tools
- CEX Trading: Price checks, order placement, balance management
- EVM Operations: Token transfers, DEX swaps, NFT operations
- Solana Support: SPL token transfers, Jupiter swaps, wallet management
- AI Decision Engine: Intelligent trading recommendations
- Portfolio Management: Balance tracking and portfolio snapshots
- News Trading: News monitoring, sentiment analysis, trending analysis, custom conditions
Available Resources
resource: wallets
: List current EVM and Solana walletsresource: candles://{venue}/{symbol}/{timeframe}
: Real-time OHLCV data
News Trading Features
- Real-time News Monitoring: RSS feeds, APIs, web scraping from multiple sources
- Sentiment Analysis: AI-powered sentiment analysis with OpenAI, Gemini, and TextBlob
- Custom Trading Conditions: Rule-based trading with sentiment, frequency, keyword, and trending conditions
- Trending Analysis: Multi-platform trending coin detection and ranking
- AI Decision Making: Intelligent trading decisions based on news and market data
- Risk Management: Position sizing, stop-loss, take-profit, and daily limits
- Trading Modes: Manual, AI-assisted, and fully automated trading
Example Usage
from mcp import ClientSession
async with ClientSession() as session:
# Get wallet information
wallets = await session.read_resource("resource: wallets")
# Get market data
candles = await session.read_resource("resource: candles://binance/BTC/USDT/1h")
# Execute trading operations
result = await session.call_tool("cex_get_price", {"symbol": "BTC/USDT"})
โ๏ธ Configuration
Environment Variables
Variable | Description | Required | Default |
---|---|---|---|
LIVE | Enable live trading (0=test, 1=live) | Yes | 0 |
AM_I_SURE | Safety confirmation for live trading | Yes | NO |
MAX_ORDER_USD | Maximum order size in USD | Yes | 100 |
DAILY_LOSS_LIMIT_USD | Daily loss limit in USD | Yes | 200 |
TELEGRAM_BOT_TOKEN | Telegram bot token | No | - |
OWNER_TELEGRAM_ID | Your Telegram user ID | No | - |
OPENAI_API_KEY | OpenAI API key for AI decisions | No | - |
GOOGLE_API_KEY | Google AI API key | No | - |
DEEPSEEK_API_KEY | DeepSeek API key | No | - |
BINANCE_API_KEY | Binance API key | No | - |
BINANCE_SECRET | Binance secret key | No | - |
ETHEREUM_RPC_URL | Ethereum RPC endpoint | No | - |
SOLANA_RPC_URL | Solana RPC endpoint | No | - |
Safety Configuration
# Test mode (safe)
LIVE=0
AM_I_SURE=NO
MAX_ORDER_USD=100
DAILY_LOSS_LIMIT_USD=200
# Live trading (dangerous - only if you know what you're doing)
LIVE=1
AM_I_SURE=YES
MAX_ORDER_USD=1000
DAILY_LOSS_LIMIT_USD=1000
๐ Documentation
View the full documentation at docs.cryptomcp.github.io
๐โโ๏ธ Running Documentation Locally
# 1. Navigate to docs directory
cd docs
# 2. Install dependencies
npm install
# 3. Start development server
npm run start
# 4. Open browser to http://localhost:3000
๐๏ธ Building Documentation
# Build for production
npm run build
# Serve built documentation locally
npm run serve
๐ Deploying to GitHub Pages
# Deploy to GitHub Pages
npm run deploy
# Documentation will be available at:
# https://cryptomcp.github.io/crypto-ai-mcp-server/
โ ๏ธ Risk Management
Safety Features
- Double Confirmation:
LIVE=1
ANDAM_I_SURE=YES
required - Order Limits:
MAX_ORDER_USD
enforces maximum trade size - Loss Limits:
DAILY_LOSS_LIMIT_USD
prevents excessive losses - Dry Run Mode: Test all operations with
dry_run: true
- Risk Assessment: AI evaluates all trade recommendations
Critical Safety Rules
- Never set
LIVE=1
withoutAM_I_SURE=YES
- Always test with
dry_run: true
first - Monitor daily loss limits
- Backup wallet private keys securely
- Start Small: Begin with small amounts
๐งช Testing
Unit Tests
pytest tests/
Integration Tests
pytest tests/ -m integration
Manual Testing
# Start server in test mode
LIVE=0 python src/server.py
# Use MCP inspector
npx @modelcontextprotocol/inspector -- python src/server.py
๐๏ธ Architecture
src/
โโโ server.py # MCP server bootstrap
โโโ mcp_tools.py # All MCP tool definitions
โโโ config/
โ โโโ env.py # Environment configuration
โโโ cex/
โ โโโ ccxt_client.py # CEX trading client
โโโ evm/
โ โโโ evm_client.py # EVM blockchain client
โโโ solana/
โ โโโ solana_client.py # Solana blockchain client
โโโ wallets/ # Wallet management
โโโ portfolio/ # Portfolio tracking
โโโ ai/ # AI decision engine
โ โโโ engine.py
โ โโโ prompts.py
โโโ telegram/
โ โโโ bot.py # Telegram bot
โโโ logging.py # Logging configuration
๐ง Development
Adding New Tools
- Define Pydantic model in
mcp_tools.py
- Implement tool function with
@mcp.tool()
decorator - Add error handling and logging
- Update tests
Adding New AI Providers
- Add provider to
AIProvider
enum - Implement query method in
AIDecisionEngine
- Add to ensemble logic if desired
- Update configuration
๐ API Reference
Response Format
All tools return structured JSON:
{
"success": true|false,
"data": { ... } | null,
"error": "error message" | null
}
Error Handling
- Network errors are automatically retried
- Validation errors return descriptive messages
- Risk violations prevent execution
- All errors are logged with context
๐ค Contributing
- Fork the repository
- Create feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit pull request
24/7 Live Support
We provide 24/7 live support with guaranteed instant response to all requests.
- All requests are acknowledged within 5 minutes.
- Support is available 7 days a week, 24 hours a day without interruption.
- Resolution time may vary depending on the type of issue, but initial response is always instant.
- We provide multilingual support, but our primary language is English.
Contact Us
- Telegram โ t.me/solbotsupport
- Email โ info@solanatrade.bot
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
โ ๏ธ Disclaimer
This software is for educational and research purposes only. Crypto trading involves substantial risk of loss and is not suitable for every investor. Past performance does not guarantee future results. You should not trade with money you cannot afford to lose.
The authors and contributors of this project are not responsible for any financial losses incurred through the use of this software.