NinjaTrader 8 MCP bridge for AI trading agents
PitBridge is a local-first MCP bridge for NinjaTrader 8. Your AI agent connects over the Model Context Protocol, proposes orders, and a guardrail engine on your own machine checks every one before it reaches the platform.
Built for NinjaTrader 8. NinjaTrader is a registered trademark of NinjaTrader, LLC. PitBridge is an independent project and is not affiliated with, endorsed by, or sponsored by NinjaTrader, LLC.
The bridge is the order route.
The agent never talks to NinjaTrader 8 directly. It talks to the daemon on localhost. The daemon runs the order through the guardrail engine, and only a permitted order reaches your account. A blocked order stops at the engine and states why.
Example decisions: ALLOW buy 2 MES, all rules pass. BLOCK buy 10 MES, size 10 exceeds max_contracts_per_order 2.
MCP is the front door
PitBridge exposes a Model Context Protocol server, so an agent that already speaks MCP can drive NinjaTrader 8 with no glue code. The server runs two ways: over stdio for a local client like Claude Desktop or Claude Code, and over streamable HTTP at /mcp for an agent or script on the same machine or your local network.
If you are weighing a CrossTrade MCP alternative, the difference is where the order route lives. PitBridge keeps the daemon, the guardrail engine and your keys on your own machine. There is no cloud relay in the order path and no webhook forwarded through a third party. CrossTrade is a capable tool built for a different job. PitBridge is built to put a hard, local risk wall between an AI agent and your account.
The tools an agent gets
Nine tools in the first version. Read tools return state. Write tools propose actions and always pass through the guardrail chain first. There are no market-data tools: the agent brings its own data and its own decisions. PitBridge routes and refuses, nothing more.
| tool | kind | what it does |
|---|---|---|
| get_accounts | read | List connected NinjaTrader 8 accounts and their mode. |
| get_positions | read | Working positions per instrument and account. |
| get_orders | read | Open and recent orders with their state. |
| get_account_state | read | Cash, realized and unrealized profit and loss. |
| get_guardrail_status | read | Which rules are active and what each is set to. |
| place_order | write | Propose an order. Runs the full guardrail chain first. |
| cancel_order | write | Cancel a working order by id. |
| close_position | write | Close a single position on one instrument. |
| flatten_account | write | Flatten every position on an account at once. |
How an agent connects
Point your MCP client at the PitBridge daemon. Claude Desktop and Claude Code read a small config block; a custom agent or script opens the streamable HTTP endpoint. Either way the daemon is the only listener, and it binds to 127.0.0.1 by default.
{
"mcpServers": {
"pitbridge": {
"command": "pitbridge",
"args": ["mcp"]
}
}
}Example client config. Values are illustrative.
agent place_order account=Sim101 instrument=MNQ side=BUY qty=2 type=MARKET daemon guardrail.eval max_contracts_per_order ok (2 <= 2) daemon order.allow routed to NT8 Sim101 agent place_order account=Sim101 instrument=MNQ side=BUY qty=8 type=MARKET daemon order.block size 8 exceeds max_contracts_per_order 2. adjust the order or the rule.
Example transcript with example configuration values. The block is returned to the agent as a typed, reasoned error.
What the bridge does and does not do
- Speaks MCP over stdio and streamable HTTP
- Runs the daemon on macOS, Windows or Linux
- Checks every order against a config file the agent cannot edit
- Returns a stated reason for every blocked order
- Keeps your keys and your order route on your own machine
- Sends no trade signals and defines no strategies
- Ships no market data and no opinion on what to trade
- Makes no profit promise and no evaluation outcome promise
- Routes no order through a PitBridge server
PitBridge is in development. NinjaTrader 8 is first.
Tell us your platform and we email you when your setup is supported. Nothing else.