An MCP server that lets Claude Code interact with NinjaTrader 8 — accounts, positions, orders, live quotes, chart data, and indicator state.
Status: Working. Actively used and maintained. Expect breaking changes before v1.0.
This bridge exposes NinjaTrader 8 capabilities as MCP (Model Context Protocol) tools that Claude Code can call directly. Ask Claude about your open positions, current quotes, chart indicators, or have it place and manage orders on a Sim account — from your terminal, without touching the NT8 UI.
It has two parts:
- MCP server (
server/) — a small Node.js process that Claude Code talks to over stdio. It translates MCP tool calls into HTTP requests. - NT8 AddOn (
ninjatrader-addon/) — a single C# file compiled inside NinjaTrader that runs an HTTP server on port 7890 and answers those requests using the NT8 API.
I'm an active NinjaScript developer and futures trader. I run Claude Code on macOS while NinjaTrader 8 runs in a Windows VM (Parallels). I wanted to query my trading platform — accounts, market data, what my indicators are doing — directly from Claude conversations instead of constantly switching into the VM. This bridge closes that gap.
+--------------------------------+
| Claude Code (macOS) |
+--------------------------------+
| stdio (MCP)
v
+--------------------------------+
| MCP Server (Node.js) |
| server/src/*.js |
+--------------------------------+
| HTTP
v
+--------------------------------+
| Windows VM or PC (port 7890) |
| |
| +------------------------+ |
| | McpHttpServer | |
| | (NT8 AddOn, C#) | |
| +------------------------+ |
| | |
| v |
| +------------------------+ |
| | NinjaTrader 8 | |
| +------------------------+ |
+--------------------------------+
Claude Code and the MCP server run on the host (macOS in my setup, but any OS with Node.js works). The AddOn runs inside NinjaTrader on Windows. They communicate over plain HTTP on your local network.
- List accounts with connection status, balances, and margins
- Read open positions and orders
- Place, modify, and cancel orders (Market, Limit, Stop, StopLimit)
- Live quotes (last/bid/ask/spread) for instruments with an active data subscription
- Historical OHLCV bars from open charts
- Chart state: which charts are open, their timeframes and indicators
- Indicator plot values, plus a reflection-based dump of any indicator's internal fields — works even for custom indicators that don't publish through
Values[]
See docs/api-reference.md for the full list of MCP tools and HTTP endpoints.
Windows side (VM or PC):
- Windows 10/11 with NinjaTrader 8 installed
- A data connection configured in NT8 (live, sim, or Playback)
Host side:
- Node.js 18+
- Claude Code
If NT8 runs in a VM, the host must be able to reach the VM's IP (Parallels Shared Network works out of the box; the default VM IP is 10.211.55.4).
Run ninjatrader-addon/install-windows.ps1 from PowerShell as Administrator. It copies McpHttpServer.cs into NT8's AddOns folder, registers the HTTP URL prefix (netsh http add urlacl), and opens port 7890 in the Windows firewall.
Then compile and activate:
- Open NinjaTrader 8 → Control Center → New → NinjaScript Editor
- File → Open →
Documents\NinjaTrader 8\bin\Custom\AddOns\McpHttpServer.cs - Press F5 to compile — check the Log tab for errors
- Restart NinjaTrader 8
- Verify in Control Center → Output:
[McpHttpServer] Listening on port 7890
Quick test from the Windows machine:
curl http://localhost:7890/api/health
And from the host (replace with your VM's IP):
curl http://10.211.55.4:7890/api/health
git clone https://github.com/royroman-dev/claude-code-nt8-bridge.git
cd claude-code-nt8-bridge/server
npm install
cp .env.example .env # edit NINJATRADER_LOCAL_URL to point at your NT8 machineclaude mcp add ninjatrader \
--env NINJATRADER_MODE=local \
--env NINJATRADER_LOCAL_URL=http://10.211.55.4:7890 \
-- node /path/to/claude-code-nt8-bridge/server/src/server.jsSee examples/claude-code-setup.md for the .mcp.json alternative and verification steps.
A Claude Code session with the bridge connected:
You: Check my NinjaTrader connection and list my accounts.
Claude: (calls
nt_health_check) Connected. You have 3 accounts: Sim101 (Connected), ...You: What's MNQ trading at?
Claude: (calls
nt_quote) MNQ last 20811.75, bid 20811.25 / ask 20811.75, spread 0.5.You: Buy 1 MNQ on Sim101 with a limit 10 points below the current price.
Claude: (calls
nt_place_order) Limit order placed: Buy 1 MNQ 06-26 @ 20801.75, state: Working.
For raw HTTP testing without Claude in the loop, see examples/api-examples.sh.
The AddOn exposes an unauthenticated HTTP server on port 7890 that can read account data and place orders. Treat it accordingly:
- It is designed for local network use only — a host talking to a VM on the same machine, or machines on a trusted LAN.
- Never expose port 7890 to the internet (no port forwarding, no tunnels). Anyone who can reach the port can trade on your connected accounts.
- The Windows firewall rule created by the installer allows inbound connections on all profiles; restrict it to your subnet if your network isn't fully trusted.
- Test order endpoints against a Sim account before ever pointing tools at a funded account.
- Quotes and bars require the instrument to have an active data subscription inside NT8 — the simplest way is keeping a chart open for it.
- Order modification is implemented as cancel + recreate (the NT8 AddOn API has no suitable in-place modify).
- Market depth (L2) is not implemented.
- Starting/stopping NinjaScript strategies remotely is not supported — use the NT8 UI.
MIT — see LICENSE. You're free to use, modify, and distribute this code commercially. Attribution appreciated but not required.
Built by Roy Román — Costa Rica-based developer with 18+ years building C# financial systems for banking institutions, now focused on NinjaScript development and AI-assisted trading workflows.
- Email: royroman.dev@gmail.com
- GitHub: @royroman-dev
This project is not affiliated with NinjaTrader, LLC or Anthropic.