Skip to main content

How to Use Cline with NinjaTrader 8 and CrossTrade MCP

Cline is an open AI coding assistant that supports MCP. With CrossTrade MCP registered, Cline can inspect your NinjaTrader 8 account, draft NinjaScript that compiles against your install, and run Strategy Analyzer backtests.

Prerequisites

RequirementDetail
CrossTrade subscriptionElite
CrossTrade Add-Onv1.13.0 or higher
NinjaTrader 8Running
ClineLatest version with MCP support
Scopemcp:read to start; mcp:trade for compile and backtest
AccountSim101
Start read-only

Authenticate with mcp:read for the first session. Use Sim101 for any compile or backtest work.

Step 1: Add the CrossTrade MCP server in Cline

Open Cline's MCP configuration. Paste the standard config:

{
"mcpServers": {
"crosstrade": {
"url": "https://app.crosstrade.io/v1/api/mcp"
}
}
}

Save. On the next tool call, Cline opens a browser tab for OAuth consent. Approve the scope.

Step 2: Verify the connection

Use read-only tools only. Confirm CrossTrade MCP is connected and NinjaTrader 8
is reachable through the add-on. List my accounts.

The agent should report add-on version, NT8 version, and the account list.

Step 3: First read-only workflow

Run a journal review:

Pull the last 20 closed trades on Sim101. Group by instrument and side. Report
win rate, average win, average loss, and the three biggest losers.

Step 4: NinjaScript compile loop (mcp:trade)

If you reauthorize at mcp:trade, Cline can run the full compile loop. The pattern is the same as Claude Code:

  1. GetNinjaScriptHelp on every NT8 type and method you plan to use.
  2. Draft the source.
  3. CompileNinjaScript(in_memory: true).
  4. On failure, LookupNinjaScriptSymbol and repair.
  5. WriteNinjaScriptFile after confirmation.
  6. RunStrategyBacktest on Sim101 with realistic commission and slippage.

See How to Vibe Code a NinjaScript Strategy for the full sequence.

Troubleshooting

SymptomFix
Tools missingReload MCP servers in Cline; redo OAuth
401 unauthorizedReauthorize from CrossTrade AI Clients
403 Elite requiredUpgrade
408 timeoutOpen NT8; verify add-on connected