Skip to main content
Glama
tradingmavenfx-cmd

MT5 MCP Server

MT5 MCP サーバー

MetaTrader 5 ターミナルを Claude に接続するローカル MCP サーバーです。 市場データ、口座状態、履歴の読み取り、チャートのスクリーンショット取得、 さらにライブ注文の送信が可能です。

必要条件

  1. MetaTrader 5 ターミナルが起動している必要があります

  2. ツール → オプション → エキスパートアドバイザー → 「アルゴリズミックトレーディングを許可」 が有効である必要があります

  3. 口座にログインしている必要があります

ターミナルが閉じている場合、すべてのツールは MT5 initialize failed を返します。ターミナルを開いて再試行してください。

Related MCP server: metatrader-mcp

インストール

uv venv --python 3.12 .venv
uv pip install --python .venv/Scripts/python.exe -r requirements.txt

次に、.mcp.json 内のパスを調整し、Claude Code を再起動します。

ツール(20)

市場データ

ツール

機能

mt5_status

ターミナルのビルド、接続状態、口座、残高、純資産、証拠金、DEMO/REAL

list_symbols

銘柄の検索 — ワイルドカード対応(EUR**USD*

symbol_info

桁数、ポイント、スプレッド、契約サイズ、ロット制限、証拠金・スワップレート

get_ticks

1つ以上の銘柄のリアルタイム bid/ask とスプレッド

get_candles

M1 から MN1 までの OHLCV、本数指定または日付範囲指定

get_tick_history

生の bid/ask ティックストリーム。バックテストに有用

口座

ツール

機能

get_positions

保有ポジションと合計変動損益

get_pending_orders

有効な指値・逆指値注文

get_history_deals

利益、手数料、スワップ合計を含む約定履歴

get_history_orders

発注、キャンセル、拒否された注文の履歴

calc_trade

送信の証拠金と予想利益の計算(注文は発注されません)

画面キャプチャ

ツール

機能

list_charts

開いているチャート(銘柄、時間足、サイズ)

screenshot

ターミナルウィンドウまたは単一チャートの PNG

screenshot は MetaTrader5 Python API によるものではありません。この API には スクリーンショット機能がまったく存在しません。Windows の PrintWindow 呼び出しに基づいて 構築されています(mt5_capture.py)。バックグラウンドウィンドウでは動作しますが、 最小化されたウィンドウでは動作しません

ターミナル全体の場合は target='window' を、単一チャートの場合は target='XAUUSD,M30' を 渡します。'XAUUSD' のみを渡すと、その銘柄の最も大きなチャートが選択されます。

トレーディング — ライブ

ツール

機能

open_position

成行き買い/売り、SL/TP は絶対価格またはポイントで指定

place_pending_order

買い/売り指値または逆指値、有効期限の指定も可能

modify_position

保有ポジションの SL/TP 変更

modify_pending_order

未約定注文の価格、SL、TP の変更

close_position

全量または一部決済

cancel_pending_order

未約定注文の削除

close_all_positions

全ポジション、または特定銘柄のみの決済

⚠️ トレーディングツールにはデモ/リアル口座のガードはありません。注文は ターミナルがログインしている口座に送信されます。ブローカーの約定モードは 自動的に検出され、必要に応じて銘柄が Market Watch に追加されます。

CLI(trade.py

Claude を使わずに、コマンドラインから直接同じツールを使用できます:

.venv/Scripts/python.exe trade.py buy XAUUSD 0.01 --sl-points 500 --tp-points 1000
.venv/Scripts/python.exe trade.py modify 10090941191 --sl 4345.56 --tp 4360.56
.venv/Scripts/python.exe trade.py close 10090941191
.venv/Scripts/python.exe trade.py close-all --symbol XAUUSD
.venv/Scripts/python.exe trade.py positions
.venv/Scripts/python.exe trade.py calc buy XAUUSD 0.01 --close-price 4360

各サブコマンドの詳細は trade.py --help を実行してください。

時刻形式

すべての時刻入力は UTC です:YYYY-MM-DDYYYY-MM-DD HH:MM、または YYYY-MM-DD HH:MM:SS。出力タイムスタンプも UTC です。

設定

以下の環境変数は .mcp.json 内でオプションです:

変数

目的

MT5_PATH

terminal64.exe へのパス。ターミナルが閉じている場合の起動に使用

MT5_LOGIN / MT5_PASSWORD / MT5_SERVER

別の口座にログイン(デフォルト:ターミナルがすでに使用している口座)

スモークテスト

.venv/Scripts/python.exe -c "import mt5_mcp_server as s; print(s.mt5_status()['account'])"
F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables comprehensive access to the MetaTrader 5 trading platform for retrieving market data, managing accounts, and executing trading operations. It provides 32 specialized tools for interacting with MT5 functionalities, including historical OHLCV data access, real-time position monitoring, and automated order management.
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables users to capture real MetaTrader 5 chart snapshots with custom indicators and fetch market data through natural language in Claude Desktop.
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables interaction with MetaTrader 5 for market data, technical analysis, Fibonacci calculations, and trading via MCP clients such as Claude.
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Enables Claude AI to perform forex trading operations and market data analysis through MetaTrader 5, including order placement, position management, and multi-timeframe candle data retrieval.
    16

View all related MCP servers

Related MCP Connectors

  • Connect any MCP client to MetaTrader 4/5 to read prices, manage positions, and place trades.

  • Global stock research, ML forecasts, valuation signals, screeners & portfolio tracking in Claude

  • Trade Robinhood through natural language in Claude Code.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tradingmavenfx-cmd/mt5-tradingview-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server