home / mcp / crypto orderbook mcp server

Crypto Orderbook MCP Server

An MCP server that analyzes order book depth and imbalance across major crypto exchanges.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kukapay-crypto-orderbook-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/crypto-orderbook-mcp",
        "run",
        "main.py"
      ]
    }
  }
}

Crypto Orderbook MCP analyzes order book depth and imbalance across major crypto exchanges, providing real-time market structure insights for AI agents and trading systems. It can compute per-exchange metrics and generate cross-exchange comparisons to help you gauge liquidity and pricing pressure across markets.

How to use

You interact with the Crypto Orderbook MCP through a client that can send specific commands to the server. Use the two core capabilities to derive actionable market structure insights: calculate_orderbook for a single exchange and symbol, and compare_orderbook to benchmark multiple exchanges side-by-side. Your prompts should specify the trading pair, the target exchange(s), and the depth range you want to analyze. The system returns structured results you can feed into dashboards, AI agents, or trading workflows.

Typical usage patterns include: calculating bid depth, ask depth, and imbalance for BTC/USDT on Binance, or compiling a cross-exchange table comparing these metrics across Binance, Kraken, and OKX. Use the results to assess liquidity skew, potential execution risk, and relative price pressure across venues.

How to install

Prerequisites you need before installing: Python 3.10 or higher, and uv as the Python package and project manager.

Step-by-step installation and setup:

  • git clone https://github.com/kukapay/crypto-orderbook-mcp.git
  • cd crypto-orderbook-mcp
  • uv sync

Configure your MCP client to run the server. Use the following MCP configuration to start the local server with uv.

"mcpServers": { 
  "crypto_orderbook_mcp": { 
    "command": "uv", 
    "args": [ "--directory", "/absolute/path/to/crypto-orderbook-mcp", "run", "main.py" ]
  } 
}

Notes and configuration

The MCP server exposes its functionality as local stdio through uv. The configuration snippet shown above starts the server by directing uv to run the main.py script from the absolute path where you placed the Crypto Orderbook MCP source. Ensure the directory path you provide matches your environment.

You can customize where the server runs from and how it is invoked by adjusting the --directory and the run argument as needed for your setup. If you later relocate the project, update the path accordingly in your MCP client configuration.

Examples and results

Example: Calculate Order Book Metrics for BTC/USDT on Binance with a 1% depth range.

Example: Compare Order Book Across Exchanges for BTC/USDT across Binance, Kraken, and OKX with a 1% depth range.

Security and troubleshooting

Keep your environment secure by restricting who can access the MCP client and server endpoints. If you encounter issues starting the server, verify that Python 3.10+ is installed, uv is available in your environment, and the directory path in the configuration is correct. Check file permissions and ensure the main.py script is present at the specified location.

Available tools

calculate_orderbook

Computes bid depth, ask depth, and imbalance for a specified trading pair on a chosen exchange.

compare_orderbook

Compiles and returns a Markdown table comparing bid depth, ask depth, and imbalance across multiple exchanges.