
Pitbridge
com.pitbridge由 pitbridge.com 发布v0.2.2更新于 Nov 3, 2026
Local-first MCP bridge for NinjaTrader 8 behind a deterministic guardrail engine.
概览
本地优先的 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。
安装
在 SourceWeft 中
- 打开 控制台中的 Pitbridge,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
PitBridge
A local-first MCP bridge for NinjaTrader 8, with hard risk limits your AI cannot bypass.
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.CbiAccount 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.
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 verifyproves 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.
- Kill switch: file, CLI, or REST engages it; release is CLI-only, never an agent tool.
- Daily-loss halt: per-account day ledger with New-York rollover; can latch sticky for the rest of the day once breached.
- Profit lock: stop trading for the day after a configured profit.
- Max contracts per order: reject any single order above the cap.
- Max position per instrument and account: cap net exposure, and refuse an over-cap position flipping to an equally over-cap opposite side.
- Instrument allowlist: only configured contracts may be traded.
- Trading windows and holiday calendar: per-account timezone, holiday and early-close aware.
- Cooldown: a minimum spacing after a loss and/or after an order.
- Order rate limits: caps per minute, per hour, and per day.
- Duplicate-order protection: same account, instrument, side, and quantity within N seconds is rejected.
- Link-down block: if the heartbeat to the AddOn goes stale, new orders hard-reject rather than queue against a dead link.
- 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.
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.
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
- docs/architecture.md: the binding architecture and safety spec.
- docs/testing-on-mac.md: run and test the daemon on a Mac against the fake AddOn.
- SECURITY.md: how to report a vulnerability.
- CONTRIBUTING.md: how to contribute, and the rules for safety-critical changes.
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版本历史
1- v0.2.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
