MT-MCP Docs
Tool Reference

Trading

3 tools — auto-generated from the MCP server's tool schemas.

Generated

This page is generated from packages/server/mcp/src/tools/*.ts by pnpm docs:generate-tools. Do not edit it by hand — edit the tool's description/schema in source and regenerate.

close_position

Closes an open position by ticket. Defaults to dry_run=true — set dry_run=false to execute live. Requires the trade capability and inp_AllowTrading=true on the EA.

This tool can affect a live trading account. dry_run defaults to true — pass dry_run: false explicitly to execute for real.

Parameters

NameTypeRequiredDefaultDescription
ticketintegerYes
dry_runbooleanNotrue
terminal_idstringNo

modify_position

Modifies the stop_loss and/or take_profit of an open position. At least one of stop_loss or take_profit must be provided. Defaults to dry_run=true — set dry_run=false to execute live. Requires the trade capability and inp_AllowTrading=true on the EA.

This tool can affect a live trading account. dry_run defaults to true — pass dry_run: false explicitly to execute for real.

Parameters

NameTypeRequiredDefaultDescription
ticketintegerYes
stop_lossnumberNo
take_profitnumberNo
dry_runbooleanNotrue
terminal_idstringNo

place_order

Places a market or pending order on MT5. Defaults to dry_run=true — set dry_run=false to execute live. Pending orders may set expiry (unix epoch seconds) for broker-side expiration; expiry is rejected on market orders. Requires the trade capability and inp_AllowTrading=true on the EA.

This tool can affect a live trading account. dry_run defaults to true — pass dry_run: false explicitly to execute for real.

Parameters

NameTypeRequiredDefaultDescription
symbolstringYes
volumenumberYes
order_typestringYes(one of: BUY, SELL, BUY_LIMIT, BUY_STOP, SELL_LIMIT, SELL_STOP)
pricenumberNo
stop_lossnumberNo
take_profitnumberNo
magicintegerNo
commentstringNo
expiryintegerNoPending orders only: expiration as unix epoch seconds (UTC). Must be in the future.
dry_runbooleanNotrue
terminal_idstringNo

On this page