1. Conduid
  2. Developer Tools
  3. Ninjatrader MCP
MCP server · Developer Tools

Ninjatrader MCP

MCP Server for NinjaTrader - Claude Code integration

Unclaimed last commit 6 months ago devtools
39Low

Scored 8 days ago · breakdown

About Ninjatrader MCP

Ninjatrader MCP is an MCP server published by ozmnf4 in the Developer Tools category: mCP Server for NinjaTrader - Claude Code integration.

The repository has 36 stars and 16 forks, with the last commit 6 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/ozmnf4/ninjatrader-mcp

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Ninjatrader MCP

Powered by Claude · Grounded in docs

I know everything about Ninjatrader MCP. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 6 days ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • !License declaredNo license file. Legally you have no right to use it in a product.
  • ✓Tests presentA test suite exists in the repository.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.

1 check has not been run yet.

README

NinjaTrader MCP Server

MCP (Model Context Protocol) server for NinjaTrader trading platform. Provides Claude Code with tools to read positions, place orders, access market data, and interact with NinjaScript indicators.

Features

  • Two Connection Modes:

    • Local: Connect to NinjaTrader Desktop running on your machine
    • Cloud: Use NinjaTrader Ecosystem API
  • Account Management: View accounts, balances, margin

  • Position Tracking: Monitor open positions

  • Order Management: Place, modify, and cancel orders

  • Market Data: Get quotes, historical bars, market depth

  • NinjaScript Access: Read indicator values, chart state (local mode only)

  • Health Check: Verify connection status

Prerequisites

  • Node.js 18+
  • NinjaTrader 8 (for local mode)
  • NinjaTrader account (for cloud mode)

Setup

1. Clone and Install

git clone https://github.com/YOUR_USERNAME/ninjatrader-mcp.git ~/ninjatrader-mcp
cd ~/ninjatrader-mcp
npm install

2. Configure Environment

cp .env.example .env

Edit .env based on your connection mode:

Local Mode (Desktop running):

NINJATRADER_MODE=local
NINJATRADER_LOCAL_URL=http://localhost:7890

Cloud Mode (Ecosystem API):

NINJATRADER_MODE=cloud
NINJATRADER_API_KEY=your_api_key_here

3. For Local Mode - Install NinjaTrader Add-On

You need a NinjaScript Add-On running on NinjaTrader Desktop that exposes an HTTP server. See NinjaTrader Add-On Development for details.

4. Test Connection

node src/server.js --test

5. Add to Claude Code

Add to ~/.claude/.mcp.json:

{
  "mcpServers": {
    "ninjatrader": {
      "command": "node",
      "args": ["/Users/YOUR_USERNAME/ninjatrader-mcp/src/server.js"]
    }
  }
}

Replace YOUR_USERNAME with your actual username.

6. Restart Claude Code

# Restart Claude Code, then ask:
# "Use nt_health_check to verify NinjaTrader is connected"

Available Tools

Account (Both Modes)

  • nt_accounts - List all trading accounts
  • nt_account_info - Get account details
  • nt_account_balance - Get balance and margin

Positions (Both Modes)

  • nt_positions - List all open positions
  • nt_position - Get specific position

Orders (Both Modes)

  • nt_orders - List orders
  • nt_place_order - Place new order
  • nt_modify_order - Modify existing order
  • nt_cancel_order - Cancel specific order
  • nt_cancel_all_orders - Cancel all orders

Market Data (Both Modes)

  • nt_quote - Get current quote
  • nt_historical_bars - Get historical OHLCV data
  • nt_market_depth - Get order book
  • nt_search_instruments - Search instruments

NinjaScript (Local Mode Only)

  • nt_indicator_values - Read custom indicator values from chart
  • nt_chart_state - Get current chart symbol/timeframe
  • nt_execute_strategy - Trigger a NinjaScript strategy

Utility

  • nt_health_check - Verify connection

Usage Examples

Check Your Positions

Use nt_positions to show my current futures positions

Place an Order

Use nt_place_order to buy 1 ES contract at market

Get Historical Data

Use nt_historical_bars to get 100 bars of 5-minute ES data

Read an Indicator (Local Mode)

What's the current RSI value on my ES chart?
Use nt_indicator_values with symbol "ES" and indicatorName "RSI"

Get Chart State (Local Mode)

What's currently displayed on my chart?
Use nt_chart_state

Connection Modes Explained

Local Mode

Connects directly to NinjaTrader Desktop running on your machine via a local HTTP server (default port 7890).

Pros:

  • Access to NinjaScript indicators
  • Real-time chart data
  • Execute strategies

Requirements:

  • NinjaTrader 8 running
  • NinjaScript Add-On installed and running
  • Local server accessible at localhost:7890

Cloud Mode

Uses NinjaTrader's Ecosystem API for cloud-based access.

Pros:

  • No local software required
  • Access from anywhere
  • Works with multiple devices

Requirements:

  • NinjaTrader Ecosystem account
  • API key from NinjaTrader developer portal

Troubleshooting

Local Mode

"Connection refused"

  • Ensure NinjaTrader Desktop is running
  • Verify the Add-On server is started in NinjaTrader
  • Check NINJATRADER_LOCAL_URL in .env

"Indicator values not available"

  • This feature is only available in local mode
  • Verify NinjaTrader Desktop is running with the chart open

Cloud Mode

"Authentication failed"

  • Verify your API key is correct
  • Check API key has necessary permissions

"No accounts found"

  • Verify your NinjaTrader account is linked to the Ecosystem
  • Check account is active

Architecture

Claude Code  ←→  MCP Server (stdio)  ←→  Tradovate API
                              ↓
                        Local Mode:
                        NinjaTrader Desktop (port 7890)
                        
                        Cloud Mode:
                        NinjaTrader Ecosystem API

Security Notes

  • Never commit your .env file
  • Keep API keys secure
  • Local mode exposes localhost:7890 (only local access)

Comparison: Tradovate vs NinjaTrader MCP

Feature Tradovate NinjaTrader
Official API ✅ Yes ✅ Yes
Local Desktop Access ❌ No ✅ Yes
Indicator Access ❌ No ✅ Yes
Strategy Execution Via API ✅ Yes
Chart Control ❌ No ✅ Yes
WebSocket ✅ Yes ✅ Yes
Market Data ✅ Yes ✅ Yes
Order Management ✅ Yes ✅ Yes

License

MIT

README fetched from the repository 6 days ago. The original is authoritative.

Questions

About Ninjatrader MCP

How do I install Ninjatrader MCP?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Ninjatrader MCP safe to use with an AI agent?

Its trust score is 39 out of 100 (low). It passes 4 of the 5 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Ninjatrader MCP still maintained?

The last commit was 6 months ago. That's long enough that you should check whether the maintainer is responding to issues before depending on it.