MT-MCP Docs
Tool Reference

Core & Session Management

7 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.

create_terminal_key

Creates a new terminal-scoped API key bound to a specific terminal. The plaintext key is returned exactly once and cannot be retrieved again — store it securely immediately. Multiple keys per terminal are allowed (e.g. one for each AI client). Seat limits are NOT enforced at key creation; the terminal still needs to connect to claim a seat.

Parameters

NameTypeRequiredDefaultDescription
terminal_idstringYesThe terminal ID to bind this key to (get from list_terminal_keys or get_terminals).
labelstringNoOptional human-readable label, e.g. 'Claude - Live Account'.

get_default_terminal

Returns the current session default terminal ID, or null if none is set (auto-routing is active).

Parameters

No parameters.


get_terminals

Lists all MetaTrader terminals currently connected under this license, with their terminalId, platform (MT4/MT5), and last-seen timestamp. Call this first to discover available terminals. If only one terminal is connected, all tools route to it automatically without needing terminal_id. For multiple terminals, call set_default_terminal once per session so the agent does not need to repeat the terminal_id on every message.

Parameters

No parameters.


get_tick

Returns the current bid, ask, and spread for a symbol. terminal_id is optional — omit it to route to the session default (set via set_default_terminal) or the only connected terminal. Call get_terminals to discover available terminals.

Parameters

NameTypeRequiredDefaultDescription
symbolstringYes
terminal_idstringNo

list_terminal_keys

Lists all terminal-scoped API keys for this license. Shows key ID, bound terminal ID, optional label, creation date, and active status. Plaintext keys are never shown. Use create_terminal_key to issue a new key, or revoke_terminal_key to deactivate one.

Parameters

No parameters.


revoke_terminal_key

Revokes (deactivates) a terminal-scoped API key by its key ID. Revoked keys are rejected immediately at /api/token. The key record is retained for audit purposes. Use list_terminal_keys to find the key ID.

Parameters

NameTypeRequiredDefaultDescription
key_idstringYesThe key ID to revoke (from list_terminal_keys).

set_default_terminal

Sets the default terminal for this session. After calling this, all tools that accept terminal_id will use this terminal automatically when terminal_id is omitted. Call get_terminals first to see available terminal IDs. Useful in multi-terminal setups so the user does not have to repeat the terminal ID in every message. Call with terminal_id: null to clear the default and fall back to auto-routing.

Parameters

NameTypeRequiredDefaultDescription
terminal_idanyYesTerminal ID to set as default, or null to clear.

On this page