================================================================
  MetaTrader MCP - Setup for Claude Desktop
================================================================

WHAT THIS DOES
--------------
Connects Claude Desktop to your MetaTrader 5 account so you can
chat with the AI to view your account, check prices, and place
trades using natural language.

REQUIREMENTS
------------
1. Windows 10 or 11
2. Claude Desktop installed     (https://claude.ai/download)
3. MetaTrader 5 installed and RUNNING (logged in)
4. An MT5 trading account (demo recommended for first try)


HOW TO USE
----------
1. Make sure MetaTrader 5 is RUNNING and LOGGED IN.

2. Enable algorithmic trading in MT5:
     Tools  ->  Options  ->  Expert Advisors
     [x] Allow algorithmic trading
     OK

3. Double-click  setup.bat

4. Wait for prerequisites to install (Python will be installed
   automatically if missing; takes 1-2 minutes).

5. A small window will appear asking for:
      - MT5 Login    (your account number, e.g. 12345678)
      - MT5 Password (your trader password)
      - MT5 Server   (e.g. MetaQuotes-Demo, Exness-MT5Trial7)

6. Click "Test Connection" to verify, then "Install".

7. When you see "Setup complete!", close the installer.

8. IMPORTANT: Fully QUIT and REOPEN Claude Desktop
      File  ->  Quit
      (Then open Claude Desktop again from Start menu.)

   Without this restart, Claude Desktop will not load the new
   MCP server.

9. In Claude Desktop, try:
      "What is my MT5 account balance?"
      "Show me EURUSD current price"
      "Buy 0.01 lots of EURUSD"


WHERE TO FIND YOUR MT5 CREDENTIALS
----------------------------------
- Open MetaTrader 5
- Look at the bottom-right status bar:
      "12345678: Exness-Demo"
      ^^^^^^^^ ^^^^^^^^^^^^
        login     server
- The password is what you typed when logging in.
- If you don't remember it, check the email from your broker
  when you opened the account.


TROUBLESHOOTING
---------------
* "Failed to install Python"
    Install Python 3.12 manually from https://python.org and
    re-run setup.bat.

* "MT5 connection failed"
    - Is MetaTrader 5 actually running?
    - Did you enable "Allow algorithmic trading"?
    - Is the server name exact? (case-sensitive!)
    - Are you using your TRADER password, not investor password?

* "Claude Desktop doesn't see the MCP server"
    - Did you FULLY QUIT Claude Desktop (not just close window)?
      Right-click the taskbar icon -> Quit
    - Reopen Claude Desktop after running setup.

* The setup window closes immediately
    Open Command Prompt, cd to this folder, then run:
        setup.bat
    You'll see the error message.


UNINSTALL
---------
1. Remove the metatrader entry from Claude Desktop config:
      Edit %APPDATA%\Claude\claude_desktop_config.json
      Delete the "metatrader" entry under "mcpServers".

2. Uninstall the Python package:
      pip uninstall metatrader-mcp-server

3. (Optional) Remove the trading skill:
      rmdir /s /q "%APPDATA%\Claude\skills\trading"


SECURITY NOTE
-------------
Your MT5 password is saved in plaintext inside
%APPDATA%\Claude\claude_desktop_config.json. This is the
standard mechanism for Claude Desktop's local MCP servers.

For maximum safety:
  - Use a DEMO account when testing.
  - Don't share your computer or that config file.
  - Don't put live-trading credentials on shared computers.


MORE INFO
---------
Project: https://github.com/ariadng/metatrader-mcp-server
