# 安装 MetaTrader 5 MCP Bridge

- 类型: MCP 工具
- 说明: 让 AI 通过 MCP 读取并交易 MetaTrader 5 账户，且需人工审批确认。
- 仓库: https://github.com/vincentwongso/mt5-trading-mcp

## 方式一 · 一键代装（复制提示词让 AI 代劳）

### Claude Code
```
请帮我安装 askskill 上的 "MetaTrader 5 MCP Bridge" MCP 服务：
执行：claude mcp add 'io-github-vincentwongso-mt5-trading-mcp' -- uvx mt5-trading-mcp
```

### Codex
```
请帮我安装 askskill 上的 "MetaTrader 5 MCP Bridge" MCP 服务：
在 ~/.codex/config.toml 中添加：
[mcp_servers.io-github-vincentwongso-mt5-trading-mcp]
command = "uvx"
args = ["mt5-trading-mcp"]
然后重启 Codex 生效
```

### Cursor
```
请帮我安装 askskill 上的 "MetaTrader 5 MCP Bridge" MCP 服务：
在 .cursor/mcp.json 的 "mcpServers" 中添加：
"io-github-vincentwongso-mt5-trading-mcp": { "command": "uvx", "args": ["mt5-trading-mcp"] }
然后在 Cursor 设置 > MCP 中启用
```

## 方式二 · 命令行安装（原生命令与配置）

### Claude Code
```bash
claude mcp add --env MT5_LOGIN=YOUR_VALUE --env MT5_PASSWORD=YOUR_VALUE --env MT5_SERVER=YOUR_VALUE --transport stdio io-github-vincentwongso-mt5-trading-mcp -- uvx mt5-trading-mcp
```
需要环境变量：MT5_LOGIN, MT5_PASSWORD, MT5_SERVER

### Codex
```bash
codex mcp add --env MT5_LOGIN=YOUR_VALUE --env MT5_PASSWORD=YOUR_VALUE --env MT5_SERVER=YOUR_VALUE io-github-vincentwongso-mt5-trading-mcp -- uvx mt5-trading-mcp
```
配置文件 ~/.codex/config.toml：
```toml
[mcp_servers.io-github-vincentwongso-mt5-trading-mcp]
command = "uvx"
args = ["mt5-trading-mcp"]

[mcp_servers.io-github-vincentwongso-mt5-trading-mcp.env]
MT5_LOGIN = "YOUR_VALUE"
MT5_PASSWORD = "YOUR_VALUE"
MT5_SERVER = "YOUR_VALUE"
```
需要环境变量：MT5_LOGIN, MT5_PASSWORD, MT5_SERVER

### Cursor
配置文件 .cursor/mcp.json：
```json
{
  "mcpServers": {
    "io-github-vincentwongso-mt5-trading-mcp": {
      "command": "uvx",
      "args": [
        "mt5-trading-mcp"
      ],
      "env": {
        "MT5_LOGIN": "YOUR_VALUE",
        "MT5_PASSWORD": "YOUR_VALUE",
        "MT5_SERVER": "YOUR_VALUE"
      }
    }
  }
}
```
一键安装：cursor://anysphere.cursor-deeplink/mcp/install?name=io-github-vincentwongso-mt5-trading-mcp&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyJtdDUtdHJhZGluZy1tY3AiXSwiZW52Ijp7Ik1UNV9MT0dJTiI6IllPVVJfVkFMVUUiLCJNVDVfUEFTU1dPUkQiOiJZT1VSX1ZBTFVFIiwiTVQ1X1NFUlZFUiI6IllPVVJfVkFMVUUifX0
需要环境变量：MT5_LOGIN, MT5_PASSWORD, MT5_SERVER
