NinjaTrader MCP Server

Reads and trades NinjaTrader 8 accounts, positions, orders and market data over MCP

By ozmnf4 (individual) JavaScript Local · stdio Finance and payments

19 popularity score ★ 36

Connect your client

Local (from source)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

FirstTerminal
git clone https://github.com/ozmnf4/ninjatrader-mcp.git
cd ninjatrader-mcp
npm install
Claude CodeTerminal
claude mcp add ninjatrader -- node '<ABSOLUTE_PATH_TO_CLONE>/src/server.js'
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "ninjatrader": {
      "command": "node",
      "args": [
        "<ABSOLUTE_PATH_TO_CLONE>/src/server.js"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "ninjatrader": {
      "command": "node",
      "args": [
        "<ABSOLUTE_PATH_TO_CLONE>/src/server.js"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "ninjatrader": {
      "type": "stdio",
      "command": "node",
      "args": [
        "<ABSOLUTE_PATH_TO_CLONE>/src/server.js"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.ninjatrader]
command = "node"
args = ["<ABSOLUTE_PATH_TO_CLONE>/src/server.js"]
Gemini CLITerminal
gemini mcp add --scope user ninjatrader node -- '<ABSOLUTE_PATH_TO_CLONE>/src/server.js'

Settings 3

NINJATRADER_MODE Optional: local (default, NinjaTrader Desktop Add-On) or cloud (Ecosystem API).
NINJATRADER_LOCAL_URL Optional: Address of the local Add-On HTTP server; default http://localhost:7890.
NINJATRADER_API_KEY Optional: NinjaTrader Ecosystem API key; needed in cloud mode only.

What it does

A small Node.js stdio server that puts a NinjaTrader 8 account in reach of an MCP client. Its 18 tools list accounts, balances and margin, show open positions, place, change and cancel orders, fetch quotes, historical bars, order-book depth and instrument searches, and in local mode read indicator values and chart state or start a NinjaScript strategy.

It has two modes, chosen with NINJATRADER_MODE. Local mode, the default, sends plain HTTP requests to an endpoint on the same machine (http://localhost:7890 unless NINJATRADER_LOCAL_URL says otherwise) that a NinjaScript Add-On inside NinjaTrader Desktop is expected to serve. Cloud mode sends requests to https://api.ninjatrader.com with NINJATRADER_API_KEY as a bearer token.

The repository does not ship that Add-On: it holds only src/server.js, src/api.js, the README, a setup guide and a TODO list, and the README points to NinjaTrader's developer portal for building one. The server is a hand-written JSON-RPC loop announcing protocol 2024-11-05 and version 1.0.0, with no published package; it runs from a clone. In src/api.js the cloud sign-in is marked as a placeholder ("Actual auth flow depends on NinjaTrader's Ecosystem API"), and the bearer token is only set when nt_health_check runs, so cloud calls made before a health check go out without a valid token.

What it needs

RuntimeNode.js 18+

Node.js 18 or later and a clone of the repository with npm install run in it. Local mode: NinjaTrader 8 Desktop running (Windows) with a NinjaScript Add-On that serves the HTTP endpoints the server calls on port 7890; you must supply or build that Add-On yourself. Cloud mode: a NinjaTrader Ecosystem account and an API key from the NinjaTrader developer portal.

Limits

nt_indicator_values, nt_chart_state and nt_execute_strategy return an error outside local mode. The Add-On local mode depends on is not included, and the repository's own TODO.md (2026-04-05) still lists the NinjaTrader connection test as pending. Cloud sign-in is a stub that passes the API key straight through as a bearer token, and only after nt_health_check has run. Settings are read with dotenv from a .env file in the working directory, which is usually not the clone when a client starts it, so pass them as environment variables in the client config. Local requests time out after 10 seconds; nt_historical_bars returns 100 bars of interval 1 by default.

Who it suits

Suits a NinjaTrader 8 user comfortable with NinjaScript who already runs, or will write, a local Add-On exposing an HTTP API and wants an assistant to read positions and place orders through it. Since its tools can place and cancel real orders, try it on a simulation account first. Anyone wanting something that works without writing their own bridge should look elsewhere: we also hold an official NinjaTrader entry (official-ninjatrader-mcp, published by nt-ninjatrader) and another community ninjatrader-mcp by anfs-pain.

Tools 18

nt_accounts
List the trading accounts available
nt_account_info
Show details for one account
nt_account_balance
Show an account's balance and margin
nt_positions
List open positions
nt_position
Show the position in one instrument
nt_orders
List orders, optionally filtered by account or status
nt_place_order
Send a market, limit, stop or stop-limit buy or sell order
nt_modify_order
Change the quantity or prices of an existing order
nt_cancel_order
Cancel one order by id
nt_cancel_all_orders
Cancel every open order, optionally for one account
nt_quote
Get the current quote for an instrument
nt_historical_bars
Fetch historical OHLCV bars (100 bars at interval 1 by default)
nt_market_depth
Get the order book for an instrument
nt_search_instruments
Search for tradable instruments
nt_indicator_values
Read values of an indicator on a chart (local mode only)
nt_chart_state
Report the chart's symbol, timeframe and indicators (local mode only)
nt_execute_strategy
Start a named NinjaScript strategy with parameters (local mode only)
nt_health_check
Check the connection and list accounts; also sets the cloud token

Similar servers