by ariadng
Enables AI LLMs to execute trades on the MetaTrader 5 platform through the Model Context Protocol.
Enables large language models to interact with MetaTrader 5, allowing AI‑driven trade execution and management via a standardized MCP interface.
pip install metatrader-mcp-server
.Tools → Options → Allow algorithmic trading
).metatrader-mcp-server --login <YOUR_MT5_LOGIN> --password <YOUR_MT5_PASSWORD> --server <YOUR_MT5_SERVER>
This launches the MCP server and automatically starts the MT5 terminal.{
"mcpServers": {
"metatrader": {
"command": "metatrader-mcp-server",
"args": ["--login", "<YOUR_MT5_LOGIN>", "--password", "<YOUR_MT5_PASSWORD>", "--server", "<YOUR_MT5_SERVER>"]
}
}
}
metatrader-http-server --login <YOUR_MT5_LOGIN> --password <YOUR_MT5_PASSWORD> --server <YOUR_MT5_SERVER> --host 0.0.0.0 --port 8000
Then add http://localhost:8000
as a tool server in the Open WebUI settings.Q: What Python version is required? A: Python 3.10 or newer.
Q: Do I need a licensed MetaTrader 5 terminal? A: Yes, the server interacts with a locally installed MT5 client.
Q: How are credentials supplied?
A: Via command‑line arguments --login
, --password
, and --server
when launching the server.
Q: Can I run the server on a remote machine? A: The server must be on the same host as the MT5 terminal because it launches the client locally.
Q: Is there any legal disclaimer? A: Yes – the package disclaims liability for any trading losses; users assume all risks.
This is a Model Context Protocol (MCP) server built with Python to enable AI LLMs to trade using MetaTrader platform.
Financial trading involves significant risk, and the developers of this package disclaim any liability for any losses or profits; this package is provided solely to facilitate MetaTrader 5 trade executions via AI LLMs using the Model Context Protocol (MCP). By using this package, you assume all risks and agree not to hold the developers liable or to initiate any legal action for any damages, losses, or profits.
Make sure you have Python version 3.10+ and MetaTrader 5 terminal installed in your workspace. Then install the package:
pip install metatrader-mcp-server
Then you need to enable algorithmic trading on MetaTrader 5 terminal. Open Tools > Options
and check Allow algorithmic trading
.
To use this package to enable trading operations via Claude Desktop app, please add this into your Claude Desktop configuration:
{
"mcpServers": {
"metatrader": {
"command": "metatrader-mcp-server",
"args": [
"--login", "<YOUR_MT5_LOGIN>",
"--password", "<YOUR_MT5_PASSWORD>",
"--server", "<YOUR_MT5_SERVER>"
]
}
}
}
You can use this MCP server with other LLMs such as OpenAI's GPT by using its HTTP server and Open WebUI.
To start, make sure you have installed the package. Then, run the server:
metatrader-http-server --login <YOUR_MT5_LOGIN> --password <YOUR_MT5_PASSWORD> --server <YOUR_MT5_SERVER> --host 0.0.0.0 --port 8000
It will launch HTTP server locally on port 8000 and automatically launch MetaTrader 5 terminal.
On Open WebUI settings page, navigate to Tools menu. Then click plus button on "Manage Tool Servers". Add http://localhost:8000
(or whatever you set your port is).
If all is well, you can now access the tools via chat using available models, such as gpt-4o
or o4-mini
.
For full version checklist, see version-checklist.md.
Task | Status | Done | Tested |
---|---|---|---|
Connect to MetaTrader 5 terminal | Finished | ✅ | ✅ |
Develop MetaTrader client module | Finished | ✅ | ✅ |
Develop MCP Server module | Finished | ✅ | ✅ |
Implement MCP tools | Finished | ✅ | ✅ |
Publish to PyPi | Finished | ✅ | ✅ |
Claude Desktop integration | Finished | ✅ | ✅ |
OpenAPI server | Finished | ✅ | ✅ |
Open WebUI integration | Finished | ✅ | ✅ |
Google ADK integration | On progress | - | - |
For developers, see Developer's Documentation.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by goat-sdk
Enables AI agents to send and receive payments, purchase goods and services, execute investment strategies, tokenize assets, and obtain financial insights by leveraging blockchains, stablecoins, and wallets.
by financial-datasets
Provides access to income statements, balance sheets, cash flow statements, stock prices, market news, and cryptocurrency data through MCP tools for AI assistants.
by alpacahq
Enables large language models to trade stocks and options, retrieve real‑time and historical market data, and manage portfolios using plain English commands through a local or remote MCP server.
by XeroAPI
Provides a bridge between the Model Context Protocol and Xero's API, enabling standardized access to Xero accounting and business features.
by stefanoamorelli
Provides an MCP server that connects AI models to SEC EDGAR filings, enabling real‑time retrieval of company filings, financial statements, and insider‑trading data with exact XBRL precision and verifiable filing references.
by calvernaz
Provides access to Alpha Vantage stock market data via an MCP server, supporting stdio and HTTP streaming modes with optional OAuth 2.1 authentication.
by kukapay
Integrates the Freqtrade cryptocurrency trading bot with MCP, exposing its REST API as tools for AI agents to perform automated trading operations.
by kukapay
Provides a comprehensive set of cryptocurrency technical analysis indicators and ready‑to‑use trading strategies through an MCP interface, enabling AI agents and applications to generate buy, hold, or sell signals.
by OctagonAI
Provides AI-powered financial research and analysis by integrating with the Octagon Market Intelligence API, enabling extraction of insights from public filings, earnings call transcripts, financial metrics, stock market data, and private market transactions within Claude Desktop and other popular MCP clients.