MetaTrader MCP Server is an MCP server that connects AI assistants to the MetaTrader 5 trading platform. It enables software developers, algorithmic traders, and market analysts to manage trades, monitor portfolios, and inspect financial markets using natural language. The server bridges large language models, including Claude and ChatGPT, directly to an active MetaTrader 5 terminal via standard stdio or remote Server-Sent Events transports. Through this connection, assistants can read real-time pricing data, access historical candlestick data across multiple timeframes, check account balances, evaluate equity and margin levels, and execute market transactions. Users can place, modify, or close positions, set stop-loss and take-profit thresholds, and cancel pending orders. Additionally, the project includes an HTTP API and a dedicated WebSocket streaming server for live tick data updates, allowing external monitoring tools or dashboards to observe market shifts alongside conversational AI control.
Category: Developer Tools & Code Intelligence
Tags: automation, finance, forex, metatrader, trading
bash pip install metatrader-mcp-server 3. Configure Claude Desktop by editing claude_desktop_config.json (found at %APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS). 4. Add the server entry under mcpServers: json { "mcpServers": { "metatrader": { "command": "metatrader-mcp-server", "args": [ "--login", "YOUR_MT5_LOGIN", "--password", "YOUR_MT5_PASSWORD", "--server", "YOUR_MT5_SERVER", "--transport", "stdio" ] } } } 5. Replace the login credentials with your MT5 account details and restart Claude Desktop.Part of MCP Servers
You can install the server using pip with the command pip install metatrader-mcp-server. You must also have Python 3.10 or higher, an active MetaTrader 5 desktop terminal with algorithmic trading enabled, and valid MT5 trading account credentials including your login, password, and broker server name.
The server allows AI assistants to interact directly with MetaTrader 5. It provides tools for placing market orders, managing pending orders, modifying stop-loss and take-profit levels, closing open positions, fetching symbol information, and streaming live tick quotes via a companion WebSocket server.
It works natively with Claude Desktop via stdio transport and Claude Code via custom skill definitions. It also supports remote SSE connections for distributed setups and provides an HTTP server compatible with Open WebUI for tools integration with ChatGPT and other LLMs.
Yes, MetaTrader MCP Server is open source software distributed under the MIT license. You can inspect the source code, contribute features, and review documentation on its GitHub repository.