MetaTrader
Model Context Protocol (MCP) to enable AI LLMs to trade using MetaTrader platform
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
Maintainer
Works with
Installation
Manual Installation
npx metatraderConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
Install the package from PyPI
Install the metatrader-mcp-server package using pip. Python 3.10+ is required.
pip install metatrader-mcp-serverEnable 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.
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.
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"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.
MetaTrader Alternatives — Similar Finance & Fintech Servers
Looking for alternatives to MetaTrader? Here are other popular finance & fintech servers you can use with Claude, Cursor, and VS Code.
ValueCell
★ 10.7kValueCell is a community-driven, multi-agent platform for financial applications.
Vibe Trading
★ 8.1k'Vibe-Trading: Your Personal Trading Agent'
Quantdinger
★ 6.2kAI quantitative trading platform for crypto, stocks, and forex with backtesting, live trading, market data, and multi-agent research.vibe-trading ,trading-agents,ai-trader,ai-trading
TradingView
★ 2.8kReal-time crypto & stock screening, advanced technical indicators, Bollinger Bands intelligence, candlestick patterns + native Claude Desktop integration. Multi-exchange (Binance, KuCoin, Bybit+). Open-source AI trading infrastructure.
Financial Datasets
★ 2.1kProvides access to comprehensive financial data including income statements, balance sheets, cash flow statements, stock prices, company news, SEC filings, and cryptocurrency information with built-in financial ratio analysis.
Stripe
★ 1.6kThe Stripe Model Context Protocol server allows you to integrate with Stripe APIs through function calling. This protocol supports various tools to interact with different Stripe services.
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.
Set Up MetaTrader in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.