How to Connect Claude Code to NinjaTrader MCP: Demo-First Setup Guide

Set up NinjaTrader's official MCP beta with Claude Code or another compatible AI client. Learn the difference between Demo and Live, permission scopes, and a safe first workflow.

NinjaTrader now ships an official Model Context Protocol (MCP) beta. A supported AI client can query your account, pull market data, and place orders on your behalf. The setup is not hard. Choosing the right environment and permissions before anything touches your account is what matters.

This guide covers NinjaTrader’s official remote MCP service for Claude Code, Claude Desktop, ChatGPT, Codex, Cursor, and other compatible clients. It is separate from community-built local bridges that run a NinjaScript Add-On on your Windows PC.

Beta notice: NinjaTrader’s MCP server is in beta and is not yet generally available. Server hostnames, the tool set, and the onboarding flow may change before launch. Check NinjaTrader’s official MCP documentation before connecting a new client.

What is NinjaTrader MCP?

MCP is an open standard that lets an AI client call tools exposed by another service. NinjaTrader’s official MCP beta is a remote HTTPS server. You authorize it through OAuth in your browser. There is no local Add-On, Node server, or open port required for the official connection.

Once connected, your agent can read account balances, positions, orders, market data, historical performance, and risk settings. With the right permissions, it can also place or manage orders, change risk settings, or create alerts. What it can actually do depends on the access you approve on the consent screen.

Official MCP vs. a local NinjaScript bridge

Two very different things get called a “NinjaTrader MCP server.”

Approach Where it runs What it is for What to check first
Official NinjaTrader MCP beta NinjaTrader’s remote service Account, market data, orders, performance, and risk tools Environment and permission scopes
Community local bridge Your Windows PC with a custom Add-On Local NinjaScript files, compiler logs, or chart-specific tools Source code, port exposure, and exact capabilities

They are not interchangeable. A community bridge may help with NinjaScript development, but it is not the official account connection. Review its source code before installing it, especially if it can access NinjaTrader files, logs, orders, or credentials.

Server URLs: Demo and Live

The official MCP server hosts one environment per endpoint. Demo trades simulated money. Live trades real money. Start on Demo.

Environment MCP server URL
Demo (simulated trading) https://mcp-demo.tradovateapi.com/mcp
Live (real money) https://mcp-live.tradovateapi.com/mcp

Keep each conversation on one environment. A Demo account exists only on the Demo server. A Live account exists only on the Live server. Mixing them in one session can fail with an account-not-found error or silently target the wrong environment.

Connect Claude Code

NinjaTrader documents the Demo URL and the server name ninjatrader-demo. For Live, substitute the Live URL and use ninjatrader-live.

  1. Run this in your terminal:
claude mcp add ninjatrader-demo --transport http https://mcp-demo.tradovateapi.com/mcp
  1. Enter /mcp in Claude Code.
  2. Select ninjatrader-demo and authenticate.
  3. Complete the NinjaTrader OAuth sign-in in your desktop browser and review the permissions before approving.

Do not reuse a community configuration example, local port, or API key as though it were the official MCP setup.

Connect other AI clients

The transport is Streamable HTTP. Your client discovers the NinjaTrader authorization server automatically when it first connects.

Client Where to add the server
Claude Desktop Settings → Connectors → Add custom connector → paste the Demo URL
ChatGPT Settings → Apps → Create app (Developer Mode on) → paste the Demo URL
Codex Settings → MCP servers → Streamable HTTP → paste the Demo URL
Codex CLI codex mcp add ninjatrader-demo --url https://mcp-demo.tradovateapi.com/mcp
Cursor Settings → Cursor Settings → Tools & MCPs → add the Demo URL → Connect

Full per-client steps are in NinjaTrader’s Connect Your AI Agent guide.

Authorize: permissions and risk limits

The first connection opens NinjaTrader’s OAuth consent screen in your browser. Your AI client never sees your password.

Actions and read access. The consent screen lists what the agent can do. Start with the smallest scope that fits your goal. Read-only access covers balances, positions, orders, market data, and risk settings. Write access covers order placement, risk changes, and alerts.

Goal Typical access required Example tools
Review balances and performance Accounting: Read performance_summary, cash_history
Review open positions and orders Positions: Read, Orders: Read my_portfolio, order_history
Look up prices or contracts Prices: Read, ContractLibrary: Read market_snapshot, search_contracts
Review risk configuration Risks: Read risk_settings
Submit, modify, or cancel an order Orders: Full Access place_order, cancel_order
Change account risk settings Risks: Full Access update_risk_settings
Create price alerts Alerts: Full Access create_alert, dismiss_alert

Risk limits (optional). The consent screen also offers optional caps on how much this connection can trade: max total exposure, max traded volume per session, and per-product or per-contract limits. All four are off by default. Setting per-product or per-contract limits also acts as an allowlist. The agent can only open positions in what you listed. These limits stack with your account-level risk settings. The more restrictive cap wins.

Write tools such as place_order, modify_order, and close_position carry a destructive-action hint in the MCP protocol, so most clients pause for approval before running them. Check your client’s settings. Depending on configuration, an agent may place trades without asking on every call.

Verify the connection

Before granting write access or connecting Live, confirm the server works with a read-only prompt:

List my NinjaTrader accounts and show my current positions and working orders.

This calls the read-only my_portfolio tool. If your agent returns your Demo accounts, you are connected. Confirm the account names match what you expect.

Then try these one at a time:

  1. Show the net liquidation value, open P&L, and open positions for [Demo account name].
  2. What is the current quote and margin requirement for the front-month E-mini S&P contract?
  3. Summarize last week's Demo performance: trade count, win rate, average trade, and maximum drawdown.

If a response does not name the right environment or account, stop and fix the connection before granting more access.

When you should not give an AI order access

Keep order and risk-setting access off when you only need analysis or a performance summary. Connecting an AI to account tools does not make it a trade-management system.

An AI can misunderstand a prompt, use incomplete context, or respond after market conditions have moved. NinjaTrader’s beta documentation recommends starting on Demo, keeping risk limits in place, and monitoring account activity. Read Safety & Disclosures before connecting a Live account.

For active trading, set your native account risk limits first. When you do authorize an action, name the environment, account, instrument, quantity, and order type explicitly in plain language.

Need NinjaScript compiler access?

The official MCP does not expose local NinjaScript source files, compiler output, or open chart state. That is a different workflow.

If you want an AI to read compiler errors from your NinjaTrader logs or inspect local .cs files, you need a community local bridge such as ozmnf4/ninjatrader-mcp. That project runs a NinjaScript Add-On inside NT8 and a local Node.js MCP server on your machine (typically port 7890). It is useful for NinjaScript development. It is not the official account MCP and should be evaluated on its own security and maintenance merits.

For most coding help, pointing Cursor or Claude Code at your Documents/NinjaTrader 8/bin/Custom/ folder is enough. Use the official MCP when you want account and market-data tools. Use a local bridge when you need compiler logs or chart-specific context.

FAQ

Does the official NinjaTrader MCP require a local server or NinjaScript Add-On?

No. NinjaTrader describes its official MCP beta as a remote HTTPS service authorized through OAuth. Local Add-On-based bridges are separate community projects.

Can Claude Code place a live order through NinjaTrader MCP?

Yes, when the connection has Orders: Full Access and you connect to the Live URL. Treat that as a separate decision from connecting the service. Start in Demo and verify how Claude Code asks for approval before granting any Live order access.

Can I use Demo and Live in the same conversation?

Do not mix them. The two environments have separate endpoints and accounts. Keep each conversation on one environment and state the environment explicitly in your prompt.

How is this different from CrossTrade MCP?

CrossTrade offers a separate hosted MCP at https://app.crosstrade.io/v1/api/mcp that bridges to a CrossTrade Add-On inside NT8. It is a third-party commercial product, not NinjaTrader’s official service. Evaluate it on its own terms if you need NT8 Strategy Analyzer or Add-On-specific tools.

Official resources