$git clone https://github.com/ariadng/metatrader-mcp-server<br />
| 1 | <div align="center"> |
| 2 | <h1>MetaTrader MCP Server</h1> |
| 3 | </div> |
| 4 | |
| 5 | <br /> |
| 6 | |
| 7 | <div align="center"> |
| 8 | |
| 9 | [](https://pypi.org/project/metatrader-mcp-server/) |
| 10 | [](https://www.python.org/downloads/) |
| 11 | [](https://opensource.org/licenses/MIT) |
| 12 | |
| 13 | **Let AI assistants trade for you using natural language** |
| 14 | |
| 15 |  |
| 16 | |
| 17 | </div> |
| 18 | |
| 19 | <br /> |
| 20 | |
| 21 | --- |
| 22 | |
| 23 | ## 📑 Table of Contents |
| 24 | |
| 25 | - [What is This?](#-what-is-this) |
| 26 | - [Features](#-features) |
| 27 | - [Who Is This For?](#-who-is-this-for) |
| 28 | - [Important Disclaimer](#%EF%B8%8F-important-disclaimer) |
| 29 | - [Prerequisites](#-prerequisites) |
| 30 | - [Quick Start](#-quick-start) |
| 31 | - [Trading Assistant Skill](#-trading-assistant-skill-claude-code--claude-desktop) |
| 32 | - [Usage Examples](#-usage-examples) |
| 33 | - [Available Operations](#-available-operations) |
| 34 | - [WebSocket Quote Server](#-websocket-quote-server) |
| 35 | - [Advanced Configuration](#-advanced-configuration) |
| 36 | - [Roadmap](#%EF%B8%8F-roadmap) |
| 37 | - [Development](#%EF%B8%8F-development) |
| 38 | - [Contributing](#-contributing) |
| 39 | - [Documentation](#-documentation) |
| 40 | - [Getting Help](#-getting-help) |
| 41 | - [License](#-license) |
| 42 | |
| 43 | --- |
| 44 | |
| 45 | ## 🌟 What is This? |
| 46 | |
| 47 | **MetaTrader MCP Server** is a bridge that connects AI assistants (like Claude, ChatGPT) to the MetaTrader 5 trading platform. Instead of clicking buttons, you can simply tell your AI assistant what to do: |
| 48 | |
| 49 | > "Show me my account balance" |
| 50 | > "Buy 0.01 lots of EUR/USD" |
| 51 | > "Close all profitable positions" |
| 52 | |
| 53 | The AI understands your request and executes it on MetaTrader 5 automatically. |
| 54 | |
| 55 | ### How It Works |
| 56 | |
| 57 | ``` |
| 58 | You → AI Assistant → MCP Server → MetaTrader 5 → Your Trades |
| 59 | ``` |
| 60 | |
| 61 | ## ✨ Features |
| 62 | |
| 63 | - **🗣️ Natural Language Trading** - Talk to AI in plain English to execute trades |
| 64 | - **🤖 Multi-AI Support** - Works with Claude Desktop, ChatGPT (via Open WebUI), and more |
| 65 | - **📊 Full Market Access** - Get real-time prices, historical data, and symbol information |
| 66 | - **💼 Complete Account Control** - Check balance, equity, margin, and trading statistics |
| 67 | - **⚡ Order Management** - Place, modify, and close orders with simple commands |
| 68 | - **🔒 Secure** - All credentials stay on your machine |
| 69 | - **🌐 Flexible Interfaces** - Use as MCP server, REST API, or WebSocket stream |
| 70 | - **📖 Well Documented** - Comprehensive guides and examples |
| 71 | |
| 72 | ## 🎯 Who Is This For? |
| 73 | |
| 74 | - **Traders** who want to automate their trading using AI |
| 75 | - **Developers** building trading bots or analysis tools |
| 76 | - **Analysts** who need quick access to market data |
| 77 | - **Anyone** interested in combining AI with financial markets |
| 78 | |
| 79 | ## ⚠️ Important Disclaimer |
| 80 | |
| 81 | **Please read this carefully:** |
| 82 | |
| 83 | Trading financial instruments involves significant risk of loss. This software is provided as-is, and the developers accept **no liability** for any trading losses, gains, or consequences of using this software. |
| 84 | |
| 85 | By using this software, you acknowledge that: |
| 86 | - You understand the risks of financial trading |
| 87 | - You are responsible for all trades executed through this system |
| 88 | - You will not hold the developers liable for any outcomes |
| 89 | - You are using this software at your own risk |
| 90 | |
| 91 | **This is not financial advice. Always trade responsibly.** |
| 92 | |
| 93 | --- |
| 94 | |
| 95 | ## 📋 Prerequisites |
| 96 | |
| 97 | Before you begin, make sure you have: |
| 98 | |
| 99 | 1. **Python 3.10 or higher** - [Download here](https://www.python.org/downloads/) |
| 100 | 2. **MetaTrader 5 terminal** - [Download here](https://www.metatrader5.com/en/download) |
| 101 | 3. **MT5 Trading Account** - Demo or live account credentials |
| 102 | - Login number |
| 103 | - Password |
| 104 | - Server name (e.g., "MetaQuotes-Demo") |
| 105 | |
| 106 | ## 🚀 Quick Start |
| 107 | |
| 108 | ### Step 1: Install the Package |
| 109 | |
| 110 | Open your terminal or command prompt and run: |
| 111 | |
| 112 | ```bash |
| 113 | pip install metatrader-mcp-server |
| 114 | ``` |
| 115 | |
| 116 | ### Step 2: Enable Algorithmic Trading |
| 117 | |
| 118 | 1. Open MetaTrader 5 |
| 119 | 2. Go to `Tools` → `Options` |
| 120 | 3. Click the `Expert Advisors` tab |
| 121 | 4. Check the box for `Allow algorithmic trading` |
| 122 | 5. Cl |