Production-ready Model Context Protocol (MCP) server for crypto trading automation with AI decision support.
- 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
- 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
- Python 3.11+
- Linux/macOS/Windows
- API keys for exchanges and AI providers
# 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
# 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 .
cp .env.example .env
# Edit .env with your API keys and settings
# Start the MCP server
mcp-crypto-bot
# Or with custom environment
TELEGRAM_BOT_TOKEN=your_token mcp-crypto-bot
# 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
- 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
resource: wallets
: List current EVM and Solana walletsresource: candles://{venue}/{symbol}/{timeframe}
: Real-time OHLCV data
- 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
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"})
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 | - |
# 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
View the full documentation at docs.cryptomcp.github.io
# 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
# Build for production
npm run build
# Serve built documentation locally
npm run serve
# Deploy to GitHub Pages
npm run deploy
# Documentation will be available at:
# https://cryptomcp.github.io/crypto-ai-mcp-server/
- 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
- 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
pytest tests/
pytest tests/ -m integration
# Start server in test mode
LIVE=0 python src/server.py
# Use MCP inspector
npx @modelcontextprotocol/inspector -- python src/server.py
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
- Define Pydantic model in
mcp_tools.py
- Implement tool function with
@mcp.tool()
decorator - Add error handling and logging
- Update tests
- Add provider to
AIProvider
enum - Implement query method in
AIDecisionEngine
- Add to ensemble logic if desired
- Update configuration
All tools return structured JSON:
{
"success": true|false,
"data": { ... } | null,
"error": "error message" | null
}
- Network errors are automatically retried
- Validation errors return descriptive messages
- Risk violations prevent execution
- All errors are logged with context
- Fork the repository
- Create feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit pull request
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.
- Telegram β t.me/solbotsupport
- Email β info@solanatrade.bot
This project is licensed under the MIT License - see the LICENSE file for details.
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.