metatrader-mcp-server  by ariadng

AI-driven trading automation for MetaTrader 5

Created 1 year ago
297 stars

Top 89.1% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a bridge between AI Large Language Models (LLMs) and the MetaTrader 5 (MT5) trading platform, enabling users to execute trades and manage accounts using natural language commands. It targets traders, developers building trading bots, and analysts seeking to integrate AI with financial markets, offering an intuitive way to automate trading strategies.

How It Works

The MetaTrader MCP Server acts as an intermediary, translating natural language instructions processed by AI assistants (like Claude or ChatGPT) into executable commands for the MT5 platform. It supports multiple interfaces, including a Model Context Protocol (MCP) server, a REST API, and a WebSocket stream for real-time data, allowing flexible integration into various AI workflows and custom applications.

Quick Start & Requirements

  • Installation: Install via pip: pip install metatrader-mcp-server.
  • Prerequisites: Python 3.10 or higher, MetaTrader 5 terminal installed, and valid MT5 account credentials (login, password, server name). Algorithmic trading must be enabled within the MT5 terminal settings.
  • Interfaces: Options include local integration with Claude Desktop via stdio, a REST API server for ChatGPT/Open WebUI, a WebSocket server for real-time quotes, and a remote MCP server (SSE).
  • Documentation: Links to PyPI, Python downloads, and the MIT license are provided.

Highlighted Details

  • Natural Language Trading: Execute trades, manage orders, and query account status using plain English.
  • Multi-AI Support: Integrates with popular AI assistants like Claude Desktop and ChatGPT via Open WebUI.
  • Flexible Interfaces: Offers MCP, REST API, and WebSocket streaming for diverse use cases.
  • Real-Time Data: A dedicated WebSocket server streams live tick data for dashboards and bots.
  • Trading Assistant Skill: Includes a pre-built skill for Claude Code/Desktop, enhancing AI's domain knowledge.

Maintenance & Community

The project is actively developed, with planned features including Docker containerization and Google ADK integration. Community support is available through GitHub Issues and Discussions. The primary contributor is Aria Dhanang.

Licensing & Compatibility

The project is released under the MIT License, which is permissive and allows for commercial use and integration into closed-source applications.

Limitations & Caveats

The MCP protocol itself does not include authentication, necessitating careful network security (firewalls, reverse proxies) when exposing the server remotely. The project includes a strong disclaimer regarding the significant risks associated with financial trading, emphasizing that users are solely responsible for all trades executed through the system.

Health Check
Last Commit

2 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
3
Star History
77 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.