Skip to content

A Python-based MCP (Model Context Protocol) server that provides real-time and historical cryptocurrency market data using CCXT. Built with FastAPI, includes caching, error handling, structured endpoints, and automated test coverage (pytest).

Notifications You must be signed in to change notification settings

1314172004/Python_based-MCP-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto Market MCP Server

A Python-based MCP (Model Context Protocol) server that provides:

✔ Real-time cryptocurrency ticker data

✔ Historical data (via CCXT)

✔ FastAPI REST endpoints

✔ Error handling

✔ Caching layer

✔ Full test coverage using pytest

✔ Ready to deploy on any system

🔧 Tech Stack

Python 3.10+

FastAPI

CCXT (exchange API wrapper)

Uvicorn

propcache (TTL caching)

Pytest

📦 Installation

Clone the repository:

git clone <your_repo_link> cd assignment1

Create virtual environment:

python -m venv .venv

Activate it:

Windows:

.venv\Scripts\activate

Mac/Linux:

source .venv/bin/activate

Install dependencies:

pip install -r requirements.txt

🚀 Running the Server uvicorn app.main:app --reload

Visit:

http://127.0.0.1:8000

You should see:

{"message": "Crypto MCP Server running"}

📡 API Endpoints

  1. Health Check GET /

  2. Live Ticker GET /ticker/{exchange}/{symbol}

Example:

/ticker/binance/BTC-USDT

🧪 Running Tests pytest -q

Expected output:

2 passed

📁 Project Structure assignment1/ │── app/ │ ├── init.py │ ├── main.py │ ├── fetcher.py │ └── cache.py │── tests/ │ └── test_main.py │── requirements.txt │── README.md

✔ Notes & Assumptions

CCXT is used for exchange communication.

Caching implemented using propcache (TTL: 5 seconds).

Server is intentionally simple for internship assignment.

Fully tested and ready to deploy.

👨‍💻 Author

Aswini

About

A Python-based MCP (Model Context Protocol) server that provides real-time and historical cryptocurrency market data using CCXT. Built with FastAPI, includes caching, error handling, structured endpoints, and automated test coverage (pytest).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages