Skip to content

Production-ready MCP server for cryptocurrency market intelligence, AI-powered trading, and multi-agent analysis

License

Notifications You must be signed in to change notification settings

Arshad-13/CryptoIntel-MCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Market Intelligence MCP Server

A production-ready Model Context Protocol server for cryptocurrency market intelligence, powered by real-time exchange data, machine learning, and multi-agent orchestration.

Python 3.10+ License: MIT MCP Compatible


πŸš€ Features

30+ MCP Tools Across 11 Categories

  • πŸ“Š Real-Time Exchange Data - Binance, Kraken, Coinbase orderbooks & tickers
  • πŸ”¬ Market Microstructure - OFI, OBI, Microprice, VPIN analytics
  • πŸ€– ML Price Prediction - DeepLOB-Lite model for buy/sell signals
  • 🎯 Trading Strategies - Multi-signal aggregation engine
  • πŸ‘₯ Multi-Agent System - Research, Risk, Execution agents with voting
  • πŸ“‘ WebSocket Streaming - Real-time orderbook/ticker updates
  • πŸ”” Smart Alerts - Price-based notifications with background monitoring
  • πŸ’Ό Portfolio Management - Risk analysis, P&L tracking, paper trading
  • πŸ•΅οΈ Anomaly Detection - Spoofing, layering, market regime classification
  • πŸ“ˆ Interactive Dashboard - Streamlit UI for live market visualization
  • 🌐 Sentiment Analysis - Fear & Greed Index integration

πŸ“‹ Quick Start

Installation

# Clone repository
git clone https://github.com/Arshad-13/CryptoIntel-MCP.git
cd CryptoIntel-MCP

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Claude Desktop Integration

  1. Copy configuration to Claude Desktop:

    cp docs/claude_desktop_config.json %APPDATA%\Claude\claude_desktop_config.json
  2. Update paths in the config file to match your installation

  3. Restart Claude Desktop

  4. Test:

    "Fetch orderbook for BTC/USDT"
    "Run analysis pipeline for ETH/USDT with sentiment 0.7"
    

Launch Dashboard

streamlit run dashboard.py

Open http://localhost:8501


🎯 Use Cases

1. Market Analysis with Claude

You: "What's the current liquidity situation for BTC/USDT?"

Claude: [Fetches orderbook, calculates depth, analyzes spread]
"The BTC/USDT orderbook shows strong liquidity with 
$2.3M in bids within 0.5% of mid-price..."

2. ML-Driven Trading Signals

from tools.strategy_tools import get_trading_signal

signal = await get_trading_signal('ETH/USDT', sentiment_score=0.6)
# Returns: {'signal': 'BUY', 'confidence': 0.82, ...}

3. Multi-Agent Pipeline

You: "Run full analysis on SOL/USDT"

Claude: [Orchestrates Research β†’ Risk β†’ Execution agents]
"Research Agent: ML prediction BUY (78% confidence)
Risk Agent: Position size approved (2x BTC)
Execution Agent: Recommended entry: $142.35"

4. Real-Time Monitoring

  • Dashboard: Live orderbook depth charts, ML predictions, portfolio P&L
  • WebSocket Streams: Subscribe to orderbook/ticker updates
  • Alerts: Get notified when BTC crosses $90,000

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Claude Desktop                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚ JSON-RPC / STDIO
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Market Intelligence MCP Server                 β”‚
β”‚                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Exchange    β”‚  β”‚  Analytics   β”‚  β”‚   Strategy   β”‚ β”‚
β”‚  β”‚   Tools      β”‚  β”‚    Engine    β”‚  β”‚    Engine    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚         β”‚  Direct HTTP     β”‚  ML Models       β”‚  Agentsβ”‚ β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Binance  β”‚  Kraken  β”‚  Coinbase  β”‚  WebSockets  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Technologies:

  • 🐍 Python 3.13 - Async I/O, type hints
  • πŸ”Œ httpx - Direct REST API calls (no CCXT overhead)
  • ⚑ websockets - Real-time streaming
  • 🧠 ONNX Runtime - ML model inference
  • πŸ“Š Streamlit - Interactive dashboard
  • πŸ’Ύ SQLite - Local persistence

See Architecture Documentation for details


πŸ“š Documentation

Document Description
Installation Guide Setup, configuration, troubleshooting
API Reference Complete tool documentation with examples
Architecture System design, data flows, scalability
Dashboard Guide Dashboard features and customization
Changelog Version history and feature timeline

πŸ› οΈ Development

Project Structure

CryptoIntel-MCP/
β”œβ”€β”€ core/           # Business logic (analytics, ML, risk)
β”œβ”€β”€ tools/          # MCP tool implementations
β”œβ”€β”€ agents/         # Multi-agent system
β”œβ”€β”€ tests/          # Test suite (pytest)
β”œβ”€β”€ docs/           # Documentation
β”œβ”€β”€ dashboard.py    # Streamlit UI
└── market_server.py # MCP server entry point

Running Tests

pytest tests/ -v

Coverage: 13 test files, 100+ test cases

Adding New Tools

  1. Create function in tools/your_tool.py
  2. Register in market_server.py:
    @mcp.tool()
    def your_tool(param: str) -> str:
        return your_function(param)
  3. Add tests in tests/test_your_tool.py

πŸ”§ Configuration

Environment Variables (.env)

# Optional: For premium APIs
CRYPTO_API_KEY=your_coingecko_api_key

Exchange Fallback

Automatic failover: Binance β†’ Kraken β†’ Coinbase

Configure in tools/exchange_tools.py:

EXCHANGE_FALLBACK_ORDER = ["binance", "kraken", "coinbase"]

πŸ“Š Example Outputs

Orderbook Data

{
  "symbol": "BTC/USDT",
  "exchange": "binance",
  "bids": [[88360.79, 0.5], [88360.0, 1.2]],
  "asks": [[88361.0, 0.3], [88361.5, 0.8]],
  "fallback_used": false
}

Trading Signal

{
  "signal": "BUY",
  "confidence": 0.85,
  "components": {
    "ml_prediction": "buy",
    "ml_confidence": 0.78,
    "sentiment_score": 0.7,
    "risk_reward_ratio": 3.2
  }
}

Multi-Agent Pipeline

{
  "final_decision": "BUY",
  "confidence": 0.82,
  "agents": {
    "research": {"recommendation": "buy", "confidence": 0.78},
    "risk": {"approved": true, "max_size": 0.05},
    "execution": {"entry_price": 88360.0, "slippage": 0.02}
  }
}

🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Model Context Protocol (MCP) - Anthropic's extensible AI integration framework
  • DeepLOB - Limit order book prediction research
  • Alternative.me - Fear & Greed Index data

πŸ“ž Support


Built with ❀️ for the crypto trading community

Disclaimer: This is an educational project. Not financial advice. Trade at your own risk.

Releases

No releases published

Packages

No packages published

Languages