Skip to main content
Glama
order-flow-mcp

order-flow-mcp

by zadescoxp

order-flow-mcp

Live crypto order flow for any AI agent. An MCP server that streams trades, order books, open interest, funding and liquidations from 10 exchanges and gives agents the same analytics as the Order Flow Screener terminal: footprint candles, CVD, volume profile, VWAP bands, book imbalance and walls, block prints, absorption and iceberg detection, OI regimes, venue lead/lag and a multi-symbol screener.

Works with Claude Code, Codex, Cursor, Claude Desktop, VS Code, Windsurf, Gemini CLI, or any client that speaks MCP. You don't need API keys or an account, and there's nothing to configure.

Website: zadescoxp.github.io/order-flow-mcp has a setup guide for each agent.

you ▸ What's the order flow on BTC right now?
agent ▸ (calls get_market_snapshot, get_footprint, get_derivatives)
        BTC 59,197, 1.3σ above session VWAP and above value (VAH 59,110). Buyers took
        76% of the last 5m; an iceberg offer at 59,098 absorbed the push before it broke.
        OI flat, funding +0.003%/8h, 10/10 venues live.

Quick start

Node.js 20 or newer is required. Pick your agent and paste one command or config block.

Claude Code

claude mcp add orderflow -- npx -y github:zadescoxp/order-flow-mcp

Codex CLI

codex mcp add orderflow -- npx -y github:zadescoxp/order-flow-mcp

Or add it to ~/.codex/config.toml:

[mcp_servers.orderflow]
command = "npx"
args = ["-y", "github:zadescoxp/order-flow-mcp"]
startup_timeout_sec = 60   # the first run installs the package

Cursor, Claude Desktop, Windsurf, Gemini CLI, Cline and others

Add this to the client's MCP config. The file is ~/.cursor/mcp.json for Cursor and claude_desktop_config.json for Claude Desktop (Settings → Developer → Edit Config). Windsurf uses ~/.codeium/windsurf/mcp_config.json and Gemini CLI uses ~/.gemini/settings.json.

{
  "mcpServers": {
    "orderflow": {
      "command": "npx",
      "args": ["-y", "github:zadescoxp/order-flow-mcp"]
    }
  }
}

VS Code (Copilot agent mode)

.vscode/mcp.json:

{
  "servers": {
    "orderflow": { "type": "stdio", "command": "npx", "args": ["-y", "github:zadescoxp/order-flow-mcp"] }
  }
}

Faster startup: the first npx run downloads the package, which can take 20–40 s. To skip that, install it once with npm install -g github:zadescoxp/order-flow-mcp and use order-flow-mcp as the command (no args).

Remote / shared server (HTTP)

To run one server that several agents or machines share:

npx -y github:zadescoxp/order-flow-mcp --http --port 3333 --host 0.0.0.0 --token "$SECRET"
# or: docker build -t order-flow-mcp . && docker run -d --restart unless-stopped -p 3333:3333 -e ORDERFLOW_HTTP_TOKEN=$SECRET order-flow-mcp

Then connect a client:

claude mcp add --transport http orderflow http://your-host:3333/mcp --header "Authorization: Bearer $SECRET"

GET /health reports the server version and the markets being streamed.

From source

git clone https://github.com/zadescoxp/order-flow-mcp && cd order-flow-mcp
npm install && npm run build
claude mcp add orderflow -- node "$PWD/dist/index.js"

The repo also ships a .mcp.json, so Claude Code picks the server up automatically inside the clone.

Related MCP server: Hyperliquid Liquidations

Check that it works

Ask your agent: "Use orderflow to get a market snapshot for BTC." You can also exercise every tool against the live exchanges with the bundled smoke test, or browse the tools in the MCP Inspector:

npm run smoke            # BTC across all perp venues
node scripts/smoke.mjs ETH bybit
npm run inspect          # MCP Inspector UI

Tools

Tool

What it returns

get_market_snapshot

Start here. Price and spread, session OHLC, VWAP and σ distance, buy/sell volume and delta over 1m/5m/15m, volume z-score, realized volatility, POC/VAH/VAL, book imbalance and depth bands, OI and its regime, funding, basis, liquidations, block prints, absorption/iceberg events, plain-language signals, and the status of each venue

get_footprint

Footprint candles (1m–4h) with bid × ask volume per price row, delta, CVD, POC, VWAP, imbalance flags and stacked imbalances

get_volume_profile

Session volume at price: POC, value area (any %), high-volume nodes, buy/sell per row

get_order_book

Aggregated book with cumulative size, depth within 0.1–2 % of mid, large walls, and the top of book on each venue

get_flow_series

Time bars (1 s–1 h) with OHLC, buy/sell volume, delta, CVD, trade count and volume z-score, plus realized volatility

get_trades

Time & sales, filterable by notional, side and venue

get_big_trades

Block / whale prints at least N× the average print size

get_derivatives

Open interest, funding (native, 8h-normalized and annualized) and basis per venue, OI change over 1/5/15/60m with the price × OI regime (new longs, short covering, new shorts, long unwind)

get_liquidations

Long vs short liquidations, per-minute buckets, the largest liquidation and a cascade flag

get_microstructure_events

Absorption (passive side holds against aggressive flow) and iceberg (hidden size refilling) detections

get_venue_comparison

Each venue's price premium, volume share and delta, and which exchange leads price (in ms)

get_liquidity_heatmap

Resting depth over time within ±1 % of mid, with persistent walls marked pulled, added or held

scan_markets

Screener: rank up to 15 symbols by volume z-score, delta, buy %, VWAP stretch, OI change, liquidations…

watch_markets / unwatch_market / list_active_markets

Add markets to the watchlist, stop one, or see what is streaming and for how long

list_markets

The 120+ supported assets, which venues list each one, and timeframes

There is also an analyze_order_flow prompt (a slash command in clients that support MCP prompts).

Every market tool takes symbol ("BTC", "eth", "SOL-PERP", "DOGEUSDT"…), plus optional venue (default "all", or one of binance, bybit, okx, bitget, hyperliquid, deribit, coinbase, gate, kucoin, kraken, htx) and market_type (perp by default, or spot).

Coverage

Venues

Perpetuals

Binance, Bybit, OKX, Bitget, Hyperliquid, Deribit, Gate, KuCoin, Kraken, HTX

Spot

Binance, Coinbase, OKX, Bybit, Bitget, Gate, KuCoin, Kraken, HTX

Also

Gold and silver (XAU/XAG) perpetuals

How it works

Exchange WebSockets (Siebly SDKs)
  → venue adapters → normalized trades / books / OI / funding / liquidations
  → order-flow engine (footprint, profile, CVD, VWAP, absorption, icebergs, venue lead/lag)
  → per-market in-memory session  →  MCP tools (compact JSON)  →  your agent

The engine is the Order Flow Screener's own code (src/lib), running headless in Node.

Always live

  • The watchlist streams from startup. As soon as your agent connects (which starts the server), BTC, ETH and SOL perpetuals start streaming across every venue, before anyone asks a question. Change the list with --watch or ORDERFLOW_WATCH; none turns it off.

  • Every other market keeps streaming once asked for. The first request for any other market starts its stream, and it then runs for as long as the server does. Exchange sockets reconnect on their own after drops.

  • History builds while the server runs. Statistics cover the time since a market began streaming. Each response includes stream_age_s, and warming_up is true for the first minute. The engine keeps about 8 h of 1-minute footprint candles, 2 h of 1-second flow bars, 2 h of depth snapshots and the last 20,000 prints per market. Older data rolls off, so memory stays bounded (about 250 MB for the default three markets after a few minutes).

  • For 24/7 history, run it as a service. A stdio server lives only as long as the agent app that started it, so closing the app ends the stream. To keep data flowing between sessions, run the HTTP server permanently (for example with Docker and --restart unless-stopped) and point your agents at it.

  • Limits: at most --max-markets (default 20) markets stream at once. When a new one is needed past that, the least recently used market that isn't on the watchlist is closed.

Responses are compact JSON, and tables use columns + rows, so even large footprints stay small in the agent's context.

Configuration

Flag

Env

Default

--http

ORDERFLOW_TRANSPORT=http

stdio

Serve Streamable HTTP at /mcp

--port

PORT

3333

HTTP port

--host

ORDERFLOW_HOST

127.0.0.1

HTTP bind address

--token

ORDERFLOW_HTTP_TOKEN

–

Require Authorization: Bearer <token>

--watch BTC,ETH

ORDERFLOW_WATCH

BTC,ETH,SOL

Markets that stream from startup and are never closed; none for no watchlist

--idle-minutes

ORDERFLOW_IDLE_MINUTES

0 (never)

Close markets outside the watchlist after this much idle time

--max-markets

ORDERFLOW_MAX_MARKETS

20

Upper bound on concurrent markets

HTTPS_PROXY / ORDERFLOW_PROXY

–

Send exchange WebSockets and REST calls through an HTTP(S) proxy

To pass env vars from a client config, add "env": { "ORDERFLOW_WATCH": "BTC,ETH" } next to command.

Notes

  • Some exchanges geo-block certain regions. For example, Binance refuses US IP addresses. A blocked venue shows status: "connecting" or "error" in connections, and the other venues keep working. To skip one, pass a specific venue.

  • Venues quote in USDT, USDC or USD, so an aggregated book can overlap by a few basis points at the touch (cross_venue_crossed: true). The reported mid and spread_bps are medians of each venue's own quote.

  • For the same reason, last is the median of each venue's latest print, so it doesn't jump when a USD-quoted venue like Deribit or Kraken trades. The snapshot also gives the newest raw print as last_print and last_print_venue.

  • This server is for market analysis only. It cannot place orders, and nothing it returns is financial advice.

Development

npm install
npm run dev          # run from source (tsx)
npm test             # offline unit tests (synthetic trades through the real engine)
npm run typecheck
npm run build        # bundles to dist/index.js (committed so `npx github:` needs no build step)
npm run smoke        # live end-to-end test of every tool

Contributing

Contributions are welcome. See CONTRIBUTING.md for setup, project layout and guidelines.

License

Apache-2.0. The order-flow engine and exchange adapters come from order-flow-screener. Market data is sourced through the Siebly exchange SDKs.

Available Tools

17 tools
get_big_tradesBig printsB
Read-only

Block / whale prints: trades at least N× the session's average print size, with buy vs sell totals.

Inputs: symbol (required), limit, venue, min_ratio, +3 more.

get_derivativesOpen interest & fundingA
Read-only

Perpetuals positioning: aggregate and per-venue open interest, funding (native and 8h-normalized, annualized), next funding, mark/index basis, OI change over 1m/5m/15m/60m with the price × OI regime (new longs, short covering, new shorts, long unwind), and per-minute OI history.

Inputs: symbol (required), venue, market_type, wait_seconds, +1 more.

get_flow_seriesFlow bars (CVD, volume z-score)A
Read-only

Time bars of executed flow: OHLC, volume, buy/sell volume, delta, cumulative volume delta (CVD), trade count and rolling volume z-score, plus realized volatility. Built from 1-second bars (2h kept).

Inputs: symbol (required), bars, venue, z_window, +3 more.

get_footprintFootprint candlesB
Read-only

Footprint (bid × ask volume per price row) candles: OHLC, volume, delta, CVD, POC, VWAP, per-row bid/ask volume with imbalance flags, and stacked imbalances. Rows are grouped so each candle has at most max_rows rows.

Inputs: symbol (required), venue, candles, max_rows, +7 more.

get_liquidationsLiquidationsB
Read-only

Forced liquidations on perpetuals: long vs short notional over a window, per-minute buckets, largest liquidation, cascade flag and the latest events.

Inputs: symbol (required), limit, venue, market_type, +2 more.

get_liquidity_heatmapResting liquidity heatmapA
Read-only

Order-book depth over time (sampled every second) within ±1% of mid: average resting size per price row and time column, plus persistent walls and whether they were pulled, added or held.

Inputs: symbol (required), rows, venue, columns, +3 more.

get_market_snapshotMarket snapshotB
Read-only

One-call overview of live order flow for a market: price/spread, session OHLC & VWAP (σ distance), buy/sell volume & delta over 1m/5m/15m, volume z-score, realized vol, POC/VAH/VAL, order-book imbalance and depth bands, open interest & regime, funding, basis, liquidations, big prints, absorption/iceberg events, plain-language signals and venue connection status.

Inputs: symbol (required), venue, market_type, wait_seconds.

get_microstructure_eventsAbsorption & icebergsB
Read-only

Detected absorption (passive side holding against aggressive flow without price moving) and iceberg orders (hidden size refilling at a level).

Inputs: symbol (required), kind, limit, venue, +3 more.

get_order_bookOrder bookB
Read-only

Live aggregated order book: top levels with cumulative size, spread, imbalance, depth within 0.1–2% of mid, large resting walls, and optionally per-venue top of book.

Inputs: symbol (required), depth, venue, per_venue, +3 more.

get_tradesTime & salesA
Read-only

Recent executed trades (tape), newest first, with aggressor side and notional. Filter by minimum notional, side or venue.

Inputs: symbol (required), side, limit, venue, +4 more.

get_venue_comparisonVenue comparisonB
Read-only

Cross-exchange view for an aggregated market: each venue's last price premium vs the median, 60s volume share and delta, and which venue leads price (lag in ms).

Inputs: symbol (required), venue, market_type, wait_seconds.

get_volume_profileSession volume profileB
Read-only

Volume at price for the streamed session: POC, value area high/low, high-volume nodes, and per-row buy/sell volume and delta.

Inputs: symbol (required), rows, venue, market_type, +2 more.

list_active_marketsActive streamsA
Read-only

Markets currently streaming on this server, with age, trade count, pin state and venue connection status.

Inputs: no named parameters.

list_marketsList marketsB
Read-only

Supported crypto assets (plus gold and silver perpetuals), which exchanges list each as perpetual or spot, and timeframes. Filter with query (e.g. 'sol', 'meme').

Inputs: limit, query.

scan_marketsOrder-flow screenerA
Read-only

Screen several markets side by side: price change, 5m delta and buy %, 5m notional, 1m volume z-score, VWAP distance, book imbalance, funding, 5m OI change, 5m liquidations and big prints. Starts streams that are not running yet.

Inputs: venue, sort_by, symbols, market_type, +1 more.

unwatch_marketStop a marketB
Destructive

Stop streaming a market and discard its in-memory history.

Inputs: symbol (required), venue, market_type.

watch_marketsWatch marketsA

Start streaming markets now and keep them running (pinned, never idle-closed) so history accumulates for later analysis. Returns each market's status.

Inputs: symbols (required), venue, market_type.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 17 tools

    Disambiguation4/5

    Most tools target clearly distinct analytical views: tape, footprint, volume profile, order book, derivatives, liquidations, venue comparison, and stream lifecycle are separable. The main overlap is that get_market_snapshot aggregates many of the same metrics available in specialized tools, and scan_markets overlaps somewhat with snapshot but is clearly multi-market.

    Naming Consistency5/5

    Tool names follow a consistent verb_noun convention: list_*, get_*, scan_*, watch_*, unwatch_*, and list_* again. The only minor wrinkle is plural 'watch_markets' versus singular 'unwatch_market', but this does not meaningfully hurt readability or predictability.

    Tool Count4/5

    Seventeen tools is slightly above the ideal compact range, but each maps to a meaningful order-flow concept or stream-lifecycle operation. The set is broad without obvious redundant filler, though a few overview tools could potentially be consolidated.

    Completeness5/5

    The surface covers market discovery, stream lifecycle, single-market overview, order-book depth, tape, block trades, footprint, volume profile, flow series, derivatives, liquidations, microstructure events, venue comparison, and multi-market scanning. For an order-flow analytics server, this is comprehensive with no obvious dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers