Skip to main content

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

RequirementDetails
CrossTrade subscriptionElite tier.
Add-onCrossTrade Add-On v1.13.0 or newer.
NinjaTraderNT8 running and connected.
ClaudeClaude Desktop or Claude Code. Web Claude does not have local MCP.
BrowserRequired for one-time OAuth consent.

Claude Desktop setup

  1. Open Claude Desktop.
  2. Settings → Developer → Edit Config.
  3. Paste:
{
"mcpServers": {
"crosstrade": {
"url": "https://app.crosstrade.io/v1/api/mcp"
}
}
}
  1. Save and quit Claude Desktop. Reopen it.
  2. On the next message that uses CrossTrade, Claude opens a browser tab to the CrossTrade consent screen. Approve mcp:read to start.
  3. 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:

  1. Read accounts, positions, working orders, account summary, and watermarks.
  2. Restate the action with account, instrument, side, and quantity.
  3. Wait for me to type "confirm" before calling the write tool.
  4. 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

SymptomLikely causeFix
Claude does not see CrossTrade toolsConfig not saved, app not restarted, or OAuth not completed.Recheck config, quit and reopen, redo consent.
MCP requires an Elite subscriptionAccount below Elite.Upgrade.
Tools time outNT8 closed or add-on disconnected.Open NT8.
Compile errors keep repeatingModel is hallucinating a symbol.Force LookupNinjaScriptSymbol for that name.
Strategy deploys but is_trading: falseCompile or chart issue.Read GetDeployedStrategyState.errors.