Skip to main content

How to Connect Zed to NinjaTrader 8 with CrossTrade MCP

Zed is a fast Rust-based editor with a built-in AI panel. Zed calls MCP servers 'context servers' in its config — important detail because pasting an mcpServers block from another tool will silently fail to register. Zed prompts for OAuth automatically when the Authorization header is omitted.

OAuth scope: mcp:tradeMulti-model harness

Prerequisites

RequirementDetail
CrossTrade subscriptionElite
CrossTrade Add-Onv1.13.0 or higher
NinjaTrader 8Running, broker connected
AccountSim101 for first runs
OAuth scopemcp:trade
Config file~/.config/zed/settings.json
CrossTrade MCP server
https://app.crosstrade.io/v1/api/mcp
Transport: streamable-http. Auth: OAuth 2.1 + PKCE. Request scope mcp:trade. Read plus write. Place/cancel orders, deploy strategies, compile NinjaScript.

Step 1: Register CrossTrade as a context server

Open ~/.config/zed/settings.json (or run the agent: open settings command) and add:

{
"context_servers": {
"crosstrade": {
"url": "https://app.crosstrade.io/v1/api/mcp"
}
}
}
Key name is context_servers, not mcpServers

Zed uses context_servers (snake_case). Pasting mcpServers from a Cursor/Cline/Claude Desktop config will silently fail — Zed simply won't see the server.

For a pre-issued bearer token instead of OAuth:

{
"context_servers": {
"crosstrade": {
"url": "https://app.crosstrade.io/v1/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}

Restart Zed.

Step 2: OAuth (omit Authorization header to trigger)

Per Zed's docs: "When a remote MCP server has no configured 'Authorization' header, Zed will prompt you to authenticate yourself against the MCP server using the standard MCP OAuth flow."

So if you want browser OAuth, leave the headers block out entirely.

Step 3: Open the Assistant

Cmd/Ctrl+? (or whichever shortcut your Zed maps to the Assistant). CrossTrade tools appear in the available tool list.

Step 4: First read-only

Confirm CrossTrade MCP is connected. List my accounts and summarize open
positions. Read-only.

Step 5: NinjaScript work

Same compile loop as Cursor. Zed's smaller footprint makes it pleasant for quick agent sessions over a NinjaScript file without booting a heavier IDE.

FAQ

What about the Zed extension registry?

Zed distinguishes "Extensions" (pre-packaged MCP servers from the Zed extension registry) from "Custom Servers" (manual JSON config). Both share the context_servers block — extensions are configured via UI, custom remote ones via the JSON above.

Plan requirements?

Zed Personal is free with 2,000 accepted edit predictions/month. Pro is $10/mo. Business is $30/seat/mo. BYOK is fully supported on free tier — you can bring API keys for any provider.

OAuth handshake

The first tool call surfaces an authorization URL. Open it in a browser, approve mcp:trade, 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.

If you authorized mcp:trade, also confirm Sim101 is the default account before any order placement.

Funded-account safety
The mcp:trade scope grants order placement. The scope does not protect a funded account; your prompt and account selection do. Default to Sim101 during setup. For funded accounts, verify the firm's automation policy first.

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
Zed shows no MCP toolsUsed mcpServers as the top-level keyRename the top-level key to context_servers — Zed uses this naming exclusively
OAuth prompt never appearsAuthorization header was set, so Zed assumes static authRemove the Authorization header to trigger Zed's OAuth prompt