MCP Uptime
← MCP Reliability Index  /  Databases
M

MTContext

io.github.mtcontext/mtcontext
Connect any MCP client to MetaTrader 4/5 to read prices, manage positions, and place trades.
healthy
status
73
tools exposed
533ms
connect latency
aaae14dffa53
schema fingerprint

Tools (73)

get_tick
Returns the current bid, ask, and spread for a symbol.
get_bars
Returns OHLCV bars for a symbol and timeframe.
get_symbols
Returns all symbols available in Market Watch.
get_symbol_info
Returns contract spec for a symbol: lot size, swap rates, digits.
get_account_info
Returns account balance, equity, margin, leverage, and currency.
get_positions
Returns all open positions with P&L.
get_orders
Returns all pending orders.
get_trade_history
Returns closed trades with optional date range filter.
get_indicator
Returns raw indicator values for a symbol and timeframe. Values are deterministic and unlabelled — no directional signals or verdicts are attached; the caller interprets them. Provide either `timeframe` (single) or `timeframes` (array, returns results keyed by timeframe under `by_timeframe`) — exact
get_terminal_info
Returns MT5 terminal metadata: name, company, path, build, max_bars.
list_experts
Returns all Expert Advisors currently attached to open charts.
read_ea_logs
Returns recent lines from the EA log file. available=false when the log cannot be read (MQL5 sandbox).
get_journal
Returns recent lines from the MT5 Journal log. available=false when the log cannot be read.
get_trade_stats
Returns aggregate statistics over closed trades: total_trades, win/loss counts, win_rate, avg_profit, avg_loss, profit_factor, total_pnl, expectancy, max_drawdown_percent, sharpe_ratio, consistency_percent.
get_pnl_by_symbol
Returns P&L broken down per trading symbol. Result: { items: [{ symbol, pnl, trades }] } sorted by |pnl| descending.
get_pnl_by_time
Returns P&L bucketed into time intervals. Result: { items: [{ period_start, pnl, trades }] } sorted chronologically.
check_order
Checks whether an order can be placed without sending it. Supports both market and pending order types. Returns { feasible, required_margin, free_margin, estimated_cost, reason? }.
get_tick_history
Returns a sequence of raw ticks for a symbol. Result: { ticks: [{ time, bid, ask, last, volume }] }.
place_order
Places a market or pending order on MT5. Defaults to dry_run=true — set dry_run=false to execute live. Pending orders may set expiry (unix epoch seconds) for broker-side expiration; expiry is rejected on market orders. Requires the `trade` capability and inp_AllowTrading=true on the EA.
close_position
Closes an open position by ticket. Defaults to dry_run=true — set dry_run=false to execute live. Requires the `trade` capability and inp_AllowTrading=true on the EA.
modify_position
Modifies the stop_loss and/or take_profit of an open position. At least one of stop_loss or take_profit must be provided. Defaults to dry_run=true — set dry_run=false to execute live. Requires the `trade` capability and inp_AllowTrading=true on the EA.
cancel_order
Cancels a pending (limit or stop) order by ticket. Defaults to dry_run=true — set dry_run=false to execute live. Returns ORDER_NOT_FOUND if the ticket is not in pending orders. Requires the `trade` capability and inp_AllowTrading=true on the EA.
partial_close
Closes a portion of an open position. `volume` must be less than the full position volume. Defaults to dry_run=true — set dry_run=false to execute live. Returns INVALID_PARAMETER if volume >= position volume, POSITION_NOT_FOUND if position closed between dry-run and live call. Requires the `trade` c
modify_order
Modifies the price, stop_loss, take_profit, or expiry of a pending order. At least one of price, stop_loss, take_profit, or expiry must be provided. Defaults to dry_run=true — set dry_run=false to execute live. Requires the `trade` capability and inp_AllowTrading=true on the EA.
close_all_positions
Closes all currently open positions, optionally filtered by symbol. The EA executes all closes in a single command to avoid N round-trips and partial-disconnect risk. Returns a `results` array with per-ticket success/failure. Defaults to dry_run=true — set dry_run=false to execute live. Requires the
set_breakeven
Moves the stop loss of a position (or all positions) to its entry price. Optional buffer_points adds N points on the safe side of entry. Returns POSITION_NOT_IN_PROFIT if the position has not yet moved favourably. Defaults to dry_run=true — set dry_run=false to execute live. Requires the `trade` cap
set_trailing_stop
Registers a software trailing stop on a position. The EA updates the SL each timer cycle when price moves trailing_points in the position's favour. IMPORTANT: trailing state is lost if the EA restarts — callers should re-set after reconnect. trailing_points minimum is 10. Defaults to dry_run=true —
reverse_position
Closes an open position and opens a market order in the opposite direction as ONE EA command (single trade-context acquisition — minimises the gap between the two fills vs separate close_position + place_order calls). volume defaults to the closed volume; optional stop_loss / take_profit apply to th
calculate_lot_size
Calculates the appropriate lot size for a trade based on account equity and risk parameters. Uses live account equity and symbol contract specs from the connected terminal. Returns the recommended lot size, risk amount in account currency, and pip value. Returns LOT_TOO_SMALL if the computed lots ar
get_risk_summary
Returns a portfolio risk overview: aggregate currency exposure, margin utilisation, and correlated pairs. NOTE: Currency exposure logic assumes FX symbols (e.g., EURUSD) where the base currency is the first 3 characters. Results for indices, cryptos, and stocks will be inaccurate. Requires the `anal
get_correlation
Returns the Pearson price correlation coefficient between two symbols over N daily bars. Ranges from -1.0 (perfect inverse) to +1.0 (perfect positive). Requires the `analytics` capability (Team+ tier).
get_economic_calendar
Returns upcoming and recent economic calendar events. Prefers MT5's built-in Calendar API when a terminal is connected; falls back to the server-side calendar (free feed) on MT4 or when disconnected. Response includes a `source` field ('terminal' or 'server'). Requires the `analytics` capability (Te
get_market_depth
Returns Depth of Market (DOM) bid/ask levels for a symbol. Requires the broker to supply DOM data — if unavailable, returns empty arrays with a note. On MT4 terminals, returns { error: 'NOT_SUPPORTED_ON_MT4' }. Requires the `read` capability (Pro+ tier).
scan_symbols
Scans Market Watch symbols and filters by spread, RSI, or ATR thresholds. At least one filter criterion must be provided. Returns up to 50 symbols. If scanning takes over 10 seconds, partial results are returned with partial=true. Requires the `read` capability (Pro+ tier).
get_spread_alert
Returns the current spread for a symbol compared to an estimated historical average. The 30-day average is estimated from daily high-low range (not tick-level data). A spread is flagged as abnormal if it exceeds threshold_multiplier × the estimated average. Requires the `analytics` capability (Team+
get_market_sessions
Returns which major trading sessions (Sydney, Tokyo, London, New York) are currently open and when the next session opens/closes. Pure server-side UTC computation — no EA dispatch required. Available at Free+ tier.
get_interest_rates
Returns current central bank policy interest rates for major currencies, sourced from MT5's built-in Calendar API. Includes the date of the last change and next scheduled decision. On MT4 terminals, returns { error: 'NOT_SUPPORTED_ON_MT4' }. Requires the `analytics` capability (Team+ tier).
get_macro_indicators
Returns key macroeconomic indicators (CPI, GDP, NFP, PMI, unemployment, retail sales, trade balance) for a currency with the latest actual, previous, forecast, and surprise values. Data from MT5's built-in Calendar API. On MT4 terminals, returns { error: 'NOT_SUPPORTED_ON_MT4' }. Requires the `analy
get_cot_report
Returns the latest CFTC Commitments of Traders (COT) report data for a currency or commodity. Data sourced from the CFTC Socrata public API (free, no key required), cached 24 hours. Supported symbols: EUR, GBP, JPY, CHF, AUD, CAD, NZD, GOLD, OIL. Returns { error: 'COT_UNAVAILABLE' } if the feed is u
get_rate_differential
Returns the interest rate differential between the two currencies in a pair, plus the annualised swap cost/credit for the specified volume. Computed server-side from get_interest_rates and get_symbol_info data. Requires the `analytics` capability (Team+ tier).
get_rate_expectations
Returns the market's expected policy path per G10 central bank: next scheduled meeting + countdown, current policy rate, last decision, and — for USD when a Fed Funds futures quote source is configured — market-implied cut/hold/hike probabilities and the implied year-end rate. Every response is labe
get_news
Returns recent forex/financial news articles from NewsAPI.org. Requires NEWS_API_KEY environment variable — returns NEWS_NOT_CONFIGURED if not set. Returns NEWS_UNAVAILABLE if the feed is unreachable. Results cached 5 minutes. Requires the `analytics` capability (Team+ tier).
get_sentiment
Returns retail trader positioning sentiment for a symbol from Myfxbook Community Outlook (free, no key required). Includes long/short percentages and a contrarian signal (when retail is >70% long, signal is SHORT). Returns SENTIMENT_UNAVAILABLE if the feed is unreachable. Results cached 15 minutes.
explain_trade
Explains a trade: what conditions existed at entry, the risk/reward ratio, SL/ATR ratio, and whether it aligns with common strategies. Works for both open positions and closed trade history. Returns POSITION_NOT_FOUND if ticket not found. Requires the `analytics` capability (Team+ tier).
get_fibonacci_levels
Computes Fibonacci retracement and extension levels from swing high and low price points. Pure server-side computation — no EA dispatch required. Available at Free+ tier.
backtest_strategy
Runs a micro-backtest of a simple rule-based strategy over historical bars fetched from the EA. Maximum 5000 bars. Returns equity curve and basic statistics. Times out after 30 seconds and returns BACKTEST_TIMEOUT. Supported entry/exit conditions: rsi_above, rsi_below, price_above_ema, price_below_e
get_market_snapshot
Returns a single-call market snapshot for one symbol: current tick (bid/ask/spread) plus a chosen indicator set across up to 4 timeframes. Replaces 5-8 separate tool calls when analysing a symbol. Limits: 4 timeframes x 6 indicators, 10 values per indicator. Defaults: timeframes ["H1"], indicators [
get_currency_strength
Ranks the 8 major currencies (USD EUR GBP JPY CHF CAD AUD NZD) by normalised % change, computed from bars across up to 28 major crosses in the terminal's Market Watch. Strongest first. Symbols missing from Market Watch are skipped and listed in skipped[]; currencies with fewer than 4 contributing pa
get_key_levels
Computes support/resistance key levels for a symbol: classic + Fibonacci pivot points from the prior period, swing highs/lows (fractal detection), and psychological round numbers near the current price. Each level includes its distance from the current price. Available at Free+ tier.
detect_patterns
Runs deterministic rule-based candlestick pattern detection over recent bars: engulfing, hammer, shooting star, doji, inside/outside bar, morning/evening star. Detection thresholds are fixed constants echoed in the response `criteria` field. Patterns are locations in the data, not trade signals. Ava
get_execution_quality
Reports slippage statistics (requested vs filled price) for live market orders placed through MT-MCP: average, median, and worst slippage in points, overall and per symbol. Measurement starts from when fill auditing was enabled — earlier periods return DATA_INSUFFICIENT with the earliest measurable
create_alert
Creates a persistent server-side alert, evaluated every ~30 seconds while the terminal is connected (not tick-precise). Types: price (level above/below), indicator (value or cross vs threshold), position_event (sl_hit / tp_hit / position_closed, optional ticket filter), margin_level (below %). mode=
list_alerts
Lists all alerts for this license with status (active/fired/cancelled), condition, mode, fire count, and last_evaluated_at (stale while the terminal is disconnected — evaluation pauses). Available at Pro+ tier.
cancel_alert
Cancels an active alert by alert_id (from create_alert or list_alerts). Returns ALERT_NOT_FOUND if the alert does not exist, already fired, or was already cancelled. Available at Pro+ tier.
poll_alerts
Drains undelivered fired-alert events (oldest first) and marks them delivered. Each event carries event_id, the alert's condition echo, the triggering values, and the fired timestamp. Events are retained 7 days; pass include_delivered=true to see the retained history. Call this periodically — alerts
set_equity_guard
Configures an account-level circuit breaker enforced server-side (survives this session): when equity falls max_daily_loss_percent below the daily anchor (or max_total_drawdown_percent below initial equity), the guard breaches. breach_action: close_all = close all positions then block new live trade
get_equity_guard_status
Returns the current equity guard: config, status (armed / breached / breached_pending / none), day_start_equity anchor, current equity, daily P&L percent, and the equity level at which the guard breaches. Requires the `trade` capability.
remove_equity_guard
Removes the equity guard. If the guard is currently breached (or breached_pending), removal requires confirm=true — this prevents silently disabling an active safety rail; without it the call returns CONFIRM_REQUIRED. Requires the `trade` capability.
set_prop_firm_rules
Configures a per-terminal prop-firm ruleset evaluated server-side (survives this session). Rules: max_daily_loss_percent (vs the daily equity anchor), optional max_total_drawdown_percent with drawdown_mode (static = from initial balance; trailing = from the high-watermark) and drawdown_basis (balanc
get_prop_firm_status
Returns a decision-ready prop-firm verdict: overall status (ok | warning | critical | breached), trade_advice (proceed | reduce_risk | block), max_safe_risk_percent for the next trade, per-rule headroom (percent and account currency) with human-readable reasons, days_traded, trailing watermark, and
remove_prop_firm_rules
Removes the prop-firm ruleset for the terminal (does not touch any linked equity guard — remove that separately with remove_equity_guard). Returns RULESET_NOT_FOUND if none exists. Requires the `trade` capability.
write_trade_note
Persists a trade journal entry: rationale, setup label, and tags, optionally linked to a position/order ticket. Entries are append-only and immutable — to correct one, write a new note with amends_entry_id pointing at the original. Use at order time to capture WHY a trade was taken; query later with
query_journal
Queries trade journal entries, newest first. Filters: ticket, tag, setup, from_date/to_date (ISO), and search (case-insensitive text match). Entries linked to closed trades include realized_pnl when the terminal is connected (null otherwise). Available at Free+ tier.
get_behavioral_insights
Computes descriptive behavioural metrics from closed trade history: overtrading (trades/day vs the trailing 30-day baseline), revenge trading (re-entry within 15 min of a loss on the same symbol at >=1.5x volume), volume escalation across consecutive losses, and winner-vs-loser hold-time asymmetry.
get_event_risk
Preflight check: returns a graded verdict (proceed/caution/block) for trading a symbol based on upcoming high-impact economic events within the horizon. Uses the server-side calendar — works with no terminal connected. Includes blackout windows, resume_after time, and per-event details. Unknown symb
get_holding_risk
Assesses risk for holding (or planning to hold) a position in a symbol for a specified duration. Reports events landing inside the hold window, weekend/market-closure gap exposure, and triple-swap day flags. Uses the server-side calendar — works with no terminal. Requires the `analytics` capability
get_risk_regime
Returns a composite risk-on/risk-off score in [−1, 1] from z-scored market inputs (VIX, DXY, gold, 2s10s spread, equities). Pure scoring function with transparent per-input drivers, confidence, missing_inputs, and sizing_advice. Requires at least 3 available inputs or returns REGIME_UNAVAILABLE. Req
get_economic_surprise
Returns a rolling actual-vs-forecast surprise index for a currency's economic events, weighted by impact tier (high=3×, medium=1×, low ignored). Reports insufficient_history when fewer than 30 days of data exist. Uses the server-side calendar. Requires the `analytics` capability (Team+ tier).
get_cb_stance
Returns the central bank hawk/dove stance for a currency, scored from −1 (max dovish) to +1 (max hawkish). Reads from persisted snapshots — no LLM call in the request path. Includes recent_change indicator, source statements, and classifier provenance marker. Requires the `analytics` capability (Tea
set_news_guard
Configures a persistent server-side news monitor. When enabled, the guard polls news at the specified interval, classifies articles by severity and affected currencies, and triggers alerts (via poll_alerts) when articles meet the threshold. One guard per license — calling again replaces the config.
get_news_guard_status
Returns the current news guard configuration, enabled state, last poll time, classifier mode (llm/heuristic), and count of alerts raised in the last 24h. Returns { status: 'none' } if no guard is configured. Requires the `analytics` capability.
remove_news_guard
Removes the news guard for this license. The guard stops polling immediately. Returns { removed: true } on success. Requires the `analytics` capability.
get_market_context
Returns live cross-asset context in one call: DXY (broad USD), VIX (equity-vol risk regime), and the US 10Y yield — each with level, short-horizon (5-day) change, asof, and source — plus a transparent risk_tone (risk_on / neutral / risk_off) derived from a documented VIX+DXY heuristic. Reads the ser

Endpoint

https://mcp.mtcontext.com/mcp/v1
Category: Databases · Last checked: 2026-07-30T13:56:40Z

Monitor your own MCP server

Get alerted the moment yours goes down, a tool schema drifts, or an upstream silently breaks.

Get early access
How we measure →
What this means. This server responded to the MCP handshake and listed its tools without authentication. The schema fingerprint lets us flag if tool signatures silently change (schema drift) between checks.