by ariadng
MetaTrader MCP Server is a Python-based Model Context Protocol (MCP) server that enables AI Large Language Models (LLMs) to execute trades on the MetaTrader platform.
MetaTrader MCP Server is a Python-based Model Context Protocol (MCP) server designed to bridge the gap between AI Large Language Models (LLMs) and the MetaTrader 5 trading platform. It allows LLMs to interact with MetaTrader 5 and execute trading operations programmatically.
To use MetaTrader MCP Server, you need Python 3.10+ and MetaTrader 5 terminal installed. Install the package via pip:
pip install metatrader-mcp-server
After installation, enable algorithmic trading in your MetaTrader 5 terminal (Tools > Options > Allow algorithmic trading
).
For Claude Desktop integration, add the provided JSON configuration to your Claude Desktop settings, including your MetaTrader 5 login, password, and server details.
For other LLMs using Open WebUI, run the HTTP server locally with your MetaTrader 5 credentials:
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
(or your chosen port) as a tool server in Open WebUI settings under the "Tools" menu.
Q: Is financial trading with this package risky? A: Yes, financial trading involves significant risk. The developers explicitly disclaim any liability for losses or profits. This package is provided solely to facilitate MetaTrader 5 trade executions via AI LLMs, and users assume all risks.
Q: What Python version is required? A: Python 3.10+ is required.
Q: Do I need MetaTrader 5 installed? A: Yes, you need the MetaTrader 5 terminal installed in your workspace.
Q: Can I use this with LLMs other than Claude Desktop? A: Yes, you can use it with other LLMs like OpenAI's GPT models via its HTTP server and Open WebUI integration.
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.
Discover more MCP servers with similar functionality and use cases
by stripe
Enables popular agent frameworks to integrate with Stripe APIs via function calling, providing tools for MCP, Python, and TypeScript.
by goat-sdk
GOAT is the largest agentic finance toolkit for AI agents, enabling them to become economic actors by leveraging blockchains, cryptocurrencies, and wallets.
by financial-datasets
Provides AI assistants with tools to retrieve income statements, balance sheets, cash flow statements, stock prices, market news, and crypto information via the Model Context Protocol.
by razorpay
Enables seamless interaction with Razorpay APIs via Model Context Protocol, allowing developers and AI agents to capture payments, manage orders, process refunds, handle settlements, and more through a unified MCP interface.
by armorwallet
Armor Crypto MCP provides a unified interface for AI agents to interact with the crypto ecosystem, including wallet management, swaps, staking, and multi-chain operations.
by alpacahq
Alpaca’s MCP server lets you trade stocks and options, analyze market data, and build strategies through Alpaca's Trading API.
by XeroAPI
Provides a bridge between the Model Context Protocol and Xero's API, enabling standardized access to Xero accounting and business features.
by kukapay
Integrates the Freqtrade cryptocurrency trading bot with an MCP server, exposing the bot's REST API as tools that AI agents can call for fully automated trading operations.
by kukapay
Offers over 50 cryptocurrency technical analysis indicators and corresponding trading strategies, enabling AI agents and developers to assess market trends and generate buy, hold, or sell signals.