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
| Requirement | Detail |
|---|---|
| CrossTrade subscription | Elite |
| CrossTrade Add-On | v1.13.0 or higher |
| NinjaTrader 8 | Running |
| Cline | Latest version with MCP support |
| Scope | mcp:read to start; mcp:trade for compile and backtest |
| Account | Sim101 |
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:
GetNinjaScriptHelpon every NT8 type and method you plan to use.- Draft the source.
CompileNinjaScript(in_memory: true).- On failure,
LookupNinjaScriptSymboland repair. WriteNinjaScriptFileafter confirmation.RunStrategyBackteston Sim101 with realistic commission and slippage.
See How to Vibe Code a NinjaScript Strategy for the full sequence.
Troubleshooting
| Symptom | Fix |
|---|---|
| Tools missing | Reload MCP servers in Cline; redo OAuth |
| 401 unauthorized | Reauthorize from CrossTrade AI Clients |
| 403 Elite required | Upgrade |
| 408 timeout | Open NT8; verify add-on connected |