@okx_ai/okx-trade-mcp 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +123 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5645 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OKX
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# okx-trade-mcp
|
|
2
|
+
|
|
3
|
+
## English
|
|
4
|
+
|
|
5
|
+
MCP server for OKX, designed for AI tools like Claude/Cursor. It exposes OKX
|
|
6
|
+
market, account, spot, and swap tools via Model Context Protocol (stdio).
|
|
7
|
+
|
|
8
|
+
### Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g @okx_ai/okx-trade-mcp
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Configure credentials
|
|
15
|
+
|
|
16
|
+
Create `~/.okx/config.toml`:
|
|
17
|
+
|
|
18
|
+
```toml
|
|
19
|
+
default_profile = "demo"
|
|
20
|
+
|
|
21
|
+
[profiles.live]
|
|
22
|
+
api_key = "your-live-api-key"
|
|
23
|
+
secret_key = "your-live-secret-key"
|
|
24
|
+
passphrase = "your-live-passphrase"
|
|
25
|
+
|
|
26
|
+
[profiles.demo]
|
|
27
|
+
api_key = "your-demo-api-key"
|
|
28
|
+
secret_key = "your-demo-secret-key"
|
|
29
|
+
passphrase = "your-demo-passphrase"
|
|
30
|
+
demo = true
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Run
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
okx-trade-mcp --profile live # specify profile
|
|
37
|
+
okx-trade-mcp --modules market # market only (no key)
|
|
38
|
+
okx-trade-mcp --read-only # read-only, no trades
|
|
39
|
+
okx-trade-mcp --modules all # all modules
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Claude Desktop config
|
|
43
|
+
|
|
44
|
+
Add to `claude_desktop_config.json`:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"mcpServers": {
|
|
49
|
+
"okx-live": {
|
|
50
|
+
"command": "okx-trade-mcp",
|
|
51
|
+
"args": ["--profile", "live", "--modules", "all"]
|
|
52
|
+
},
|
|
53
|
+
"okx-demo": {
|
|
54
|
+
"command": "okx-trade-mcp",
|
|
55
|
+
"args": ["--profile", "demo"]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For more details, see the repository README.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 中文
|
|
66
|
+
|
|
67
|
+
OKX 的 MCP Server,供 Claude/Cursor 等 AI 工具调用,通过 MCP 协议(stdio)
|
|
68
|
+
暴露 OKX 的行情、账户、现货、合约工具。
|
|
69
|
+
|
|
70
|
+
### 安装
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm install -g @okx_ai/okx-trade-mcp
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 配置凭证
|
|
77
|
+
|
|
78
|
+
创建 `~/.okx/config.toml`:
|
|
79
|
+
|
|
80
|
+
```toml
|
|
81
|
+
default_profile = "demo"
|
|
82
|
+
|
|
83
|
+
[profiles.live]
|
|
84
|
+
api_key = "your-live-api-key"
|
|
85
|
+
secret_key = "your-live-secret-key"
|
|
86
|
+
passphrase = "your-live-passphrase"
|
|
87
|
+
|
|
88
|
+
[profiles.demo]
|
|
89
|
+
api_key = "your-demo-api-key"
|
|
90
|
+
secret_key = "your-demo-secret-key"
|
|
91
|
+
passphrase = "your-demo-passphrase"
|
|
92
|
+
demo = true
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 启动
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
okx-trade-mcp --profile live # 指定 profile
|
|
99
|
+
okx-trade-mcp --modules market # 只加载行情(无需 Key)
|
|
100
|
+
okx-trade-mcp --read-only # 只读模式,禁止下单
|
|
101
|
+
okx-trade-mcp --modules all # 加载所有模块
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Claude Desktop 配置
|
|
105
|
+
|
|
106
|
+
在 `claude_desktop_config.json` 中新增:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"mcpServers": {
|
|
111
|
+
"okx-live": {
|
|
112
|
+
"command": "okx-trade-mcp",
|
|
113
|
+
"args": ["--profile", "live", "--modules", "all"]
|
|
114
|
+
},
|
|
115
|
+
"okx-demo": {
|
|
116
|
+
"command": "okx-trade-mcp",
|
|
117
|
+
"args": ["--profile", "demo"]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
更多说明请参考仓库根目录 README。
|
package/dist/index.d.ts
ADDED