binance-futures-mcp 1.0.3__py3-none-any.whl → 1.0.4__py3-none-any.whl

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
1
  Metadata-Version: 2.4
2
2
  Name: binance-futures-mcp
3
- Version: 1.0.3
3
+ Version: 1.0.4
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
@@ -0,0 +1,9 @@
1
+ binance_futures_mcp-1.0.4.dist-info/licenses/LICENSE,sha256=zqfwopvOi7kOx5YVOnehgmRFR-IU3x1n9JEShr3QOYg,1075
2
+ binance_mcp/__init__.py,sha256=ExUxc1kp3GoSwmEtC7eGgFMZlvSQ4IdW1T5xhw-NT98,106
3
+ binance_mcp/__main__.py,sha256=_9DBrtv0PAvjLjCqKk_cMfGtkqSUOcmU6HeQKFjuFMQ,214
4
+ binance_mcp/server.py,sha256=ApB26p9GyoEoJzc0AyZhDG_Z6BMq2i43irVgf88hoFw,39605
5
+ binance_futures_mcp-1.0.4.dist-info/METADATA,sha256=uIvIKbrdj81WlYcXyRgxFsUd8ZyWEYPZ6-AvLHv0bVU,11022
6
+ binance_futures_mcp-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ binance_futures_mcp-1.0.4.dist-info/entry_points.txt,sha256=-1iVs9AF7JQBS-xMichP9hQhbCY7YfLFRJVaNKwuN34,69
8
+ binance_futures_mcp-1.0.4.dist-info/top_level.txt,sha256=RqGhe1caZUvBF_ezvTiLZD8kVS25eiWVkfJfmoND9m8,12
9
+ binance_futures_mcp-1.0.4.dist-info/RECORD,,
binance_mcp/server.py CHANGED
@@ -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.3',
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
 
@@ -1,9 +0,0 @@
1
- binance_futures_mcp-1.0.3.dist-info/licenses/LICENSE,sha256=zqfwopvOi7kOx5YVOnehgmRFR-IU3x1n9JEShr3QOYg,1075
2
- binance_mcp/__init__.py,sha256=ExUxc1kp3GoSwmEtC7eGgFMZlvSQ4IdW1T5xhw-NT98,106
3
- binance_mcp/__main__.py,sha256=_9DBrtv0PAvjLjCqKk_cMfGtkqSUOcmU6HeQKFjuFMQ,214
4
- binance_mcp/server.py,sha256=aSlbwCFr5EV9X_vt70eK6-ACVkMl6IxNDkNA4yaRW1o,38583
5
- binance_futures_mcp-1.0.3.dist-info/METADATA,sha256=xXqrBUjb3_r22RJD9l6FWRjC__4ygDfjcwz3KlkXTXg,11022
6
- binance_futures_mcp-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- binance_futures_mcp-1.0.3.dist-info/entry_points.txt,sha256=-1iVs9AF7JQBS-xMichP9hQhbCY7YfLFRJVaNKwuN34,69
8
- binance_futures_mcp-1.0.3.dist-info/top_level.txt,sha256=RqGhe1caZUvBF_ezvTiLZD8kVS25eiWVkfJfmoND9m8,12
9
- binance_futures_mcp-1.0.3.dist-info/RECORD,,