How to Fully Connect Claude Code and Desktop to MT5 for Free

  • Post category:AI Trading
  • Post author:
  • Reading time:17 mins read
  • Post last modified:August 3, 2026

If you’ve ever handed ChatGPT or Claude a screenshot of a chart and asked “what’s the signal here?” — stop. It doesn’t work. The model can’t read the exact price from a picture, and without a specific strategy behind it, it’s just pattern-matching off general knowledge, which is a bad way to trade.

There’s a better way: connect Claude directly to MetaTrader 5 with an MCP (Model Context Protocol) server, give it a real strategy as a skill, and let it read live prices, run real backtests, and manage trades — all through plain-English prompts.

This guide covers the whole setup: connecting MT5 to Claude Code and Claude Desktop, backtesting a strategy with real data, turning any strategy (yours or one you found on YouTube) into a Claude skill, why deterministic tools beat prompt-only skills, and how to automate Claude Desktop on a schedule since it doesn’t have cron built in.

Everything here is built by Offbrat Forex and free to run.

I Turned Claude Desktop into a 24/7 Trading Assistant (Free )

Why You Can’t Just Ask Claude to “Analyze This Chart”

Two problems show up immediately when people try this:

  1. No real price data. A chart screenshot is a picture, not data. The model is estimating candle positions visually, not reading actual OHLC values.
  2. No strategy. Without a defined method, the model defaults to generic technical-analysis knowledge scraped from the internet — which is exactly the kind of “everyone already knows this” analysis that doesn’t hold an edge in live markets.

The fix for both is the same: give Claude a direct, structured connection to your MT5 terminal (so it’s working with real numbers) and a specific strategy skill (so it’s not guessing).

Connecting MT5 to Claude AI With MCP Servers

MCP is the protocol Anthropic built so AI models can call external tools — in this case, tools that talk to your MetaTrader 5 terminal. You need two of them, because backtesting and live execution are different jobs with different risk profiles:

MBT — MT5 Backtest Toolkit

MBT is built around one idea: never let the AI recalculate your indicator in Python to “verify” it. If Claude wrote the indicator and then writes a second script to check it, a bug in the original logic just gets copied into the checker — you’re not getting an independent test, you’re getting Claude agreeing with itself.

Instead, MBT has your MQL5 indicator log its own real signals (entry, stop, target, the works) as it runs, then replays those signals against real broker price bars to see whether each one would have hit its stop or its target first. What gets backtested is exactly what your indicator actually drew — not an approximation of it.

MBT also drives MetaEditor and MT5’s own Strategy Tester directly, so Claude can compile an EA, read back the exact compiler errors, fix them, and run a real headless backtest — without you touching MetaEditor.

Install MBT:

git clone https://github.com/FXDavid-OffbeatForex/MBT.git
cd MBT
python install.py

This installs dependencies, generates config.yaml, and drops the signal-logging include and a headless host EA into your MT5 folders. Edit config.yaml and point mt5_path at your terminal, then set default_symbol and default_timeframe.

MTX — MT5 Trade Executor

MTX is the execution half. It turns a plain-English instruction like “buy 0.5 lots EURUSD, SL 1.0950, TP 1.1100” into a broker-validated order — but it never guesses at broker rules. Every price and lot size gets normalized against the symbol’s live tick size, volume step, and filling mode, and every order runs through the broker’s own order_check before it’s sent.

It also ships with money-management guardrails that are enforced in code, not left to the model’s judgment: max open positions, a daily loss limit, a minimum margin level, and an equity stop.

Install MTX:

git clone https://github.com/FXDavid-OffbeatForex/MTX.git
cd MTX
copy config.example.yaml config.yaml

By default, MTX runs in confirm mode — every trade previews first and only fires when you explicitly confirm it. You can flip execution.mode to auto later once you trust the setup, which is what lets a scheduled prompt open and close trades unattended.

Setting Up the Config Files

Both tools need their config.yaml pointed at your real MT5 installation:

  • In MBT’s config, set the Strategy Tester terminal path and the MetaEditor path (needed for backtesting and for compiling indicators/EAs), plus the MT5 terminal path itself.
  • In MTX’s config, set the MT5 path and your account credentials — account number, password, and server name (these come from your broker when you open the account).

A couple of Windows-specific gotchas: every backslash in a JSON or YAML path needs to be doubled (\\ instead of \), and you should keep the password out of the config file entirely.

Keep your password in a .env file, not in config.yaml. Create a plain text file, add your password in the same format the config expects, save it, then remove the .txt extension so the file is just .env. (If you can’t see file extensions in Windows Explorer, enable “File name extensions” under the View tab first.)

Adding MBT and MTX to Claude Desktop

Open Claude Desktop → Settings → Developer → Edit Config. This opens claude_desktop_config.json. Add both servers:

{
  "mcpServers": {
    "mbt": {
      "command": "python",
      "args": ["C:\\abs\\path\\to\\MBT\\mcp_server.py"]
    },
    "mtx": {
      "command": "python",
      "args": ["C:\\abs\\path\\to\\MTX\\mcp_server.py"]
    }
  }
}

On Windows, every backslash in a JSON path needs to be doubled (\\ instead of \) — a single backslash breaks the escape sequence. On Windows, every backslash in a JSON path needs to be doubled (\\ instead of \) — a single backslash breaks the escape sequence. Replace the paths with your own mcp_server.py locations, save, then fully quit and reopen Claude Desktop

Here’s what that looks like with real, full Windows paths instead of a placeholder — this is a full claude_desktop_config.json, showing that mcpServers is just one part of a bigger file:

{
  "mcpServers": {
    "mtx": {
      "command": "python",
      "args": [
        "C:\\Users\\Administrator\\Desktop\\AI-TRADING\\MTX-master\\mcp_server.py"
      ]
    },
    "mbt": {
      "command": "python",
      "args": [
        "C:\\Users\\Administrator\\Desktop\\AI-TRADING\\MBT-main\\mcp_server.py"
      ]
    }
  },
  "coworkUserFilesPath": "C:\\Users\\Administrator\\Claude",
  "preferences": {
    "launchPreviewPersistedWorkspaces": [],
    "launchPreviewSessionScopedSessions": [],
    "coworkScheduledTasksEnabled": false,
    "coworkHipaaRestricted": false,
    "ccdScheduledTasksEnabled": false,
    "sidebarMode": "chat",
    "bypassPermissionsGateByAccount": {
      "424b804c-.....-be9556ffa2dd": false
    },
    "coworkWebSearchEnabled": true,
    "coworkModelAutoFallbackByAccount": {
      "424b804c......be9556ffa2dd": true
    },
    "remoteToolsDeviceName": "srv8444684900",
    "epitaxyPrefs": {
      "starred-local-code-sessions": [],
      "starred-cowork-spaces": [],
      "starred-session-groups": [],
      "ccd-sessions-filter": {
        "state": {
          "selectedProjects": []
        },
        "version": 0
      },
      "desktop-frame.paneStore.v1": {
        "state": {
          "extraPanesByMode": {},
          "colWeightsByMode": {},
          "rowSplit": 0.5,
          "draftNonce": 0
        },
        "version": 4
      },
      "dframe-group-scopes": {},
      "dframe-local-slice": {
        "pinnedOrder": [],
        "homeProjectsPinnedOrder": []
      }
    }
  }
}

You only need to add or edit the mcpServers block; the rest (preferences, coworkUserFilesPath, etc.) are unrelated Claude Desktop app settings that will already be in your file — leave them as they are. — any config change requires a restart to take effect. You should now see both servers listed under local MCP servers.

If your broker adds a prefix or suffix to symbol names (e.g., a “zero” suffix), you have to include it in every prompt — “give me the EURUSDzero price” instead of just “EURUSD.”

Quick connection test: ask Claude for “the last 10 H1 candles for EURUSD” (confirms MBT) and “find my MT5 balance” (confirms MTX). If both come back with real numbers, your MT5 terminal is fully connected.

Using Claude Code Instead of Claude Desktop

If you’re using Claude Code rather than Claude Desktop, Paste the MBT and MTX repo URLs into Claude Code and say: 

Clone these repos and set up the MBT and MTX MCP servers for me
https://github.com/FXDavid-OffbeatForex/MTX
https://github.com/FXDavid-OffbeatForex/MBT

 Claude will clone them, run the installer, and register the servers.

How to Backtest a Trading Strategy With Claude AI

Once MBT is connected, backtesting is a conversation, not a coding project. A few examples of what you can just ask for:

  • “Run my indicator on XAUUSD H1 for the last 3 years, then backtest it.”
  • “Backtest signals since 2026-01-01 and give me the HTML report.”
  • “Check my EA for compiler errors and fix them.”
  • “Run a Strategy Tester backtest of my EA on XAUUSD H1 from 2018 to now.”
  • “Compare my EA’s results against my indicator backtest — do they match?”

That last one matters more than it sounds: MBT can diff an EA’s trades against the original indicator’s signals and point to the exact bar where they diverge, which is how you catch a bug in the MQL5-to-EA port before it costs you money.

Every backtest report comes back in R-units — 1R being the risk taken on each trade — so win rate, expectancy, profit factor, and max drawdown compare cleanly across symbols and account sizes, and Claude writes out a full HTML report with an equity curve.

Give Claude a Trading Skill (Instead of General Knowledge)

Connecting the MCPs gets Claude access to your MT5 data. It doesn’t automatically give Claude a strategy. Without one, it’s still leaning on generic textbook technical analysis — which is exactly the problem this whole setup is meant to solve.

Claude’s Skills feature fixes that. A skill is a packaged set of instructions Claude follows specifically for a domain — in this case, your trading method — instead of general internet knowledge.

The Simple Version: A Prompt-Based Skill

The most basic skill is just a well-organized prompt with no tools attached. For an ICT-style analysis, that might look like:

You are an ICT (Inner Circle Trader) analyst. When given a chart or price data, identify the current killzone based on New York time, mark liquidity levels such as equal highs/lows and previous day/week highs and lows, and determine whether price is trading at a premium, discount, or equilibrium within the current dealing range. Use this context to explain market structure and potential draws on liquidity — but do not give trade signals or entries unless explicitly asked.

Checkout professional ICT skill —> ICT ANALYST

Turn Your Own Strategy Into a Skill

If you already trade a defined strategy, hand this template to Claude and let it do the formatting work:

I’m going to describe a trading strategy. Turn it into a Claude skill in SKILL.md format. Include: (1) a short description of when this skill should trigger, (2) the step-by-step logic of the strategy, (3) the exact conditions for an entry, stop loss, and take profit, (4) any indicators or timeframes involved, and (5) edge cases or filters that would invalidate a setup. Here’s my strategy: [describe your strategy in detail].

Extract a Strategy From a YouTube Video

Found a strategy explained in a YouTube video instead of written down anywhere? Give the link to Google NotebookLM — it can watch the full video and pull out the rules. Prompt it like this:

Watch this video and extract the complete trading strategy being taught, including every rule for entries, exits, stop loss, take profit, timeframes, and indicators used.

Turn the Extracted Strategy Into a Claude Skill

Once NotebookLM hands back the strategy, paste that text to Claude along with this prompt:

Turn this trading strategy into a Claude Skill file (SKILL.md). Start with YAML frontmatter — a name and a description covering what it does and when Claude should trigger it. Then format the rules as clean markdown with a final checklist of every condition that must be true before a setup is valid. Don’t lose any specific numbers, ratios, or thresholds from the original.

Uploading the Skill

In Claude Desktop, go to Settings → Skills → Add, and upload the .md file. From that point on, every analysis you ask for runs against your uploaded strategy instead of Claude’s general knowledge.

Why Prompt-Only Skills Aren’t Enough — And What to Do Instead

A markdown skill file with no attached tools is a real improvement over asking ChatGPT for a random signal — but it has a ceiling. Every strategy that leans on an indicator or on time-based math (session times, killzones, moving averages, RSI levels) forces Claude to recalculate that math from scratch, on every single request.

That’s slower, and worse, it’s a quiet source of errors. Take ICT strategy for instance. Timezone and DST handling in particular is a classic silent-bug spot — a language model doing date arithmetic by “reasoning” about it, instead of running deterministic code, can get a session boundary wrong in a way that never shows up as an obvious mistake. It just quietly mislabels which killzone a bar falls into.

The fix is to give the skill actual tools, not just instructions. ICT Analyst is an example of that approach: a deterministic ICT (Inner Circle Trader) market-annotation toolkit, computed in exact, reproducible Python rather than eyeballed by a language model. It’s built for humans, scripts, and AI agents that need timezone and session math, plus resting-liquidity levels, handled correctly every time.

What it computes for any bar:

  • Time — New York session, active killzone(s), the macro window, the silver-bullet hour, and the ICT “true day” open — DST-correct without needing a system tzdata install.
  • Liquidity — previous day/week high-low, session ranges, equal highs/lows, untouched (unswept) old swing extremes, and the latest day/week opening gaps.
  • HTF structure — a labeled swing sequence (HH/HL/LH/LL) per higher timeframe, plus where price sits in the current dealing range: premium, equilibrium, or discount.

One detail worth calling out: it doesn’t need you to know your broker’s UTC offset. It derives that automatically from the data’s own weekly reopen gap, since FX markets reopen at a fixed, known instant — Sunday 17:00 New York. A wrong or missing offset silently corrupts every session and killzone tag downstream, so removing that manual step closes off a whole category of bugs. Worth being clear: this is analysis tooling, not a signal generator — it annotates the data; it never tells you to take a trade.

That’s the real gap between a skill that “knows about” a strategy and one that’s actually built to execute it reliably — deterministic code doing the math, and Claude reasoning on top of clean output instead of re-deriving everything itself.

How to Automate Claude Desktop on a Schedule (It Has No Cron)

At this point Claude can trade with your strategy — but only when you prompt it. Every analysis still has to be requested manually.

Claude Code solves this with a cron job. Claude Desktop doesn’t have that option unless you’re on the paid plan for Cowork — at which point Claude Code is arguably the better tool anyway.

Since the goal here is a fully free setup, Claude Desktop Scheduler fills that gap. It’s a zero-dependency Windows tool that drives Claude Desktop’s actual window the same way you would by hand: it opens the app, starts a new chat, pastes your prompt, and presses Enter — on whatever schedule you set.

Set it up:

  1. Clone or download the repo.
  2. Run test.bat — a safe dry run that pastes your prompt without sending it, so you can confirm everything’s wired up.
  3. Edit config.ini to set your prompt and schedule.
  4. Run install.bat to register it with Windows Task Scheduler.

For a forex setup, the two settings you actually need to touch are the interval (default is 60 minutes) and the day filter — set days = weekdays, since forex is closed on weekends and there’s no point burning message quota pinging Claude on a Saturday.

[schedule]
mode = interval
interval_minutes = 60
days = weekdays

One-time confirmation step: the first time Claude tries to use MBT or MTX, it asks for permission. Confirm it once — after that, everything runs hands-free. If you also want Claude to open and close trades automatically rather than just analyzing, set execution.mode: auto in MTX’s config.

Run the scheduler with install.bat, stop it with uninstall.bat, and check whether it’s actually firing with status.bat.

With that running, Claude opens on its own interval, reads your chart through MBT, checks it against your uploaded strategy skill, and — if you’ve set execution to auto — can act on it through MTX. No subscription, no cron job, no code.

Claude Code vs. Claude Desktop for Automated Trading

This whole setup works, and it’s free — but it’s worth being honest about where the ceiling is. Claude Code is the more capable option if you’re serious about running this long-term:

  • Native scheduling. A real cron job instead of a script driving a desktop window.
  • Better error handling. Claude Code can catch and recover from failures in a way that clicking through a UI can’t.
  • More integrations. Sending signals to your phone through Telegram, for example, is a natural extension in Claude Code.
  • Less manual setup. You can just ask Claude to do the configuration steps in this guide for you, instead of doing them by hand.

The free Claude Desktop route is genuinely useful and a big step up from asking a chatbot to eyeball a screenshot — it’s just not the most robust version of this system.

Test on a Demo Account First, and Consider a VPS

A few things worth doing before you point any of this at a live account:

  • Use a demo account while you’re testing the connection, the skill, and the automation — especially anything running in MTX’s auto execution mode.
  • Run it on a Windows VPS if you’re putting it on a schedule. A ~$10/month VPS is enough to run MT5, Claude Desktop, and the scheduler around the clock, in an environment that’s isolated from your everyday PC or laptop — so a mistake there doesn’t touch your main machine, and your main machine doesn’t need to stay on 24/7 for the schedule to run.

If you’re not sure what size VPS you need, Offbeat Forex has a VPS calculator built for exactly this — link in the description.

FAQ

Can Claude actually see my MT5 chart, or is it guessing from an image? With MBT connected, Claude reads real OHLCV price data directly from your terminal — not a picture. That’s the whole point of the MCP connection.

Does Claude need a specific strategy to trade well? Yes. Without an uploaded skill, Claude falls back on general technical-analysis knowledge, which is not the same as trading a defined, tested method. A skill — ideally one backed by deterministic tools rather than a prompt alone — is what makes the difference.

Is this safe to run with real money? MTX defaults to confirm mode, where every trade previews the broker’s own validation before anything executes, plus config-driven guardrails for max positions, daily loss, and equity. Even so, test on a demo account first — this is trading software, and trading carries real financial risk.

Do I need to know how to code to set this up? No. The MCP install steps are copy-paste commands, and the config files are plain YAML. Claude Code can even do the setup for you if you paste it the repo link and ask.

Can I automate Claude Desktop without paying for Cowork? Yes — that’s what Claude Desktop Scheduler is for. It uses Windows Task Scheduler to drive the app on an interval, for free.

What’s the difference between MBT and MTX? MBT is read-only — prices, backtests, indicator and EA verification. MTX is read/write — it’s the one that actually places, modifies, and closes trades.

Recap

Connecting Claude to MT5 for free takes four pieces: the MBT MCP for data and backtesting, the MTX MCP for execution, a real strategy skill such as ICT Analyst instead of general knowledge, and Claude Desktop Scheduler to keep it running without you at the keyboard. Set it up once, test it on a demo account, and Claude goes from “guessing at a screenshot” to reading real data and trading a method you actually chose.

Leave a Reply