Pitbridge

com.pitbridge由 pitbridge.com 發布v0.2.2更新於 Nov 3, 2026

Local-first MCP bridge for NinjaTrader 8 behind a deterministic guardrail engine.

已驗證STDIO僅桌面金融開發者工具

概覽

AI 產生的概覽

本地優先的 MCP 橋接服務,讓 AI 代理在確定性、預設開啟的護欄引擎下,為 NinjaTrader 8 期貨帳戶下單與管理訂單。

可以做什麼
  • 透過本機守護程序在 NinjaTrader 8 期貨帳戶上送出訂單,並讀取帳戶、持倉與訂單狀態
  • 讓每筆訂單經過固定流程:結構驗證、權限、護欄、可選人工確認、送出與稽核
  • 依賴十二項護欄,包括當日虧損熔斷、獲利鎖定、單筆與持倉上限、商品白名單、交易時段、冷卻期、頻率限制、重複訂單防護、斷線阻擋與緊急停止開關
  • 在緊急停止狀態下仍可執行取消、平倉與全部平倉等嚴格僅減倉的降風險操作
  • 透過僅追加、雜湊鏈結的稽核日誌解釋並驗證每筆訂單的決策
  • 不需 NinjaTrader 或行情資料,即可用模擬 AddOn 進行唯讀與模擬盤測試
適用情境
當你希望讓 AI 代理操作 NinjaTrader 8 期貨帳戶,但需要代理無法繞過的程式碼層級硬性限制時適用。適合在模擬環境測試代理驅動的下單流程,也適合需要每筆訂單決策可稽核的操作者。
執行需求
以本機 Python 3.12 守護程序執行,從 PyPI 安裝並以 uvx 啟動,支援 macOS、Linux 與 Windows。真實下單路徑需要 Windows 上的 NinjaTrader 8 及 C# AddOn;模擬測試可使用內附的假 AddOn。配對模式需要配對權杖以及 Tailscale 或區域網路等私有網路。實盤執行需要付費 Pro 外掛,並由操作者在命令列執行 arm-live。
安裝前請注意
這是交易基礎設施,一旦啟用實盤執行即可送出真實期貨訂單,交易具有重大虧損風險。代理無法修改限制、解除緊急停止或啟用實盤,但其送出的訂單仍會送至你的經紀商。實盤執行與多帳戶功能為付費項目。本專案不對自營交易公司規則作合規保證,且與 NinjaTrader 無任何關聯。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Pitbridge,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

PitBridge

A local-first MCP bridge for NinjaTrader 8, with hard risk limits your AI cannot bypass.

[CI] [AddOn build]

PitBridge connects an AI agent (Claude Code, Claude Desktop, or your own script) to a NinjaTrader 8 futures account through a daemon that runs on your own machine. Every order the agent asks for passes through a deterministic guardrail engine first. The guardrails are default-on, they live in code rather than in prompts, and the agent has no tool to weaken them, unlock live trading, or release the kill switch.

We build rails, not alpha. PitBridge does not tell you what to trade.

What it is

  • A local-first daemon (Python 3.12) that speaks MCP (stdio and streamable HTTP), a REST API, and a WebSocket event feed. It runs on macOS, Linux, or Windows.
  • A deterministic guardrail engine: pure, synchronous checks (daily-loss halt, position caps, trading windows, rate limits, a kill switch, and more) that every order must pass before it can reach the broker.
  • A thin NinjaTrader 8 AddOn (C#) that connects out to the daemon and places orders through the official NinjaTrader.Cbi Account API. The AddOn is deliberately dumb: all safety lives in the daemon.
  • An append-only, hash-chained audit log that records every request, decision, and outcome, and can tell you exactly why any order was allowed or blocked.

What it is NOT

Read this section before anything else.

  • Not a broker or an exchange. PitBridge routes orders you (or your agent) create to your existing NinjaTrader account. It holds no funds and executes nothing itself.
  • Not signals, strategies, or alpha. PitBridge ships no trading logic. It will not tell you what, when, or how much to trade. That is your job, or your agent's.
  • Not financial or investment advice. It is trading infrastructure.
  • Not a guarantee of prop-firm compliance. You configure the limits that match your firm's rules. PitBridge helps you encode and enforce them locally, but you remain responsible for staying within your firm's terms. We make no compliance guarantee.
  • Not a cloud order relay. Orders, keys, and positions never touch our servers. There is no PitBridge account in the order path.
  • Not autonomous. Enabling live execution is an operator-only ritual at the command line. The agent cannot arm live trading, and it cannot lift a kill.

Architecture

The entire order path is local. PitBridge's own cloud (the marketing site, the docs, software updates) is never in it.

   AI agent   (Claude Code / Claude Desktop / your own script)      │      │   MCP (stdio or HTTP)   REST /v1/*   WS events      ▼   PitBridge daemon                         ← runs on YOUR machine      │      │   frozen pipeline (no code path skips it):      │   schema → permission → GUARDRAILS → confirm → submit → audit      ▼   Guardrail engine   (deterministic, default-on, not reconfigurable by the agent)      │      │   WebSocket on :8873   (the AddOn dials OUT; the NT8 box never listens)      ▼   NT8 AddOn   (C#, .NET 4.8, next to NinjaTrader 8 on Windows)      │      │   NinjaTrader.Cbi Account API   (close / flatten are strictly reduce-only)      ▼   NinjaTrader 8   →   your broker / prop account   (CQG, Rithmic, ...)
   PitBridge's own cloud is NOT on this path.   Orders, keys, and positions never leave your machine(s).

Two run modes:

  • Localhost (default): the daemon and NinjaTrader run on the same Windows machine, bound to 127.0.0.1.
  • Paired: the daemon runs on, for example, your Mac, and the NinjaTrader AddOn connects out to it over your own private network (Tailscale / LAN). This is the "runs on your Mac, your Windows box, or both" setup. Non-localhost binds are refused unless paired mode is explicitly enabled and a pairing token is configured.

Safety model in short

  • Deterministic guardrails. The engine is a set of pure functions with no I/O and no LLM in the loop: check(request, state, now) returns Allow, Block (with a typed reason code), or RequireConfirm. Given the same inputs it always returns the same decision, and that decision is testable.
  • A frozen pipeline. Every order takes exactly one path: schema validation, then permission (read-only / paper / live), then the guardrail chain, then an optional human-confirm gate, then submit, then an audit append. There is no route from the agent surface to the broker that skips it. A structural test in CI fails the build if any code tries.
  • The agent cannot reconfigure safety. Limits live in an on-disk config that is checksum-verified. No MCP tool can edit config, raise a limit, un-kill, or arm live trading. Those controls exist only at the operator's command line.
  • Local-first. The daemon runs on your machine(s). Orders, keys, and positions never reach a PitBridge server.
  • Kill switch. A file, the CLI, or a REST call can engage it instantly. Only the CLI (a human at the keyboard) can release it. De-risking (cancel, close, flatten) is deliberately still allowed under a kill, so you can always get flat.
  • Tamper-evident audit log. Append-only, hash-chained JSONL with an out-of-file anchor. pitbridge audit why <id> explains any order; pitbridge audit verify proves the chain is intact and catches edits, truncation, or a wiped tail.

The guardrails

Twelve v0 guardrails, each its own module, all table-tested. The chain runs in a frozen order: the kill switch is checked first, the human-confirm gate last.

  1. Kill switch: file, CLI, or REST engages it; release is CLI-only, never an agent tool.
  2. Daily-loss halt: per-account day ledger with New-York rollover; can latch sticky for the rest of the day once breached.
  3. Profit lock: stop trading for the day after a configured profit.
  4. Max contracts per order: reject any single order above the cap.
  5. Max position per instrument and account: cap net exposure, and refuse an over-cap position flipping to an equally over-cap opposite side.
  6. Instrument allowlist: only configured contracts may be traded.
  7. Trading windows and holiday calendar: per-account timezone, holiday and early-close aware.
  8. Cooldown: a minimum spacing after a loss and/or after an order.
  9. Order rate limits: caps per minute, per hour, and per day.
  10. Duplicate-order protection: same account, instrument, side, and quantity within N seconds is rejected.
  11. Link-down block: if the heartbeat to the AddOn goes stale, new orders hard-reject rather than queue against a dead link.
  12. Human-confirm gate: parks an order as PENDING_CONFIRM, pings a notifier, and waits for pitbridge confirm <id> (or a REST approval); auto-rejects after 60 seconds.

Open-core boundary

PitBridge is open-core. The safety kernel is open so it can be read and trusted. Live execution and the operational suite for running many accounts are the paid tier.

Open source (free)Pro (paid)
The daemon and the full guardrail engineLive-execution unlock (the private LiveExecutionProvider plugin)
The MCP, REST, and WebSocket agent surfaceThe advanced guardrail suite and prop-firm rule packs
Read-only tools and paper trading (against the fake AddOn / simulation)Multi-account fan-out (one tool call, N accounts)
The CLI and the hash-chained audit logThe human-confirm UI and audit export

This is licensing-gating, not DRM. The core is fully functional for read-only and paper use on its own. Live trading requires the Pro plugin plus a deliberate, operator-only arm-live step.

Quickstart

You can run the complete daemon on a Mac today, with no NinjaTrader install, no Windows box, and no market data. A fake AddOn simulator stands in for the real C# AddOn, so you can watch the guardrails pass good orders, block bad ones with a typed reason, stop everything with the kill switch, and explain every decision from the audit log.

bash
cd daemonuv sync --extra devuv run pitbridge run --config ./config.toml     # terminal Auv run python ../tools/fake_addon.py \           # terminal B  --host 127.0.0.1 --port 8873 --token pb_pair_demo --account Sim101

Then place a paper order over REST or wire up Claude as the MCP client and ask it in plain language. The full walkthrough, a ready-to-paste config, the Claude Desktop / Claude Code MCP setup block, five test scenarios, and a "try to break it" section are in docs/testing-on-mac.md.

Everything in the quickstart is paper / simulation. See that guide's "What this does and does not prove" for the honest boundary.

Status and roadmap

PitBridge is early and pre-launch. We are honest about what exists versus what is planned.

Built and tested today (paper / simulation only):

  • the daemon core, the full guardrail engine (all twelve guardrails), the day ledger, and the hash-chained audit log;
  • the MCP server (nine tools), the REST API, the WebSocket event feed, and the CLI;
  • a scripted fake AddOn for end-to-end and chaos testing;
  • a table-driven test suite (300+ tests) that runs on macOS, Linux, and Windows in CI, including prompt-injection and no-bypass tests.

In progress:

  • the real C# NinjaTrader 8 AddOn (order routing on a Sim101 account), with close and flatten implemented as strictly reduce-only.

Planned:

  • shadow-mode validation, running PitBridge in parallel with our own live prop-trading operation to prove order-intent parity before it ever routes a live order;
  • a supervised, operator-gated live migration;
  • the open-core public launch, the website, and full docs;
  • additional platforms (Tradovate, ProjectX / TopstepX) via thin adapters.

No live account has been traded through PitBridge yet. Live routing sits behind an operator-only ritual and is not part of the current build.

Documentation

Disclaimers

Trademarks. NinjaTrader is a registered trademark of NinjaTrader Group, LLC. CQG, Rithmic, and any prop-firm names are trademarks of their respective owners. PitBridge is an independent project and is not affiliated with, endorsed by, or sponsored by NinjaTrader Group, LLC, any data or clearing provider, or any prop firm. Platform names are used nominatively, only to describe compatibility.

Not financial advice. PitBridge is trading infrastructure, not financial, investment, or trading advice. It provides no signals, strategies, or recommendations.

Risk. Trading futures involves substantial risk of loss and is not suitable for every investor. You are solely responsible for your own trading decisions and for staying within the terms of any broker or prop firm you use.

CFTC Rule 4.41 (hypothetical and simulated performance). Any results, examples, or simulated data shown for PitBridge are hypothetical or simulation-based. Simulated performance has inherent limitations: unlike a live record, simulated results do not represent actual trading, and because the trades were not actually executed, they may under- or over-compensate for factors such as lack of liquidity. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown.

來源:README.md,提交 a0086d4

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分