Token导航 LogoToken导航TokenDH.com
Coin Flow MCP logo
金融服务stdio官方级别未说明来源级核验

Coin Flow MCP

MCP Server

一个基于Python的MCP服务器,用于通过FastAPI、CCXT和轻量级缓存层获取实时和历史加密货币市场数据。

工具数

3

提示词数

0

GitHub Stars

0

资源数

0
加密货币历史数据Python市场数据

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

26nidhi

提供方

26nidhi

最后核验

2026/5/17 20:21

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv .venv

详细介绍

🚀 MCP Crypto Market Data Server

A Python-based MCP (Model Context Protocol) server for retrieving real-time and historical cryptocurrency market data using FastAPI, CCXT, and a lightweight caching layer. Built as part of an internship assignment.


📌 Features

✅ Core Endpoints

EndpointDescription
GET /healthHealth check
GET /realtime?symbol=BTC/USDTReal-time ticker price (via CCXT, mocked in tests)
GET /historical?symbol=BTC/USDT&interval=1h&limit=100Historical OHLCV data

✅ MCP Requirements Implemented

  • Clean modular Python package structure
  • Real-time data retrieval
  • Historical candlestick data
  • Custom error handling
  • In-memory caching (TTL-based)
  • Test suite with full mocking (no external API calls)
  • Reliable, deterministic tests

📁 Project Structure


mcp-crypto-server/
│
├── mcp_server/
│   ├── **init**.py
│   ├── main.py
│   ├── routes.py
│   └── services/
│       ├── **init**.py
│       ├── cache.py
│       ├── exchange_client.py
│       ├── errors.py
│
├── tests/
│   ├── conftest.py
│   ├── test_health.py
│   ├── test_realtime.py
│   ├── test_historical.py
│
├── requirements.txt
└── README.md

⚙️ Installation

1️⃣ Clone the repository

git clone https://github.com/YOUR_USERNAME/mcp-crypto-server.git
cd mcp-crypto-server

2️⃣ Create virtual environment

python -m venv .venv

3️⃣ Activate it

Windows:

.venv\Scripts\activate

Mac/Linux:

source .venv/bin/activate

4️⃣ Install dependencies

pip install -r requirements.txt

▶️ Running the Server

Start the FastAPI server:

uvicorn mcp_server.main:app --reload --port 8000 --reload-exclude ".venv"

Server URL:

http://127.0.0.1:8000

📡 API Endpoints

✔ Health Check

GET /health

Response:

{"status": "ok"}

✔ Real-Time Price

GET /realtime?symbol=BTC/USDT

Example:

{
  "cached": false,
  "data": {
    "symbol": "BTC/USDT",
    "price": 43250.12,
    "timestamp": 123456789,
    "exchange": "binance"
  }
}

✔ Historical OHLCV Data

GET /historical?symbol=BTC/USDT&interval=1h&limit=100

Example:

{
  "cached": false,
  "data": [
    { "timestamp": 123, "open": 1, "high": 2, "low": 1, "close": 1.5, "volume": 100 }
  ]
}

🧪 Running Tests

All external network calls are mocked. Tests run fully offline.

Run tests:

pytest -q

Expected output:

5 passed in X.XXs

🧱 Design Decisions & Assumptions

  • CCXT is used for real market data (Binance by default).
  • All live network calls are mocked in the test suite.
  • In-memory caching is sufficient for this assignment.
  • Custom errors implemented:

* InvalidSymbolError * ExchangeDownError * HistoricalDataError


目录标签

目录标签

加密货币历史数据Python市场数据本地部署实时数据FastAPICCXT

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP