6faf21369d
Consolidate the cross-cutting data tools onto the unified interface and remove their per-exchange duplicates. - /mcp/tools/get_historical: single call, `exchange` now optional. Set → that venue's candles (native symbol); omitted → cross-exchange consensus (canonical symbol, median OHLC + div_pct). Folds in the former /mcp-cross consensus, whose router is deleted. - /mcp/tools/get_indicators: new common tool computing sma/rsi/atr/macd/adx over the single-or-consensus series. Computation centralized in common/indicators.py::compute_indicators (was duplicated per exchange). - Remove get_historical from /mcp-deribit and /mcp-hyperliquid; remove get_technical_indicators (deribit) and get_indicators (hyperliquid), including the now-dead client methods, Req schemas and tool wrappers. The client get_historical METHODS stay (used by the unified dispatch). Tests: rewrite cross tests into test_unified (instruments, historical single + consensus + failures, indicators single + consensus); drop the old CrossClient test; tighten app-boot surface assertions (/mcp owns the data tools; no /mcp-cross, no per-exchange historical/indicators). Docs: API_REFERENCE / README / CLAUDE updated; smoke run_unified.sh now covers consensus + indicators. 324 passed, ruff clean. Verified live against Deribit/Hyperliquid. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1.4 KiB
1.4 KiB
Smoke locale Cerbero_mcp
# da repo root, con il server attivo (docker compose up -d)
PORT=9000 TESTNET_TOKEN="$TESTNET_TOKEN" bash tests/smoke/run.sh
MAINNET_TOKEN="$MAINNET_TOKEN" bash tests/smoke/run_unified.sh
run.sh — endpoint pubblici + un tool per-exchange
Verifica /health, /apidocs, /openapi.json (schema bearer) e, se
TESTNET_TOKEN è settato, che un tool senza bearer dia 401 e con bearer
testnet venga instradato (deribit get_ticker BTC-PERPETUAL).
run_unified.sh — interfaccia comune /mcp (upstream reali)
Verifica end-to-end contro Deribit/Hyperliquid (endpoint pubblici):
get_instruments exchange=deribit→feesehistory_startpopolati liveget_instrumentsfan-out → contribuiscono sia deribit sia hyperliquidget_historicalsingolo (deribit, hyperliquid) → candele non vuoteget_historicalconsenso (senzaexchange) →sources_usedmultipli +div_pctget_indicatorssingolo + consenso → indicatori calcolatiget_historical exchange=bybit→422(rifiutato a livello schema)
Variabili di ambiente:
PORT(default9000) oGATEWAY(URL base, defaulthttp://localhost:PORT)MAINNET_TOKEN/TESTNET_TOKEN— bearer (uno dei due basta; mainnet per dati reali)BOT_TAG(defaultsmoke) — headerX-Bot-Tag
Exit code 0 = tutto OK, 1 = uno o più check falliti, 0 con skip se nessun token.