================================================================
  MetaTrader MCP - Setup for Claude Code
================================================================

WHAT THIS DOES
--------------
Connects Claude Code to your MetaTrader 5 account so you can trade
using natural language.

REQUIREMENTS
------------
1. Windows 10 or 11
2. Claude Code installed       (https://claude.com/code)
3. MetaTrader 5 installed and running
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. Open a NEW PowerShell or Command Prompt window and run:
      claude

9. In Claude Code, try:
      /trading
      What is my MT5 account balance?


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
---------------
* "Claude Code not found"
    Install it from https://claude.com/code first.

* "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?

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


UNINSTALL
---------
To remove the MetaTrader MCP from Claude Code:

    claude mcp remove metatrader -s user

To remove the trading skill:

    rmdir /s /q "%USERPROFILE%\.claude\skills\trading"

To uninstall the Python package:

    pip uninstall metatrader-mcp-server


SECURITY NOTE
-------------
Your MT5 password is saved in plaintext inside the Claude Code
config file (~/.claude.json). This is the standard mechanism for
local MCP servers using stdio transport.

For maximum safety:
  - Use a DEMO account when testing.
  - Don't share your computer or your ~/.claude.json file.
  - Don't put live-trading credentials in shared computers.


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