Files
Cerbero-mcp/tests/smoke
Adriano 8d7e2ca30f refactor(V2): get_instruments common-only on /mcp (enriched with Deribit filters)
Move get_instruments off the per-exchange Deribit router and onto the
unified interface, without losing the advanced Deribit filtering.

- /mcp/tools/get_instruments now accepts the Deribit-specific filters
  (currency, kind, expiry_from/to, strike_min/max, min_open_interest) and
  pagination (offset/limit). Venues that list everything (Hyperliquid)
  ignore them. Response adds `meta: {deribit: {total, offset, limit,
  has_more}}` surfacing per-source pagination.
- Remove /mcp-deribit/tools/get_instruments (endpoint + tool wrapper +
  GetInstrumentsReq schema). The DeribitClient.get_instruments METHOD
  stays — it's what the unified normalizer calls.

Tests: cover the enriched filters + meta passthrough; app-boot asserts
/mcp-deribit/tools/get_instruments is gone. Docs (API_REFERENCE/README/
CLAUDE) and smoke updated; also fixed the stale Hyperliquid tool count
(14 → 15) found during the doc check.

325 passed, ruff clean. Verified live: kind=option limit=5 → 5/940
has_more=true; /mcp-deribit/tools/get_instruments → 404.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 11:06:09 +00:00
..

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=deribitfees e history_start popolati live
  • get_instruments fan-out → contribuiscono sia deribit sia hyperliquid
  • get_historical singolo (deribit, hyperliquid) → candele non vuote
  • get_historical consenso (senza exchange) → sources_used multipli + div_pct
  • get_indicators singolo + consenso → indicatori calcolati
  • get_historical exchange=bybit422 (rifiutato a livello schema)

Variabili di ambiente:

  • PORT (default 9000) o GATEWAY (URL base, default http://localhost:PORT)
  • MAINNET_TOKEN / TESTNET_TOKEN — bearer (uno dei due basta; mainnet per dati reali)
  • BOT_TAG (default smoke) — header X-Bot-Tag

Exit code 0 = tutto OK, 1 = uno o più check falliti, 0 con skip se nessun token.