kainext-binance-mcp

Let an AI assistant read Binance markets, analyze them, and propose real-money
trades — while a separate, human-gated process is the only thing that can ever execute.
The model never holds a trade key, and nothing moves without a physical click.
The gate. Every order renders exactly what will execute — and the default button is Cancel.
kainext-binance-mcp is a Model Context Protocol server
that connects any MCP client (Claude Code, Claude Desktop, …) to a Binance account.
It exposes 25 tools, 5 analyst prompts and 8 knowledge resources spanning live
market data, technical indicators, news & sentiment, derivatives positioning, market
structure, portfolio/risk analytics, transparent trading signals, and two-phase order
execution with a human in the loop — a complete, honest crypto analysis consultant in
one install. It also ships an offline USD-M futures research engine (no tools, no keys,
no network at import time) — see Futures research.
It is built around one uncompromising idea: treat the language model as untrusted. Even a
fully prompt-injected or malfunctioning model cannot move your funds, because it has neither
the credential nor the authority to do so. See SECURITY.md for the full threat
model.
⚠️ Real money. On mainnet, every order moves actual funds. Always start on
testnet and switch to mainnet only once everything is
verified.
âś… Execution works on every OS (v1.2): native dialog on macOS, a local web
confirmation page elsewhere, or a TTY prompt for headless boxes — see
Confirmation backends.
Why this exists
LLM agents are great at reasoning about markets and terrible at being trusted with
irreversible, money-moving actions. Most "AI trading" tooling hands the model an API key and
hopes for the best. This project takes the opposite stance: the AI gets rich, read-only
context and a way to propose an action, but a human holds the trigger and a
separate process holds the key. You get the upside of an AI co-pilot for your trading
without surrendering custody or control.
Security model — the headline feature
Two processes, least privilege, human-in-the-loop:
| Process | Launched by | Key | Role |
|---|
MCP server kainext-binance-mcp | your MCP client (stdio) | read-only (BINANCE_READ_*) | reads, pre-validates, and proposes orders. Never executes, holds no trade key. |
Confirmer kainext-binance-mcp-confirmer | you, in a separate terminal | trade (BINANCE_TRADE_*) | the sole authority: receives canonical fields, renders the dialog, re-validates, and executes only on your click. |
Releases are published to PyPI via trusted publishing and carry Sigstore digital
attestations (verify any file at pypi.org/integrity/): what you install is provably
what this repository's release workflow built.
sequenceDiagram
participant AI as AI model (untrusted)
participant S as MCP server<br/>(read-only key)
participant C as Confirmer<br/>(trade key)
participant H as You (human)
participant B as Binance
AI->>S: binance_spot_order_propose(...)
S->>S: pre-validate vs symbol filters
S->>C: canonical fields (local IPC socket)
S-->>AI: intent_id (no order placed yet)
C->>H: native dialog with exact fields ⚠️
H-->>C: physical click: Confirm / Cancel
C->>C: re-validate
C->>B: execute (only if confirmed)
AI->>S: binance_spot_order_status(intent_id)
S-->>AI: pending → executed / rejected / expired
To execute one order you need both the trade key (isolated in the confirmer) and your
physical click. The model has neither. Defense in depth on top of that:
- On mainnet, the server aborts at startup if its read key can trade.
- The confirmer aborts at startup if the trade key has withdrawals/transfer/margin/futures
permissions or no IP whitelist.
- Withdrawals and transfers are permanently out of scope — no key enables them.
- Single-tenant: one server+confirmer pair serves exactly one account; run separate pairs
for separate accounts.
Tools (25)
Read (5 · read key · no gate)
| Tool | What it does | Params |
|---|
binance_get_balance | Spot balances (free/locked), non-zero only | — |
binance_get_price | Current price/ticker for a symbol | symbol |
binance_get_open_orders | Open spot orders + status | symbol? |
binance_get_order_history | Closed spot order history | symbol, limit? |
binance_get_account_info | Flags + fees; key permissions (mainnet) | — |
Market data — layer 2 (4 · read key · 100% read-only)
| Tool | What it does | Params |
|---|
binance_get_klines | OHLCV candles (Decimal). last_n returns only the newest N to keep responses small | symbol, interval, limit? (≤1000), last_n? |
binance_get_ticker_24h | Rolling 24h stats (% change, high/low, volume) | symbol |
binance_compute_indicators | RSI / MACD / EMA / Bollinger / ATR. Returns only the latest value per series by default (last_n=1) to keep responses small; raise last_n for recent history | symbol, interval, indicators, limit?, last_n? |
binance_backtest | Lightweight, no-lookahead backtest of a simple rule | symbol, interval, strategy (ema_cross/rsi_threshold), limit? |
News & sentiment — layer 3 (2 · public RSS · no API key · 100% read-only)
| Tool | What it does | Params |
|---|
binance_get_news | Crypto headlines from RSS (CoinDesk, crypto.news) | asset?, sources?, limit? |
binance_get_sentiment | Aggregated raw sentiment (lexicon, not a prediction) | asset, window_hours? |
Signals — layer 4 (3 · read key · propose, never execute)
| Tool | What it does | Params |
|---|
binance_generate_signal | Composite, transparent signal: direction + score + per-factor rationale + ATR risk levels | symbol, interval?, threshold? |
binance_scan_signals | Signals for a watchlist, ranked by score | symbols, interval? |
binance_backtest_signal | Backtest the composite technical signal (no lookahead, sentiment=0) | symbol, interval?, limit?, threshold? |
Analyst — layers 5/6 (7 · read key + free public APIs · 100% read-only)
| Tool | What it does | Params |
|---|
binance_get_derivatives | Funding rate (+ short history), mark/index price, open interest — the leverage thermometer. Public futures endpoints, no extra permissions | symbol, funding_limit? |
binance_get_market_structure | Fear & Greed (+week), BTC dominance, total mcap, BTC ATH/drawdown, on-chain fees & hashrate. Free sources, per-source degradation | — |
binance_analyze_cycle | Mayer Multiple (price/200d MA), drawdown from ATH, distance to next halving — objective cycle inputs | symbol? |
binance_analyze_portfolio | Live balances valued, concentration, per-asset PNL and net break-even (taxes + spread) — cost basis is always a user parameter | cost_basis?, tax_rate?, cashout_spread? |
binance_assess_risk | Realized vol (30/90d), max drawdown, BTC correlation per held asset | symbols? |
binance_backtest_dca | Backtests a mechanical DCA plan on real history — invested, PNL, honest lump-sum comparison, max drawdown | symbol, monthly_quote, months, day_of_month?, fee? |
binance_backtest_harvest | Backtests a pre-committed harvest grid (one fire per level, upward daily-close crossings) vs pure hold | symbol, initial_qty, grid, start? |
Write — two-phase (4 · execution is spot-only · the server never executes)
| Tool | What it does | Params |
|---|
binance_spot_order_propose | Proposes an order; does not execute. Returns intent_id | symbol, side, type, env, quantity?, quote_quantity?, price?, time_in_force? |
binance_spot_order_status | Polls the outcome of a proposal | intent_id |
binance_cancel_order_propose | Proposes a cancellation (re-checks state); does not cancel | symbol, order_id, env |
binance_cancel_order_status | Polls the outcome of a cancellation | intent_id |
The read, market-data, news, and signal tools work without the confirmer. The *_propose
tools require the confirmer to be running.
The knowledge layer — what makes it a consultant
Tools fetch data; knowledge tells the model how to think about it. The server ships
its methodology through the two MCP surfaces most servers ignore:
Resources (kb://…) — read them from any MCP client: