BASTION
MCP DEVELOPER DOCS
BASTION BASTION
MCP DEVELOPER DOCS v1.0
// OVERVIEW

CONNECT YOUR CLAUDE AGENT TO
AUTONOMOUS RISK INTELLIGENCE.

BASTION MCP gives any Claude agent access to a fine-tuned 72 billion parameter AI model that analyzes 560+ real-time market signals — liquidations, whale flows, funding rates, order flow, VPVR, market structure — and returns specific trading actions with institutional-grade reasoning.

49
TOOLS
560+
SIGNALS
75.4%
ACCURACY
<3s
LATENCY
// SETUP

INSTALLATION

Run in your terminal — setup wizard handles everything:

BASH
npx bastion-agent

Checks Python, installs dependencies, validates your API key, and auto-configures Claude Code. 90+ tools live in seconds.

VERIFY CONNECTION

After installation, test by asking Claude:

"What's the current BTC price?"

Claude will call bastion_get_price automatically. If it works, you're connected.

SUPPORTED SYMBOLS (30)
BTC ETH SOL AVAX XRP DOGE LINK ADA DOT ATOM UNI AAVE ARB OP SUI APT NEAR FTM INJ TIA SEI JUP WIF PEPE BONK RENDER FET TAO ONDO
// TOOLS REFERENCE

49 TOOLS AVAILABLE

Each tool is called automatically when relevant to the conversation.

CORE bastion_evaluate_risk

Evaluate a crypto futures position using BASTION's AI risk intelligence engine. Sends a position to the fine-tuned 72B model which analyzes 560+ real-time signals and returns a specific action with reasoning.

PARAMETERS
symbolstringreqTrading pair (BTC, ETH, SOL)
directionstringreqLONG or SHORT
entry_pricefloatreqPrice position was opened at
current_pricefloatreqCurrent market price
leveragefloatoptLeverage multiplier (default 1.0)
stop_lossfloatoptStop loss price (0 = no stop)
take_profit_1floatoptFirst take profit target
take_profit_2floatoptSecond take profit target
take_profit_3floatoptThird take profit target
position_size_usdfloatoptPosition size USD (default 1000)
duration_hoursfloatoptHours position has been open
EXAMPLE PROMPT
"Evaluate my BTC long: entered at $95,000, now $97,500, 10x leverage, stop $93k, TP1 $100k"
Returns: action (HOLD / EXIT_FULL / TP_PARTIAL / EXIT_100% / REDUCE_SIZE / TRAIL_STOP), urgency, confidence, reasoning, execution details
bastion_chat

Ask BASTION's neural AI anything about crypto markets. Context-aware — knows current conditions, whale activity, structure.

querystringreqYour question about markets
symbolstringoptSymbol context (default BTC)
"Is ETH a buy right now? What does the order flow look like?"
bastion_get_price

Get the current live price of a cryptocurrency.

symbolstringoptCrypto symbol (default BTC)
"What's the current SOL price?"
bastion_get_market_data

Aggregated market intelligence: price, CVD, open interest, funding rates, volatility.

symbolstringoptCrypto symbol (default BTC)
"Show me ETH market data — order flow, OI, funding, volatility"
bastion_get_liquidations

Liquidation data: recent events, clusters, cascade risk zones.

symbolstringoptCrypto symbol (default BTC)
"Where are the BTC liquidation clusters? Any cascade risk?"
bastion_get_whale_activity

Whale transactions across 11 blockchains. Tracks large transfers (>$1M) with exchange attribution.

min_value_usdintoptMin value (default 1,000,000)
limitintoptResults (default 20, max 50)
"Show me whale transactions over $5M"
bastion_get_funding_rates

Cross-exchange funding rates. Positive = longs paying shorts, negative = shorts paying longs.

No parameters required.

"What are the funding rates across exchanges?"
MCF LABS bastion_generate_report

Generate institutional-grade MCF Labs research report with ratings, conviction scores, target prices, risk factors, trade structures.

report_typestringoptinstitutional_research, market_structure, whale_intelligence, options_flow, cycle_position
symbolstringoptSymbol to analyze (default BTC)
"Generate an institutional research report on SOL"
bastion_get_reports

List existing MCF Labs research reports. Filter by type or symbol.

limitintoptNumber of reports (default 10)
report_typestringoptFilter by type
symbolstringoptFilter by symbol
"Show me the latest whale intelligence reports"
bastion_calculate_position

Optimal position sizing with Monte Carlo simulation. 50,000 sims for TP/SL probability and expected value.

symbolstringreqTrading pair
directionstringreqLONG or SHORT
entry_pricefloatreqPlanned entry price
stop_lossfloatreqStop loss price
take_profitfloatreqTake profit target
leveragefloatoptLeverage (default 1.0)
account_sizefloatoptAccount USD (default 10,000)
risk_percentfloatoptMax risk % (default 2.0)
"Calculate position size: BTC long $95k, stop $93k, TP $100k, 5x leverage, $10k account"
// DERIVATIVES & ORDER FLOW
bastion_get_open_interest

Open interest across exchanges. Rising OI = new money entering, falling OI = positions closing.

symbolstringoptCrypto symbol (default BTC)
bastion_get_oi_changes

OI changes across all major pairs — identify where leveraged money is flowing. No parameters.

bastion_get_cvd

Cumulative Volume Delta — tracks aggressive buying vs selling pressure over time.

symbolstringoptCrypto symbol (default BTC)
bastion_get_orderflow

Detailed order flow — aggressive buyers vs sellers, large orders, and book imbalances.

symbolstringoptCrypto symbol (default BTC)
bastion_get_funding_arb

Funding rate arbitrage — cross-exchange differentials for delta-neutral yield strategies.

symbolstringoptCrypto symbol (default BTC)
bastion_get_heatmap

Liquidation heatmap — shows where clusters are building. These act as price magnets.

symbolstringoptCrypto symbol (default BTC)
bastion_get_taker_ratio

Taker buy/sell ratio. >1 = aggressive buying, <1 = aggressive selling. Real-time sentiment.

symbolstringoptCrypto symbol (default BTC)
bastion_get_top_traders

Top trader positions — how the biggest traders on Binance/Bybit are positioned (long/short ratio).

symbolstringoptCrypto symbol (default BTC)
bastion_get_market_maker_magnet

Market maker gamma magnet levels — price levels where MM exposure creates pinning behavior.

symbolstringoptCrypto symbol (default BTC)
bastion_get_options

Options data — OI, put/call ratio, max pain, notable flow indicating institutional positioning.

symbolstringoptCrypto symbol (default BTC)
// ON-CHAIN & INTELLIGENCE
bastion_get_exchange_flow

Exchange inflow/outflow — large inflows precede selling, outflows suggest accumulation.

symbolstringoptCrypto symbol (default BTC)
bastion_get_onchain

On-chain metrics — active addresses, tx counts, MVRV, NVT, and other fundamental indicators. No parameters.

bastion_get_news

Aggregated crypto news from CoinDesk, Cointelegraph, and other major outlets.

limitintoptNumber of articles (default 20)
// MACRO & SENTIMENT
bastion_get_fear_greed

Crypto Fear & Greed Index — 0 (extreme fear) to 100 (extreme greed). Composite sentiment. No parameters.

bastion_get_macro_signals

Macro market signals — DXY, yields, equity indices, gold, and their crypto correlation. No parameters.

bastion_get_etf_flows

BTC/ETH ETF flow data — daily net inflows/outflows tracking institutional buying and selling. No parameters.

bastion_get_stablecoin_markets

Stablecoin market data — USDT/USDC/DAI supply, flows, and exchange reserves. Inflows precede buying. No parameters.

bastion_get_economic_data

FRED economic data — rates, CPI, unemployment, GDP, and hundreds of macro indicators.

series_idstringoptFRED series (DFF, CPIAUCSL, T10Y2Y, UNRATE)
bastion_get_polymarket

Polymarket prediction markets — regulatory decisions, ETF approvals, price targets.

limitintoptNumber of markets (default 15)
// PORTFOLIO & TRADING
bastion_get_positions

All open positions across connected exchanges with entry, current price, PnL, and leverage. No parameters.

bastion_get_balance

Total portfolio balance with per-exchange breakdown and available margin. No parameters.

bastion_get_exchanges

List all connected exchanges with connection status. No parameters.

AI bastion_evaluate_all_positions

Run AI risk evaluation on ALL open positions simultaneously through the 72B model. No parameters.

AI bastion_scan_signals

Scan for trading signals across all supported pairs using the AI engine. No parameters.

bastion_engine_status

Autonomous trading engine status — running state, armed status, config, and execution stats. No parameters.

bastion_engine_history

Engine execution history — recent actions taken, positions evaluated, and reasoning.

limitintoptHistory entries (default 20)
bastion_get_alerts

Active risk alerts, liquidation warnings, whale alerts, and user price alerts. No parameters.

bastion_get_klines

Candlestick OHLCV data for charting and analysis.

symbolstringoptCrypto symbol (default BTC)
intervalstringopt1m, 5m, 15m, 1h, 4h, 1d (default 1h)
limitintoptNumber of candles (default 100, max 500)
bastion_get_volatility

Volatility metrics + regime detection (low/normal/high/extreme) with ATR data.

symbolstringoptCrypto symbol (default BTC)
bastion_get_session_stats

Current trading session stats — win rate, PnL, trade count, and risk metrics. No parameters.

// ADVANCED TOOLS

CHART GENERATION, DNA, STRESS, & MORE

bastion_chart_candlestickGET

Generate OHLCV candlestick chart as SVG. Server-side rendering — no client dependencies needed.

symbolstringoptCrypto symbol (default BTC)
intervalstringoptTimeframe — 1h, 4h, 1d (default 4h)
limitintoptNumber of candles (default 100)
bastion_chart_vpvrGET

Volume Profile Visible Range heatmap as SVG. Shows price levels with highest trading activity.

bastion_chart_liquidationGET

Liquidation cluster heatmap visualization as SVG. Shows where leveraged positions will get liquidated.

bastion_chart_equityGET

Portfolio equity curve chart as SVG. Plots equity snapshots over time with drawdown overlay.

bastion_position_dnaPOST

Encode position market conditions into a DNA fingerprint. Captures vol regime, funding, OI, fear/greed, and more into a compact feature vector for pattern matching.

symbolstringreqTrading pair (BTC, ETH, SOL)
directionstringreqLONG or SHORT
entry_pricefloatreqEntry price
leveragefloatoptPosition leverage (default 1)
bastion_dna_searchGET

Search stored DNA entries by symbol and direction. Returns matching fingerprints with outcomes.

bastion_dna_similarPOST

Find historically similar positions by feature similarity. Cosine similarity matching against stored DNA fingerprints.

bastion_stress_testPOST

Monte Carlo stress test across disaster scenarios — crash, squeeze, cascade, black swan, rate hike. 5000 simulations per scenario.

symbolstringreqTrading pair
directionstringreqLONG or SHORT
entry_pricefloatreqEntry price
size_usdfloatreqPosition size in USD
leveragefloatoptLeverage (default 1)
scenariosstringoptComma-separated: crash_20, squeeze_15, cascade, black_swan, rate_hike
bastion_scenario_builderPOST

Natural language to scenario parameters. Describe a market event and get structured simulation inputs.

bastion_cascade_simulatorPOST

Step-by-step liquidation cascade simulation. Models how an initial drop triggers cascading liquidations.

bastion_devils_advocatePOST

Data-driven counter-arguments against any trade. Fetches live signals and builds the strongest case against your thesis.

symbolstringreqTrading pair
directionstringreqLONG or SHORT
thesisstringoptYour trading thesis to challenge
entry_pricefloatoptEntry price
leveragefloatoptLeverage (default 1)
bastion_challenge_thesisPOST

Challenge a specific trading thesis with live market signals. Lightweight version of devils_advocate.

bastion_smart_alertPOST

Create alert from natural language. Example: "Alert me when BTC funding flips negative and OI drops 5%".

descriptionstringreqNatural language alert description
symbolstringoptSymbol to monitor
bastion_list_smart_alertsGET

List all active smart alerts with parsed conditions and status.

bastion_check_smart_alertsPOST

Check all alerts against current market conditions. Returns triggered alerts.

bastion_cancel_smart_alertDELETE

Cancel a smart alert by ID.

bastion_list_personasGET

List all 6 strategy personas — Conservative, Moderate, Aggressive, Scalper, Swing, DCA. Each has unique risk limits and rules.

bastion_get_personaGET

Get full persona details — max leverage, position limits, drawdown tolerance, and decision rules.

bastion_persona_evaluatePOST

Evaluate a trade through a persona's decision lens. Returns APPROVED/CAUTION/REJECT with violations and recommendations.

bastion_portfolio_xrayPOST

Full portfolio diagnostic — cross-position correlation matrix (48h hourly Pearson), concentration risk, net directional exposure, volatility sensitivity, cascade risk, portfolio risk grade A-F.

positionsJSON[]req[{symbol, direction, size_usd, leverage, entry_price, stop_loss}]
bastion_risk_budgetPOST

Allocate a max-loss risk budget across positions using volatility-adjusted sizing. Given total USD willing to lose, calculates optimal sizes, leverage limits, and stop distances.

risk_budget_usdfloatreqMax total USD to lose
portfolio_usdfloatoptTotal portfolio value (default 10000)
positionsJSON[]req[{symbol, direction, conviction: low/medium/high}]
bastion_correlation_monitorGET

Detect cross-asset correlation shocks. Compares 24h vs 72h Pearson correlations — delta > 0.3 flags a shock. Identifies decorrelation events and regime shifts.

symbolsstringoptComma-separated symbols (default BTC,ETH,SOL,AVAX,DOGE)
bastion_sentiment_heatmapGET

Composite sentiment scoring. Weighted: fear/greed (20%), funding (25%), OI momentum (30%), volatility (25%). Temperature labels: OVERHEATED, HOT, WARM, COOL, COLD.

symbolsstringoptComma-separated symbols (default BTC,ETH,SOL,AVAX,DOGE,XRP,LINK,ADA)
bastion_trading_planPOST

Generate a structured 24h trading plan from live market conditions. Determines bias, calculates S/R levels, generates entry scenarios with stops/TPs, position sizing, risk rules, and contingency plans.

symbolstringoptTrading pair (default BTC)
timeframestringoptPlan horizon — 4h, 24h, or 7d (default 24h)
risk_tolerancestringoptconservative, moderate, or aggressive (default moderate)
portfolio_usdfloatoptPortfolio size for sizing calculations (default 10000)
bastion_kill_switchPOST — DESTRUCTIVE

Emergency kill switch — close ALL positions across all exchanges, cancel ALL orders, disarm autonomous engine, send notifications. Logs market state for post-mortem review. Irreversible.

reasonstringoptWhy the kill switch was activated (logged for review)
bastion_autopsy_listGET

Scan recent price history for flash crashes, sharp moves, volume anomalies, and wick traps. Returns ranked events with severity, move %, and timestamps for detailed autopsy.

symbolstringoptTrading pair (default BTC)
lookback_hoursintoptHow far back to scan (default 72, max 168)
bastion_market_autopsyPOST

Full forensic autopsy of a market event. Reconstructs timeline, identifies warning signals, calculates who got liquidated, analyzes volume patterns, and determines the optimal play in hindsight.

symbolstringoptTrading pair (default BTC)
event_timestringreqEvent timestamp — ISO or epoch ms (from autopsy_list)
hours_beforeintoptPre-event analysis window (default 6h)
hours_afterintoptPost-event analysis window (default 6h)
bastion_risk_dnaGET

Generate your Risk DNA — behavioral fingerprint from trading history. Personality type (DISCIPLINED, SNIPER, GAMBLER, etc.), leverage profile, symbol preferences, direction bias, pattern detection.

user_idstringoptUser identifier (default _default)
bastion_risk_dna_patternsGET

Deep pattern mining — correlate outcomes against leverage ranges, symbol+direction combos, and setup tags. Finds your proven edges and your money-leaking patterns.

user_idstringoptUser identifier (default _default)
focusstringoptall, leverage, setups, or combos (default all)
// RESOURCES

MCP RESOURCES

bastion://status

System status: model version, GPU health, API latency, services.

{
  "model_version": "v6",
  "model": "BASTION 72B",
  "gpu_cluster": "4x NVIDIA H200 (564GB VRAM)",
  "api_status": "operational"
}
bastion://supported-symbols

Full list of 30 supported cryptocurrency symbols with data coverage notes.

bastion://model-info

Model details: version, accuracy breakdowns, supported actions, data sources.

{
  "version": "v6",
  "model": "BASTION 72B",
  "parameters": "72 billion",
  "accuracy": { "combined": "75.4%", "btc": "71.7%", "eth": "72.7%", "sol": "81.8%" },
  "infrastructure": "4x NVIDIA H200 (564GB VRAM)"
}
// REST API

REST API ENDPOINTS

Direct HTTP access to all BASTION services. Base URL: https://bastionfi.tech

These endpoints power the PULSE dashboard and are available for direct integration. All endpoints return JSON. Authentication required for account-specific operations.

MARKET DATA

MethodEndpointDescription
GET/api/price/{symbol}Live price + 24h change
GET/api/market/{symbol}Aggregated market data (CVD, OI, funding, vol)
GET/api/klines/{symbol}Candlestick / OHLCV data
GET/api/fundingCross-exchange funding rates
GET/api/oi/{symbol}Open interest
GET/api/oi-changesOI changes across exchanges
GET/api/cvd/{symbol}Cumulative Volume Delta
GET/api/volatility/{symbol}Volatility metrics + regime
GET/api/fear-greedFear & Greed Index
GET/api/heatmap/{symbol}Liquidation heatmap data
GET/api/taker-ratio/{symbol}Taker buy/sell ratio
GET/api/mm-magnet/{symbol}Market maker magnet levels
GET/api/orderflow/{symbol}Order flow analysis

INTELLIGENCE & ON-CHAIN

MethodEndpointDescription
GET/api/liquidations/{symbol}Liquidation events + clusters
GET/api/liq-exchange/{symbol}Liquidations by exchange
GET/api/whalesWhale transactions (11 chains)
GET/api/whales/flows/{symbol}Whale flows for symbol
GET/api/top-traders/{symbol}Top trader positions
GET/api/exchange-flow/{symbol}Exchange inflow/outflow
GET/api/onchainOn-chain metrics
GET/api/newsAggregated crypto news
GET/api/macro-signalsMacro market signals
GET/api/etf-flowsBTC/ETH ETF flow data
GET/api/fred-data?series_id=...FRED economic data
GET/api/polymarketPrediction market data

RISK & TRADING

MethodEndpointDescription
POST/api/risk/evaluateAI risk evaluation (72B model)
POST/api/risk/evaluate-allEvaluate all open positions
POST/api/neural/chatNeural chat — ask anything
POST/api/pre-trade-calculatorMonte Carlo position sizing
POST/api/signals/scanScan for trading signals
POST/api/mcf/generate/{type}Generate MCF research report
GET/api/mcf/reportsList research reports
GET/api/mcf/reports/{id}Get specific report
POST/api/kellyKelly Criterion calculator
POST/api/monte-carloMonte Carlo simulation

ACCOUNT & TRADING ENGINE

MethodEndpointDescription
POST/api/exchange/connectConnect exchange API keys
GET/api/exchange/listList connected exchanges
GET/api/positions/allAll open positions
GET/api/balance/totalTotal portfolio balance
POST/api/engine/startStart autonomous trading engine
POST/api/engine/stopStop trading engine
GET/api/engine/statusEngine status + armed state
POST/api/engine/armArm engine for execution
POST/api/engine/kill-switchEmergency kill switch
POST/api/actions/emergency-exitEmergency exit position
POST/api/actions/partial-closePartial close position
GET/api/settingsGet all user settings
GET/api/alertsGet alerts + notifications

Full API reference: bastionfi.tech/api/swagger — interactive Swagger UI with all 140+ endpoints.

// SYSTEM

ARCHITECTURE

Claude Agent
    |
    | SSE (Authorization: Bearer key)
    v
BASTION MCP Server ── bastionfi.tech/mcp
    |
    v
BASTION API Gateway ── 560+ real-time endpoints
    |
    |── Derivatives Analytics ... OI, funding, liquidations, CVD
    |── On-Chain Intelligence ... whale tracking (11 blockchains)
    |── Market Structure ........ VPVR, pivots, auto-support
    |── Live Price Feeds ........ multi-exchange aggregation
    |
    v
BASTION 72B Model ── 4x NVIDIA H200 (564GB VRAM)
    |
    v
Structured Response ──> back to Claude

API KEYS

An API key authenticates your Claude agent with BASTION MCP. Keys are passed via the Authorization header.

STEPS
01Create account at bastionfi.tech
02Account API Keys
03Generate MCP API key
04Add to Claude client config
Authorization: Bearer bst_live_xxxxxxxxxxxxxxxxxxxx

RATE LIMITS

TierLimitWindow
Standard100 requestsper minute
Master KeyUnlimited-

Rate limit headers included in every response. Exceeding returns 429.