mql5-docs-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mql5-docs-mcp get the signature for CopyBuffer"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mql5-docs-mcp
An MCP server that gives coding agents (Claude Code, Cursor, Claude Desktop) the real MQL5 function signatures and error-code meanings, so they stop writing MQL4 syntax or inventing functions when they build MetaTrader 5 EAs.
It runs locally over stdio with a prebuilt index. It makes no network calls at runtime and needs no API key.
Tools
Tool | What it does | Example |
| Search built-in functions by name or section, up to 10 results |
|
| Exact signature(s), section and doc link for one function |
|
| Trade server return codes and runtime errors, by number or constant |
|
Example get_signature("CopyBuffer"):
CopyBuffer (Timeseries and Indicators Access)
int CopyBuffer(int indicator_handle, int buffer_num, int start_pos, int count, double buffer[])
int CopyBuffer(int indicator_handle, int buffer_num, datetime start_time, int count, double buffer[])
int CopyBuffer(int indicator_handle, int buffer_num, datetime start_time, datetime stop_time, double buffer[])
https://www.mql5.com/en/docs/series/copybufferRelated MCP server: mt5-mcp
Status (v0.1)
The index covers all 517 functions in the official function index (name, section and doc link) and all 296 trade return codes and runtime errors. Exact signatures are indexed for 203 functions so far, because mql5.com rate-limited the indexer partway through. For the rest, get_signature returns the doc link. Running npm run build:index again resumes from .cache/ and fills in the gaps.
Install
Claude Code:
claude mcp add mql5-docs -- npx -y github:zafmy/mql5-docs-mcpAny other MCP client (mcpServers config):
{ "mql5-docs": { "command": "npx", "args": ["-y", "github:zafmy/mql5-docs-mcp"] } }Scope
Covered: MQL5 built-in functions from the official function index, trade server return codes and runtime error codes.
Not covered: Standard Library classes (CTrade and friends), backtesting, broker connections and compiling. The index stores names, signatures, sections and links only. For the full explanation, follow the link to mql5.com.
Develop
npm install
npm test # builds and runs the tests against the bundled index
npx -y github:zafmy/mcp-smoke -- node dist/index.js # smoke-tests the built server with mcp-smoke.json
npm run build:index # re-scrapes the reference slowly (4 s/page), resumable via .cache/
npm run build:index:offline # rebuilds data/ from .cache/ only, no networkLicense
MIT for the code. MQL5 and MetaTrader are trademarks of MetaQuotes Ltd.; this project is not affiliated with them. Signatures and code descriptions come from the official MQL5 reference.
Available Tools
3 toolsexplain_codeA
Explain an MQL5 trade server return code (MqlTradeResult.retcode, e.g. 10016) or runtime error (GetLastError(), e.g. 4014) by number or constant name.
Inputs: code (required).
get_signatureA
Get the exact MQL5 signature(s), section and official doc link for one function, e.g. CopyBuffer or OrderSend.
Inputs: name (required).
search_referenceA
Search the official MQL5 (MetaTrader 5) function reference by name or section. Returns up to 10 matches with signatures and doc links. Use before writing MQL5 calls to avoid MQL4 syntax or invented functions.
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
search_reference and get_signature both target function lookups and could be confused at the margins, but the multi-match search vs. single exact-signature semantics are described clearly. explain_code is entirely distinct, targeting return codes and runtime errors.
All three tools use a consistent snake_case verb_noun pattern (search_reference, get_signature, explain_code) with clear, predictable action verbs. No mixing of conventions or styles.
Three focused tools is on the lean side but each earns its place covering search, lookup, and error decoding. Slightly thin for a documentation server that could also expose browsing or content retrieval.
Search, signature lookup, and error explanation are covered, but there is no way to retrieve full documentation text, code examples, or enumerate functions within a section. These gaps force agents to rely only on signatures and external links.
Maintenance
Related MCP Connectors
Read-only MetaTrader 5 for AI agents: balances, positions, history and prices. Sign in with OAuth.
Read-only access to your MetaTrader 4 and 5 accounts for AI agents: balances, open positions, trade history with win rate, live quotes, symbol specs and candles. It cannot place, modify or close orders.
Let AI agents read and trade MetaTrader 5 accounts. Sign in with OAuth; read-only unless you allow.
TradeOS MCP: ticker search, My Agent, chart TA, macro news. npm stdio or HTTP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI coding assistants with local access to 4500+ MQL5 documentation files and supplementary ebooks via MCP, enabling efficient search, browsing, and error diagnosis for MQL5 development.25MIT
- AlicenseNot gradedqualityCmaintenanceA local-first MCP server that bridges AI coding agents with MetaTrader 5 for inspection, market data, MQL5 development, compiling, Strategy Tester review, workspace sync, logs, audit trails, demo trading, and carefully gated live trading.MIT
- AlicenseBqualityBmaintenanceEnables LLM agents to compile, deploy, backtest, and analyze MetaTrader 4/5 MQL sources without touching the MetaTrader UI, leveraging the build pipeline.41MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with MetaTrader 5 for market data, live streaming, and trading operations, running locally over stdio.-