MT5 MCP server for Claude, ChatGPT, Cursor, and Kiro
FiveSocket is a hosted MetaTrader 5 MCP server and REST API. Link your MT5 account once in the browser, then ask Claude, ChatGPT, Cursor, VS Code, or Kiro for live balance, open positions, trade history, and broker candles. It runs bar-based backtests on your broker's own candle data, checks orders against FTMO, FundedNext, and The5ers daily loss and max drawdown rules before they hit the broker, and places trades when you turn execution on.
You do not need a Windows PC, a forex VPS, or an open MT5 terminal. MetaTrader 5's built-in MCP only works while the desktop terminal is running on your own machine. FiveSocket hosts the terminal on our side, so nothing runs locally and your broker password never sits in a config file.
- Full MCP URL:
https://api.fivesocket.com/mcp - Read-only MCP URL:
https://api.fivesocket.com/mcp/read - REST API base:
https://api.fivesocket.com/v1(reference at docs.fivesocket.com) - Setup guides: fivesocket.com/mcp and docs.fivesocket.com/mcp
- Glama: server listing and hosted connector
- Pricing: Starter $9.99/mo (1 MT5 account), Prop $19.99/mo (3 accounts), Plus $29.99/mo (5 accounts), Scale $79.99/mo (20 accounts). Link an MT5 account for 7 days or 100 calls free with no card required, then a 7-day card trial. See fivesocket.com/pricing.
Because the MCP server runs at the URLs above, you do not need to install anything to connect an assistant. This repository holds client config files, stdio bridge packages, and runnable REST API examples.
Local stdio bridge
If your MCP client only speaks local stdio, use the thin bridge packages below. They connect to the same hosted server and open your browser for OAuth sign-in.
- npm:
fivesocket-mt5-mcp("command": "npx", "args": ["-y", "fivesocket-mt5-mcp"]) - PyPI:
fivesocket-mt5-mcp("command": "uvx", "args": ["fivesocket-mt5-mcp"], requires Node.js 20+)
Pass --read-only to limit the bridge to account reads. Source lives in npm/ and python/.
What is in this repo
| Path | What it is |
|---|---|
configs/ | Full-access and read-only MCP configs for Claude Code, Cursor, VS Code, and Kiro |
.cursor-plugin/ and mcp.json | Cursor plugin manifest and server definition, with icon assets in assets/ |
examples/python/ | Zero-dependency Python scripts for reading an account and placing an order |
examples/typescript/ | TypeScript client using fetch for Node 22.18+ or Bun |
examples/curl/ | Shell scripts for reading an account, placing an order, and checking MCP OAuth discovery |
Why a hosted MT5 MCP server
Most open-source MT5 MCP servers wrap MetaQuotes' local Python package. That forces you to run Windows with MT5 logged in all day, enable algorithmic trading, put your broker password into a local config file, and stay on that one machine.
| Self-hosted MT5 MCP servers | FiveSocket | |
|---|---|---|
| Needs Windows or a VPS | Yes | No |
| MT5 terminal must stay open | Yes | No |
| Broker password in a local config file | Usually | No. Entered once in the browser and encrypted at rest |
| Works in Claude web, ChatGPT, and mobile apps | Only if you expose your own host | Yes |
| Auth model | None or static key | OAuth with scoped permissions you can revoke anytime |
| Works with prop firms and any MT5 broker | Yes | Yes |
Full comparison: fivesocket.com/mt5-mcp-server-comparison.
Connect in about a minute
- Sign up at fivesocket.com and link your MT5 login, password, and server name in the browser. Your assistant never sees the broker password.
- Add FiveSocket to your client using one of the sections below.
- Approve the scopes you want (read-only by default, trading only if you opt in).
- Ask, "What is my balance?"
Try the read-only demo first
Sign up at app.fivesocket.com, open app.fivesocket.com/demo, and turn the demo on. Your assistant can immediately query account demo for balance, positions, trade history, candles, symbol specs, and backtests before you connect a real broker login. Orders on demo are refused.
Claude (claude.ai, Claude Desktop, iOS, Android)
For one-click read-only access, open claude.ai/directory/fivesocket-mt5 or search for FiveSocket under Settings -> Connectors and click Connect.
For trading access, open Settings -> Connectors -> Add custom connector, name it FiveSocket, paste https://api.fivesocket.com/mcp, and sign in. Custom connectors depend on your Claude plan.
Claude Desktop uses the same Settings -> Connectors screen, so you do not need to edit claude_desktop_config.json. Connectors added on web or Desktop sync to the Claude mobile apps. Full guide: fivesocket.com/connect-mt5-to-claude.
Claude Code
claude mcp add --transport http fivesocket https://api.fivesocket.com/mcp
Run /mcp inside Claude Code and pick fivesocket to sign in.
Read-only (configs/claude-code-read-only.sh):
claude mcp add --transport http fivesocket-read https://api.fivesocket.com/mcp/read
ChatGPT
- Open Settings -> Apps & Connectors -> Advanced and turn on Developer mode.
- Return to Apps & Connectors, choose Create, name it FiveSocket, paste
https://api.fivesocket.com/mcp(or/mcp/readfor read-only), and choose OAuth. - Sign in to FiveSocket when prompted.
Developer mode depends on your ChatGPT plan, and workspace admins may need to allow custom connectors. Guide: fivesocket.com/connect-mt5-to-chatgpt.
Cursor
Add this to ~/.cursor/mcp.json (also in configs/cursor.json, read-only in configs/cursor-read-only.json):
{
"mcpServers": {
"fivesocket": {
"url": "https://api.fivesocket.com/mcp"
}
}
}
VS Code
Add this to .vscode/mcp.json (also in configs/vscode.json, read-only in configs/vscode-read-only.json):
{
"servers": {
"fivesocket": {
"type": "http",
"url": "https://api.fivesocket.com/mcp"
}
}
}
Guide for Cursor and VS Code: fivesocket.com/connect-mt5-to-cursor.
Kiro
Or add this to ~/.kiro/settings/mcp.json (also in configs/kiro-read-only.json and configs/kiro.json):
{
"mcpServers": {
"fivesocket-read": {
"url": "https://api.fivesocket.com/mcp/read",
"oauthScopes": ["accounts:read", "data:read"]
}
}
}
Keep oauthScopes in place. Without it, Kiro requests openid email profile offline_access, which FiveSocket does not issue.
Any other MCP client
Point any Streamable HTTP MCP client that supports OAuth 2.1 (dynamic client registration + S256 PKCE) at https://api.fivesocket.com/mcp or https://api.fivesocket.com/mcp/read. See examples/curl/mcp-discovery.sh for the discovery handshake.
Example prompts
- "What is my balance and free margin across my MT5 accounts?"
- "Show my open positions and floating profit."
- "Break down my closed trades this month by symbol."
- "Check my remaining FTMO daily loss headroom before I open a trade."
- "Backtest an EMA crossover on EURUSD H1 using my broker's candles."
- "Close half of my GBPUSD position." (requires trading permission)
MCP tools
Read tools on /mcp and /mcp/read are list_connected_accounts, get_account_balance, get_open_positions, get_account_snapshot, list_closed_trades, list_deals, list_historical_orders, get_candles, get_symbol_specifications, export_history_page, prop_status, and run_backtest.
Trading tools on /mcp (only visible after you grant trading:execute) are get_execution_configuration, configure_execution, disable_execution, get_execution_capabilities, list_working_orders, get_order_status, get_executable_symbols, submit_order, modify_order, cancel_order, modify_position_protection, close_position, and reconcile_execution_command.
Full tool reference: docs.fivesocket.com/mcp.
Use the same accounts from code (REST API)
Every linked account is also reachable over HTTPS with an API key. Create a key in the dashboard with only the scopes you need (accounts:read and data:read for reads; add trading:execute only when placing orders).
export FIVESOCKET_KEY=mt5_live_...
curl https://api.fivesocket.com/v1/accounts -H "Authorization: Bearer $FIVESOCKET_KEY"
curl https://api.fivesocket.com/v1/accounts/<accountId>/balance -H "Authorization: Bearer $FIVESOCKET_KEY"
Runnable examples live in this repo:
cd examples/python && python3 read_account.py
cd examples/typescript && node read-account.ts
cd examples/curl && ./read-account.sh
For a standalone zero-dependency Python client covering candles, prop status, backtests, and commit_unknown polling, see fivesocket/fivesocket-python. For TradingView alerts via n8n or FastAPI, see fivesocket/tradingview-mt5-webhook.
| Endpoint | Returns |
|---|---|
GET /v1/accounts | Linked accounts and status |
GET /v1/accounts/{id}/balance | Balance, equity, margin, free margin, leverage, currency |
GET /v1/accounts/{id}/positions | Open positions with SL, TP, swap, and profit |
GET /v1/accounts/{id}/trades?from=&to= | Closed deals, cursor-paginated (to is required) |
GET /v1/accounts/{id}/candles?symbol=&timeframe=&count= | Completed broker candles, M1 to D1 |
GET /v1/accounts/{id}/snapshot | Balance, positions, and recent trades in one call |
GET /v1/accounts/{id}/prop-status | Daily loss and max drawdown headroom |
POST /v1/accounts/{id}/backtests | Bar-based strategy backtest on your broker's candles |
POST /v1/accounts/{id}/execution/orders | Submit an order (requires trading:execute and an execution policy) |
Errors return {"error": {"code", "message", "requestId"}}. HTTP 202 account_warming, 429, and 503 include a Retry-After header. Full OpenAPI docs: docs.fivesocket.com.
Safety
- Accounts stay read-only until you explicitly turn trading on with a symbol allowlist and per-symbol max volume caps.
- Your assistant gets a scoped OAuth token you can revoke at any time, never your broker password.
- If you only want read access, link your MT5 investor password instead of the trading password.
- For FTMO, FundedNext, and The5ers programs configured in FiveSocket, the order guard refuses API and MCP orders that would breach daily loss or max drawdown rules. Trades placed directly inside the MT5 desktop app are not intercepted.
FAQ
Which brokers work? Any broker offering MetaTrader 5, including prop firms like FTMO, FundedNext, and The5ers. See fivesocket.com/brokers.
Does it support MetaTrader 4? No, MT5 only.
Does it need Windows? No. FiveSocket hosts the MT5 terminal.
Can I try it without a card? Yes. Turn on the read-only demo right after signup, or link your own MT5 account for 7 days or 100 calls free with no card required, followed by a 7-day card trial.
Is the hosted service free? No. Pricing starts at $9.99/mo for 1 account. The configs and example clients in this repository are MIT licensed.
Links
- Product: fivesocket.com
- Free prop drawdown, lot size, and VPS calculators: fivesocket.com/tools
- Python client: fivesocket/fivesocket-python
- TradingView webhook relay: fivesocket/tradingview-mt5-webhook
- Docs: docs.fivesocket.com
- Official MCP Registry:
com.fivesocket/mt5 - Support: hello@fivesocket.com or a GitHub issue in this repo
- Privacy and terms: fivesocket.com/privacy and fivesocket.com/terms
License
The configs, bridge packages, and examples in this repository use the MIT License. The hosted FiveSocket service has its own terms and privacy policy.
FiveSocket is not affiliated with MetaQuotes. MetaTrader 5 is a trademark of MetaQuotes Ltd.