You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A comprehensive Model Context Protocol (MCP) server that exposes powerful market research tools to AI agents. Built on top of a robust Rust trading API that aggregates data from multiple financial sources including traditional markets, cryptocurrencies, DeFi protocols, Solana ecosystem, and meme tokens.
# Test Rust API
cargo test# Test MCP server integration
python test_mcp.py
# Test with sample research queries
python research_agent_example.py
📝 Environment Variables
Create a .env file:
# API Keys (optional, for enhanced data)
REDDIT_CLIENT_ID=your_reddit_client_id
REDDIT_CLIENT_SECRET=your_reddit_client_secret
ALPHAVANTAGE_API_KEY=your_alphavantage_key
# Server Configuration
SERVER_HOST=localhost
SERVER_PORT=3000
# For research agent example
OPENAI_API_KEY=your_openai_key
ANTHROPIC_API_KEY=your_anthropic_key
🚦 API Endpoints (Rust Server)
The Rust API provides comprehensive endpoints organized by category:
System & Health
GET /health - System health check
GET /metrics - Performance metrics
GET /docs - Interactive API documentation (Swagger UI)
Traditional Markets
GET /trending/stocks - Trending stocks from multiple sources
GET /reddit/stocks - Reddit sentiment analysis
GET /news - Aggregated financial news
GET /yahoo/metrics - Yahoo Finance stock metrics
GET /forex - Forex market data (Finviz)
GET /insider - Insider trading activity
GET /high-open-interest - High open interest options
Cryptocurrency Exchanges
GET /trending/crypto - Trending cryptocurrencies
GET /coingecko/top - Top cryptocurrencies (CoinGecko)
GET /coingecko/trending - Trending crypto symbols
GET /coingecko/gainers - Top crypto gainers
GET /coingecko/losers - Top crypto losers
GET /coingecko/market-context - AI-powered market insights
GET /kraken/ticker - Kraken ticker data
GET /kraken/orderbook/{pair} - Orderbook depth
GET /kraken/ohlc/{pair} - OHLC candlestick data
GET /kraken/trades/{pair} - Recent trades
GET /kraken/assets - Available trading assets
DeFi Protocols
GET /hyperliquid/markets - All Hyperliquid markets
GET /hyperliquid/trending - Trending DeFi assets
GET /hyperliquid/volume/top - Highest volume markets
GET /hyperliquid/movers - Top gainers/losers
GET /hyperliquid/funding - Funding rates
GET /hyperliquid/market/{coin} - Specific market data
GET /hyperliquid/stats/overview - Market overview
Solana Ecosystem
GET /solana/asset/{asset_id} - Asset details
GET /solana/nfts/trending - Trending NFT collections
GET /solana/tokens/trending - Trending tokens
GET /solana/collections/top - Top NFT collections
GET /solana/wallet/{address}/holdings - Wallet analysis
GET /solana/assets/search - Asset search
Meme Tokens (Pump.fun)
GET /pumpfun/trending - Trending meme tokens
GET /pumpfun/token/{mint} - Token details
GET /pumpfun/market-summary - Market overview
GET /pumpfun/search/{query} - Token search
GET /pumpfun/new-tokens - Newly launched tokens
GET /pumpfun/top-gainers - Top gaining tokens
GET /pumpfun/top-losers - Top losing tokens
GET /pumpfun/bonding-curve/{mint} - Bonding curve data
📖 Complete Documentation: Available at http://localhost:3000/docs when running the server.
🔍 OpenAPI Spec: Available at http://localhost:3000/openapi.json
🔍 Data Sources
Traditional Finance
Source
Data Type
Update Frequency
Features
Yahoo Finance
Stock prices, metrics, financial ratios
Real-time/Daily
Comprehensive stock analysis
Finviz
Stocks, forex, futures, insider trading
Real-time
Market screening, insider activity
Reddit
Social sentiment, trending discussions
Real-time
Social sentiment analysis
Alpaca
Options data, high open interest
Real-time
Options market intelligence
Cryptocurrency Exchanges
Source
Data Type
Update Frequency
Features
CoinGecko
Crypto prices, market data, trending
Real-time
Comprehensive crypto analytics
Kraken
Exchange data, orderbooks, trades
Real-time
Professional trading data
DeFi Protocols
Source
Data Type
Update Frequency
Features
Hyperliquid
Perpetual markets, funding rates
Real-time
DeFi derivatives intelligence
Solana Ecosystem
Source
Data Type
Update Frequency
Features
Helius
NFTs, tokens, wallet analysis
Real-time
Comprehensive Solana data
Jito
MEV data, block analysis
Real-time
MEV and validator insights
Direct RPC
On-chain data, program accounts
Real-time
Raw blockchain data
Meme Tokens & Emerging Markets
Source
Data Type
Update Frequency
Features
Pump.fun
Meme tokens, bonding curves
Real-time
Complete meme token ecosystem
Data Quality & Reliability
Redundancy: Multiple sources for critical data points
Validation: Cross-source data validation and consistency checks
Fallback: Graceful degradation when sources are unavailable
Rate Limiting: Intelligent rate limiting to respect API limits
Caching: Smart caching to reduce API calls and improve performance
🛡️ Security & Performance
Performance Optimizations
Intelligent Caching: Multi-layer caching system with TTL-based invalidation
Concurrent Processing: Async/await throughout for maximum throughput
Rate Limiting: Adaptive rate limiting per data source
Request Batching: Batch similar requests to reduce API calls
Response Compression: Gzip compression for API responses
Security Features
Input Validation: Comprehensive validation of all user inputs
Sanitization: Data sanitization to prevent injection attacks
CORS Protection: Configurable CORS policies
Error Handling: Secure error messages without information leakage
API Key Management: Secure handling of external API credentials
Request Logging: Comprehensive request/response logging for audit trails
Reliability & Monitoring
Health Checks: Built-in health monitoring for all components
Circuit Breakers: Automatic circuit breakers for failing services
Graceful Degradation: Continue operating with reduced functionality
Metrics Collection: Performance metrics and analytics
Error Recovery: Automatic retry logic with exponential backoff
Service Discovery: Dynamic service endpoint management
🤝 Contributing
Fork the repository
Create a feature branch (git checkout -b feature/amazing-feature)
Commit your changes (git commit -m 'Add amazing feature')
Push to the branch (git push origin feature/amazing-feature)
Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support & Troubleshooting
Common Issues
"Failed to connect to API"
Ensure Rust API is running: cargo run
Check port 3000 is available: curl http://localhost:3000/health
"Tool not found"
Verify MCP server is running: python mcp_server.py
Check tool names match exactly
"Authentication errors"
Set API keys in .env file
For research agent example, set OPENAI_API_KEY and ANTHROPIC_API_KEY
Getting Help
📖 Check the documentation in this README
🧪 Run the test suite: python test_mcp.py
🔍 Check server logs for detailed error information
📝 Review the example integration: research_agent_example.py
🎯 What You Get
✅ Production-ready MCP server with 40+ specialized market research tools
✅ Comprehensive market coverage across traditional finance, crypto, DeFi, and emerging markets
✅ Multi-source data aggregation from 15+ major financial platforms
✅ Real-time market intelligence with intelligent caching and rate limiting
✅ Solana ecosystem integration including NFTs, tokens, and wallet analysis
✅ DeFi protocol support with Hyperliquid derivatives and funding rates
✅ Meme token analytics via Pump.fun integration with bonding curve analysis
✅ Trading capabilities for both paper and live trading (Kraken, Alpaca)
✅ Easy AI integration with any MCP-compatible system (Claude, LangChain, etc.)
✅ Comprehensive documentation with examples, troubleshooting, and production guides
✅ Automated setup with testing tools and health monitoring
✅ Enterprise-ready with error handling, logging, metrics, and security features
🚀 Transform Your AI Agents Into:
Sophisticated Market Researchers with access to traditional and emerging markets
DeFi Intelligence Analysts tracking derivatives and funding rates
Meme Token Specialists analyzing bonding curves and social sentiment
Cross-Market Arbitrage Detectors identifying opportunities across ecosystems
Portfolio Analysts with wallet tracking and whale watching capabilities
News & Sentiment Analyzers combining social media and traditional news sources
Ready to revolutionize your AI trading and research capabilities? This comprehensive trading API MCP server provides everything you need to build intelligent, data-driven trading agents that understand both traditional and emerging financial markets.