MetaTrader MCP Server

Integrate AI LLMs with MetaTrader 5 for seamless, automated trading and intelligent portfolio management via the MetaTrader MCP Server.

MetaTrader MCP Server

What does “MetaTrader” MCP Server do?

The MetaTrader MCP Server is a Model Context Protocol (MCP) server built in Python that enables AI Large Language Models (LLMs) to interact with and execute trades on the MetaTrader 5 trading platform. By acting as a bridge between AI assistants and MetaTrader, it allows automated, intelligent trading operations such as placing, modifying, or closing orders directly from within AI-driven workflows. The server empowers developers and AI agents to enhance trading strategies, manage trading accounts, and analyze market data in real-time, all through standardized MCP interfaces. This significantly streamlines the development of AI trading assistants and facilitates robust integration with existing development environments.

List of Prompts

No explicit prompt templates are listed in the provided repository or documentation.

List of Resources

No explicit MCP resources are described in the provided repository or documentation.

List of Tools

No detailed tool definitions are provided in the available documentation or file listings. The server’s primary function is to enable trading actions via MetaTrader 5, but specific MCP tool names or interfaces are not enumerated.

Use Cases of this MCP Server

  • Automated Trading Operations
    Use AI LLMs to place, modify, or close trades in MetaTrader 5, automating execution based on AI-generated strategies or signals.
  • Portfolio Management
    Enable AI agents to monitor trading accounts, check balances, and manage portfolios efficiently through MCP.
  • Market Data Analysis
    Allow AI models to fetch and analyze real-time market data from MetaTrader for predictive analytics and decision-making.
  • Risk Management
    Implement AI-driven stop-loss, take-profit, and risk mitigation strategies by interacting directly with MetaTrader accounts.
  • Backtesting and Strategy Evaluation
    Use the server to facilitate AI-assisted backtesting of trading strategies on historical data in MetaTrader.

How to set it up

Windsurf

No setup instructions for Windsurf are provided in the available documentation.

Claude

  1. Prerequisites: Ensure Python 3.10+ and MetaTrader 5 terminal are installed.
  2. Install the MCP server:
    pip install metatrader-mcp-server
    
  3. Enable algorithmic trading in MetaTrader 5:
    Open Tools > Options and check Allow algorithmic trading.
  4. Edit Claude Desktop configuration:
    Add the MCP server as follows:
    {
      "mcpServers": {
        "metatrader": {
          "command": "metatrader-mcp-server",
          "args": [
            "--login",    "<YOUR_MT5_LOGIN>",
            "--password", "<YOUR_MT5_PASSWORD>",
            "--server",   "<YOUR_MT5_SERVER>"
          ]
        }
      }
    }
    
  5. Restart Claude Desktop to apply changes.

Securing API Keys

Use environment variables to store sensitive information. Example:

{
  "mcpServers": {
    "metatrader": {
      "command": "metatrader-mcp-server",
      "args": [],
      "env": {
        "MT5_LOGIN": "<YOUR_MT5_LOGIN>",
        "MT5_PASSWORD": "<YOUR_MT5_PASSWORD>",
        "MT5_SERVER": "<YOUR_MT5_SERVER>"
      }
    }
  }
}

Cursor

No setup instructions for Cursor are provided in the available documentation.

Cline

No setup instructions for Cline are provided in the available documentation.

How to use this MCP inside flows

Using MCP in FlowHunt

To integrate MCP servers into your FlowHunt workflow, start by adding the MCP component to your flow and connecting it to your AI agent:

FlowHunt MCP flow

Click on the MCP component to open the configuration panel. In the system MCP configuration section, insert your MCP server details using this JSON format:

{
  "metatrader": {
    "transport": "streamable_http",
    "url": "https://yourmcpserver.example/pathtothemcp/url"
  }
}

Once configured, the AI agent is now able to use this MCP as a tool with access to all its functions and capabilities. Remember to change "metatrader" to whatever the actual name of your MCP server is and replace the URL with your own MCP server URL.


Overview

SectionAvailabilityDetails/Notes
Overview
List of PromptsNone found
List of ResourcesNone found
List of ToolsNone found
Securing API KeysShown via env example
Sampling Support (less important in evaluation)Not mentioned

Our opinion

This MCP server is focused and well-documented for MetaTrader integration, but lacks details on prompts, resources, and tool definitions in the public documentation. It is easy to set up for Claude Desktop, and includes basic security best practices. However, the lack of explicit MCP resources, prompt templates, and tool descriptions limits its composability and discoverability for advanced MCP workflows.

MCP Score

Has a LICENSE✅ MIT
Has at least one tool
Number of Forks12
Number of Stars54

Rating:
Given the clarity of setup but the absence of explicit MCP prompt, resource, or tool definitions, this MCP server would be rated 5/10 for general MCP utility and composability. It’s functional for its core use case, but lacks broader MCP ecosystem features.

Frequently asked questions

What is the MetaTrader MCP Server?

It is a Python-based MCP server that bridges AI Large Language Models with the MetaTrader 5 trading platform, enabling automated, intelligent trading actions such as placing, modifying, or closing trades via standardized MCP interfaces.

What can I do with the MetaTrader MCP Server?

You can automate trading operations, manage portfolios, analyze real-time market data, implement AI-driven risk management, and backtest trading strategies using your AI agents connected to MetaTrader 5.

How do I securely set up credentials for the MetaTrader MCP Server?

Store your MetaTrader login, password, and server information as environment variables in your MCP server configuration to keep sensitive data protected.

Does the server include MCP prompt templates or detailed tools?

No explicit MCP prompt templates or tool/resource definitions are provided in the public documentation; the server is focused on MetaTrader integration for core trading functions.

What is the license of the MetaTrader MCP Server?

The server is released under the MIT License.

Automate Your Trading with MetaTrader MCP

Boost your trading workflows by connecting AI agents directly to MetaTrader 5 through the MetaTrader MCP Server. Streamline automation, analytics, and risk management today.

Learn more