# AirbagMCP: Risk Gate and Point-in-Time Clock for AI Trading Agents on IBKR > A Rust Model Context Protocol (MCP) server for Interactive Brokers (IBKR). It checks orders from AI agents against hard risk limits. Status: early access for IBKR paper accounts. Support for live accounts is planned. ## Status - No real order has been sent through the Rust path yet. It is built and tested for IBKR paper accounts. - Ships as a single Rust binary. Run `airbag mcp` to start the MCP server over stdio. - Tested on Linux only. - The server offers tools. It offers no MCP resources. - License: MIT. - Not an investment adviser. Nothing here is financial or investment advice. ## What it does - Risk gate: - Rejects market (MKT) orders and requires a limit price. - Routes approved limit orders through IBKR Adaptive (Normal). - Refuses a repeated `client_order_key` using a SQLite ledger. The MCP layer also checks the broker for that order ref. - Applies a daily loss lock, a total drawdown kill switch and an orders-per-minute rate limit. - Applies a spread limit and a price collar (fat finger check). - Applies single-name, sector and average-daily-volume caps. - Rejects orders with high commission drag. The commission and margin figure is a local estimate. It does not reject for margin. - Point-in-time clock: queries return an event only if `accepted_at <= sim_clock`. - Ticker masking: symbols become tokens that rotate daily. Masking does not prove that a model cannot recognise an asset. - Stream coalescer: absorbs ticks locally at zero tokens, tracks VWAP, volatility and spread, and wakes the agent on anomalies. The token saving is not measured. - Friction accounting: commission and spread costs. - Local SEC ingest: 8-K filings, MD&A tone and XBRL facts for 2,396 filers. ## MCP tools (9) 1. `set_sim_clock`: set the simulated clock for historical replay. 2. `query_pit_events`: query point-in-time events. 3. `ingest_stream_tick`: send a tick to the stream coalescer. 4. `get_stream_digest`: read the coalescer digest. 5. `stage_airbag_limit_order`: submit an order to the risk gate. 6. `get_conviction_candidates`: list conviction candidates. 7. `get_risk_and_friction_status`: read risk limits state and friction costs. 8. `get_ibkr_paper_account`: read the IBKR paper account. 9. `flatten_all_positions`: close all open positions. ## Test results We tested five of our own strategy families (11,364 backtests in total) with combinatorial purged cross-validation, probability of backtest overfitting, deflated Sharpe and a permuted-signal placebo. 0 of 5 pass. Median out-of-sample excess over SPY was negative for all five. Limits: the local data cache has survivorship bias, prices exclude dividends, and the look-ahead tests cover symbols in the local cache and sample cut days. These are simulated results and do not predict future results. ## Pricing (planned, no payment taken today) - Developer Execution Sidecar: $79/mo. The local risk gate exists. Live support is planned. - Hosted PIT SEC Catalyst Feed: $39/mo. Entirely planned. - Complete Quant Desk: $99/mo. Local part exists. Hosted part is planned. ## Setup - Command: `airbag` - Arguments: `["mcp"]` - Transport: stdio - A `docker-compose.yml` in the repository runs a local paper IB Gateway only.