Local-first, guardrailed MCP bridge for NinjaTrader 8, with hard risk limits your AI agent cannot bypass.
Project description
pitbridge (daemon)
Python 3.12 daemon that sits between AI agents (MCP / REST / WS) and the
NinjaTrader 8 AddOn (outbound WebSocket, port 8873). Binding spec:
../docs/architecture.md.
Dev setup
cd daemon
uv venv --python 3.12
uv pip install -e ".[dev]"
uv run pytest
uv run ruff check .
Status: M2 daemon-core — protocol models (14 message types, schema-mirrored),
guardrail engine (M1), the AddOn WS link (hello/auth/heartbeat/snapshot/
reconnect-reconcile, reconcile-first hard), executor (idempotent pending-order
table + ack timeouts), the frozen pipeline (schema -> permission -> guardrails
-> confirm gate -> submit -> audit) as the single order path, the /v1 REST + WS
surfaces, and tools/fake_addon.py for chaos tests. pitbridge run --config
serves it. MCP surface + C# AddOn land in M3/M4.
Agent surface (0.2.0)
One uvicorn server, one port (default 127.0.0.1:8873), three transports over
the same guardrail pipeline:
- REST
/v1/*and the WS/v1/wsevent feed; - MCP over streamable HTTP at
/mcp([daemon] mcp_http, defaulttrue), for HTTP-native MCP clients; served by bothpitbridge runandpitbridge mcp; - MCP over stdio via
pitbridge mcp(Claude Desktop / Claude Code).
Bearer auth ([daemon] agent_token)
Generate a token with pitbridge token new and set it in the config yourself
(the CLI never writes it for you). With it set, every /v1/* call, the
/v1/ws stream and /mcp require Authorization: Bearer <agent_token>
(401 otherwise, constant-time compare). The WS /v1/addon leg keeps its own
pairing_token hello auth.
Fail-closed rule: a non-localhost bind REFUSES to start without an
agent_token (on top of the existing paired_mode + pairing_token
requirement). On a 127.0.0.1 bind the token is optional and off by default
(backwards compatible). pitbridge status and pitbridge doctor report the
auth state.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pitbridge-0.2.0.tar.gz.
File metadata
- Download URL: pitbridge-0.2.0.tar.gz
- Upload date:
- Size: 150.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6296959b0016660897ae710fc4876f51b67e2ac24eaed510303260fecb4ed959
|
|
| MD5 |
9d0a2c0d85386695b3a2a66b5514e970
|
|
| BLAKE2b-256 |
53e3e319ab4effe2e3aba42152333218c57a536b8460f32b4852626cc590c5d5
|
File details
Details for the file pitbridge-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pitbridge-0.2.0-py3-none-any.whl
- Upload date:
- Size: 79.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db15da3b624c96e4b1ad204ff0309105130240a1dc9fc3725fde8e1f1d3cb83a
|
|
| MD5 |
3c6d445d0afff91ba0c8d44597d051f3
|
|
| BLAKE2b-256 |
c42b6fcb018796e00f8fbd44b7c431e5c260799718ac6a58dfa7384148c6ce42
|