Code validation

MQL4 syntax checker MCP for MetaEditor

Pineify's mql4-syntax-checker is a read-only MCP tool that checks either one complete MQL4 source file or a bounded multi-file project with MetaEditor. It returns normalized error locations without editing, executing, backtesting, or trading with the submitted code.

MCP tool name
mql4-syntax-checker

Example prompt

Use Pineify to check this standalone MQL4 Expert Advisor with MetaEditor and explain each returned error.

Direct answer

What mql4-syntax-checker does

Use standalone mode when the entire MQL4 program is in one source string. Send only code. The gateway checks it as Indicators/Main.mq4, so code cannot be combined with entry or files in the same request.

Use project mode when the entry depends on local includes or other bounded files. Send entry as a relative .mq4 path and include that exact path, plus every required project file, in files. The service accepts safe relative .mq4, .mqh, .txt, .csv, and .json paths; it does not read your local workspace.

The result separates source diagnostics from infrastructure failures. hasError reports whether MetaEditor returned errors, while isTimeout and isSystemError mean that no conclusive check was completed.

Contract

What the agent sends and receives

Inputs

  • Standalone mode: code contains complete non-empty MQL4 source and cannot exceed 524,288 UTF-8 bytes.
  • Project mode: entry is a safe relative .mq4 path and must also appear exactly in files.
  • Project mode: files contains unique relative paths and content for every required file, with at most 50 files, 524,288 UTF-8 bytes per file, and 2,097,152 bytes of total content.
  • Choose one mode per call. Send code alone, or send entry and files together. The user cannot set platform, mode, compiler arguments, credentials, or raw-log options.

Structured output

  • hasError states whether MetaEditor returned one or more source errors.
  • errors contains message, row, column, and an optional safely matched relative file path for each diagnostic.
  • isTimeout states that the downstream validation request exceeded its time limit.
  • isSystemError states that the checker could not produce a valid result because of a validation, service, network, or response failure.

Capabilities

Where this MCP tool fits

Standalone MQL4 checks

Submit one complete script, indicator, or Expert Advisor through the code field for a focused MetaEditor syntax check.

Bounded multi-file checks

Submit an entry .mq4 path with all required project files, including relative .mq4 and .mqh source paths.

Safe normalized diagnostics

Receive each error with its message, row, column, and a submitted relative file path only when the service path can be matched unambiguously.

Read-only agent routing

Let an MCP client call MetaEditor without changing source files, executing code, placing trades, or modifying a MetaTrader account.

Agent workflow

A bounded call from question to review

  1. 1

    Choose the input mode

    Use code for one self-contained MQL4 file. Use entry with files when the program depends on local includes or supporting files.

  2. 2

    Supply the bounded source set

    For a project, include the entry in files and add every required dependency with a unique safe relative path.

  3. 3

    Run the MetaEditor check

    The MCP tool sends the fixed MT4 syntax request to the isolated MetaEditor service and returns only safe structured status fields.

  4. 4

    Review and retry

    Fix diagnostics by relative file, row, and column. Treat timeouts and system errors as inconclusive rather than successful checks.

Prompt examples

Questions an agent can route to this tool

"Use Pineify to check this standalone MQL4 Expert Advisor with MetaEditor and explain each returned error."
"Use Pineify to syntax-check this bounded MQL4 project. Experts/Main.mq4 is the entry, and I will provide every .mq4 and .mqh file it needs."
"Run the MQL4 syntax checker on these project files, group diagnostics by relative file, and suggest the smallest source fixes without executing or backtesting the code."

Operator notes

How I review the result

I send only code for a self-contained MQL4 file. Mixing code with entry or files is rejected before the downstream service is called.

I use project mode for local includes, make entry match one file path exactly, and keep the project within the file and UTF-8 byte limits.

I fix the earliest useful diagnostic before retrying because later errors may be consequences. I never treat isTimeout or isSystemError as a clean result.

Boundaries to keep in the prompt

  • This is a MetaEditor static syntax check, not code execution, Strategy Tester, optimization, backtesting, broker connectivity, or proof that trading logic is correct.
  • Standalone mode cannot resolve project files that are not contained in the submitted code. Use entry and files for local dependencies.
  • Project mode accepts at most 50 files. Each file is limited to 524,288 UTF-8 bytes, and all submitted content together is limited to 2,097,152 bytes.
  • Entry must be a safe relative .mq4 path. Supporting files must use safe relative .mq4, .mqh, .txt, .csv, or .json paths; unsafe, absolute, traversal, duplicate, binary, or MQL5 paths are rejected.
  • The public result contains errors, not warning or raw-log output. A diagnostic file path is optional because a service path is only exposed as a submitted relative path when the match is unambiguous.
  • A clean syntax result does not prove runtime behavior, broker compatibility, strategy profitability, or future performance. Check your source-sharing policy before sending proprietary MQL4 code.

Pineify MCP is an information and code-validation tool, not investment advice. It does not promise returns, place trades, or modify a portfolio. Review timestamps, source fields, code diagnostics, and risk assumptions before acting.

FAQ

MQL4 syntax checker MCP for MetaEditor questions

Add mql4-syntax-checker to your AI workflow

Connect one remote Pineify MCP endpoint, then let your compatible AI client discover this tool with the rest of the read-only catalog.

Open MCP setup