anandh007/mcp-server
3.1
If you are the rightful owner of 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 dayong@mcphub.com.
The Model Context Protocol (MCP) server is a specialized server designed to facilitate communication and data exchange between various machine learning models and applications.
🚀 MCP Server – Crypto Market Data Platform
A FastAPI-based crypto pricing, OHLCV data, and WebSocket live updates server.
📌 Overview
MCP Server is a lightweight crypto market data backend built using FastAPI, Redis, and CCXT. It supports:
- 📈 Live ticker data
- 🕯️ OHLCV (candlestick) historical data
- 🔌 WebSocket real-time updates
- ⚡ Redis caching for high performance
- 🧪 Fully tested using pytest (10/10 tests passing)
🔧 Tech Stack
- Python 3.11
- FastAPI
- CCXT (Async Support)
- Redis
- WebSockets
- pytest
📂 Project Structure
mcp-server/
│
├── app/
│ ├── main.py
│ ├── routes.py
│ ├── exchange_client.py
│ ├── broadcaster.py
│ ├── cache.py
│ ├── config.py
│
├── tests/
├── README.md
└── requirements.txt
▶️ Running the Project
1️⃣ Install Dependencies
pip install -r requirements.txt
2️⃣ Start Redis
redis-server
3️⃣ Run FastAPI Server
uvicorn app.main:app --reload
🧪 Running Tests
All tests must pass (10 passed ✔️)
pytest -q
📡 API Endpoints
✅ Health Check
GET /api/health
📈 Get Crypto Ticker
GET /api/ticker?exchange=binance&symbol=BTC/USDT
🕯️ Get OHLCV Candles
GET /api/ohlcv?exchange=binance&symbol=BTC/USDT&timeframe=1h&limit=5
🔌 WebSocket Live Updates
/api/ws
📝 Features
- Real-time market data broadcasting
- Rate-limited exchange calls with retries
- Automatic caching using Redis
- Graceful WebSocket connection handling
- Fully async architecture
- 10 passing unit tests using pytest
- Lightweight & easy to deploy backend