NinjaTrader

v1.0.0Finance & Fintechstable

MCP Server for NinjaTrader - Claude Code integration

ninjatradermcpai-integration
Share:
11
Stars
0
Downloads
0
Weekly
0/5

What is NinjaTrader?

NinjaTrader is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for ninjatrader - claude code integration

MCP Server for NinjaTrader - Claude Code integration

This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • MCP Server for NinjaTrader - Claude Code integration

Use Cases

Access NinjaTrader trading platform features through Claude Code.
Analyze market data and automate trading workflows.
ozmnf4

Maintainer

LicenseMIT
Languagejavascript
Versionv1.0.0
UpdatedMay 16, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx ninjatrader

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use NinjaTrader

The NinjaTrader MCP server bridges Claude Code and NinjaTrader 8, exposing account management, position tracking, order operations, and real-time market data tools through the MCP protocol. It supports both a local mode (connecting directly to a running NinjaTrader 8 instance on localhost) and a cloud mode (using NinjaTrader's remote API with an API key), making it suitable for both desktop traders and automated trading workflows.

Prerequisites

  • Node.js 18 or higher installed
  • NinjaTrader 8 installed and licensed (for local mode) OR a NinjaTrader cloud account with API access (for cloud mode)
  • Git installed to clone the repository
  • An MCP-compatible client such as Claude Desktop or Claude Code CLI
1

Clone the repository

Clone the ninjatrader-mcp repository from GitHub and navigate into it.

git clone https://github.com/ozmnf4/ninjatrader-mcp.git ~/ninjatrader-mcp
cd ~/ninjatrader-mcp
2

Install dependencies

Install the required Node.js packages using npm.

npm install
3

Configure environment variables

Set the connection mode and endpoint. For local mode, point to your running NinjaTrader 8 instance. For cloud mode, provide your API key instead.

# Local mode
export NINJATRADER_MODE=local
export NINJATRADER_LOCAL_URL=http://localhost:7890

# Cloud mode
export NINJATRADER_MODE=cloud
export NINJATRADER_API_KEY=your_api_key_here
4

Add to Claude Desktop configuration

Register the server in your Claude Desktop config file, passing the environment variables inline.

{
  "mcpServers": {
    "ninjatrader": {
      "command": "node",
      "args": ["/Users/you/ninjatrader-mcp/index.js"],
      "env": {
        "NINJATRADER_MODE": "local",
        "NINJATRADER_LOCAL_URL": "http://localhost:7890"
      }
    }
  }
}
5

Start NinjaTrader 8 (local mode)

Launch NinjaTrader 8 on your machine and ensure the local server or connection adapter is running on port 7890 before starting the MCP server.

6

Verify connection with health check

Ask Claude to call the nt_health_check tool to confirm the MCP server can reach NinjaTrader.

NinjaTrader Examples

Client configuration

Claude Desktop config for NinjaTrader MCP in local mode.

{
  "mcpServers": {
    "ninjatrader": {
      "command": "node",
      "args": ["/Users/you/ninjatrader-mcp/index.js"],
      "env": {
        "NINJATRADER_MODE": "local",
        "NINJATRADER_LOCAL_URL": "http://localhost:7890"
      }
    }
  }
}

Prompts to try

Example prompts that exercise the NinjaTrader tools.

- "Show my current account balance and open positions"
- "Get the last 100 five-minute bars for ES (E-mini S&P 500)"
- "What is the current bid/ask and market depth for NQ?"
- "Place a market order to buy 1 ES contract"
- "Cancel all open orders on my account"
- "What is the current RSI value on my ES chart?"

Troubleshooting NinjaTrader

Connection refused when using local mode

Confirm NinjaTrader 8 is open and the local connection adapter is enabled and listening on port 7890. Check your firewall settings to ensure the port is not blocked by Windows Defender or another security tool.

API key authentication fails in cloud mode

Log into your NinjaTrader cloud account portal to verify the API key is active and has not expired. Regenerate the key if needed and update the NINJATRADER_API_KEY environment variable.

NinjaScript tools (nt_indicator_values, nt_chart_state) return errors

These tools are only available in local mode with an active NinjaTrader 8 chart open. Ensure you have a chart running with the relevant instrument before calling these tools.

Frequently Asked Questions about NinjaTrader

What is NinjaTrader?

NinjaTrader is a Model Context Protocol (MCP) server that mcp server for ninjatrader - claude code integration It connects AI assistants to external tools and data sources through a standardized interface.

How do I install NinjaTrader?

Follow the installation instructions on the NinjaTrader GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with NinjaTrader?

NinjaTrader works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is NinjaTrader free to use?

Yes, NinjaTrader is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Finance & Fintech MCP Servers

Explore all finance & fintech servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "ninjatrader": { "command": "npx", "args": ["-y", "ninjatrader"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use NinjaTrader?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides