crypto-orderbook-mcp is an MCP (Model Context Protocol) server for analyzing order book depth and buy-sell imbalance on major cryptocurrency exchanges, helping AI agents and trading systems gain real-time market structure insights.
Purpose: This tool is aimed at AI agents and trading systems that need order book data, providing analysis capabilities for order book depth and buy-sell imbalance, and can be used to understand market structure.
Main capabilities:
- Order book metrics: For a specified exchange and trading pair, calculate bid depth, ask depth, and buy-sell imbalance.
- Cross-exchange comparison: Compare order book depth and buy-sell imbalance across multiple exchanges in a unified Markdown table.
- Supported exchanges: Binance, Kraken, Coinbase, Bitfinex, Okx, Bybit.
Usage:
- Environment requirements: Python 3.10 or higher, and uv (Python package and project management tool).
- Clone the repository: git clone https://github.com/kukapay/crypto-orderbook-mcp.git cd crypto-orderbook-mcp
- Install dependencies: Use uv to install the required packages: uv sync
- Configure the MCP client (using Claude Desktop as an example): "mcpServers": { "crypto-orderbook-mcp": { "command": "uv", "args": [ "--directory", "/absolute/path/to/crypto-orderbook-mcp", "run", "main.py" ] } }
- The server provides two main tools:
- calculate_orderbook: Calculate the bid depth, ask depth, and imbalance for a trading pair on a specified exchange.
- compare_orderbook: Compare the bid depth, ask depth, and imbalance across multiple exchanges, returning a Markdown table.
Examples:
- Calculate order book metrics: Prompt: "Calculate the order book metrics for BTC/USDT on Binance with a 1% depth range." Expected output: JSON object.
- Cross-exchange comparison: Prompt: "Compare the order book metrics for BTC/USDT across Binance, Kraken, and OKX with a 1% depth range." Expected output: Markdown table.
Limitations: The project uses the MIT license; see the LICENSE file for details. Other limitation information is not currently provided.