Replies: 1 comment 1 reply
-
|
feel free to mark this as complete. I really was just sharing the scripts with u. If there was a discussion section I would have posted there. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
MetaTrader 5 on Linux: Wine + MCP Server Setup
The scripts to automate everything are below.
I've got a solid method to run MetaTrader 5 on Linux using Wine, with Python setup for MCP server integration. This lets you use AI assistants in a linux env.
Why This Matters
Prerequisites
Step-by-Step Setup
Step 1: Install Wine and MetaTrader 5
Run the Wine setup script to install Wine and MT5:
# Download and run the Wine/MT5 setup script curl -O https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/main/mt5linux.sh chmod +x mt5linux.sh ./mt5linux.shThis script will:
Reboot your system after installation as instructed.
Step 2: Clone the MCP Server Repository
git clone https://github.com/Qoyyuum/mcp-metatrader5-server.git cd mcp-metatrader5-serverStep 3: Set Up Python Environment for MCP
Run the Python setup script (modify paths as needed):
This script will:
Step 4: Configure Your AI Assistant
Copy the generated MCP configuration to your AI client's config directory. For Claude Code:
IMPORTANT: Your MCP Configuration should look like this:
{ "mcpServers": { "metatrader5": { "command": "bash", "args": [ "-c", "WINEPREFIX=$TARGET_PREFIX wine python -c \\\"import sys; sys.path.insert(0, 'Z:$MCP_SERVER_DIR/src'); import os; os.chdir('Z:$MCP_SERVER_DIR'); from mcp_mt5 import main; main()\\\"" ], "env": { "MT5_PATH": "C:\\\\\\\\Program Files\\\\\\\\MetaTrader 5\\\\\\\\terminal64.exe" }, "disabled": false, "alwaysAllow": [] } } }Restart your AI assistant to load the MCP server.
Step 5: Test the Integration
Start MetaTrader 5 in Wine:
Log in to your trading account in MT5, then test the MCP integration with:
Troubleshooting
Wine Issues
Python Installation Problems
MCP Server Issues
Performance Notes
Security Considerations
What You Get
This setup turns Linux into a full-featured trading workstation with AI capabilities. Wine provides compatibility while MCP enables AI integration.
Hit me up if you run into issues or need help with configurations.
Installation Scripts 📜
Wine & MT5 Setup Script (
mt5linux.sh)Python MCP Setup Script (
setup_mt5_python_only.sh)Beta Was this translation helpful? Give feedback.
All reactions