Skip to main content

How to Connect AnythingLLM to NinjaTrader 8 with CrossTrade MCP

AnythingLLM combines a document RAG layer with agent tooling. Pair with CrossTrade MCP to ask questions that span your local docs (trade rules, broker statements) and live NT8 state. Uses type: 'streamable' (not streamable-http or streamableHttp). No native OAuth, use a bearer token in headers.

OAuth scope: mcp:readMulti-model harness

Prerequisites

RequirementDetail
CrossTrade subscriptionElite
CrossTrade Add-Onv1.13.0 or higher
NinjaTrader 8Running, broker connected
AccountSim101 for first runs
OAuth scopemcp:read
Config file${STORAGE}/plugins/anythingllm_mcp_servers.json (Docker) or ~/Library/Application Support/anythingllm-desktop/storage/plugins/anythingllm_mcp_servers.json (macOS Desktop)
CrossTrade MCP server
https://app.crosstrade.io/v1/api/mcp
Transport: streamable-http. Auth: OAuth 2.1 + PKCE. Request scope mcp:read. Read-only. Inspect accounts, orders, positions, journal, NinjaScript.

Step 1: Install AnythingLLM

Desktop or Docker. See anythingllm.com.

Docker:

docker pull mintplexlabs/anythingllm:latest
# See the official "How to Use Docker" guide for the full docker run with STORAGE_LOCATION mount

Default app port: 3001. Open http://localhost:3001.

Step 2: Add CrossTrade MCP

The MCP config lives in a JSON file (not the UI). File location:

  • Desktop (macOS): ~/Library/Application Support/anythingllm-desktop/storage/plugins/anythingllm_mcp_servers.json
  • Docker: ${STORAGE_LOCATION}/plugins/anythingllm_mcp_servers.json (e.g. /opt/anythingllm/storage/plugins/anythingllm_mcp_servers.json)

The file is auto-created when you first open the Agent Skills page.

{
"mcpServers": {
"crosstrade": {
"type": "streamable",
"url": "https://app.crosstrade.io/v1/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
},
"anythingllm": {
"autoStart": true
}
}
}
}
type is "streamable"

AnythingLLM uses "type": "streamable" for Streamable HTTP. Other tools use streamable-http, streamableHttp, http, or remote. Don't copy from other configs.

If you omit type entirely with a url, AnythingLLM defaults to SSE.

Step 3: Get a bearer token

AnythingLLM's MCP client doesn't support OAuth. To get a token:

  1. Authorize CrossTrade via Claude Desktop, Cursor, OpenCode, or any OAuth-capable client.
  2. Copy the issued token from your AI Clients page.
  3. Paste in the JSON above.

Step 4: Workspace pattern

Create a workspace that combines your trade rules, broker statements, and prop firm rule PDFs. Then:

Compare the current state in CrossTrade (open positions, watermarks) against my
trade rules PDF in this workspace. Am I in violation of any rule? Read-only;
don't act.

AnythingLLM joins the RAG context with the live tool calls.

Multi-user caveat

AnythingLLM stores MCP server config at the instance/global level. Tools registered via MCP are exposed to any workspace/agent in that instance. There is no per-user MCP credential scoping — users in a multi-user Docker deployment share whatever credentials the admin put in the JSON. If you need per-user isolation, LibreChat is the better fit.

FAQ

Free?

Yes — MIT-licensed.

Anythingllm-specific JSON keys?

"anythingllm": { "autoStart": false } to prevent auto-launch of a configured server.

OAuth handshake

The first tool call surfaces an authorization URL. Open it in a browser, approve mcp:read, and return to the harness. The access token is stored by the harness (keychain, config file, or memory depending on the client).

See CrossTrade MCP OAuth for the full flow, and 403/408 troubleshooting if the handshake fails.

Verify the connection

Smoke-test before doing anything stateful:

Call GetMcpCapabilities and McpSelfTest. Then ListAccounts and GetConnections.
Report add-on version, NT8 version, and which accounts are linked.
Read-only scope
You authorized mcp:read. The agent can inspect state but cannot place orders, deploy strategies, or write NinjaScript files.

Troubleshooting

SymptomLikely causeFix
403 insufficient_scopeToken authorized at mcp:read but tool requires mcp:tradeReauthorize the connection and select mcp:trade
OAuth callback failsSystem browser blocked the redirect or popupCopy the auth URL manually, complete it, paste the code back
Tools list is empty after connectServer registered but session did not refreshRestart the harness or trigger a tool list refresh
Add-on offline errorNT8 not running, or add-on not loadedConfirm NT8 is open and the CrossTrade add-on (v1.13.0+) is installed
type: "streamable-http" or "streamableHttp" rejectedAnythingLLM uses type: "streamable" — different from other toolsUse type: "streamable" (or omit type; default for url is SSE)
JSON file disappears on restartSTORAGE_LOCATION volume not properly mounted in DockerConfirm the storage volume mount before editing the JSON; otherwise file is regenerated empty
Cannot mix command and urlAnythingLLM rejects entries with both stdio and remote shapePick stdio (command) OR remote (url), not both
No OAuth flowAnythingLLM's MCP client supports bearer tokens via headers onlyObtain a token via another OAuth-capable client and paste in headers