Skip to main content

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/ws event feed;
  • MCP over streamable HTTP at /mcp ([daemon] mcp_http, default true), for HTTP-native MCP clients; served by both pitbridge run and pitbridge 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

pitbridge-0.2.1.tar.gz (157.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pitbridge-0.2.1-py3-none-any.whl (82.8 kB view details)

Uploaded Python 3

File details

Details for the file pitbridge-0.2.1.tar.gz.

File metadata

  • Download URL: pitbridge-0.2.1.tar.gz
  • Upload date:
  • Size: 157.0 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

Hashes for pitbridge-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ea519ea5c1d0612bcf209fa4734d41dd1976c10530732d15f0a639ee437f3da5
MD5 ea782647e971c23591308a8f4d29e8c4
BLAKE2b-256 4093214fb31d50d65e72d63f8c46ca95a482e116a945a941c28b6f13c4be8d14

See more details on using hashes here.

File details

Details for the file pitbridge-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pitbridge-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 82.8 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

Hashes for pitbridge-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9e0125ccf13c3dafcb355320944329dca4fb489f0c385e7ee087dadace45666
MD5 d62a53ec71f20ab3b79fac33b7312448
BLAKE2b-256 074915852e63e49b0446de18480a4738670fd42ed001d56b75bdb007db3de872

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page