# MetaTrader MCP server. Let your agent trade.

Source: https://pipsocket.com/metatrader-mcp-server

A hosted MCP server for your MetaTrader accounts. Add one URL to Claude, ChatGPT or any MCP app, sign in, and tick what it may do in each workspace: read, trade, or set up TradingView.

$15 per account, per month. MT5 today, MT4 next.

- [Connect an account](https://app.pipsocket.com)
- [MCP docs](https://docs.pipsocket.com/md/mcp.md): connecting, approving, revoking

## An agent trading through the MCP server

You ask Claude: "Close half my EURUSD and move the rest to break-even."

It calls three tools on `https://mcp.pipsocket.com/mcp` (arguments shortened):

```
list_positions       { "account": "acc_01m6tx3k…" }
close_position       { "position": 881402311, "volume": 0.05, … }
set_position_levels  { "position": 881402311, "sl": 1.08412, … }
```

And answers: "Closed 0.05 EURUSD at 1.08488, +$3.80. The other 0.05 now has its stop at your entry, 1.08412."

## How the MCP server behaves

- **Works from chat apps.** A hosted server, so Claude and ChatGPT on the web can use it, as well as desktop and coding apps.
- **You approve each workspace.** OAuth sign-in, no API key. Tick read, trade or manage per workspace; members can only allow read.
- **Same rules as the API.** Each trading tool is one REST call: one MT5 request, safe to retry with a key, with the broker's own answer.
- **Kill switch in reach.** You, the agent or the dashboard can engage it: it blocks new orders, then tries to close and cancel what's open, and reports what's left.

## Tools your agent gets.

The REST API one to one, account start and stop, and TradingView setup. Each tool says the scope it needs, so the model knows what to ask you for. Add one URL to your app: `https://mcp.pipsocket.com/mcp`. [Every tool, with its scope](https://docs.pipsocket.com/md/mcp-tools.md).

### Read the account

- `get_account` (read): balance, equity, margin and status
- `list_positions` (read): open positions, read fresh from the terminal
- `get_tick` (read): the latest bid and ask for a symbol
- `list_history_deals` (read): deals in a time range
- `get_request` (read): a trade request and how it ended

### Trade and control

- `place_order` (trade): a market or pending order, sent once
- `close_position` (trade): close all or part of a position
- `set_position_levels` (trade): a position's stop loss and take profit
- `cancel_order` (trade): delete a pending order
- `engage_kill_switch` (trade): block new orders, then try to close and cancel what's open

### Accounts and TradingView

- `start_account` (manage): start the account's terminal (and `stop_account`, `restart_account`)
- `list_broker_symbols` (read): the broker's names for its symbols
- `set_symbol_map` (manage): map TradingView's symbol to the broker's
- `create_hook` (manage): a webhook URL that trades the accounts you pick
- `test_hook` (manage): a dry run of an alert on every target account

## From MetaTrader login to a trading agent. Three steps, one URL.

### Connect your MT5 login

In the dashboard: server, login and password, from any MT5 broker. Your terminal starts next to your broker's trade server and stays on.

### Add the server to your app

Paste the URL into Claude, ChatGPT or any MCP app. No API key: it signs in with OAuth.

### Approve what it can do

Sign in and tick read, trade or manage for each workspace. Lower it or revoke it any time in Connected apps.

## Hosted, beside MetaTrader's own MCP.

|                           | MetaTrader 5's own MCP server             | Pipsocket MCP server                                 |
| ------------------------- | ----------------------------------------- | ---------------------------------------------------- |
| Where it runs             | In the terminal, on your computer or VPS  | Hosted by Pipsocket: nothing to install              |
| Apps that can reach it    | Apps on the same machine                  | Any MCP app, including Claude and ChatGPT on the web |
| Signing in                | An API key from the terminal              | OAuth in your browser, workspace by workspace        |
| Accounts                  | The account that terminal is logged in to | Every account in the workspaces you approve          |
| When your computer is off | Off with it                               | Still on, with the terminal                          |

## MetaTrader MCP server questions

### What is an MCP server for MetaTrader?

MCP is the standard way AI apps call tools. Pipsocket's MCP server gives Claude, ChatGPT or any MCP app tools to read and trade your MetaTrader accounts, on terminals we host, and to set up TradingView alerts.

### Which AI apps work?

Any app that can add a remote MCP server with OAuth sign-in, including Claude and ChatGPT on the web, and coding apps like Claude Code and Cursor. It speaks the current MCP version and the earlier ones many apps still use. In Claude, choose Register automatically as the OAuth client.

### How is it different from MetaTrader's own MCP server?

MetaTrader 5's own MCP server runs in the terminal on your computer, for apps on the same machine. Pipsocket's is hosted, for the terminals we run for you, so apps on the web can reach it and it keeps working when your computer is off.

### Do I give the app an API key or my MT5 password?

No. You sign in to Pipsocket in your browser and tick what the app may do in each workspace: read, trade or manage. To connect an MT5 account, the app gives you a link to the dashboard, so the password never goes through it.

### Can the agent set up TradingView alerts?

Yes, with manage ticked. It maps the symbol, creates the hook, writes the alert message and dry-runs it on your accounts. You paste the URL and the message into TradingView.

### How do I stop the agent?

Revoke it in Connected apps: its account and hook tools stop at once, its trading tools within 5 minutes. Also engage the kill switch from the dashboard or the API: it blocks new orders, then tries to close and cancel what's open, so check what's left. Until its access runs out the agent could still lift it, so check again after 5 minutes. Hooks the agent set up keep trading until you pause them.

### Can I try it on a demo account?

Yes. Connect a demo MT5 login first and watch what the agent does before you give it a live one.

### What does it cost?

$15 per account, per month. The MCP server is included, with no per-call fees.

## The same account, other ways in

- [MetaTrader WebSocket API](https://pipsocket.com/metatrader-websocket-api.md) (`wss://wss.pipsocket.com`): ticks, fills and deals pushed as they happen.
- [TradingView to MetaTrader](https://pipsocket.com/tradingview-to-metatrader.md) (`hooks.pipsocket.com`): turn alerts into orders on every account you pick.
- [MetaTrader REST API](https://pipsocket.com/metatrader-rest-api.md) (`api.pipsocket.com`): orders, positions and history over HTTPS.
