binance-futures-mcp 1.0.3__tar.gz → 1.0.7__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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
2
- Name: binance-futures-mcp
3
- Version: 1.0.3
1
+ Metadata-Version: 2.1
2
+ Name: binance_futures_mcp
3
+ Version: 1.0.7
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
 
@@ -43,21 +29,23 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
43
29
 
44
30
  1. **Install the package:**
45
31
  ```bash
46
- pip install binance-futures-mcp
32
+ pip install binance_futures_mcp
47
33
  ```
48
34
 
49
35
  2. **Run the server:**
50
36
  ```bash
51
- uvx binance-futures-mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
37
+ uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
52
38
  ```
53
39
 
54
40
  3. **Or configure in VS Code** by adding to your `settings.json`:
55
41
  ```json
56
42
  {
57
- "mcp.servers": {
58
- "binance": {
59
- "command": "uvx",
60
- "args": ["binance-futures-mcp", "--binance-api-key", "your_key", "--binance-secret-key", "your_secret"]
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
  }
@@ -97,7 +85,7 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
97
85
  ## Installation
98
86
 
99
87
  ```bash
100
- pip install binance-futures-mcp
88
+ pip install binance_futures_mcp
101
89
  ```
102
90
 
103
91
  ### Development Installation
@@ -120,11 +108,12 @@ Add to your VS Code `settings.json`:
120
108
 
121
109
  ```json
122
110
  {
123
- "mcp.servers": {
124
- "binance": {
125
- "command": "uvx",
126
- "args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"],
127
- "env": {}
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
- 3. **Alternative commands**: You can also use:
191
- - `pip install binance-futures-mcp && python -m binance_mcp`
192
- - `binance-mcp-server` (if installed globally and on PATH)
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)
179
+ - `pip install binance_futures_mcp && python -m binance_mcp`
193
180
 
194
181
  4. **Python environment**: Using `uvx` automatically handles the Python environment.
195
182
 
@@ -223,15 +210,15 @@ export BINANCE_SECRET_KEY="your_secret_key_here"
223
210
  python -m binance_mcp
224
211
 
225
212
  # Or using uvx (no installation needed)
226
- uvx binance-futures-mcp
213
+ uvx binance_futures_mcp
227
214
 
228
215
  # With API credentials as arguments
229
- uvx binance-futures-mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
216
+ uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
230
217
  ```
231
218
 
232
219
  ### Available Tools
233
220
 
234
- The server provides 32 tools organized into categories:
221
+ The server provides 35 tools organized into categories:
235
222
 
236
223
  #### Account Information (5 tools)
237
224
  - `get_account_info` - Get futures account information
@@ -264,19 +251,21 @@ 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 (6 tools)
254
+ #### Market Data (10 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
274
263
  - `get_aggregate_trades` - Get aggregate trade data
264
+ - `get_funding_rate_history` - Get funding rate history
275
265
 
276
- #### Trading History (3 tools)
266
+ #### Trading History (2 tools)
277
267
  - `get_account_trades` - Get account trade history
278
268
  - `get_income_history` - Get income history
279
- - `get_funding_rate_history` - Get funding rate history
280
269
 
281
270
  ## Example Usage
282
271
 
@@ -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
@@ -6,21 +6,23 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
6
6
 
7
7
  1. **Install the package:**
8
8
  ```bash
9
- pip install binance-futures-mcp
9
+ pip install binance_futures_mcp
10
10
  ```
11
11
 
12
12
  2. **Run the server:**
13
13
  ```bash
14
- uvx binance-futures-mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
14
+ uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
15
15
  ```
16
16
 
17
17
  3. **Or configure in VS Code** by adding to your `settings.json`:
18
18
  ```json
19
19
  {
20
- "mcp.servers": {
21
- "binance": {
22
- "command": "uvx",
23
- "args": ["binance-futures-mcp", "--binance-api-key", "your_key", "--binance-secret-key", "your_secret"]
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
  }
@@ -60,7 +62,7 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
60
62
  ## Installation
61
63
 
62
64
  ```bash
63
- pip install binance-futures-mcp
65
+ pip install binance_futures_mcp
64
66
  ```
65
67
 
66
68
  ### Development Installation
@@ -83,11 +85,12 @@ Add to your VS Code `settings.json`:
83
85
 
84
86
  ```json
85
87
  {
86
- "mcp.servers": {
87
- "binance": {
88
- "command": "uvx",
89
- "args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"],
90
- "env": {}
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
- 3. **Alternative commands**: You can also use:
154
- - `pip install binance-futures-mcp && python -m binance_mcp`
155
- - `binance-mcp-server` (if installed globally and on PATH)
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)
156
+ - `pip install binance_futures_mcp && python -m binance_mcp`
156
157
 
157
158
  4. **Python environment**: Using `uvx` automatically handles the Python environment.
158
159
 
@@ -186,15 +187,15 @@ export BINANCE_SECRET_KEY="your_secret_key_here"
186
187
  python -m binance_mcp
187
188
 
188
189
  # Or using uvx (no installation needed)
189
- uvx binance-futures-mcp
190
+ uvx binance_futures_mcp
190
191
 
191
192
  # With API credentials as arguments
192
- uvx binance-futures-mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
193
+ uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
193
194
  ```
194
195
 
195
196
  ### Available Tools
196
197
 
197
- The server provides 32 tools organized into categories:
198
+ The server provides 35 tools organized into categories:
198
199
 
199
200
  #### Account Information (5 tools)
200
201
  - `get_account_info` - Get futures account information
@@ -227,19 +228,21 @@ 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 (6 tools)
231
+ #### Market Data (10 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
237
240
  - `get_aggregate_trades` - Get aggregate trade data
241
+ - `get_funding_rate_history` - Get funding rate history
238
242
 
239
- #### Trading History (3 tools)
243
+ #### Trading History (2 tools)
240
244
  - `get_account_trades` - Get account trade history
241
245
  - `get_income_history` - Get income history
242
- - `get_funding_rate_history` - Get funding rate history
243
246
 
244
247
  ## Example Usage
245
248
 
@@ -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
@@ -6,8 +6,8 @@ with open("README.md", "r", encoding="utf-8") as fh:
6
6
  long_description = fh.read()
7
7
 
8
8
  setup(
9
- name="binance-futures-mcp",
10
- version="1.0.3",
9
+ name="binance_futures_mcp",
10
+ version="1.0.7",
11
11
  author="Binance MCP Server",
12
12
  description="A Model Context Protocol server for Binance Futures API",
13
13
  long_description=long_description,
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.1
2
2
  Name: binance-futures-mcp
3
- Version: 1.0.3
3
+ Version: 1.0.7
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
 
@@ -43,21 +29,23 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
43
29
 
44
30
  1. **Install the package:**
45
31
  ```bash
46
- pip install binance-futures-mcp
32
+ pip install binance_futures_mcp
47
33
  ```
48
34
 
49
35
  2. **Run the server:**
50
36
  ```bash
51
- uvx binance-futures-mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
37
+ uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
52
38
  ```
53
39
 
54
40
  3. **Or configure in VS Code** by adding to your `settings.json`:
55
41
  ```json
56
42
  {
57
- "mcp.servers": {
58
- "binance": {
59
- "command": "uvx",
60
- "args": ["binance-futures-mcp", "--binance-api-key", "your_key", "--binance-secret-key", "your_secret"]
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
  }
@@ -97,7 +85,7 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
97
85
  ## Installation
98
86
 
99
87
  ```bash
100
- pip install binance-futures-mcp
88
+ pip install binance_futures_mcp
101
89
  ```
102
90
 
103
91
  ### Development Installation
@@ -120,11 +108,12 @@ Add to your VS Code `settings.json`:
120
108
 
121
109
  ```json
122
110
  {
123
- "mcp.servers": {
124
- "binance": {
125
- "command": "uvx",
126
- "args": ["binance-futures-mcp", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"],
127
- "env": {}
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
- 3. **Alternative commands**: You can also use:
191
- - `pip install binance-futures-mcp && python -m binance_mcp`
192
- - `binance-mcp-server` (if installed globally and on PATH)
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)
179
+ - `pip install binance_futures_mcp && python -m binance_mcp`
193
180
 
194
181
  4. **Python environment**: Using `uvx` automatically handles the Python environment.
195
182
 
@@ -223,15 +210,15 @@ export BINANCE_SECRET_KEY="your_secret_key_here"
223
210
  python -m binance_mcp
224
211
 
225
212
  # Or using uvx (no installation needed)
226
- uvx binance-futures-mcp
213
+ uvx binance_futures_mcp
227
214
 
228
215
  # With API credentials as arguments
229
- uvx binance-futures-mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
216
+ uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
230
217
  ```
231
218
 
232
219
  ### Available Tools
233
220
 
234
- The server provides 32 tools organized into categories:
221
+ The server provides 35 tools organized into categories:
235
222
 
236
223
  #### Account Information (5 tools)
237
224
  - `get_account_info` - Get futures account information
@@ -264,19 +251,21 @@ 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 (6 tools)
254
+ #### Market Data (10 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
274
263
  - `get_aggregate_trades` - Get aggregate trade data
264
+ - `get_funding_rate_history` - Get funding rate history
275
265
 
276
- #### Trading History (3 tools)
266
+ #### Trading History (2 tools)
277
267
  - `get_account_trades` - Get account trade history
278
268
  - `get_income_history` - Get income history
279
- - `get_funding_rate_history` - Get funding rate history
280
269
 
281
270
  ## Example Usage
282
271
 
@@ -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
@@ -1,5 +1,6 @@
1
1
  LICENSE
2
2
  README.md
3
+ pyproject.toml
3
4
  setup.py
4
5
  src/binance_futures_mcp.egg-info/PKG-INFO
5
6
  src/binance_futures_mcp.egg-info/SOURCES.txt
@@ -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
- self.session = aiohttp.ClientSession()
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.7',
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
 
@@ -448,6 +472,17 @@ class BinanceMCPServer:
448
472
  "required": []
449
473
  }
450
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
+ ),
451
486
  Tool(
452
487
  name="get_order_book",
453
488
  description="Get order book for a symbol",
@@ -515,6 +550,21 @@ class BinanceMCPServer:
515
550
  "required": []
516
551
  }
517
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
+ ),
518
568
 
519
569
  # Trading History Tools
520
570
  Tool(
@@ -555,9 +605,9 @@ class BinanceMCPServer:
555
605
 
556
606
  # Check if API credentials are configured for authenticated endpoints
557
607
  unauthenticated_tools = [
558
- "get_exchange_info", "get_price_ticker", "get_book_ticker",
608
+ "get_exchange_info", "get_price_ticker", "get_24hr_ticker", "get_book_ticker",
559
609
  "get_order_book", "get_klines", "get_mark_price",
560
- "get_aggregate_trades", "get_funding_rate_history"
610
+ "get_aggregate_trades", "get_funding_rate_history", "get_taker_buy_sell_volume"
561
611
  ]
562
612
 
563
613
  if not self.config.api_key or not self.config.secret_key:
@@ -689,6 +739,11 @@ class BinanceMCPServer:
689
739
  if "symbol" in arguments:
690
740
  params["symbol"] = arguments["symbol"]
691
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)
692
747
  elif name == "get_order_book":
693
748
  params = {
694
749
  "symbol": arguments["symbol"],
@@ -709,6 +764,9 @@ class BinanceMCPServer:
709
764
  elif name == "get_funding_rate_history":
710
765
  params = {k: v for k, v in arguments.items() if v is not None}
711
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)
712
770
 
713
771
  # Trading History Tools
714
772
  elif name == "get_account_trades":
@@ -758,7 +816,7 @@ async def main():
758
816
  write_stream,
759
817
  InitializationOptions(
760
818
  server_name="binance-futures-mcp-server",
761
- server_version="1.0.1",
819
+ server_version="1.0.7",
762
820
  capabilities={
763
821
  "tools": {}
764
822
  }