TC Terminal Control API by MTCodec
MetaTrader 5 · Expert Advisors · Windows VPS

Let your AI chat operate the customer's EAs, not just report on them.

A small service inside the VPS image plus one REST/MCP API. Start and stop Expert Advisors, switch risk presets, change parameters — with server-side validation, a confirmation step, and proof of what actually happened on the terminal.

1–3 scommand to confirmed result
5 verbsstart · stop · set risk · set param · restart
0 inbound portsoutbound HTTPS only from the VPS
Recorded session · 3 Sep 2026 · demo account, Alpari-MT5-Demo
How is my account doing?
get_client_state · 200 · 2 accounts, 5 EA instances, VPS online
Account 53133703 (Alpari-MT5-Demo, EUR): balance €5,000.00, equity €5,000.00, no open positions. 1 EA running: Night Hunter Pro — EURUSD M5, preset medium, MaximumSpread 7. No closed deals in the last 7 days — the EAs were started yesterday evening. This is information about your account, not financial advice.
Restart Night Hunter on account 53133703 with MaxSpread 15
get_ea night_hunter_pro · 92 inputs · "MaxSpread" resolves to MaximumSpread (0.5–50)
restart_ea dry_run · Set MaximumSpread 7 → 15 on Night Hunter Pro (EURUSD) — EA will restart
Here's the dry run for Night Hunter Pro on 53133703 (instance inst_baoxec84, EURUSD M5): • MaximumSpread: 7.0 → 15.0 pips • The EA will restart — it has 0 open positions and 0 pending orders, nothing is at risk. Shall I apply it?
yes, go ahead
restart_ea · 202 queued · cmd_01M1JY85A07NCXYZ
get_command wait=30 · succeeded · reconciled: true · read back MaximumSpread=15.0
Done ✅
Requested (queued) 06:10:41Confirmed (dispatched, running) 06:10:42Happened (succeeded) 06:10:43
MaximumSpread 7 → 15 applied on Night Hunter Pro (EURUSD); EA restarted. The terminal confirms it back: instance running on EURUSD M5 with MaximumSpread = 15.0, everything else unchanged.
How it works

Five hops, one contract

The chat never touches the terminal. Every request passes through our validation layer, is executed by a small agent on the VPS, and is checked against what the terminal actually shows afterwards.

Yours

Chat / dashboard

Your LLM agent with our tool definitions, or any backend. Shows the dry run, asks the user, relays the outcome.

Ours

Control server

REST + MCP. Catalog of EAs, whitelist of parameters and ranges, risk presets, restart-safety status. Rejects before queuing.

Ours · in the VPS image

Agent

Outbound-only service. Keeps terminals up, streams state every 15 s, executes commands, self-heals after restarts.

Ours · MQL5

Manager EA

One per terminal. Opens charts and applies templates with the EA and its inputs; reads the applied inputs back.

Customer's

MT5 terminal + EAs

Closed .ex5 as delivered by the vendor. No source code, no reverse engineering, no Manager API.

Our layerExisting pieces, untouchedReconcile: requested → resolved → observed; a mismatch is a failed command, never a silent success.
Guarantees

The LLM is never the security boundary

Whatever the model sends, the server validates again. These rules are enforced in our layer for every tenant.

Whitelist, server-side

Only catalogued EAs, only allowed symbols, only whitelisted inputs inside their ranges. Everything else is a 422 with a message the model can relay.

Restart safety

Every parameter change restarts the EA. Changes on an EA with open positions are refused until that EA's basket recovery has been verified on a demo account.

Proof, not promises

Each command carries what was asked, what was applied and what the terminal shows afterwards, with timestamps. Inputs are read back from the running EA.

Dry run first

dry_run: true returns the summary and the was → now diff without queuing anything — the natural place for a confirmation step.

Adoption

EAs a customer already runs by hand appear in the API as managed instances, with their real inputs, without touching them.

Per-EA attribution

Positions and closed deals are mapped to EA instances by magic number, so your reporting knows which EA did what.

API

REST, Claude tool definitions, MCP

One OpenAPI 3.1 contract. The same capabilities ship as tool schemas for any function-calling model and as an MCP server for MCP-capable clients. Every call carries the customer id; there is no shared database.

MethodPathPurpose
GET/v1/clients/{client_id}/stateEverything the customer owns, live: VPS health, accounts, running EAs with effective inputs, positions, orders.
GET/v1/eas · /v1/eas/{ea_id}Catalog: presets, allowed symbols, every changeable input with label, range and whether to confirm.
POST/v1/accounts/{account_id}/commandsstart_ea, stop_ea, set_risk, set_param, restart_ea — 202 + command id, or 200 dry run.
GET/v1/commands/{command_id}?wait=30Long-poll the outcome: status, diff, observed state, timeline.
GET/v1/accounts/{account_id}/historyClosed deals with ea_id attribution.

Full reference: OpenAPI document and Swagger UI · tool definitions for Claude and other function-calling models · MCP server (stdio).

Pilot

Built for VPS providers and brokers who run EAs for their customers

We install the service into your VPS image, onboard your EA catalog (about ten minutes of review per EA), and give your team the sandbox, the spec and the tool schemas. You keep the dashboard, the agent persona and the customer relationship.

  • Non-exclusive licence, per-VPS pricing, no source code transfer.
  • Restart-safety knowledge base per EA, maintained by us as vendors ship new builds.
  • Backtests from chat on a dedicated tester pool — specified, next version.
Get in touch

Request a live demo

Thirty minutes: your EAs, a demo account, the chat driving them end to end.

Contact MTCodec