home / mcp / metatrader 5 mcp server
Provides an MCP interface to MetaTrader 5 for market data access, order placement, and trading history analysis.
Configuration
View docs{
"mcpServers": {
"sameerasulakshana-mcpmt5": {
"command": "uv",
"args": [
"run",
"mt5mcp",
"dev"
]
}
}
}This MCP server lets an AI assistant interact with MetaTrader 5 to query market data, manage trades, and analyze history in an automated, scalable way. You can run the server locally for development, connect via an MCP client, and optionally deploy or configure it for tools like Claude Desktop to enable seamless trading workflows.
You will connect an MCP client to the MetaTrader 5 MCP Server to access market data, place and manage trades, and review trading history. Start by launching the server in development mode, then send requests through your MCP client to initialize the MT5 terminal, log in to your account, retrieve symbols and price data, and place orders. Use the available market data endpoints to fetch rates, ticks, and historical bars, and use trading endpoints to open, monitor, and close positions. When you are finished, shut down the connection to MT5 gracefully.
Prerequisites you need before installing:
From source, install and set up the server with these steps:
git clone https://github.com/Qoyyuum/mcp-metatrader5-server.git
cd mcp-metatrader5-server
pip install -e .Run the server in development mode to start listening on the default host and port.
uv run mt5mcp devBy default, the server will be available at http://127.0.0.1:8000. You can change the host and port as needed:
uv run mt5mcp dev --host 0.0.0.0 --port 8080If you are integrating with Claude Desktop, clone the project and install the server using the runtime helper, then configure Claude to load the MCP server.
git clone https://github.com/Qoyyuum/mcp-metatrader5-server
cd mcp-metatrader5-server
uv run fastmcp install src\mcp_metatrader5_server\server.pyYour Claude Desktop configuration can include an MCP server entry like this (paths may vary):
{
"mcpServers": {
"MetaTrader 5 MCP Server": {
"command": "uv",
"args": [
"run",
"--with",
"MetaTrader5",
"--with",
"fastmcp",
"--with",
"numpy",
"--with",
"pandas",
"--with",
"pydantic",
"fastmcp",
"run",
"C:\\FULL_PATH_TO\\src\\mcp_metatrader5_server\\server.py"
]
}
}
}