bitget-mcp-server 1.0.1 → 1.0.2
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/README.md +136 -72
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,33 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://img.bitgetimg.com/multiLang/web/d54dfa8d6e4ccc3b1d42.svg" alt="Bitget" width="200" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/bitget-mcp-server)
|
|
5
|
-
[](https://www.npmjs.com/package/bitget-mcp-server)
|
|
5
|
+
<h1 align="center">Bitget MCP Server</h1>
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Connect AI assistants to Bitget — trade, query, and manage your crypto portfolio through natural language.</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/bitget-mcp-server"><img src="https://img.shields.io/npm/v/bitget-mcp-server.svg?style=flat-square&color=cb3837" alt="npm version" /></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/bitget-mcp-server"><img src="https://img.shields.io/npm/dm/bitget-mcp-server.svg?style=flat-square&color=blue" alt="npm downloads" /></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/bitget-mcp-server"><img src="https://img.shields.io/node/v/bitget-mcp-server.svg?style=flat-square&color=43853d" alt="node version" /></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/bitget-mcp-server"><img src="https://img.shields.io/npm/l/bitget-mcp-server.svg?style=flat-square" alt="license" /></a>
|
|
16
|
+
<a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-compatible-8A2BE2?style=flat-square" alt="MCP compatible" /></a>
|
|
17
|
+
<a href="https://www.bitget.com"><img src="https://img.shields.io/badge/Exchange-Bitget-00b897?style=flat-square" alt="Bitget" /></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="#quick-start">Quick Start</a> •
|
|
22
|
+
<a href="#available-modules">Modules</a> •
|
|
23
|
+
<a href="#tool-highlights">Tools</a> •
|
|
24
|
+
<a href="#configuration">Configuration</a> •
|
|
25
|
+
<a href="#security">Security</a>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## What is this?
|
|
31
|
+
|
|
32
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that gives AI assistants — **Cursor**, **Claude Desktop**, **Windsurf**, and others — direct access to the Bitget cryptocurrency exchange.
|
|
33
|
+
|
|
34
|
+
> **One config, 56+ tools.** Ask your AI to check prices, place trades, manage positions, and more.
|
|
35
|
+
|
|
36
|
+
---
|
|
8
37
|
|
|
9
38
|
## Features
|
|
10
39
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- **
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
40
|
+
| | Feature | Description |
|
|
41
|
+
|---|---------|-------------|
|
|
42
|
+
| **56+ tools** | Full API coverage | Spot, futures, margin, copy trading, convert, earn, P2P, broker |
|
|
43
|
+
| **Read-only mode** | `--read-only` flag | Disable all write/trade operations for safe exploration |
|
|
44
|
+
| **Module filtering** | `--modules` flag | Expose only the tools you need |
|
|
45
|
+
| **Smart detection** | Dynamic capabilities | Unavailable modules auto-hidden from AI tool lists |
|
|
46
|
+
| **Agent-first** | `system_get_capabilities` | Machine-readable capability discovery for agent planning |
|
|
47
|
+
| **Rate limiting** | Token bucket | Client-side rate limiting per endpoint prevents API abuse |
|
|
48
|
+
| **Auth** | HMAC-SHA256 | Industry-standard Bitget API authentication |
|
|
49
|
+
| **Structured errors** | Error codes + suggestions | Machine-parseable errors with actionable suggestions |
|
|
50
|
+
|
|
51
|
+
---
|
|
20
52
|
|
|
21
53
|
## Quick Start
|
|
22
54
|
|
|
23
55
|
### Prerequisites
|
|
24
56
|
|
|
25
|
-
- Node.js >= 18
|
|
26
|
-
- A [Bitget API key](https://www.bitget.com/account/newapi) with appropriate permissions
|
|
57
|
+
- **Node.js** >= 18
|
|
58
|
+
- A [**Bitget API key**](https://www.bitget.com/account/newapi) with appropriate permissions
|
|
27
59
|
|
|
28
|
-
### Cursor
|
|
60
|
+
### Cursor
|
|
29
61
|
|
|
30
|
-
Add to
|
|
62
|
+
Add to `.cursor/mcp.json` in your project root:
|
|
31
63
|
|
|
32
64
|
```json
|
|
33
65
|
{
|
|
@@ -45,14 +77,16 @@ Add to your MCP configuration (e.g. `.cursor/mcp.json`):
|
|
|
45
77
|
}
|
|
46
78
|
```
|
|
47
79
|
|
|
48
|
-
###
|
|
80
|
+
### Claude Desktop
|
|
81
|
+
|
|
82
|
+
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
|
|
49
83
|
|
|
50
84
|
```json
|
|
51
85
|
{
|
|
52
86
|
"mcpServers": {
|
|
53
87
|
"bitget": {
|
|
54
88
|
"command": "npx",
|
|
55
|
-
"args": ["-y", "bitget-mcp-server", "--modules", "all"
|
|
89
|
+
"args": ["-y", "bitget-mcp-server", "--modules", "all"],
|
|
56
90
|
"env": {
|
|
57
91
|
"BITGET_API_KEY": "your-api-key",
|
|
58
92
|
"BITGET_SECRET_KEY": "your-secret-key",
|
|
@@ -63,47 +97,98 @@ Add to your MCP configuration (e.g. `.cursor/mcp.json`):
|
|
|
63
97
|
}
|
|
64
98
|
```
|
|
65
99
|
|
|
66
|
-
###
|
|
100
|
+
### Read-Only Mode
|
|
101
|
+
|
|
102
|
+
For safe exploration without trading risk:
|
|
67
103
|
|
|
68
104
|
```json
|
|
69
105
|
{
|
|
70
106
|
"mcpServers": {
|
|
71
107
|
"bitget": {
|
|
72
108
|
"command": "npx",
|
|
73
|
-
"args": ["-y", "bitget-mcp-server", "--modules", "all"],
|
|
109
|
+
"args": ["-y", "bitget-mcp-server", "--modules", "all", "--read-only"],
|
|
74
110
|
"env": {
|
|
75
111
|
"BITGET_API_KEY": "your-api-key",
|
|
76
112
|
"BITGET_SECRET_KEY": "your-secret-key",
|
|
77
|
-
"BITGET_PASSPHRASE": "your-passphrase"
|
|
78
|
-
"all_proxy": "http://127.0.0.1:7890"
|
|
113
|
+
"BITGET_PASSPHRASE": "your-passphrase"
|
|
79
114
|
}
|
|
80
115
|
}
|
|
81
116
|
}
|
|
82
117
|
}
|
|
83
118
|
```
|
|
84
119
|
|
|
120
|
+
---
|
|
121
|
+
|
|
85
122
|
## Available Modules
|
|
86
123
|
|
|
87
124
|
| Module | Tools | Description |
|
|
88
|
-
|
|
89
|
-
| `spot` | 13 | Spot market data +
|
|
90
|
-
| `futures` | 14 | Futures market data + trading +
|
|
125
|
+
|:-------|:-----:|:------------|
|
|
126
|
+
| `spot` | 13 | Spot market data + order placement & management |
|
|
127
|
+
| `futures` | 14 | Futures market data + trading + leverage + positions |
|
|
91
128
|
| `account` | 8 | Assets, transfers, withdrawals, deposits, sub-accounts |
|
|
92
|
-
| `margin` | 7 |
|
|
93
|
-
| `copytrading` | 5 | Copy trading
|
|
94
|
-
| `convert` | 3 | Coin conversion with real-time
|
|
95
|
-
| `earn` | 3 | Savings & staking
|
|
96
|
-
| `p2p` | 2 | P2P merchant list and
|
|
129
|
+
| `margin` | 7 | Cross/isolated margin trading, borrow & repay |
|
|
130
|
+
| `copytrading` | 5 | Copy trading with auto trader selection |
|
|
131
|
+
| `convert` | 3 | Coin conversion with real-time quoted prices |
|
|
132
|
+
| `earn` | 3 | Savings & staking (auto-detected availability) |
|
|
133
|
+
| `p2p` | 2 | P2P merchant list and order history |
|
|
97
134
|
| `broker` | 3 | Broker account and API key management |
|
|
98
135
|
|
|
99
|
-
Default
|
|
136
|
+
> **Default:** `spot`, `futures`, `account`. Use `--modules all` to enable everything.
|
|
137
|
+
|
|
138
|
+
---
|
|
100
139
|
|
|
101
|
-
##
|
|
140
|
+
## Tool Highlights
|
|
141
|
+
|
|
142
|
+
### Market Data *(no auth required)*
|
|
143
|
+
|
|
144
|
+
| Tool | Description |
|
|
145
|
+
|:-----|:------------|
|
|
146
|
+
| `spot_get_ticker` / `futures_get_ticker` | Real-time price and 24h stats |
|
|
147
|
+
| `spot_get_depth` / `futures_get_depth` | Live order book |
|
|
148
|
+
| `spot_get_candles` / `futures_get_candles` | K-line / candlestick data |
|
|
149
|
+
| `futures_get_funding_rate` | Current and historical funding rates |
|
|
150
|
+
| `futures_get_open_interest` | Open interest by symbol |
|
|
151
|
+
|
|
152
|
+
### Trading
|
|
153
|
+
|
|
154
|
+
| Tool | Description |
|
|
155
|
+
|:-----|:------------|
|
|
156
|
+
| `spot_place_order` / `futures_place_order` | Place single or batch orders |
|
|
157
|
+
| `spot_place_plan_order` | Trigger / stop-loss / take-profit orders |
|
|
158
|
+
| `futures_set_leverage` | Adjust leverage per symbol |
|
|
159
|
+
| `futures_get_positions` | View current open positions |
|
|
160
|
+
|
|
161
|
+
### Account & Transfers
|
|
162
|
+
|
|
163
|
+
| Tool | Description |
|
|
164
|
+
|:-----|:------------|
|
|
165
|
+
| `get_account_assets` | Balances across all account types |
|
|
166
|
+
| `transfer` | Internal transfers between spot, futures, funding |
|
|
167
|
+
| `get_deposit_address` | Generate deposit addresses |
|
|
168
|
+
| `withdraw` | On-chain withdrawals |
|
|
169
|
+
|
|
170
|
+
### Copy Trading
|
|
171
|
+
|
|
172
|
+
| Tool | Description |
|
|
173
|
+
|:-----|:------------|
|
|
174
|
+
| `copy_get_traders` | Browse available elite traders |
|
|
175
|
+
| `copy_place_order` | Follow a trader (auto-selects when `traderId` omitted) |
|
|
176
|
+
|
|
177
|
+
### Agent Utilities
|
|
178
|
+
|
|
179
|
+
| Tool | Description |
|
|
180
|
+
|:-----|:------------|
|
|
181
|
+
| `system_get_capabilities` | Full module availability snapshot for planning |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Configuration
|
|
186
|
+
|
|
187
|
+
### CLI Options
|
|
102
188
|
|
|
103
189
|
```
|
|
104
|
-
|
|
190
|
+
bitget-mcp-server [options]
|
|
105
191
|
|
|
106
|
-
Options:
|
|
107
192
|
--modules <list> Comma-separated modules (default: spot,futures,account)
|
|
108
193
|
Use "all" to load all modules
|
|
109
194
|
--read-only Disable all write/trade operations
|
|
@@ -111,51 +196,30 @@ Options:
|
|
|
111
196
|
--version Show version
|
|
112
197
|
```
|
|
113
198
|
|
|
114
|
-
|
|
199
|
+
### Environment Variables
|
|
115
200
|
|
|
116
201
|
| Variable | Required | Description |
|
|
117
|
-
|
|
118
|
-
| `BITGET_API_KEY` |
|
|
119
|
-
| `BITGET_SECRET_KEY` |
|
|
120
|
-
| `BITGET_PASSPHRASE` |
|
|
202
|
+
|:---------|:---------|:------------|
|
|
203
|
+
| `BITGET_API_KEY` | Yes * | Bitget API key |
|
|
204
|
+
| `BITGET_SECRET_KEY` | Yes * | Bitget secret key |
|
|
205
|
+
| `BITGET_PASSPHRASE` | Yes * | Bitget API passphrase |
|
|
121
206
|
| `BITGET_API_BASE_URL` | No | API base URL (default: `https://api.bitget.com`) |
|
|
122
207
|
| `BITGET_TIMEOUT_MS` | No | Request timeout in ms (default: `15000`) |
|
|
123
|
-
| `all_proxy` | No | Proxy URL for all requests |
|
|
124
|
-
|
|
125
|
-
## Tool Highlights
|
|
126
|
-
|
|
127
|
-
### Market Data (no auth required)
|
|
128
|
-
- `spot_get_ticker` / `futures_get_ticker` — Real-time price
|
|
129
|
-
- `spot_get_depth` / `futures_get_depth` — Order book
|
|
130
|
-
- `spot_get_candles` / `futures_get_candles` — K-line data
|
|
131
|
-
- `futures_get_funding_rate` — Funding rate history
|
|
132
|
-
- `futures_get_open_interest` — Open interest
|
|
133
|
-
|
|
134
|
-
### Trading
|
|
135
|
-
- `spot_place_order` / `futures_place_order` — Place orders (single or batch)
|
|
136
|
-
- `spot_place_plan_order` — Trigger/stop orders
|
|
137
|
-
- `futures_set_leverage` — Adjust leverage
|
|
138
|
-
- `futures_get_positions` — Current positions
|
|
139
208
|
|
|
140
|
-
|
|
141
|
-
- `get_account_assets` — Balances across all account types
|
|
142
|
-
- `transfer` — Internal transfers between accounts
|
|
143
|
-
- `get_deposit_address` — Deposit addresses
|
|
209
|
+
> \* Required for private endpoints. Public market data tools work without auth.
|
|
144
210
|
|
|
145
|
-
|
|
146
|
-
- `copy_place_order` — Auto-selects trader when `traderId` is omitted
|
|
147
|
-
- `copy_get_traders` — Browse available traders
|
|
148
|
-
|
|
149
|
-
### Agent Utilities
|
|
150
|
-
- `system_get_capabilities` — Full module availability snapshot for agent planning
|
|
211
|
+
---
|
|
151
212
|
|
|
152
213
|
## Security
|
|
153
214
|
|
|
154
|
-
- API credentials are passed via environment variables
|
|
155
|
-
-
|
|
156
|
-
- All private requests
|
|
157
|
-
-
|
|
215
|
+
- API credentials are passed via **environment variables**, never hardcoded or logged
|
|
216
|
+
- **`--read-only` mode** prevents all write operations at the server level
|
|
217
|
+
- All private requests are signed with **HMAC-SHA256**
|
|
218
|
+
- **Client-side rate limiting** prevents accidental API abuse
|
|
219
|
+
- Structured error responses never leak credentials or internal state
|
|
220
|
+
|
|
221
|
+
---
|
|
158
222
|
|
|
159
223
|
## License
|
|
160
224
|
|
|
161
|
-
MIT
|
|
225
|
+
[MIT](./LICENSE)
|
package/dist/index.js
CHANGED