MetaTrader

v1.0.0Finance & Fintechstable

Model Context Protocol (MCP) to enable AI LLMs to trade using MetaTrader platform

aifinanceinvestmentllmmcp
Share:
268
Stars
0
Downloads
0
Weekly
0/5

What is MetaTrader?

MetaTrader is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) to enable ai llms to trade using metatrader platform

Model Context Protocol (MCP) to enable AI LLMs to trade using MetaTrader platform

This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Model Context Protocol (MCP) to enable AI LLMs to trade usin

Use Cases

Enable AI trading on MetaTrader
Execute algorithmic trades
Analyze quantitative finance
ariadng

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx metatrader

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MetaTrader

MetaTrader MCP Server (PyPI: metatrader-mcp-server) is a bridge that connects AI assistants such as Claude to the MetaTrader 5 trading platform, allowing you to trade and analyze markets using plain English commands. It exposes full account control, order management, and market data retrieval through the MCP protocol, and also ships an HTTP/REST API server and a WebSocket quote streamer for non-MCP integrations. Traders, analysts, and developers use it to automate order placement, monitor positions, and fetch historical price data without manual platform interaction.

Prerequisites

  • Python 3.10 or higher installed
  • MetaTrader 5 terminal installed and running (download from metatrader5.com)
  • An MT5 trading account (demo or live) with login number, password, and server name
  • Algorithmic trading enabled in MT5: Tools > Options > Expert Advisors > Allow algorithmic trading
  • Claude Desktop or another MCP-compatible client
1

Install the package from PyPI

Install the metatrader-mcp-server package using pip. Python 3.10+ is required.

pip install metatrader-mcp-server
2

Enable algorithmic trading in MetaTrader 5

Open MT5, go to Tools > Options > Expert Advisors tab, and check 'Allow algorithmic trading'. Without this the server cannot place orders.

3

Configure Claude Desktop with your MT5 credentials

Add the server to your claude_desktop_config.json, passing your MT5 login, password, and broker server name as arguments.

4

Optionally specify a custom MT5 terminal path

If your MT5 terminal is installed in a non-standard location, add the --path argument pointing to the terminal64.exe binary.

# Example path argument for non-standard installations
--path "C:\Program Files\MetaTrader 5\terminal64.exe"
5

Restart Claude Desktop and verify the connection

Restart Claude Desktop after saving the config. Ask Claude 'What is my account balance?' to confirm the server has connected to MT5 successfully.

MetaTrader Examples

Client configuration

Add the metatrader MCP server to claude_desktop_config.json using STDIO transport. Replace placeholders with your real MT5 credentials.

{
  "mcpServers": {
    "metatrader": {
      "command": "metatrader-mcp-server",
      "args": [
        "--login", "YOUR_MT5_LOGIN",
        "--password", "YOUR_MT5_PASSWORD",
        "--server", "YOUR_MT5_SERVER",
        "--transport", "stdio"
      ]
    }
  }
}

Prompts to try

These prompts exercise the account, market data, and order management tools exposed by the server.

- "Show me my account balance, equity, and free margin"
- "Buy 0.01 lots of EUR/USD at market price"
- "Close all positions that are currently in profit"
- "What is the current bid/ask spread for XAUUSD?"
- "Show my last 10 closed trades and total profit/loss"

Troubleshooting MetaTrader

Connection failed error when starting the server

Ensure MetaTrader 5 is running and logged into your account before starting the MCP server. Check that algorithmic trading is enabled in MT5 Options and your login credentials are correct.

Module not found error for metatrader_mcp

Run 'pip install metatrader-mcp-server' and ensure you are using Python 3.10 or higher. Run 'python --version' to check, and prefix the pip command with the correct Python version if multiple are installed.

Order execution fails with insufficient margin error

Verify that you have enough free margin for the trade size. Switch to a demo account to test, ensure the symbol is available on your broker, and check that the market is currently open.

Frequently Asked Questions about MetaTrader

What is MetaTrader?

MetaTrader is a Model Context Protocol (MCP) server that model context protocol (mcp) to enable ai llms to trade using metatrader platform It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MetaTrader?

Follow the installation instructions on the MetaTrader GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MetaTrader?

MetaTrader works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MetaTrader free to use?

Yes, MetaTrader is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Finance & Fintech MCP Servers

Explore all finance & fintech servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "metatrader": { "command": "npx", "args": ["-y", "metatrader"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MetaTrader?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides