About Metatrader5 Server
Metatrader5 Server is an MCP server published by Qoyyuum in the Developer Tools category: a Model Context Protocol (MCP) server for interacting with the MetaTrader 5 trading platform. This server provides AI assistants with tools and resources to access market data, perform trading operations, and analyze trading history. Conduid read 26 tools from its source: copy_rates_from_date, copy_rates_from_pos, copy_rates_range, copy_ticks_from_date, copy_ticks_from_pos, copy_ticks_range and 20 more. It is published to PyPI as mcp-metatrader5-server and runs with uvx.
The repository has 250 stars and 81 forks, and its last commit was on 30 Nov 2026. The latest release is v0.1.8 (19 Jun 2026): Bumped version update and support #74 #75 #76 Added support for Buy Limit and Sell Limit #72 #64 Improved order send and order check validation #63 Shoutout to @syahnur1… It follows v0.1.7 (23 Oct 2025), and the 4 most recent releases go back to v0.1.5 (2 Oct 2025). It passes 4 of the 6 static checks Conduid ran on the repository; it does not pass License declared and Scoped permissions. Its topics include metatrader-5 and devtools.
Install
claude mcp add metatrader5-server -- uvx --from mcp-metatrader5-server mt5mcpuvx --from mcp-metatrader5-server mt5mcpuvx mcp-metatrader5-serverpip install mcp-metatrader5-servergit clone https://github.com/Qoyyuum/mcp-metatrader5-serverTools (26)
copy_rates_from_dateGet bars from a specified symbol and timeframe starting from the specified date.| Parameter | Type | Description |
|---|---|---|
| count * | integer | Number of bars to retrieve |
| date_from * | any | Start date for bar retrieval |
| symbol * | string | Symbol name |
| timeframe * | integer | Timeframe (use TIMEFRAME_* constants) |
copy_rates_from_posGet bars from a specified symbol and timeframe starting from the specified position.| Parameter | Type | Description |
|---|---|---|
| count * | integer | Number of bars to retrieve as an INTEGER (e.g., 100 for last 100 bars) |
| start_pos * | integer | Starting position as an INTEGER (0 = most recent bar, 1 = second most recent, etc.) |
| symbol * | string | Symbol name (e.g., "EURUSD", "GBPUSD") |
| timeframe * | integer | Timeframe in minutes as an INTEGER: - 1: TIMEFRAME_M1 (1 minute) - 5: TIMEFRAME_M5 (5 minutes) - 15: TIMEFRAME_M15 (15 minutes) - 30: TIMEFRAME_M30 (30 minutes) - 60: TIMEFRAME_H1 (1 hour) - 240: TIMEFRAME_H4 (4 hours) - 1440: TIMEFRAME_D1 (1 day) - 10080: TIMEFRAME_W1 (1 week) - 43200: TIMEFRAME_MN1 (1 month) |
copy_rates_rangeGet bars from a specified symbol and timeframe within the specified date range.| Parameter | Type | Description |
|---|---|---|
| date_from * | any | Start date for bar retrieval |
| date_to * | any | End date for bar retrieval |
| symbol * | string | Symbol name |
| timeframe * | integer | Timeframe (use TIMEFRAME_* constants) |
copy_ticks_from_dateGet ticks from a specified symbol starting from the specified date.| Parameter | Type | Description |
|---|---|---|
| count * | integer | Number of ticks to retrieve |
| date_from * | any | Start date for tick retrieval |
| flags | integer | Type of requested ticks |
| symbol * | string | Symbol name |
copy_ticks_from_posGet ticks from a specified symbol starting from the specified position.| Parameter | Type | Description |
|---|---|---|
| count * | integer | Number of ticks to retrieve |
| flags | integer | Type of requested ticks: - mt5.COPY_TICKS_ALL: All ticks (default) - mt5.COPY_TICKS_INFO: Ticks containing bid and/or ask price changes - mt5.COPY_TICKS_TRADE: Ticks containing last price and volume changes |
| start_time * | any | Initial time for tick retrieval |
| symbol * | string | Symbol name |
copy_ticks_rangeGet ticks from a specified symbol within the specified date range.| Parameter | Type | Description |
|---|---|---|
| date_from * | any | Start date for tick retrieval |
| date_to * | any | End date for tick retrieval |
| flags | integer | Type of requested ticks |
| symbol * | string | Symbol name |
get_account_infoGet information about the current trading account.get_last_errorGet the last error code and description.get_symbol_infoGet information about a specific symbol.| Parameter | Type | Description |
|---|---|---|
| symbol * | string | Symbol name |
get_symbol_info_tickGet the latest tick data for a symbol.| Parameter | Type | Description |
|---|---|---|
| symbol * | string | Symbol name (e.g., "EURUSD", "XAUUSD", "GBPUSD") |
get_symbolsGet all available symbols (financial instruments) from the MetaTrader 5 terminal.get_symbols_by_groupGet symbols that match a specific group or pattern.| Parameter | Type | Description |
|---|---|---|
| group * | string | Filter for arranging a group of symbols (e.g., "*", "EUR*", etc.) |
get_terminal_infoGet information about the MetaTrader 5 terminal.get_versionGet the MetaTrader 5 version.history_deals_getGet deals from history.| Parameter | Type | Description |
|---|---|---|
| from_date | any | Start date for deal retrieval. Defaults to the epoch. |
| group | string | Filter for arranging a group of deals (e.g., "*", "USD*") |
| position | integer | Position ticket. Looked up on its own; other filters are ignored. |
| symbol | string | Symbol name, used as a filter (e.g. "EURUSD"). Ignored when group is given. |
| ticket | integer | Order ticket - returns the deals generated by that order (DEAL_ORDER), not a deal ticket. Looked up on its own; other filters are ignored. |
| to_date | any | End date for deal retrieval. Defaults to tomorrow. |
history_orders_getGet orders from history.| Parameter | Type | Description |
|---|---|---|
| from_date | any | Start date for order retrieval. Defaults to the epoch. |
| group | string | Filter for arranging a group of orders (e.g., "*", "USD*") |
| position | integer | Position ticket. Looked up on its own; other filters are ignored. |
| symbol | string | Symbol name, used as a filter (e.g. "EURUSD"). Ignored when group is given. |
| ticket | integer | Order ticket. Looked up on its own; other filters are ignored. |
| to_date | any | End date for order retrieval. Defaults to tomorrow. |
initializeInitialize the MetaTrader 5 terminal.| Parameter | Type | Description |
|---|---|---|
| path | string | Full path to the MT5 terminal executable (optional). If omitted, the MT5_PATH environment variable of the server is used. If that is not set either, MetaTrader5 connects to the terminal it finds on its own. Common paths: - "C:\\Program Files\\MetaTrader 5\\terminal64.exe" - "C:\\Program Files (x86)\\MetaTrader 5\\terminal64.exe" |
loginLog in to the MetaTrader 5 trading account.| Parameter | Type | Description |
|---|---|---|
| login | integer | Trading account number (integer, e.g., 12345678). Optional. |
| password | string | Trading account password (string). Optional. |
| server | string | Trading server name (e.g., "Demo-Server", "YourBroker-Live"). Optional. |
order_checkCheck if an order can be placed with the specified parameters.| Parameter | Type | Description |
|---|---|---|
| request * | any | OrderRequest object (same format as order_send) See order_send() documentation for field details and examples. |
order_sendSend an order to the trade server.| Parameter | Type | Description |
|---|---|---|
| request * | any | OrderRequest object with these fields: |
orders_getGet active orders.| Parameter | Type | Description |
|---|---|---|
| group | string | Filter for arranging a group of orders (e.g., "*", "USD*", etc.) |
| symbol | string | Symbol name. If specified, only orders for this symbol will be returned. |
orders_get_by_ticketGet an active order by its ticket.| Parameter | Type | Description |
|---|---|---|
| ticket * | integer | Order ticket |
positions_getGet open positions.| Parameter | Type | Description |
|---|---|---|
| group | string | Filter for arranging a group of positions (e.g., "*", "USD*", etc.) |
| symbol | string | Symbol name. If specified, only positions for this symbol will be returned. |
positions_get_by_ticketGet an open position by its ticket.| Parameter | Type | Description |
|---|---|---|
| ticket * | integer | Position ticket |
shutdownShut down the connection to the MetaTrader 5 terminal.symbol_selectSelect a symbol in the Market Watch window or remove a symbol from it.| Parameter | Type | Description |
|---|---|---|
| symbol * | string | Symbol name (e.g., "EURUSD", "XAUUSD", "GBPUSD") |
| visible | boolean | Symbol visibility flag - True: Add/show the symbol in Market Watch (default, recommended) - False: Hide the symbol from Market Watch |
Security checks
Static checks derived from the repository 10 hours ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 1.0K words.
- !License declaredNo license file. Legally you have no right to use it in a product.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by uv.lock.
- ✓No dynamic code executionScanned 2 source files and found no eval, dynamic Function or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdio and Streamable HTTPsrc/mcp_mt5/__init__.py:27, src/mcp_mt5/__init__.py:24
- Starts other programs
- No calls that start other programs
- Outbound network calls
- No outbound network calls
- Writes or deletes files
- No file writes or deletes
- Lockfile
- uv.lock
Pattern matches on the source text of 2 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 1.0K words, fetched 10 hours ago. The original in the repository is authoritative.
Read full README