Home Connecting Your AI Client Connecting Claude Code

Connecting Claude Code

Last updated on Jul 25, 2026

Claude Code — Anthropic's command-line coding agent — is an MCP client, so it can connect to your MetaTrader terminal through MTContext and pull live prices, account state, and (when you choose) place trades, right from your terminal or IDE. Setup is a single command.

This assumes you've subscribed, installed the EA, and your terminal shows connected. If not, start with Installing the EA on MT5.

Get your endpoint and key

From your MTContext dashboard, copy your MCP endpoint URL (https://mcp.mtcontext.com/mcp/v1) and your license key. You'll pass both to Claude Code.

Add MTContext with one command

MTContext is an HTTP MCP server, so add it with the HTTP transport and an Authorization header:

claude mcp add --transport http mtcontext https://mcp.mtcontext.com/mcp/v1 \
  --header "Authorization: Bearer YOUR_LICENSE_KEY"

Replace YOUR_LICENSE_KEY with your real key. Add --scope user if you want MTContext available across all your projects rather than just the current one.

Verify it's registered

List your MCP servers and confirm MTContext connected:

claude mcp list

You should see mtcontext with a connected status. Inside a Claude Code session, you can also run /mcp to see it and its tools.

Confirm it works

In a Claude Code session, ask a read-only question:

"Using MTContext, what's my current account balance and open positions?"

A live answer means you're connected — and read-only requests never touch your account.

Troubleshooting

  • Not connected in claude mcp list — re-check the URL and that the Authorization header includes Bearer before the key.

  • "No terminal connected" — the terminal is offline; confirm the EA is attached and connected.

  • Auth error — the key is wrong or expired; re-copy it from the dashboard.

Next steps

See Checking prices, bars, and account state for what to ask, and Placing trades safely with dry_run before enabling trades.

Start free at mtcontext.com · full reference in the documentation.