Finance Toolkit
500+ transparent financial methods calculated from raw statements, not third-party endpoints.
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Let an AI agent read and trade a MetaTrader 5 account over MCP, behind a human-approval gate.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
MT5_LOGIN, MT5_PASSWORD, MT5_SERVERค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"mt5-trading": {
"command": "uvx",
"args": [
"mt5-trading-mcp"
],
"env": {
"MT5_LOGIN": "ใส่ค่าของคุณ",
"MT5_PASSWORD": "ใส่ค่าของคุณ",
"MT5_SERVER": "ใส่ค่าของคุณ"
}
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add mt5-trading --env MT5_LOGIN='ใส่ค่าของคุณ' --env MT5_PASSWORD='ใส่ค่าของคุณ' --env MT5_SERVER='ใส่ค่าของคุณ' -- uvx mt5-trading-mcpเติมค่าที่เว้นว่างไว้ก่อนรัน
วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"mt5-trading": {
"command": "uvx",
"args": [
"mt5-trading-mcp"
],
"env": {
"MT5_LOGIN": "ใส่ค่าของคุณ",
"MT5_PASSWORD": "ใส่ค่าของคุณ",
"MT5_SERVER": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"mt5-trading": {
"type": "stdio",
"command": "uvx",
"args": [
"mt5-trading-mcp"
],
"env": {
"MT5_LOGIN": "ใส่ค่าของคุณ",
"MT5_PASSWORD": "ใส่ค่าของคุณ",
"MT5_SERVER": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
MT5_LOGIN envMT5_SERVER envค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 10 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub vincentwongso ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
ต้องใส่ค่าเหล่านี้: MT5_PASSWORD
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (1.4.2) เข้า registry 5 เดือนที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย
ในหมวดเดียวกันมี Finance Toolkit, SolidInvoice, Korea Tax Calculator
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:↓ ดาวน์โหลดต่อสัปดาห์i★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
500+ transparent financial methods calculated from raw statements, not third-party endpoints.
Create and send invoices and quotes, manage clients, and track payments in SolidInvoice.
Korean tax calculation and tax-audit judgment MCP: 97 tools with statutory citations.
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Let an AI agent manage your MetaTrader 5 account over [Model Context Protocol](https://modelcontextprotocol.io) - with configurable human approval gate.
A Hermes agent placing then closing a real 0.01-lot trade on a demo account, end-to-end over MCP on Linux.
Not a mock-up - the same round-trip in MetaTrader 5's own History tab; the tickets and balance match the recording.
⚠️ **This software places _real_ trades through your MetaTrader 5 terminal with
real orders and irreversible fills.** Read
and SECURITY.md
before connecting it to a live account. Always test using your demo account first.
Runs locally - in the same process tree as your agent, no cloud, no telemetry. Windows (native) or Linux (via Docker); Python 3.10+.
📖 The story behind this: this project is built step by step in
Part 1 of the *Trade with AI agent* series on the Fintrix engineering blog.
mt5-mcp lets an AI agent read your MetaTrader 5 account and place trades through it, over the Model Context Protocol.
place_order, modify_order, cancel_order, close_position, each behind a preflight + human-consent + idempotency + audit layer.account://, positions://, and quotes://{symbol} snapshots that push change notifications..claude/skills/: mt5-market-data and mt5-trading teach an agent how to read the account and run the consent flow safely.Full catalogue and the consent flow: [docs/tools.md](https://github.com/vincentwongso/mt5-trading-mcp/blob/main/docs/tools.md).
place_order as a live attack surface and says so plainly - the MCP is explicitly *not* the security boundary (see SECURITY.md).rpyc version-matching).pip install mt5-trading-mcp
python -m mt5_mcp doctor: expect [INFO] backend: native and [PASS] lines.python -m mt5_mcp serve.Wire it to OpenClaw in one command (registers the mcp.servers entry):
openclaw mcp set mt5-mcp '{"command":"python","args":["-m","mt5_mcp","serve"]}'
The MT5 terminal + the MCP run headless in an all-in-one image; your agent talks MCP over HTTP. No host Python, no bridge.
cp deploy/.env.example deploy/.env # add MT5_LOGIN / MT5_PASSWORD / MT5_SERVER
docker compose -f deploy/docker-compose.yml up -d
Log the terminal in once via the KasmVNC web UI at http://127.0.0.1:3001 (File -> Login to Trade Account; persists across restarts), then point your agent at http://127.0.0.1:8765/mcp. Wire it to OpenClaw in one command:
openclaw mcp set mt5-mcp '{"url":"http://127.0.0.1:8765/mcp","transport":"streamable-http"}'
Full walkthrough: [docs/installation.md](https://github.com/vincentwongso/mt5-trading-mcp/blob/main/docs/installation.md).
get_chart_screenshot(symbol, timeframe, annotations?) returns a PNG of the native MT5 chart, optionally annotated, so an LLM can read it visually (candles, support/resistance, patterns). Because the MetaTrader5 Python API cannot capture charts, this uses a small MQL5 Expert Advisor that runs inside a GUI terminal and calls ChartScreenShot().
See Chart annotations for marking up support/resistance lines, trendlines and notes before capture.
Setup (one time):
AgentScreenshot EA - see mql5/README.md.[screenshot] template = "agent.tpl" in your config, or leave it unset for the default chart.Config knobs ([screenshot] section): width (default 1600), height (default 900), template (default none), timeout_s (default 10).
Not available on the headless Linux/Docker deployment: it needs a GUI terminal. Off Windows the tool returns SCREENSHOT_NOT_SUPPORTED.
If you've been handed this repository to install and run, follow the runbook in [docs/agents.md](https://github.com/vincentwongso/mt5-trading-mcp/blob/main/docs/agents.md). It covers platform detection, install, verification, registering the server, and the hard safety rules for trades - read it before calling any mutating tool.
| Guide | What's in it |
|---|---|
| Installation & setup | Requirements, Windows + Linux/Docker setup, wiring to an agent. |
| For AI agents | Step-by-step runbook for an agent installing and running the server. |
| Configuration | config.toml schema, storage paths, hot-reload. |
| Tools & resources | Read tools, mutating tools + consent flow, subscribable resources. |
| MCP client setup | Per-client config snippets and Claude Code usage. |
| Transports & deployment | stdio/HTTP transports and Windows VPS patterns. |
| Contributing | How to contribute and run the tests. |
| Changelog | Release history and known limitations. |
mt5-mcp is not the security boundary, the broker's MT5 server enforces the hard limits (margin, max-lot, symbol permissions). Pre-flight checks in the policy engine are UX guardrails to catch agent mistakes early, not security controls.
The human-consent gate is opt-in and off by default: auto_approve_notional defaults to 0, so mutating calls auto-execute (full-open) - intended for trusted or unattended agents. Arm the gate by setting `auto_approve_notional` > 0: orders/closes whose notional is at or above it then return an ApprovalPreview you must confirm, and modifying a stop to widen or remove it also requires approval. The pre-flight limits (max_*) and symbol allow/deny lists are likewise opt-in (0 / empty = off). Every mutating call is recorded in an append-only audit JSONL log regardless. For vulnerability disclosure, see SECURITY.md.
mt5-mcp wraps the MetaTrader 5 Python library behind a FastMCP server. A single MT5Client (src/mt5_mcp/adapter/) owns the terminal connection, broker-timezone inference, and type conversions; everything else sits on top of it. The Pydantic models in src/mt5_mcp/types.py / src/mt5_mcp/config.py are the source of truth for the data and config schemas.
Agent / MCP client (Hermes, OpenClaw, Claude Code, Claude Desktop, …)
│ │ stdio · loopback HTTP ▼ ┌──────────────────────────────────────────────────────────┐ │ FastMCP server │ │ │ │ tools/ resources/ policy/ │ │ read + subscribable consent · idempotency │ │ mutating account/quotes · audit (JSONL) │ │ │ │ streaming/ - change-detection poller + dispatcher │ │ types.py · config.py - Pydantic schemas: source of │ │ truth for data + config │ │ │ └──────────────────────────────────────────────────────────┘ │ ▼ ┌──────────────────────────────────────────────────────────┐ │ │ │ adapter/ MT5Client │ │ one terminal connection · broker-TZ inference · │ │ type conversions · transparent reinit │ │ │ └──────────────────────────────────────────────────────────┘ │ ▼ MetaTrader 5 Python library -> broker terminal -> broker server
The module paths shown (tools/, resources/, policy/, streaming/, adapter/, types.py, config.py) all live under src/mt5_mcp/.
Contributions are welcome, see CONTRIBUTING.md for the dev setup, test workflow, and project principles.
ตัดมาแค่ช่วงต้น อ่านต่อใน repo