nisargshah96/Investor-GPT
If you are the rightful owner of Investor-GPT and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A FastAPI-based MCP server for fetching OHLCV market data, running trading strategies, and sending Discord alerts.
📈 Market Data MCP Server
A FastAPI-based MCP server for fetching OHLCV market data, running trading strategies, and sending Discord alerts.
Supports REST APIs and MCP tools for AI/LLM integration.
🚀 Features
- 🔑 API key authentication
- 📡 Market data with fallback chain: Yahoo → Alpha Vantage → Google scrape
- 📊 Trading strategies:
- Breakout (1:R risk-reward)
- Wyckoff (prototype/TODO route)
- 🤖 MCP support:
/tools/list+/tools/call - 🔔 Discord alerts for actionable or neutral signals
- ⚙️ AWS Secrets Manager integration for production
📂 Structure
market_data_mcp/ ├── main.py └── app/ ├── routes.py # REST + MCP endpoints ├── auth.py # API key verification ├── config.py # .env / AWS Secrets Manager ├── tools.py # MCP tool handlers ├── providers/ # Yahoo, Alpha Vantage, Google ├── strategies/ # Breakout, Wyckoff └── utils/ # Discord notifier
🔧 Setup
1. Install
pip install -r requirements.txt
2. Config
API_KEY=your-secret ALPHA_VANTAGE_KEY=your-alpha-key DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/xxxx/yyyy AWS_REGION=ap-south-1
3. Run
uvicorn main:app --reload
4. Endpoints
-
GET /health → { "status": "ok" }
-
GET /market-data/{symbol}?interval=5m&lookback=20
-
GET /breakout/{symbol}?interval=5m&lookback=20&rr=3¬ify_when_no_signal=true
-
POST /tools/call
{ "name": "breakout_signal", "arguments": { "symbol": "RELIANCE", "interval": "5m", "lookback": 20, "rr": 3 } }
5. Sample Response
-
Breakout (with signal):
{ "symbol": "RELIANCE", "strategy": "breakout", "result": { "signal": "LONG", "entry": 2540, "stop_loss": 2530, "target": 2570, "rr": 3 } } -
No breakout:
{ "symbol": "RELIANCE", "strategy": "breakout", "result": { "signal": null, "reason": "No breakout yet" } }
⚠️ Notes
- Yahoo Finance → good NSE/BSE coverage (RELIANCE.NS, TCS.NS)
- Alpha Vantage → free but rate-limited
- Google scrape → last resort, single candle
- Data may lag; not financial advice
🛠️ Roadmap
- Add /wyckoff/{symbol} route
- More indicators (RSI, MA crossovers)
- Caching & backtesting
- Web dashboard
📜 License
MIT