binance-futures-mcp 1.0.2__tar.gz → 1.0.6__tar.gz
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.
- {binance_futures_mcp-1.0.2/src/binance_futures_mcp.egg-info → binance-futures-mcp-1.0.6}/PKG-INFO +46 -35
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/README.md +44 -19
- binance-futures-mcp-1.0.6/pyproject.toml +0 -0
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/setup.py +1 -1
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6/src/binance_futures_mcp.egg-info}/PKG-INFO +46 -35
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/src/binance_futures_mcp.egg-info/SOURCES.txt +1 -0
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/src/binance_mcp/server.py +76 -10
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/LICENSE +0 -0
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/setup.cfg +0 -0
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/src/binance_futures_mcp.egg-info/dependency_links.txt +0 -0
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/src/binance_futures_mcp.egg-info/entry_points.txt +0 -0
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/src/binance_futures_mcp.egg-info/requires.txt +0 -0
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/src/binance_futures_mcp.egg-info/top_level.txt +0 -0
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/src/binance_mcp/__init__.py +0 -0
- {binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6}/src/binance_mcp/__main__.py +0 -0
{binance_futures_mcp-1.0.2/src/binance_futures_mcp.egg-info → binance-futures-mcp-1.0.6}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.1
|
2
2
|
Name: binance-futures-mcp
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.6
|
4
4
|
Summary: A Model Context Protocol server for Binance Futures API
|
5
5
|
Home-page: https://github.com/alexcandrabersiva/bin-mcp
|
6
6
|
Author: Binance MCP Server
|
@@ -20,20 +20,6 @@ Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
20
20
|
Requires-Python: >=3.8
|
21
21
|
Description-Content-Type: text/markdown
|
22
22
|
License-File: LICENSE
|
23
|
-
Requires-Dist: mcp>=1.0.0
|
24
|
-
Requires-Dist: aiohttp>=3.8.0
|
25
|
-
Requires-Dist: pydantic>=2.0.0
|
26
|
-
Dynamic: author
|
27
|
-
Dynamic: classifier
|
28
|
-
Dynamic: description
|
29
|
-
Dynamic: description-content-type
|
30
|
-
Dynamic: home-page
|
31
|
-
Dynamic: keywords
|
32
|
-
Dynamic: license-file
|
33
|
-
Dynamic: project-url
|
34
|
-
Dynamic: requires-dist
|
35
|
-
Dynamic: requires-python
|
36
|
-
Dynamic: summary
|
37
23
|
|
38
24
|
# Binance MCP Server
|
39
25
|
|
@@ -54,10 +40,12 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
54
40
|
3. **Or configure in VS Code** by adding to your `settings.json`:
|
55
41
|
```json
|
56
42
|
{
|
57
|
-
"mcp
|
58
|
-
"
|
59
|
-
"
|
60
|
-
|
43
|
+
"mcp": {
|
44
|
+
"servers": {
|
45
|
+
"binance": {
|
46
|
+
"command": "uvx",
|
47
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_key", "--binance-secret-key", "your_secret"]
|
48
|
+
}
|
61
49
|
}
|
62
50
|
}
|
63
51
|
}
|
@@ -120,11 +108,12 @@ Add to your VS Code `settings.json`:
|
|
120
108
|
|
121
109
|
```json
|
122
110
|
{
|
123
|
-
"mcp
|
124
|
-
"
|
125
|
-
"
|
126
|
-
|
127
|
-
|
111
|
+
"mcp": {
|
112
|
+
"servers": {
|
113
|
+
"binance": {
|
114
|
+
"command": "uvx",
|
115
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
116
|
+
}
|
128
117
|
}
|
129
118
|
}
|
130
119
|
}
|
@@ -139,8 +128,7 @@ Add to your Cursor configuration file (`.cursor/mcp.json`):
|
|
139
128
|
"servers": {
|
140
129
|
"binance": {
|
141
130
|
"command": "uvx",
|
142
|
-
"args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
143
|
-
"env": {}
|
131
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
144
132
|
}
|
145
133
|
}
|
146
134
|
}
|
@@ -155,8 +143,7 @@ Add to your Windsurf configuration (`.windsurf/mcp.json`):
|
|
155
143
|
"mcpServers": {
|
156
144
|
"binance": {
|
157
145
|
"command": "uvx",
|
158
|
-
"args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
159
|
-
"env": {}
|
146
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
160
147
|
}
|
161
148
|
}
|
162
149
|
}
|
@@ -174,8 +161,7 @@ Add to your Claude Desktop configuration file:
|
|
174
161
|
"mcpServers": {
|
175
162
|
"binance": {
|
176
163
|
"command": "uvx",
|
177
|
-
"args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
178
|
-
"env": {}
|
164
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
179
165
|
}
|
180
166
|
}
|
181
167
|
}
|
@@ -187,9 +173,10 @@ Add to your Claude Desktop configuration file:
|
|
187
173
|
|
188
174
|
2. **Set API credentials**: Replace `your_api_key` and `your_secret_key` with your actual Binance API credentials.
|
189
175
|
|
190
|
-
|
176
|
+
2. **Alternative commands**: You can also use:
|
177
|
+
- `uvx binance-futures-mcp` (direct package execution)
|
178
|
+
- `uvx --from binance-futures-mcp binance-mcp-server.exe` (explicit executable)
|
191
179
|
- `pip install binance-futures-mcp && python -m binance_mcp`
|
192
|
-
- `binance-mcp-server` (if installed globally and on PATH)
|
193
180
|
|
194
181
|
4. **Python environment**: Using `uvx` automatically handles the Python environment.
|
195
182
|
|
@@ -231,7 +218,7 @@ uvx binance-futures-mcp --binance-api-key "your_key" --binance-secret-key "your_
|
|
231
218
|
|
232
219
|
### Available Tools
|
233
220
|
|
234
|
-
The server provides
|
221
|
+
The server provides 37 tools organized into categories:
|
235
222
|
|
236
223
|
#### Account Information (5 tools)
|
237
224
|
- `get_account_info` - Get futures account information
|
@@ -264,10 +251,12 @@ The server provides 32 tools organized into categories:
|
|
264
251
|
- `change_position_mode` - Change position mode
|
265
252
|
- `modify_position_margin` - Modify position margin
|
266
253
|
|
267
|
-
#### Market Data (
|
254
|
+
#### Market Data (8 tools)
|
268
255
|
- `get_exchange_info` - Get trading rules and symbol info
|
269
256
|
- `get_book_ticker` - Get best bid/ask prices
|
270
257
|
- `get_price_ticker` - Get latest prices
|
258
|
+
- `get_24hr_ticker` - Get 24hr price change statistics
|
259
|
+
- `get_taker_buy_sell_volume` - Get taker buy/sell volume ratio
|
271
260
|
- `get_order_book` - Get order book depth
|
272
261
|
- `get_klines` - Get candlestick data
|
273
262
|
- `get_mark_price` - Get mark price and funding rate
|
@@ -332,6 +321,28 @@ The server provides 32 tools organized into categories:
|
|
332
321
|
}
|
333
322
|
```
|
334
323
|
|
324
|
+
### Get 24hr Price Statistics
|
325
|
+
|
326
|
+
```json
|
327
|
+
{
|
328
|
+
"tool": "get_24hr_ticker",
|
329
|
+
"arguments": {
|
330
|
+
"symbol": "BTCUSDT"
|
331
|
+
}
|
332
|
+
}
|
333
|
+
```
|
334
|
+
|
335
|
+
### Get Taker Buy/Sell Volume Ratio
|
336
|
+
|
337
|
+
```json
|
338
|
+
{
|
339
|
+
"tool": "get_taker_buy_sell_volume",
|
340
|
+
"arguments": {
|
341
|
+
"symbol": "BTCUSDT"
|
342
|
+
}
|
343
|
+
}
|
344
|
+
```
|
345
|
+
|
335
346
|
## Security
|
336
347
|
|
337
348
|
### API Key Security
|
@@ -17,10 +17,12 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
17
17
|
3. **Or configure in VS Code** by adding to your `settings.json`:
|
18
18
|
```json
|
19
19
|
{
|
20
|
-
"mcp
|
21
|
-
"
|
22
|
-
"
|
23
|
-
|
20
|
+
"mcp": {
|
21
|
+
"servers": {
|
22
|
+
"binance": {
|
23
|
+
"command": "uvx",
|
24
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_key", "--binance-secret-key", "your_secret"]
|
25
|
+
}
|
24
26
|
}
|
25
27
|
}
|
26
28
|
}
|
@@ -83,11 +85,12 @@ Add to your VS Code `settings.json`:
|
|
83
85
|
|
84
86
|
```json
|
85
87
|
{
|
86
|
-
"mcp
|
87
|
-
"
|
88
|
-
"
|
89
|
-
|
90
|
-
|
88
|
+
"mcp": {
|
89
|
+
"servers": {
|
90
|
+
"binance": {
|
91
|
+
"command": "uvx",
|
92
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
93
|
+
}
|
91
94
|
}
|
92
95
|
}
|
93
96
|
}
|
@@ -102,8 +105,7 @@ Add to your Cursor configuration file (`.cursor/mcp.json`):
|
|
102
105
|
"servers": {
|
103
106
|
"binance": {
|
104
107
|
"command": "uvx",
|
105
|
-
"args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
106
|
-
"env": {}
|
108
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
107
109
|
}
|
108
110
|
}
|
109
111
|
}
|
@@ -118,8 +120,7 @@ Add to your Windsurf configuration (`.windsurf/mcp.json`):
|
|
118
120
|
"mcpServers": {
|
119
121
|
"binance": {
|
120
122
|
"command": "uvx",
|
121
|
-
"args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
122
|
-
"env": {}
|
123
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
123
124
|
}
|
124
125
|
}
|
125
126
|
}
|
@@ -137,8 +138,7 @@ Add to your Claude Desktop configuration file:
|
|
137
138
|
"mcpServers": {
|
138
139
|
"binance": {
|
139
140
|
"command": "uvx",
|
140
|
-
"args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
141
|
-
"env": {}
|
141
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
142
142
|
}
|
143
143
|
}
|
144
144
|
}
|
@@ -150,9 +150,10 @@ Add to your Claude Desktop configuration file:
|
|
150
150
|
|
151
151
|
2. **Set API credentials**: Replace `your_api_key` and `your_secret_key` with your actual Binance API credentials.
|
152
152
|
|
153
|
-
|
153
|
+
2. **Alternative commands**: You can also use:
|
154
|
+
- `uvx binance-futures-mcp` (direct package execution)
|
155
|
+
- `uvx --from binance-futures-mcp binance-mcp-server.exe` (explicit executable)
|
154
156
|
- `pip install binance-futures-mcp && python -m binance_mcp`
|
155
|
-
- `binance-mcp-server` (if installed globally and on PATH)
|
156
157
|
|
157
158
|
4. **Python environment**: Using `uvx` automatically handles the Python environment.
|
158
159
|
|
@@ -194,7 +195,7 @@ uvx binance-futures-mcp --binance-api-key "your_key" --binance-secret-key "your_
|
|
194
195
|
|
195
196
|
### Available Tools
|
196
197
|
|
197
|
-
The server provides
|
198
|
+
The server provides 37 tools organized into categories:
|
198
199
|
|
199
200
|
#### Account Information (5 tools)
|
200
201
|
- `get_account_info` - Get futures account information
|
@@ -227,10 +228,12 @@ The server provides 32 tools organized into categories:
|
|
227
228
|
- `change_position_mode` - Change position mode
|
228
229
|
- `modify_position_margin` - Modify position margin
|
229
230
|
|
230
|
-
#### Market Data (
|
231
|
+
#### Market Data (8 tools)
|
231
232
|
- `get_exchange_info` - Get trading rules and symbol info
|
232
233
|
- `get_book_ticker` - Get best bid/ask prices
|
233
234
|
- `get_price_ticker` - Get latest prices
|
235
|
+
- `get_24hr_ticker` - Get 24hr price change statistics
|
236
|
+
- `get_taker_buy_sell_volume` - Get taker buy/sell volume ratio
|
234
237
|
- `get_order_book` - Get order book depth
|
235
238
|
- `get_klines` - Get candlestick data
|
236
239
|
- `get_mark_price` - Get mark price and funding rate
|
@@ -295,6 +298,28 @@ The server provides 32 tools organized into categories:
|
|
295
298
|
}
|
296
299
|
```
|
297
300
|
|
301
|
+
### Get 24hr Price Statistics
|
302
|
+
|
303
|
+
```json
|
304
|
+
{
|
305
|
+
"tool": "get_24hr_ticker",
|
306
|
+
"arguments": {
|
307
|
+
"symbol": "BTCUSDT"
|
308
|
+
}
|
309
|
+
}
|
310
|
+
```
|
311
|
+
|
312
|
+
### Get Taker Buy/Sell Volume Ratio
|
313
|
+
|
314
|
+
```json
|
315
|
+
{
|
316
|
+
"tool": "get_taker_buy_sell_volume",
|
317
|
+
"arguments": {
|
318
|
+
"symbol": "BTCUSDT"
|
319
|
+
}
|
320
|
+
}
|
321
|
+
```
|
322
|
+
|
298
323
|
## Security
|
299
324
|
|
300
325
|
### API Key Security
|
File without changes
|
@@ -7,7 +7,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
7
7
|
|
8
8
|
setup(
|
9
9
|
name="binance-futures-mcp",
|
10
|
-
version="1.0.
|
10
|
+
version="1.0.6",
|
11
11
|
author="Binance MCP Server",
|
12
12
|
description="A Model Context Protocol server for Binance Futures API",
|
13
13
|
long_description=long_description,
|
{binance_futures_mcp-1.0.2 → binance-futures-mcp-1.0.6/src/binance_futures_mcp.egg-info}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.1
|
2
2
|
Name: binance-futures-mcp
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.6
|
4
4
|
Summary: A Model Context Protocol server for Binance Futures API
|
5
5
|
Home-page: https://github.com/alexcandrabersiva/bin-mcp
|
6
6
|
Author: Binance MCP Server
|
@@ -20,20 +20,6 @@ Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
20
20
|
Requires-Python: >=3.8
|
21
21
|
Description-Content-Type: text/markdown
|
22
22
|
License-File: LICENSE
|
23
|
-
Requires-Dist: mcp>=1.0.0
|
24
|
-
Requires-Dist: aiohttp>=3.8.0
|
25
|
-
Requires-Dist: pydantic>=2.0.0
|
26
|
-
Dynamic: author
|
27
|
-
Dynamic: classifier
|
28
|
-
Dynamic: description
|
29
|
-
Dynamic: description-content-type
|
30
|
-
Dynamic: home-page
|
31
|
-
Dynamic: keywords
|
32
|
-
Dynamic: license-file
|
33
|
-
Dynamic: project-url
|
34
|
-
Dynamic: requires-dist
|
35
|
-
Dynamic: requires-python
|
36
|
-
Dynamic: summary
|
37
23
|
|
38
24
|
# Binance MCP Server
|
39
25
|
|
@@ -54,10 +40,12 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
54
40
|
3. **Or configure in VS Code** by adding to your `settings.json`:
|
55
41
|
```json
|
56
42
|
{
|
57
|
-
"mcp
|
58
|
-
"
|
59
|
-
"
|
60
|
-
|
43
|
+
"mcp": {
|
44
|
+
"servers": {
|
45
|
+
"binance": {
|
46
|
+
"command": "uvx",
|
47
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_key", "--binance-secret-key", "your_secret"]
|
48
|
+
}
|
61
49
|
}
|
62
50
|
}
|
63
51
|
}
|
@@ -120,11 +108,12 @@ Add to your VS Code `settings.json`:
|
|
120
108
|
|
121
109
|
```json
|
122
110
|
{
|
123
|
-
"mcp
|
124
|
-
"
|
125
|
-
"
|
126
|
-
|
127
|
-
|
111
|
+
"mcp": {
|
112
|
+
"servers": {
|
113
|
+
"binance": {
|
114
|
+
"command": "uvx",
|
115
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
116
|
+
}
|
128
117
|
}
|
129
118
|
}
|
130
119
|
}
|
@@ -139,8 +128,7 @@ Add to your Cursor configuration file (`.cursor/mcp.json`):
|
|
139
128
|
"servers": {
|
140
129
|
"binance": {
|
141
130
|
"command": "uvx",
|
142
|
-
"args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
143
|
-
"env": {}
|
131
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
144
132
|
}
|
145
133
|
}
|
146
134
|
}
|
@@ -155,8 +143,7 @@ Add to your Windsurf configuration (`.windsurf/mcp.json`):
|
|
155
143
|
"mcpServers": {
|
156
144
|
"binance": {
|
157
145
|
"command": "uvx",
|
158
|
-
"args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
159
|
-
"env": {}
|
146
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
160
147
|
}
|
161
148
|
}
|
162
149
|
}
|
@@ -174,8 +161,7 @@ Add to your Claude Desktop configuration file:
|
|
174
161
|
"mcpServers": {
|
175
162
|
"binance": {
|
176
163
|
"command": "uvx",
|
177
|
-
"args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
178
|
-
"env": {}
|
164
|
+
"args": ["--from", "binance-futures-mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
179
165
|
}
|
180
166
|
}
|
181
167
|
}
|
@@ -187,9 +173,10 @@ Add to your Claude Desktop configuration file:
|
|
187
173
|
|
188
174
|
2. **Set API credentials**: Replace `your_api_key` and `your_secret_key` with your actual Binance API credentials.
|
189
175
|
|
190
|
-
|
176
|
+
2. **Alternative commands**: You can also use:
|
177
|
+
- `uvx binance-futures-mcp` (direct package execution)
|
178
|
+
- `uvx --from binance-futures-mcp binance-mcp-server.exe` (explicit executable)
|
191
179
|
- `pip install binance-futures-mcp && python -m binance_mcp`
|
192
|
-
- `binance-mcp-server` (if installed globally and on PATH)
|
193
180
|
|
194
181
|
4. **Python environment**: Using `uvx` automatically handles the Python environment.
|
195
182
|
|
@@ -231,7 +218,7 @@ uvx binance-futures-mcp --binance-api-key "your_key" --binance-secret-key "your_
|
|
231
218
|
|
232
219
|
### Available Tools
|
233
220
|
|
234
|
-
The server provides
|
221
|
+
The server provides 37 tools organized into categories:
|
235
222
|
|
236
223
|
#### Account Information (5 tools)
|
237
224
|
- `get_account_info` - Get futures account information
|
@@ -264,10 +251,12 @@ The server provides 32 tools organized into categories:
|
|
264
251
|
- `change_position_mode` - Change position mode
|
265
252
|
- `modify_position_margin` - Modify position margin
|
266
253
|
|
267
|
-
#### Market Data (
|
254
|
+
#### Market Data (8 tools)
|
268
255
|
- `get_exchange_info` - Get trading rules and symbol info
|
269
256
|
- `get_book_ticker` - Get best bid/ask prices
|
270
257
|
- `get_price_ticker` - Get latest prices
|
258
|
+
- `get_24hr_ticker` - Get 24hr price change statistics
|
259
|
+
- `get_taker_buy_sell_volume` - Get taker buy/sell volume ratio
|
271
260
|
- `get_order_book` - Get order book depth
|
272
261
|
- `get_klines` - Get candlestick data
|
273
262
|
- `get_mark_price` - Get mark price and funding rate
|
@@ -332,6 +321,28 @@ The server provides 32 tools organized into categories:
|
|
332
321
|
}
|
333
322
|
```
|
334
323
|
|
324
|
+
### Get 24hr Price Statistics
|
325
|
+
|
326
|
+
```json
|
327
|
+
{
|
328
|
+
"tool": "get_24hr_ticker",
|
329
|
+
"arguments": {
|
330
|
+
"symbol": "BTCUSDT"
|
331
|
+
}
|
332
|
+
}
|
333
|
+
```
|
334
|
+
|
335
|
+
### Get Taker Buy/Sell Volume Ratio
|
336
|
+
|
337
|
+
```json
|
338
|
+
{
|
339
|
+
"tool": "get_taker_buy_sell_volume",
|
340
|
+
"arguments": {
|
341
|
+
"symbol": "BTCUSDT"
|
342
|
+
}
|
343
|
+
}
|
344
|
+
```
|
345
|
+
|
335
346
|
## Security
|
336
347
|
|
337
348
|
### API Key Security
|
@@ -27,14 +27,31 @@ class BinanceConfig:
|
|
27
27
|
|
28
28
|
|
29
29
|
class BinanceClient:
|
30
|
-
"""Binance Futures API client"""
|
30
|
+
"""Binance Futures API client with improved connectivity"""
|
31
31
|
|
32
32
|
def __init__(self, config: BinanceConfig):
|
33
33
|
self.config = config
|
34
34
|
self.session: Optional[aiohttp.ClientSession] = None
|
35
35
|
|
36
36
|
async def __aenter__(self):
|
37
|
-
|
37
|
+
# Create session with better connectivity settings
|
38
|
+
timeout = aiohttp.ClientTimeout(total=30, connect=10)
|
39
|
+
connector = aiohttp.TCPConnector(
|
40
|
+
ttl_dns_cache=300,
|
41
|
+
use_dns_cache=True,
|
42
|
+
limit=100,
|
43
|
+
limit_per_host=10,
|
44
|
+
enable_cleanup_closed=True
|
45
|
+
)
|
46
|
+
|
47
|
+
self.session = aiohttp.ClientSession(
|
48
|
+
timeout=timeout,
|
49
|
+
connector=connector,
|
50
|
+
headers={
|
51
|
+
'User-Agent': 'binance-mcp-server/1.0.6',
|
52
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
53
|
+
}
|
54
|
+
)
|
38
55
|
return self
|
39
56
|
|
40
57
|
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
@@ -78,17 +95,24 @@ class BinanceClient:
|
|
78
95
|
|
79
96
|
try:
|
80
97
|
if method == "GET":
|
81
|
-
async with self.session.get(url, params=params, headers=headers) as response:
|
98
|
+
async with self.session.get(url, params=params, headers=headers, ssl=False) as response:
|
99
|
+
response.raise_for_status()
|
82
100
|
return await response.json()
|
83
101
|
elif method == "POST":
|
84
|
-
async with self.session.post(url, data=params, headers=headers) as response:
|
102
|
+
async with self.session.post(url, data=params, headers=headers, ssl=False) as response:
|
103
|
+
response.raise_for_status()
|
85
104
|
return await response.json()
|
86
105
|
elif method == "DELETE":
|
87
|
-
async with self.session.delete(url, data=params, headers=headers) as response:
|
106
|
+
async with self.session.delete(url, data=params, headers=headers, ssl=False) as response:
|
107
|
+
response.raise_for_status()
|
88
108
|
return await response.json()
|
89
109
|
else:
|
90
110
|
raise ValueError(f"Unsupported HTTP method: {method}")
|
91
111
|
|
112
|
+
except aiohttp.ClientError as e:
|
113
|
+
raise Exception(f"Network error connecting to Binance API: {str(e)}")
|
114
|
+
except asyncio.TimeoutError:
|
115
|
+
raise Exception("Request timeout - please check your internet connection")
|
92
116
|
except Exception as e:
|
93
117
|
raise Exception(f"Request failed: {str(e)}")
|
94
118
|
|
@@ -248,7 +272,11 @@ class BinanceMCPServer:
|
|
248
272
|
inputSchema={
|
249
273
|
"type": "object",
|
250
274
|
"properties": {
|
251
|
-
"orders": {
|
275
|
+
"orders": {
|
276
|
+
"type": "array",
|
277
|
+
"description": "List of order parameters",
|
278
|
+
"items": {"type": "object"}
|
279
|
+
},
|
252
280
|
"quantity_precision": {"type": "integer", "description": "Quantity precision for validation"},
|
253
281
|
"price_precision": {"type": "integer", "description": "Price precision for validation"}
|
254
282
|
},
|
@@ -274,7 +302,11 @@ class BinanceMCPServer:
|
|
274
302
|
"type": "object",
|
275
303
|
"properties": {
|
276
304
|
"symbol": {"type": "string", "description": "Trading pair symbol"},
|
277
|
-
"order_id_list": {
|
305
|
+
"order_id_list": {
|
306
|
+
"type": "array",
|
307
|
+
"description": "List of order IDs to cancel (up to 10 orders per batch)",
|
308
|
+
"items": {"type": "integer"}
|
309
|
+
}
|
278
310
|
},
|
279
311
|
"required": ["symbol", "order_id_list"]
|
280
312
|
}
|
@@ -440,6 +472,17 @@ class BinanceMCPServer:
|
|
440
472
|
"required": []
|
441
473
|
}
|
442
474
|
),
|
475
|
+
Tool(
|
476
|
+
name="get_24hr_ticker",
|
477
|
+
description="Get 24hr ticker price change statistics",
|
478
|
+
inputSchema={
|
479
|
+
"type": "object",
|
480
|
+
"properties": {
|
481
|
+
"symbol": {"type": "string", "description": "Trading pair symbol (optional, if not provided returns all symbols)"}
|
482
|
+
},
|
483
|
+
"required": []
|
484
|
+
}
|
485
|
+
),
|
443
486
|
Tool(
|
444
487
|
name="get_order_book",
|
445
488
|
description="Get order book for a symbol",
|
@@ -507,6 +550,21 @@ class BinanceMCPServer:
|
|
507
550
|
"required": []
|
508
551
|
}
|
509
552
|
),
|
553
|
+
Tool(
|
554
|
+
name="get_taker_buy_sell_volume",
|
555
|
+
description="Get taker buy/sell volume ratio statistics",
|
556
|
+
inputSchema={
|
557
|
+
"type": "object",
|
558
|
+
"properties": {
|
559
|
+
"symbol": {"type": "string", "description": "Trading pair symbol"},
|
560
|
+
"period": {"type": "string", "description": "Period for the data (5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d)"},
|
561
|
+
"start_time": {"type": "integer", "description": "Start timestamp in ms"},
|
562
|
+
"end_time": {"type": "integer", "description": "End timestamp in ms"},
|
563
|
+
"limit": {"type": "integer", "description": "Number of entries (max 500, default 30)"}
|
564
|
+
},
|
565
|
+
"required": ["symbol", "period"]
|
566
|
+
}
|
567
|
+
),
|
510
568
|
|
511
569
|
# Trading History Tools
|
512
570
|
Tool(
|
@@ -547,9 +605,9 @@ class BinanceMCPServer:
|
|
547
605
|
|
548
606
|
# Check if API credentials are configured for authenticated endpoints
|
549
607
|
unauthenticated_tools = [
|
550
|
-
"get_exchange_info", "get_price_ticker", "get_book_ticker",
|
608
|
+
"get_exchange_info", "get_price_ticker", "get_24hr_ticker", "get_book_ticker",
|
551
609
|
"get_order_book", "get_klines", "get_mark_price",
|
552
|
-
"get_aggregate_trades", "get_funding_rate_history"
|
610
|
+
"get_aggregate_trades", "get_funding_rate_history", "get_taker_buy_sell_volume"
|
553
611
|
]
|
554
612
|
|
555
613
|
if not self.config.api_key or not self.config.secret_key:
|
@@ -681,6 +739,11 @@ class BinanceMCPServer:
|
|
681
739
|
if "symbol" in arguments:
|
682
740
|
params["symbol"] = arguments["symbol"]
|
683
741
|
result = await client._make_request("GET", "/fapi/v1/ticker/price", params)
|
742
|
+
elif name == "get_24hr_ticker":
|
743
|
+
params = {}
|
744
|
+
if "symbol" in arguments:
|
745
|
+
params["symbol"] = arguments["symbol"]
|
746
|
+
result = await client._make_request("GET", "/fapi/v1/ticker/24hr", params)
|
684
747
|
elif name == "get_order_book":
|
685
748
|
params = {
|
686
749
|
"symbol": arguments["symbol"],
|
@@ -701,6 +764,9 @@ class BinanceMCPServer:
|
|
701
764
|
elif name == "get_funding_rate_history":
|
702
765
|
params = {k: v for k, v in arguments.items() if v is not None}
|
703
766
|
result = await client._make_request("GET", "/fapi/v1/fundingRate", params)
|
767
|
+
elif name == "get_taker_buy_sell_volume":
|
768
|
+
params = {k: v for k, v in arguments.items() if v is not None}
|
769
|
+
result = await client._make_request("GET", "/futures/data/takerlongshortRatio", params)
|
704
770
|
|
705
771
|
# Trading History Tools
|
706
772
|
elif name == "get_account_trades":
|
@@ -750,7 +816,7 @@ async def main():
|
|
750
816
|
write_stream,
|
751
817
|
InitializationOptions(
|
752
818
|
server_name="binance-futures-mcp-server",
|
753
|
-
server_version="1.0.
|
819
|
+
server_version="1.0.6",
|
754
820
|
capabilities={
|
755
821
|
"tools": {}
|
756
822
|
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|