How to Connect Claude to NinjaTrader 8
Claude was the original MCP client, and its desktop and CLI apps remain the most reliable MCP environments today. If you trade NinjaTrader 8 on Windows, the simplest path to an AI agent that actually understands your account is Claude plus CrossTrade MCP.
This page covers Claude Desktop, Claude Code, and the workflows that make them worth the setup time.
Why Claude users care about MCP
Anthropic introduced MCP as a standard way for AI assistants to talk to external systems. Claude was designed around it. The result is that Claude can discover and call CrossTrade's tools natively, and that the tool calls feel native instead of bolted on. The same protocol now reaches NinjaTrader 8 through CrossTrade's hosted server.
The benefit, in practice:
- One URL. No local MCP server to maintain.
- OAuth-based auth, with scopes you control.
- The full CrossTrade tool surface: accounts, journal, webhook signals, copier activity, NinjaScript, Strategy Analyzer.
Requirements
| Requirement | Details |
|---|---|
| CrossTrade subscription | Elite tier. |
| Add-on | CrossTrade Add-On v1.13.0 or newer. |
| NinjaTrader | NT8 running and connected. |
| Claude | Claude Desktop or Claude Code. Web Claude does not have local MCP. |
| Browser | Required for one-time OAuth consent. |
Claude Desktop setup
- Open Claude Desktop.
- Settings → Developer → Edit Config.
- Paste:
{
"mcpServers": {
"crosstrade": {
"url": "https://app.crosstrade.io/v1/api/mcp"
}
}
}
- Save and quit Claude Desktop. Reopen it.
- On the next message that uses CrossTrade, Claude opens a browser tab to the CrossTrade consent screen. Approve
mcp:readto start. - Verify with:
Call GetMcpCapabilities and McpSelfTest. Tell me the add-on version, NT8 version, backtest engine availability, and feature flags.
Claude Code setup
claude mcp add --transport http crosstrade https://app.crosstrade.io/v1/api/mcp
On the first tool call, Claude Code prints a URL. Open it, approve the scope, and you are in.
When to use Claude Desktop vs Claude Code:
- Claude Desktop: interactive trading sessions, journal review, conversational debugging, anything where the conversation is the primary artifact.
- Claude Code: NinjaScript work, repository-style sessions where you also edit local files, larger backtest scripts, anything you want under version control.
First read-only prompts
Build trust before you grant write scope.
Risk brief
For Sim101, give me a risk brief: ListAccounts, GetConnections, ListPositions, ListOrders, GetAccountSummary, and GetWatermarks. Report what is open, what is working, and the day's realized P&L. Do not place anything.
Journal analysis
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. Do not expose the account number in the summary.
Webhook audit
Pull the TradingView webhook signal history for the last 24 hours on Sim101. For each signal, list intended action, mapped order, and outcome. Flag any that did not fill and the likely cause.
Trade copier diagnosis
For APEX1234 and APEX1235 between 14:30 and 14:35 today, pull GetActivityLog. Reconstruct the timeline event by event. Explain why APEX1235 did not match APEX1234's fill.
NinjaScript workflow
Claude Code is excellent at the compile loop. A representative prompt:
Write a NinjaScript strategy for MES called MyEmaCross. Long when 9-EMA crosses above 21-EMA, ATR-based trailing stop, max two trades per session, no averaging down. Before writing, call GetNinjaScriptHelp on EMA, ATR, and CrossAbove. Then write the source, CompileNinjaScript(in_memory: true). If compile fails, look up the symbols and fix. Only WriteNinjaScriptFile after compile is green. Do not deploy or run a backtest unless I say so.
Claude will sequence the tool calls. You watch the conversation and decide when to upgrade from compile to file write to backtest to deploy.
Safety prompts
These are good to include in the system prompt when running with mcp:trade.
Universal trade-enabled prompt
You have mcp:trade. Before any PlaceOrder, CancelOrder, FlattenEverything, DeployStrategy, or WriteNinjaScriptFile, you must:
- Read accounts, positions, working orders, account summary, and watermarks.
- Restate the action with account, instrument, side, and quantity.
- Wait for me to type "confirm" before calling the write tool.
- Refuse if any read fails.
Funded account prompt
I am trading a funded evaluation. Do not place an order or deploy unless you have verified open positions, working orders, account summary, watermarks, and computed remaining daily loss room against $1,500 trailing drawdown. If room is below $150, refuse new trades. Do not run experiments on this account.
Read-only assistant prompt
You have mcp:read only. You may inspect, summarize, and explain. Do not attempt any write tool. If I ask you to place, cancel, flatten, deploy, or write, refuse and remind me that the token is read-only.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Claude does not see CrossTrade tools | Config not saved, app not restarted, or OAuth not completed. | Recheck config, quit and reopen, redo consent. |
MCP requires an Elite subscription | Account below Elite. | Upgrade. |
| Tools time out | NT8 closed or add-on disconnected. | Open NT8. |
| Compile errors keep repeating | Model is hallucinating a symbol. | Force LookupNinjaScriptSymbol for that name. |
Strategy deploys but is_trading: false | Compile or chart issue. | Read GetDeployedStrategyState.errors. |