claude-mt5-mcp-windows

CrysiscodeX/claude-mt5-mcp-windows

3.2

If you are the rightful owner of claude-mt5-mcp-windows and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A local MCP server for Claude Desktop to interact with the MetaTrader 5 terminal running natively on Windows.

Claude MT5 MCP Server (Native Windows 11)

A local MCP server for Claude Desktop to interact with the MetaTrader 5 terminal running natively on Windows.

This project bridges the gap between the native Claude Desktop application and the MetaTrader 5 terminal. It allows Claude to access account information, pull market data, and analyze indicators directly from your trading platform.


⚠️ Architecture & Requirements

This is a native Windows solution. It is far more stable than Wine-based workarounds.

  1. Native Python: It uses your system's installed Python (3.9+ recommended).
  2. Native MT5: It connects directly to the official MetaTrader 5 Windows application.
  3. GUI-Dependent: This server requires the MetaTrader 5 desktop application to be open, running, and logged in. It is not a headless, 24/7 server.

🚀 Installation and Setup Guide

Step 1: Install Core Dependencies

  1. Install Python: If you haven't, install Python 3.9 or newer from python.org. Ensure you check "Add python.exe to PATH" during installation.
  2. Install MetaTrader 5: Install the official MT5 terminal for Windows from your broker or the MetaQuotes website.
  3. Install Git: If you haven't, install Git from git-scm.com.

Step 2: Get the Project Code

Open a Command Prompt or PowerShell and clone this repository.

# Navigate to a folder of your choice, e.g., your Desktop
cd C:\Users\YourUser\Desktop

# Clone the project
git clone https://github.com/YourUsername/claude-mt5-mcp-windows.git

# Enter the new project directory
cd claude-mt5-mcp-windows

Step 3: Create Environment & Install Packages

We have a simple script to do this for you.

  1. In File Explorer, navigate to the claude-mt5-mcp-windows folder.
  2. Double-click the create_env.bat file.
  3. A command prompt will open, create a venv folder, and install all required Python libraries.
  4. Press any key to close the window when it's done.

🛠️ Configuration

Part 1: Configure MetaTrader 5

  1. Open the MetaTrader 5 application.
  2. In the top menu, go to Tools -> Options.
  3. Click the Expert Advisors tab.
  4. CHECK the box for "Allow Algo Trading".
  5. Click OK.

Part 2: Configure Claude Desktop

This is the final step. We need to tell Claude how to run our new server.

1. Get Your Project's Absolute Path

In the File Explorer, click in the address bar of your claude-mt5-mcp-windows folder. Copy the path. It will look like: C:\Users\YourUser\Desktop\claude-mt5-mcp-windows

2. Edit the Claude Config File

  1. Open the Claude config file with a text editor. The file is located at: C:\Users\YourUser\AppData\Roaming\Claude\claude_desktop_config.json (You can paste %APPDATA%\Claude into your File Explorer address bar to get there)

  2. Add your new server to the mcpServers object. Do not remove existing servers.

  3. Paste your absolute path and add \run.bat to the end.

Example claude_desktop_config.json:

{
  "mcpServers": {
    "some-other-server": {
      "command": "npx",
      "args": [ ... ]
    },
    "mt5-local-server": {
      "command": "C:\\Users\\YourUser\\Desktop\\claude-mt5-mcp-windows\\run.bat",
      "args": []
    }
  }
}

Save the file.


⚡ Running the Server

You are ready!

  1. Fully RESTART your Claude Desktop application (quit and re-open it).
  2. Make sure your MetaTrader 5 application is open, running, and logged in to your trading account.
  3. In Claude, open Settings -> Developer -> Extensions.
  4. You should see mt5-local-server listed with a "running" status.
  5. Open a new chat and test it!
Example Prompts:
  • "Using my MT5 tools, what is my account balance?"
  • "What is the current bid/ask spread for EURUSD?"
  • "Get the last 10 hourly bars for GBPUSD."
  • "What is the 14-period SMA for EURUSD on the H1 timeframe?"