BASTION

Risk Intelligence MCP Server for crypto agents — 52 tools, 72B AI model, 560+ signals, derivatives, on-chain, autonomous trading

BASTION

Risk Intelligence MCP Server for Crypto Agents

75.4% Win Rate  |  147 Tools  |  560+ Signals  |  72B Parameter AI  |  5 Exchanges

MCP Claude v1.0.0 License Stars

Quick Start  ·  Features  ·  Architecture  ·  Examples  ·  Docs

Platform  •  Agents Hub  •  Developers  •  Get API Key

[!IMPORTANT] Zero install required. BASTION is a cloud-hosted MCP server. Connect with one command and your Claude agent instantly gets 147 real-time crypto tools. No dependencies, no Docker, no API wrappers.

What is BASTION?

BASTION is a Model Context Protocol (MCP) server that turns any Claude agent into a professional crypto trading desk. Through a single MCP connection (Streamable HTTP or SSE), your agent gains 147 specialized tools for market data, derivatives analytics, on-chain intelligence, AI risk evaluation, portfolio management, and autonomous trade execution.

The core engine is a fine-tuned 72B parameter model running on a 4x RTX 5090 GPU cluster, analyzing 560+ real-time signals per evaluation. It doesn't just return data — it returns structured risk assessments with reasoning chains, confidence scores, and explicit action recommendations.

You:    "Check my BTC long, I'm worried about the funding spike"

Claude: [Calls bastion_evaluate_risk, bastion_get_funding_rates, bastion_get_liquidations]

        Your BTC LONG is at moderate risk (52/100). Here's why:

        Funding at 0.035% is elevated but not extreme. However, there's a
        $2.1B liquidation cluster at $94,200 — just 3.8% below current price.
        OI rose 4.2% without corresponding volume, suggesting overleveraged
        longs. CVD is diverging bearish on the 1h.

        Recommendation: TP_PARTIAL — Take 50% profit here. Move stop to
        breakeven on the remainder.

[!TIP] All market data, derivatives, on-chain, macro, and AI tools work without an API key. You only need a key for portfolio access and trade execution.


Quick Start

Claude Code — One Command

# Streamable HTTP (recommended)
claude mcp add bastion-mcp --transport http https://bastionfi.tech/mcp/stream

# Or legacy SSE
claude mcp add bastion-mcp --transport sse https://bastionfi.tech/mcp/sse

That's it. Restart Claude Code. All 147 tools are live.

Claude Desktop — One Config

Add to claude_desktop_config.json (macOS ~/Library/Application Support/Claude/ · Windows %APPDATA%\Claude\):

{
  "mcpServers": {
    "bastion": {
      "type": "streamable-http",
      "url": "https://bastionfi.tech/mcp/stream"
    }
  }
}
{
  "mcpServers": {
    "bastion": {
      "type": "sse",
      "url": "https://bastionfi.tech/mcp/sse"
    }
  }
}

Python MCP Client

from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

# Streamable HTTP (recommended)
async with streamablehttp_client("https://bastionfi.tech/mcp/stream") as (read, write, _):
    async with ClientSession(read, write) as session:
        await session.initialize()

        result = await session.call_tool("bastion_evaluate_risk", {
            "symbol": "BTC",
            "direction": "LONG",
            "entry_price": 96200.0,
            "current_price": 98400.0,
            "leverage": 5,
            "stop_loss": 94000.0
        })
from mcp import ClientSession
from mcp.client.sse import sse_client

async with sse_client("https://bastionfi.tech/mcp/sse") as (read, write):
    async with ClientSession(read, write) as session:
        await session.initialize()
        result = await session.call_tool("bastion_evaluate_risk", {...})

Authenticated Access

For portfolio, trading, and engine tools — pass your key in the URL:

https://bastionfi.tech/mcp/stream?api_key=bst_your_key_here

Get a key at bastionfi.tech/account  |  Full walkthrough in quickstart.md  |  Detailed guides in guides/


Features

Key Capabilities

CapabilityDescription
Risk Intelligence560+ signal evaluation with reasoning chains and action recommendations
Derivatives AnalyticsOI, CVD, funding, liquidation heatmaps, options flow, gamma exposure
On-Chain IntelligenceWhale tracking, exchange flow, accumulation detection
Macro & SentimentDXY, ETF flows, Fear/Greed, Polymarket, FRED economic data
Market DataReal-time price, OHLCV klines, volatility metrics
Portfolio ManagementMulti-exchange positions, balances, alerts, session stats
Trade ExecutionEmergency exits, partial closes, TP/SL, breakeven moves
Autonomous EngineSelf-monitoring risk engine with armed/disarmed modes
Research ReportsAI-generated deep analysis reports with position sizing

147 Tools Across 35 Categories

ToolDescription
bastion_evaluate_riskFull risk evaluation with 560+ signals, reasoning chain, and action recommendation
bastion_chatNatural language conversation with the fine-tuned 72B risk model
bastion_evaluate_all_positionsBatch risk evaluation of every open position
bastion_scan_signalsProactive signal scanner — finds trade opportunities ranked by conviction
ToolDescription
bastion_get_priceReal-time price, 24h change, volume
bastion_get_market_dataMarket cap, circulating supply, dominance, ATH tracking
bastion_get_klinesOHLCV candlestick data — any timeframe from 1m to 1M
bastion_get_volatilityRealized volatility, ATR, Bollinger bandwidth, IV percentile
ToolDescription
bastion_get_open_interestAggregate open interest across all exchanges
bastion_get_oi_changesOI delta over time windows (confirms or denies price moves)
bastion_get_cvdCumulative Volume Delta — buyer vs seller aggression
bastion_get_orderflowOrder flow imbalance and absorption analysis
bastion_get_funding_ratesPerpetual funding rates across 5 exchanges
bastion_get_funding_arbCross-exchange funding rate arbitrage opportunities
bastion_get_liquidationsReal-time and aggregate liquidation data
bastion_get_heatmapLiquidation heatmap — see where cascading liquidations cluster
bastion_get_taker_ratioTaker buy/sell ratio (real-time directional aggression)
bastion_get_top_tradersTop trader long/short positioning ratios
bastion_get_market_maker_magnetMarket maker gamma exposure and magnet price levels
bastion_get_optionsOptions flow, max pain, put/call ratio, IV skew
ToolDescription
bastion_get_whale_activityLarge wallet movements, accumulation/distribution patterns
bastion_get_exchange_flowExchange inflow/outflow trends (deposit vs withdrawal)
bastion_get_onchainActive addresses, NVT ratio, SOPR, network metrics
bastion_get_newsAI-curated crypto news feed with sentiment scoring
ToolDescription
bastion_get_fear_greedCrypto Fear & Greed Index with historical context
bastion_get_macro_signalsDXY, US10Y, SPX correlation, macro regime detection
bastion_get_etf_flowsBitcoin & Ethereum spot ETF daily flow data
bastion_get_stablecoin_marketsStablecoin supply changes and capital flow analysis
bastion_get_economic_dataCPI, FOMC, NFP, unemployment — via FRED API
bastion_get_polymarketPrediction market odds for crypto-relevant events
ToolAuthDescription
bastion_get_positionsreadAll open positions across connected exchanges
bastion_get_balancereadAccount balance and margin information
bastion_get_exchangesreadConnected exchange accounts and status
bastion_engine_statusreadAutonomous engine status and configuration
bastion_engine_historyreadEngine action history and audit log
bastion_get_alertsreadActive alerts and notifications
bastion_get_session_statsreadTrading session performance statistics
ToolAuthReversibleDescription
bastion_emergency_exittradeNoClose position at market immediately
bastion_partial_closetradeNoClose a percentage of a position
bastion_set_take_profittradeYesSet or modify take-profit order
bastion_set_stop_losstradeYesSet or modify stop-loss order
bastion_move_to_breakeventradeYesMove stop-loss to entry price
bastion_flatten_winnerstradeNoClose all positions currently in profit
ToolAuthDescription
bastion_engine_startengineStart the autonomous risk engine
bastion_engine_armengineArm for live trade execution
bastion_engine_disarmengineDisarm to monitor-only mode
STOPPED  →  engine_start  →  MONITORING  →  engine_arm  →  ARMED (live)
                                                              │
                                                        engine_disarm
                                                              │
                                                          MONITORING
ToolAuthDescription
bastion_war_room_postreadPost signals, theses, or alerts to the multi-agent War Room feed
bastion_war_room_readRead the latest signals and consensus from the War Room
bastion_war_room_consensusGet real-time directional consensus across all active agents

The War Room is a shared intelligence feed where multiple Claude agents can post signals, build consensus, and coordinate strategies in real-time.

ToolAuthDescription
bastion_chart_candlestickOHLCV candlestick chart as SVG
bastion_chart_vpvrVolume Profile Visible Range heatmap
bastion_chart_liquidationLiquidation cluster heatmap
bastion_chart_equityPortfolio equity curve chart
ToolAuthDescription
bastion_position_dnaEncode position into DNA fingerprint
bastion_dna_searchSearch stored DNA entries
bastion_dna_similarFind historically similar positions
ToolAuthDescription
bastion_stress_testMonte Carlo stress test across disaster scenarios
bastion_scenario_builderNatural language to scenario parameters
bastion_cascade_simulatorLiquidation cascade simulation
ToolAuthDescription
bastion_devils_advocateData-driven counter-arguments against any trade
bastion_challenge_thesisChallenge a trading thesis with live signals
ToolAuthDescription
bastion_smart_alertCreate alert from natural language
bastion_list_smart_alertsList active smart alerts
bastion_check_smart_alertsCheck alerts against market conditions
bastion_cancel_smart_alertCancel a smart alert
ToolAuthDescription
bastion_list_personasList all 6 strategy personas
bastion_get_personaGet full persona details and rules
bastion_persona_evaluateEvaluate trade through a persona's lens
ToolAuthDescription
bastion_portfolio_xrayFull portfolio diagnostic (correlation, concentration, exposure)
ToolAuthDescription
bastion_risk_budgetVolatility-adjusted position sizing from max loss budget
ToolAuthDescription
bastion_correlation_monitorCross-asset correlation shifts + regime detection
ToolAuthDescription
bastion_sentiment_heatmapComposite sentiment scoring across symbols
ToolAuthDescription
bastion_trading_planStructured 24h trading plan from live market data
ToolAuthDescription
bastion_kill_switchtradeEmergency exit — close ALL positions, cancel orders, disarm engine

The nuclear option. Logs market state at kill time for post-mortem review.

ToolAuthDescription
bastion_autopsy_listList recent flash crashes, selloffs, and anomalies
bastion_market_autopsyFull forensic breakdown — timeline, casualties, warning signals

Like an NTSB crash report for crypto. Reconstructs exactly what happened.

ToolAuthDescription
bastion_risk_dnaGenerate trading personality profile from history
bastion_risk_dna_patternsDeep pattern mining — find edges and leaks

Your behavioral fingerprint. Maps leverage, symbols, direction bias, streaks, and assigns a personality type.

MCP Resources & Prompts

TypeNameDescription
Resourcebastion://positionsLive position data stream
Resourcebastion://market/{symbol}Real-time market data for any symbol
Resourcebastion://engine/statusEngine status and health
Promptbastion-risk-checkGuided risk evaluation workflow
Promptbastion-morning-briefDaily market briefing template
Promptbastion-researchDeep research analysis template

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                      YOUR CLAUDE AGENT                          │
│                                                                 │
│  "Evaluate my BTC long and check whale activity"                │
│       │                                                         │
│       ▼                                                         │
│  ┌────────────┐  ┌─────────────┐  ┌───────────────┐            │
│  │ evaluate_  │  │ get_whale_  │  │ get_funding_  │  Claude    │
│  │ risk       │  │ activity    │  │ rates         │  picks     │
│  └─────┬──────┘  └──────┬──────┘  └──────┬────────┘  tools    │
│        │                │                │                      │
└────────┼────────────────┼────────────────┼──────────────────────┘
         │                │                │
         ▼                ▼                ▼
┌─────────────────────────────────────────────────────────────────┐
│              MCP PROTOCOL  ·  SSE Transport                     │
│              https://bastionfi.tech/mcp/sse                     │
└─────────────────────────────────────────────────────────────────┘
         │                │                │
         ▼                ▼                ▼
┌─────────────────────────────────────────────────────────────────┐
│                    BASTION MCP SERVER                            │
│                                                                 │
│  ┌──────────┐  ┌────────────┐  ┌─────────────┐                 │
│  │147 Tools │  │ Auth Layer │  │ Rate Limiter│                  │
│  │ Router   │  │ (bst_ keys)│  │ (4 tiers)   │                 │
│  └────┬─────┘  └────────────┘  └─────────────┘                 │
│       │                                                         │
│  ┌────┴────────────────────────────────────────────────────┐    │
│  │               RISK INTELLIGENCE CORE                    │    │
│  │                                                          │    │
│  │  ┌────────────┐  ┌────────────┐  ┌──────────────────┐  │    │
│  │  │  72B AI    │  │  Signal    │  │  Structure       │  │    │
│  │  │  Model     │  │  Aggregator│  │  Analyzer        │  │    │
│  │  │  (4x 5090) │  │  (560+)   │  │  (VPVR, S/R,    │  │    │
│  │  │            │  │            │  │   Order Flow)    │  │    │
│  │  └────────────┘  └────────────┘  └──────────────────┘  │    │
│  └─────────────────────────────────────────────────────────┘    │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
         │                │                │
         ▼                ▼                ▼
┌─────────────────────────────────────────────────────────────────┐
│                       DATA SOURCES                              │
│                                                                 │
│  Binance · Bybit · OKX · Bitget · Hyperliquid · CoinGlass     │
│  Coinalyze · On-Chain APIs · Whale Alert · ETF Providers       │
│  FRED · Polymarket · News Aggregators · Social Sentiment       │
└─────────────────────────────────────────────────────────────────┘

Signal Coverage

The risk model ingests 560+ signals per evaluation across 8 categories:

CategoryCountKey Signals
Derivatives~120Open interest, OI delta, funding, liquidations, basis, CVD
Microstructure~90VPVR, graded support/resistance, pivot structure, trendlines
On-Chain~90Exchange flow, whale wallets, SOPR, NVT, active addresses
Price Action~80Multi-timeframe OHLCV, EMAs, RSI, MACD, Bollinger
Order Flow~60Taker ratio, absorption, spoofing detection, book depth
Macro~50DXY, yields, SPX correlation, ETF flows, stablecoin supply
Options~40Put/call ratio, max pain, IV skew, gamma exposure
Sentiment~30Fear & Greed, social volume, news sentiment scoring

Example Conversations

You:    What's the current state of BTC? Give me a quick overview.

Claude: [bastion_get_price] [bastion_get_market_data] [bastion_get_fear_greed]

        Bitcoin Overview:

        Price:       $98,420 (+2.3% 24h)
        24h Volume:  $48.2B
        Market Cap:  $1.94T
        Dominance:   56.8%
        Fear/Greed:  72 (Greed)

        BTC is showing strong momentum approaching the $100K psychological
        level. Volume is elevated and sentiment is firmly in Greed territory.
You:    Check all my positions and evaluate risk.

Claude: [bastion_get_positions] [bastion_evaluate_all_positions]

        3 open positions evaluated:

        1. BTC/USDT LONG · 5x · Entry $96,200 · Now $98,420 (+2.3%)
           Risk: 35/100 (Low) → HOLD
           OI rising with price confirms genuine demand.

        2. ETH/USDT LONG · 3x · Entry $2,680 · Now $2,645 (-1.3%)
           Risk: 55/100 (Moderate) → HOLD with caution
           ETH/BTC ratio declining signals relative weakness.

        3. SOL/USDT SHORT · 2x · Entry $195.40 · Now $198.20 (-1.4%)
           Risk: 68/100 (Elevated) → REDUCE_SIZE
           Rising OI + positive CVD + whale accumulation detected.
You:    Any funding rate arb opportunities right now?

Claude: [bastion_get_funding_rates] [bastion_get_funding_arb]

        Top Opportunity: BTC/USDT
        Spread: Bybit vs dYdX = 0.043% per 8h (47.1% annualized)

        Strategy:
        → Long on dYdX (collect 0.008%)
        → Short on Bybit (pay 0.035%)
        → Net: Collect spread while delta-neutral
You:    What are the whales doing with ETH right now?

Claude: [bastion_get_whale_activity] [bastion_get_exchange_flow]

        Whale Activity — ETH (last 24h):

        → 3 large wallets accumulated 12,400 ETH ($32.8M)
        → Exchange outflow exceeds inflow by 8,200 ETH
        → Top 100 wallets increased holdings by 0.3%

        Interpretation: Smart money is accumulating. Exchange outflow
        suggests coins moving to cold storage (bullish signal).

Authentication

ScopeKey RequiredAccess
PublicNoMarket data, derivatives, on-chain, macro, sentiment, AI evaluation, research
Readbst_Portfolio viewing — positions, balances, alerts, engine status
Tradebst_Trade execution — exits, partial closes, TP/SL management
Enginebst_Autonomous engine — start, arm, disarm

[!NOTE] Higher scopes include all lower scope permissions. An engine key has full trade and read access.

  • Keys transmitted over HTTPS only — TLS encrypted
  • Server-side SHA-256 hashing — plaintext keys are never stored
  • Instant revocation from the dashboard
  • Configurable rate limits per key
  • IP restriction support on exchange API keys
  • Exchange withdrawal permissions are never required

Agent Patterns

Proven agentic workflows for building with BASTION tools:

Monitor & Alert

bastion_get_positions            → Get all open positions
bastion_evaluate_all_positions   → Run AI risk on each
[If risk > 70]                   → Alert user with full analysis
[If risk > 90]                   → bastion_emergency_exit

Research Pipeline

bastion_get_price                → Current price context
bastion_get_open_interest        → Derivatives positioning
bastion_get_whale_activity       → Smart money flow
bastion_get_fear_greed           → Market sentiment
bastion_generate_report          → Synthesize into research report

Execution Loop

bastion_evaluate_risk            → Get AI recommendation
[EXIT_FULL]                      → bastion_emergency_exit
[TP_PARTIAL]                     → bastion_partial_close (50%)
[REDUCE_SIZE]                    → bastion_partial_close (30%)
[HOLD + near TP]                 → bastion_set_take_profit

See workflows/ for 6 complete multi-step workflow templates and prompt-templates/ for ready-to-use Claude prompt personas.


Rate Limits

TierRequests/minBurstAI Evals/minKey Required
Free30105No
Basic1203020Yes
Pro600100100Yes
EnterpriseCustomCustomCustomYes
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 118
X-RateLimit-Reset: 1708444800

Supported Symbols

SymbolNameAI SupportBacktest Win Rate
BTCBitcoinFull71.7%
ETHEthereumFull72.7%
SOLSolanaFull81.8%
DOGEDogecoinFull89.6%
LINKChainlinkFull77.8%
ADACardanoFull74.5%
AVAXAvalancheFull68.2%
XRPRippleFull59.5%
ARBArbitrumFull
OPOptimismFull

Plus 90+ additional pairs with market data and derivatives support.

[!NOTE] Pass symbols without the /USDT suffix — use "BTC" not "BTC/USDT".


Comparison

BASTIONGeneric Crypto APIManual Research
MCP NativeYesNoNo
AI Risk Evaluation72B fine-tunedNoneHuman judgment
Signal Count560+10-50Varies
Derivatives Depth12 tools1-3 endpointsDashboard
Autonomous ExecutionBuilt-in engineNoneManual
Time to InsightSecondsMinutesHours
Claude IntegrationNative toolsWrapper neededCopy-paste
Backtested75.4% win rateN/AN/A

Error Handling

{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded. Retry after 12 seconds.",
    "retry_after": 12
  }
}
CodeMeaningAgent Behavior
INVALID_SYMBOLSymbol not recognizedAsk user to verify
AUTH_REQUIREDTool requires API keyPrompt user to add key
SCOPE_DENIEDKey lacks required scopeExplain what scope is needed
RATE_LIMITEDToo many requestsWait and retry
EXCHANGE_ERRORExchange API issueReport and suggest retry
MODEL_TIMEOUTAI model busyRetry or use simpler tools

Repository Structure

BASTION-MCP/
├── README.md                        ← You are here
├── quickstart.md                    ← 5-minute getting started
├── TOOLS.md                         ← Complete 147-tool reference
├── mcp-config.json                  ← Copy-paste MCP config
├── LICENSE                          ← MIT
├── CONTRIBUTING.md                  ← How to contribute
├── SECURITY.md                      ← API key safety & disclosure
├── CHANGELOG.md                     ← Version history
│
├── .github/
│   ├── ISSUE_TEMPLATE/              ← Bug, feature, example templates
│   ├── PULL_REQUEST_TEMPLATE.md
│   └── FUNDING.yml
│
├── examples/                        ← 55 tool examples
│   ├── core-ai/                     ← Risk eval, chat, signals (4)
│   ├── market-data/                 ← Price, klines, volatility (4)
│   ├── derivatives/                 ← OI, CVD, funding, options (12)
│   ├── onchain/                     ← Whales, exchange flow (4)
│   ├── macro-sentiment/             ← Fear/greed, ETF, macro (6)
│   ├── portfolio/                   ← Positions, balance, engine (7)
│   ├── trading-actions/             ← Exit, TP/SL, breakeven (6)
│   ├── engine-control/              ← Start, arm, disarm (3)
│   ├── research/                    ← Reports, position calc (3)
│   ├── resources/                   ← MCP resources (3)
│   └── prompts/                     ← MCP prompts (3)
│
├── guides/
│   ├── claude-code-setup.md
│   ├── claude-desktop-setup.md
│   └── api-custom-setup.md
│
├── workflows/                       ← 6 multi-step workflows
│   ├── morning-briefing.md
│   ├── position-risk-review.md
│   ├── pre-trade-analysis.md
│   ├── risk-engine-setup.md
│   ├── whale-intelligence-sweep.md
│   └── macro-crypto-correlation.md
│
└── prompt-templates/                ← 4 Claude prompt personas
    ├── market-overview.md
    ├── risk-check.md
    ├── trade-setup.md
    └── continuous-monitor.md

FAQ

No. BASTION is cloud-hosted. Your Claude client connects via SSE — no Docker, no pip install, no local server.

Claude Code, Claude Desktop, and any custom client built with the MCP Python SDK. Anything that speaks MCP over SSE.

Yes. All market data, derivatives, on-chain, macro, sentiment, and AI tools are free at 30 req/min. You only need a paid key for higher rate limits or portfolio/trading access.

Yes. With a trade-scoped API key and a connected exchange (Binance, Bybit, OKX, Bitget, or Hyperliquid), BASTION can execute exits, partial closes, and TP/SL orders. All actions require explicit Claude agent confirmation.

Backtested at 75.4% combined accuracy across BTC (71.7%), ETH (72.7%), and SOL (81.8%). Extended testing: DOGE 89.6%, LINK 77.8%, ADA 74.5%. The model provides probabilistic assessments with explicit reasoning — not guarantees.

Market data tools: <100ms. AI risk evaluations: 2-5 seconds (full 560+ signal analysis on 4x RTX 5090 cluster). Structure analysis: ~1ms on cache hit, ~700ms on cache miss.

Keys are HTTPS-only, SHA-256 hashed server-side, instantly revocable, and never logged in plaintext. Exchange API keys connected through BASTION are session-encrypted and never stored.


Links

Resource
Platformbastionfi.tech
Agents Hubbastionfi.tech/agents
Dashboardbastionfi.tech/dashboard
MCP Endpointhttps://bastionfi.tech/mcp/sse
Get API Keybastionfi.tech/account
GitHubBASTION-MCP
Tool ReferenceTOOLS.md
Quick Startquickstart.md

Contributing

We welcome contributions — new examples, workflows, prompt templates, bug reports, and docs improvements.

git clone https://github.com/bastionfintech-spec/bastion-mcp-server.git
cd BASTION-MCP
git checkout -b feature/your-contribution

See CONTRIBUTING.md for file format standards and guidelines.


Disclaimer

BASTION provides market intelligence and risk analysis tools. It does not provide financial advice. Cryptocurrency trading involves substantial risk of loss. Past model performance does not guarantee future results. Always DYOR and never trade with funds you cannot afford to lose.


License

MIT License — See LICENSE for details.


Built for the agentic era.

Get Started  ·  Documentation  ·  Developers  ·  GitHub

Related Servers