MetaTrader 5 × Claude AI — Instant Setup

MetaTrader 5 × Claude AI — Trade in plain English, no coding required

Connect Claude AI directly to your MT5 account · Natural language commands · 1-click setup · Zero terminal commands

6 roadblocks between you and AI Trading

It's not that AI is hard. It's the gap between traders and coders — too wide. Each roadblock alone is enough to make you quit:

🐍 #1 — Install Python

Which version? 32 or 64-bit? What does "Add to PATH" even mean?

📦 #2 — pip install

Terminal shows red text. No clue what the error says.

📝 #3 — Edit JSON

One missing comma → Claude refuses to start.

🔑 #4 — Enter credentials

Trader or Investor password? Is the server name spelled right?

🔌 #5 — Connection failed

Where's the error? Guessing blind, no diagnostic tool.

🧠 #6 — The /trading skill

Copy SKILL.md into which folder, exactly?

Code2trade wraps everything into one setup.bat file

We automated all 6 roadblocks above into a single file. You double-click setup.bat, it handles everything — you only enter 3 pieces of MT5 account info in one window, click Test → Install. Done.

😩 Manual way — hours of headache
  • Visit python.org, download Python 3.12
  • Install, remember to tick "Add to PATH"
  • Open CMD, run pip install metatrader-mcp-server
  • Find claude_desktop_config.json
  • Hand-write JSON config — exact commas & brackets
  • Copy the trading skill folder into %APPDATA%\Claude\skills
  • Restart Claude, hope it works
  • Errors → Google → retry → still errors
🚀 With Code2trade — instant
  • Step 1: Double-click setup.bat
  • Step 2: Wait 1-2 minutes (Python & package auto-installed)
  • Step 3: Enter Login / Password / Server → Test → Install
  • Step 4: Open Claude Code, type /trading
✓ Auto-installs Python (via winget)
✓ Auto-installs MetaTrader MCP package
✓ Auto-registers MCP server with Claude Code
✓ Auto-copies the /trading skill to the right folder
✓ Built-in Test Connection button before install
🔒 Security — No middleman server Everything runs locally on your machine. Code2trade does not store, see, or transmit your MT5 credentials anywhere. Your password is saved in the Claude Code config file (same standard mechanism as any local STDIO MCP server). For maximum safety: use a demo account when starting out, or create a separate trader password just for AI use.

5 steps from download to your first command

Follow in order. Total time: ~3 minutes.

1

Prepare MetaTrader 5

Open MT5 and log into your account (demo or real, your choice).

Go to Tools → Options → Expert Advisors, tick the box "Allow algorithmic trading" → OK. This is mandatory — without it, the AI can't place orders.

2

Extract the package & run setup.bat

Download MetaTraderMCP-Setup.rar from the button below, extract it to any folder.

Enter the extracted folder → Double-click setup.bat. If Windows shows a SmartScreen warning, click "More info" → "Run anyway". A black window appears and automatically does:

[1/4] Checking Claude Code... OK [2/4] Checking Python... OK (Python 3.12) [3/4] Installing metatrader-mcp-server OK [4/4] Launching credential setup window...

Note: If Python isn't installed, the script auto-installs it via winget (1-2 minutes). No Claude Code yet? Install from claude.com/code and re-run.

3

Enter your MT5 account in the Setup window

A small window pops up asking for 3 things — the same 3 you use to log into MT5:

  • MT5 Login — account number (e.g. 12345678)
  • MT5 Password — your Trader password (not the Investor one)
  • MT5 Server — your broker's server name (e.g. Exness-MT5Trial7, MetaQuotes-Demo)

How to find it: In MT5, look at the bottom-right status bar. You'll see something like 12345678: Exness-Demo — the part before the colon is Login, the part after is Server.

👉 Click "Test Connection" first. If it shows "Connected. Balance: ..." you're good. Then click "Install" to register the MCP with Claude Code.

4

Open Claude Code & type /trading

When you see "Setup complete!", close the installer. Two ways to open Claude Code:

  • Option 1 — Via Claude Desktop: Open the Claude Desktop app, click the Claude Code tab in the sidebar — no commands needed.
  • Option 2 — Via Terminal: Open a new Command Prompt or PowerShell window, then run:
claude

Once Claude Code is running, type /trading and hit Enter to activate the trading skill. Now Claude "knows" how to operate your MT5.

5

Trade in plain English — AI executes instantly

From now on, just talk to Claude like a personal trading assistant. A few commands to try right away:

› Check my account balance
→ AI calls get_account_info, prints Balance / Equity / Margin / Leverage.
› What's the current XAUUSD price?
→ AI returns realtime Bid / Ask / Spread.
› BUY 0.01 lot EURUSD, SL 1.0800, TP 1.0950
→ AI places a market order, then calls modify_position to attach SL/TP.
› Close all losing positions
→ AI calls close_all_losing_positions, reports results.
› Give me 50 H1 candles of BTCUSD
→ AI calls get_candles_latest, presents the OHLC table.

What can the AI do after setup?

Over 25 MT5 operations unlocked — full coverage from analysis to execution:

💼 Account management

Check balance, equity, profit, margin, free margin, leverage, account type (Demo/Real).

📊 Market data

Realtime prices, symbol list, OHLCV candles across timeframes (M1 → MN1), historical data.

⚡ Instant execution

Market BUY/SELL orders, pending LIMIT/STOP orders. AI auto-detects LIMIT vs STOP from current price.

🛡️ Position management

Modify SL/TP, close by ID, close by symbol, close all winning / losing / open positions.

📋 Pending orders

View, modify, cancel pending orders — by ID, by symbol, or all at once.

📜 Trading history

Pull deals & orders by date range, by symbol — analyze performance instantly.

"I used to panic at the words MCP, JSON config. Now it's just one setup.bat running for a minute, type /trading in Claude and I'm placing trades — like having a co-trader sitting next to me."
— Feedback from a trader using Code2trade MetaTrader MCP
📌 System requirements
  • Windows 10 / 11 (the setup script runs on Windows)
  • Claude Code installed — download at claude.com/code
  • MetaTrader 5 running and logged into your account
  • Python 3.10+ — not required, the script auto-installs via winget

Download MetaTrader MCP Setup — Code2trade

Includes setup.bat, GUI installer, the /trading skill · Supports Windows 10/11

⬇ Download — MetaTraderMCP-Setup.rar

.rar file · Free · Updated June 2026