# MTContext

MTContext — a hosted MCP server that lets Claude, Cursor or any MCP client read and trade a MetaTrader 4/5 terminal through one Expert Advisor on a chart.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · 161 installs
- Author: tranvietthanh
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://smithery.ai/server/tranvietthanh/mtcontext
- Updated: 2026-07-28
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/mtcontext

## What it does

Nothing runs on your machine. The endpoint is cloud-hosted, so there is no Python package and no local process to keep alive. You drag an Expert Advisor onto a chart in MetaTrader 4 or 5, and the terminal starts answering your MCP client: Claude, Codex, Cursor, Copilot, Windsurf, Cline, Zed or Gemini CLI.

Read tools return quotes, OHLCV bars, contract specs, balance and equity, open positions, pending orders and closed trade history. Beyond that you get indicator values, EA logs, the terminal journal, win rate and profit factor over closed trades, P&L split by symbol or by time bucket, symbol correlation and an economic calendar. Indicators come back as raw numbers with no verdict attached; the agent does the interpreting.

Order tools, from placing and partial close to breakeven, trailing stop and reversal, act as a dry run unless you pass `dry_run=false`, and live execution also needs the `trade` capability with `inp_AllowTrading=true` on the EA. Two rough edges: a software trailing stop is forgotten when the EA restarts, and depth of market does not exist on MT4, where the call answers `NOT_SUPPORTED_ON_MT4`.

## Requirements
- Remote server: `https://mtcontext--tranvietthanh.run.tools`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http mtcontext https://mtcontext--tranvietthanh.run.tools
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add mtcontext --url https://mtcontext--tranvietthanh.run.tools
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mtcontext": {
            "url": "https://mtcontext--tranvietthanh.run.tools"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mtcontext": {
            "type": "http",
            "url": "https://mtcontext--tranvietthanh.run.tools"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http mtcontext https://mtcontext--tranvietthanh.run.tools
```

## When to use it
- Check free margin before sending an order
- Size a lot from account equity and a risk share
- Break P&L down by symbol or by time period
- Move a stop to entry once the position is in profit
- Read recent lines from the EA log or terminal journal

## Example prompts
- What's the bid, ask and spread on EURUSD right now?
- Size a lot for GBPUSD from equity at the risk share I give you, then check the margin
- Set a trailing stop of 10 points on position `<ticket>` as a dry run

## Similar
- [mt5-robot-tester](https://affpapa.org/en/nevibecode/skills/mt5-robot-tester.md) — skill · 2700 installs
- [gold-mcp](https://affpapa.org/en/nevibecode/mcp/gold-mcp.md) — MCP server · ★ 9 repo stars
- [MetaTrader 5 MCP Bridge](https://affpapa.org/en/nevibecode/mcp/metatrader-5-mcp-bridge.md) — MCP server · ★ 7 repo stars
- [AlgoVesta MCP Trading](https://affpapa.org/en/nevibecode/mcp/algovesta-mcp-trading.md) — MCP server · ★ 4 repo stars
- [mql5-indicator-patterns](https://affpapa.org/en/nevibecode/skills/mql5-indicator-patterns.md) — skill · 520 installs
- [log-reader](https://affpapa.org/en/nevibecode/skills/log-reader.md) — skill · 145 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
