binance-futures-mcp 1.0.6__tar.gz → 1.0.8__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.6/src/binance_futures_mcp.egg-info → binance_futures_mcp-1.0.8}/PKG-INFO +36 -22
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/README.md +17 -17
- binance_futures_mcp-1.0.8/pyproject.toml +55 -0
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/setup.py +3 -3
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8/src/binance_futures_mcp.egg-info}/PKG-INFO +36 -22
- binance_futures_mcp-1.0.8/src/binance_futures_mcp.egg-info/requires.txt +10 -0
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/src/binance_mcp/server.py +122 -22
- binance-futures-mcp-1.0.6/pyproject.toml +0 -0
- binance-futures-mcp-1.0.6/src/binance_futures_mcp.egg-info/requires.txt +0 -3
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/LICENSE +0 -0
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/setup.cfg +0 -0
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/src/binance_futures_mcp.egg-info/SOURCES.txt +0 -0
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/src/binance_futures_mcp.egg-info/dependency_links.txt +0 -0
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/src/binance_futures_mcp.egg-info/entry_points.txt +0 -0
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/src/binance_futures_mcp.egg-info/top_level.txt +0 -0
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/src/binance_mcp/__init__.py +0 -0
- {binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/src/binance_mcp/__main__.py +0 -0
{binance-futures-mcp-1.0.6/src/binance_futures_mcp.egg-info → binance_futures_mcp-1.0.8}/PKG-INFO
RENAMED
@@ -1,12 +1,14 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: binance-futures-mcp
|
3
|
-
Version: 1.0.
|
4
|
-
Summary: A Model Context Protocol server for Binance Futures API
|
3
|
+
Version: 1.0.8
|
4
|
+
Summary: A Model Context Protocol server for Binance Futures API with comprehensive trading tools
|
5
5
|
Home-page: https://github.com/alexcandrabersiva/bin-mcp
|
6
6
|
Author: Binance MCP Server
|
7
|
-
|
7
|
+
License-Expression: MIT
|
8
|
+
Project-URL: Homepage, https://github.com/alexcandrabersiva/bin-mcp
|
8
9
|
Project-URL: Repository, https://github.com/alexcandrabersiva/bin-mcp.git
|
9
|
-
|
10
|
+
Project-URL: Issues, https://github.com/alexcandrabersiva/bin-mcp/issues
|
11
|
+
Keywords: mcp,binance,trading,futures,api,model-context-protocol
|
10
12
|
Classifier: Development Status :: 4 - Beta
|
11
13
|
Classifier: Intended Audience :: Developers
|
12
14
|
Classifier: Programming Language :: Python :: 3
|
@@ -20,6 +22,18 @@ Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
20
22
|
Requires-Python: >=3.8
|
21
23
|
Description-Content-Type: text/markdown
|
22
24
|
License-File: LICENSE
|
25
|
+
Requires-Dist: mcp>=1.0.0
|
26
|
+
Requires-Dist: aiohttp>=3.8.0
|
27
|
+
Requires-Dist: pydantic>=2.0.0
|
28
|
+
Provides-Extra: dev
|
29
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
30
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
31
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
32
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
33
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
34
|
+
Dynamic: home-page
|
35
|
+
Dynamic: license-file
|
36
|
+
Dynamic: requires-python
|
23
37
|
|
24
38
|
# Binance MCP Server
|
25
39
|
|
@@ -29,12 +43,12 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
29
43
|
|
30
44
|
1. **Install the package:**
|
31
45
|
```bash
|
32
|
-
pip install
|
46
|
+
pip install binance_futures_mcp
|
33
47
|
```
|
34
48
|
|
35
49
|
2. **Run the server:**
|
36
50
|
```bash
|
37
|
-
uvx
|
51
|
+
uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
|
38
52
|
```
|
39
53
|
|
40
54
|
3. **Or configure in VS Code** by adding to your `settings.json`:
|
@@ -44,7 +58,7 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
44
58
|
"servers": {
|
45
59
|
"binance": {
|
46
60
|
"command": "uvx",
|
47
|
-
"args": ["--from", "
|
61
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_key", "--binance-secret-key", "your_secret"]
|
48
62
|
}
|
49
63
|
}
|
50
64
|
}
|
@@ -85,7 +99,7 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
85
99
|
## Installation
|
86
100
|
|
87
101
|
```bash
|
88
|
-
pip install
|
102
|
+
pip install binance_futures_mcp
|
89
103
|
```
|
90
104
|
|
91
105
|
### Development Installation
|
@@ -112,7 +126,7 @@ Add to your VS Code `settings.json`:
|
|
112
126
|
"servers": {
|
113
127
|
"binance": {
|
114
128
|
"command": "uvx",
|
115
|
-
"args": ["--from", "
|
129
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
116
130
|
}
|
117
131
|
}
|
118
132
|
}
|
@@ -128,7 +142,7 @@ Add to your Cursor configuration file (`.cursor/mcp.json`):
|
|
128
142
|
"servers": {
|
129
143
|
"binance": {
|
130
144
|
"command": "uvx",
|
131
|
-
"args": ["--from", "
|
145
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
132
146
|
}
|
133
147
|
}
|
134
148
|
}
|
@@ -143,7 +157,7 @@ Add to your Windsurf configuration (`.windsurf/mcp.json`):
|
|
143
157
|
"mcpServers": {
|
144
158
|
"binance": {
|
145
159
|
"command": "uvx",
|
146
|
-
"args": ["--from", "
|
160
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
147
161
|
}
|
148
162
|
}
|
149
163
|
}
|
@@ -161,7 +175,7 @@ Add to your Claude Desktop configuration file:
|
|
161
175
|
"mcpServers": {
|
162
176
|
"binance": {
|
163
177
|
"command": "uvx",
|
164
|
-
"args": ["--from", "
|
178
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
165
179
|
}
|
166
180
|
}
|
167
181
|
}
|
@@ -174,9 +188,9 @@ Add to your Claude Desktop configuration file:
|
|
174
188
|
2. **Set API credentials**: Replace `your_api_key` and `your_secret_key` with your actual Binance API credentials.
|
175
189
|
|
176
190
|
2. **Alternative commands**: You can also use:
|
177
|
-
- `uvx
|
178
|
-
- `uvx --from
|
179
|
-
- `pip install
|
191
|
+
- `uvx binance_futures_mcp` (direct package execution)
|
192
|
+
- `uvx --from binance_futures_mcp binance-mcp-server.exe` (explicit executable)
|
193
|
+
- `pip install binance_futures_mcp && python -m binance_mcp`
|
180
194
|
|
181
195
|
4. **Python environment**: Using `uvx` automatically handles the Python environment.
|
182
196
|
|
@@ -210,15 +224,15 @@ export BINANCE_SECRET_KEY="your_secret_key_here"
|
|
210
224
|
python -m binance_mcp
|
211
225
|
|
212
226
|
# Or using uvx (no installation needed)
|
213
|
-
uvx
|
227
|
+
uvx binance_futures_mcp
|
214
228
|
|
215
229
|
# With API credentials as arguments
|
216
|
-
uvx
|
230
|
+
uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
|
217
231
|
```
|
218
232
|
|
219
233
|
### Available Tools
|
220
234
|
|
221
|
-
The server provides
|
235
|
+
The server provides 35 tools organized into categories:
|
222
236
|
|
223
237
|
#### Account Information (5 tools)
|
224
238
|
- `get_account_info` - Get futures account information
|
@@ -251,7 +265,7 @@ The server provides 37 tools organized into categories:
|
|
251
265
|
- `change_position_mode` - Change position mode
|
252
266
|
- `modify_position_margin` - Modify position margin
|
253
267
|
|
254
|
-
#### Market Data (
|
268
|
+
#### Market Data (10 tools)
|
255
269
|
- `get_exchange_info` - Get trading rules and symbol info
|
256
270
|
- `get_book_ticker` - Get best bid/ask prices
|
257
271
|
- `get_price_ticker` - Get latest prices
|
@@ -261,11 +275,11 @@ The server provides 37 tools organized into categories:
|
|
261
275
|
- `get_klines` - Get candlestick data
|
262
276
|
- `get_mark_price` - Get mark price and funding rate
|
263
277
|
- `get_aggregate_trades` - Get aggregate trade data
|
278
|
+
- `get_funding_rate_history` - Get funding rate history
|
264
279
|
|
265
|
-
#### Trading History (
|
280
|
+
#### Trading History (2 tools)
|
266
281
|
- `get_account_trades` - Get account trade history
|
267
282
|
- `get_income_history` - Get income history
|
268
|
-
- `get_funding_rate_history` - Get funding rate history
|
269
283
|
|
270
284
|
## Example Usage
|
271
285
|
|
@@ -6,12 +6,12 @@ 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
|
9
|
+
pip install binance_futures_mcp
|
10
10
|
```
|
11
11
|
|
12
12
|
2. **Run the server:**
|
13
13
|
```bash
|
14
|
-
uvx
|
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`:
|
@@ -21,7 +21,7 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
21
21
|
"servers": {
|
22
22
|
"binance": {
|
23
23
|
"command": "uvx",
|
24
|
-
"args": ["--from", "
|
24
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_key", "--binance-secret-key", "your_secret"]
|
25
25
|
}
|
26
26
|
}
|
27
27
|
}
|
@@ -62,7 +62,7 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
62
62
|
## Installation
|
63
63
|
|
64
64
|
```bash
|
65
|
-
pip install
|
65
|
+
pip install binance_futures_mcp
|
66
66
|
```
|
67
67
|
|
68
68
|
### Development Installation
|
@@ -89,7 +89,7 @@ Add to your VS Code `settings.json`:
|
|
89
89
|
"servers": {
|
90
90
|
"binance": {
|
91
91
|
"command": "uvx",
|
92
|
-
"args": ["--from", "
|
92
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
93
93
|
}
|
94
94
|
}
|
95
95
|
}
|
@@ -105,7 +105,7 @@ Add to your Cursor configuration file (`.cursor/mcp.json`):
|
|
105
105
|
"servers": {
|
106
106
|
"binance": {
|
107
107
|
"command": "uvx",
|
108
|
-
"args": ["--from", "
|
108
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
109
109
|
}
|
110
110
|
}
|
111
111
|
}
|
@@ -120,7 +120,7 @@ Add to your Windsurf configuration (`.windsurf/mcp.json`):
|
|
120
120
|
"mcpServers": {
|
121
121
|
"binance": {
|
122
122
|
"command": "uvx",
|
123
|
-
"args": ["--from", "
|
123
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
124
124
|
}
|
125
125
|
}
|
126
126
|
}
|
@@ -138,7 +138,7 @@ Add to your Claude Desktop configuration file:
|
|
138
138
|
"mcpServers": {
|
139
139
|
"binance": {
|
140
140
|
"command": "uvx",
|
141
|
-
"args": ["--from", "
|
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
|
}
|
@@ -151,9 +151,9 @@ Add to your Claude Desktop configuration file:
|
|
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
|
155
|
-
- `uvx --from
|
156
|
-
- `pip install
|
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`
|
157
157
|
|
158
158
|
4. **Python environment**: Using `uvx` automatically handles the Python environment.
|
159
159
|
|
@@ -187,15 +187,15 @@ export BINANCE_SECRET_KEY="your_secret_key_here"
|
|
187
187
|
python -m binance_mcp
|
188
188
|
|
189
189
|
# Or using uvx (no installation needed)
|
190
|
-
uvx
|
190
|
+
uvx binance_futures_mcp
|
191
191
|
|
192
192
|
# With API credentials as arguments
|
193
|
-
uvx
|
193
|
+
uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
|
194
194
|
```
|
195
195
|
|
196
196
|
### Available Tools
|
197
197
|
|
198
|
-
The server provides
|
198
|
+
The server provides 35 tools organized into categories:
|
199
199
|
|
200
200
|
#### Account Information (5 tools)
|
201
201
|
- `get_account_info` - Get futures account information
|
@@ -228,7 +228,7 @@ The server provides 37 tools organized into categories:
|
|
228
228
|
- `change_position_mode` - Change position mode
|
229
229
|
- `modify_position_margin` - Modify position margin
|
230
230
|
|
231
|
-
#### Market Data (
|
231
|
+
#### Market Data (10 tools)
|
232
232
|
- `get_exchange_info` - Get trading rules and symbol info
|
233
233
|
- `get_book_ticker` - Get best bid/ask prices
|
234
234
|
- `get_price_ticker` - Get latest prices
|
@@ -238,11 +238,11 @@ The server provides 37 tools organized into categories:
|
|
238
238
|
- `get_klines` - Get candlestick data
|
239
239
|
- `get_mark_price` - Get mark price and funding rate
|
240
240
|
- `get_aggregate_trades` - Get aggregate trade data
|
241
|
+
- `get_funding_rate_history` - Get funding rate history
|
241
242
|
|
242
|
-
#### Trading History (
|
243
|
+
#### Trading History (2 tools)
|
243
244
|
- `get_account_trades` - Get account trade history
|
244
245
|
- `get_income_history` - Get income history
|
245
|
-
- `get_funding_rate_history` - Get funding rate history
|
246
246
|
|
247
247
|
## Example Usage
|
248
248
|
|
@@ -0,0 +1,55 @@
|
|
1
|
+
[build-system]
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
3
|
+
build-backend = "setuptools.build_meta"
|
4
|
+
|
5
|
+
[project]
|
6
|
+
name = "binance-futures-mcp"
|
7
|
+
version = "1.0.8"
|
8
|
+
description = "A Model Context Protocol server for Binance Futures API with comprehensive trading tools"
|
9
|
+
authors = [
|
10
|
+
{name = "Binance MCP Server"}
|
11
|
+
]
|
12
|
+
license = "MIT"
|
13
|
+
readme = "README.md"
|
14
|
+
requires-python = ">=3.8"
|
15
|
+
keywords = ["mcp", "binance", "trading", "futures", "api", "model-context-protocol"]
|
16
|
+
classifiers = [
|
17
|
+
"Development Status :: 4 - Beta",
|
18
|
+
"Intended Audience :: Developers",
|
19
|
+
"Programming Language :: Python :: 3",
|
20
|
+
"Programming Language :: Python :: 3.8",
|
21
|
+
"Programming Language :: Python :: 3.9",
|
22
|
+
"Programming Language :: Python :: 3.10",
|
23
|
+
"Programming Language :: Python :: 3.11",
|
24
|
+
"Programming Language :: Python :: 3.12",
|
25
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
26
|
+
"Topic :: Office/Business :: Financial :: Investment",
|
27
|
+
]
|
28
|
+
dependencies = [
|
29
|
+
"mcp>=1.0.0",
|
30
|
+
"aiohttp>=3.8.0",
|
31
|
+
"pydantic>=2.0.0",
|
32
|
+
]
|
33
|
+
|
34
|
+
[project.optional-dependencies]
|
35
|
+
dev = [
|
36
|
+
"pytest>=7.0.0",
|
37
|
+
"pytest-asyncio>=0.21.0",
|
38
|
+
"black>=23.0.0",
|
39
|
+
"mypy>=1.0.0",
|
40
|
+
"ruff>=0.1.0",
|
41
|
+
]
|
42
|
+
|
43
|
+
[project.scripts]
|
44
|
+
binance-mcp-server = "binance_mcp.__main__:cli_main"
|
45
|
+
|
46
|
+
[project.urls]
|
47
|
+
Homepage = "https://github.com/alexcandrabersiva/bin-mcp"
|
48
|
+
Repository = "https://github.com/alexcandrabersiva/bin-mcp.git"
|
49
|
+
Issues = "https://github.com/alexcandrabersiva/bin-mcp/issues"
|
50
|
+
|
51
|
+
[tool.setuptools.packages.find]
|
52
|
+
where = ["src"]
|
53
|
+
|
54
|
+
[tool.setuptools.package-dir]
|
55
|
+
"" = "src"
|
@@ -6,10 +6,10 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
6
6
|
long_description = fh.read()
|
7
7
|
|
8
8
|
setup(
|
9
|
-
name="
|
10
|
-
version="1.0.
|
9
|
+
name="binance_futures_mcp",
|
10
|
+
version="1.0.8",
|
11
11
|
author="Binance MCP Server",
|
12
|
-
description="A Model Context Protocol server for Binance Futures API",
|
12
|
+
description="A Model Context Protocol server for Binance Futures API with comprehensive trading tools",
|
13
13
|
long_description=long_description,
|
14
14
|
long_description_content_type="text/markdown",
|
15
15
|
url="https://github.com/alexcandrabersiva/bin-mcp",
|
{binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8/src/binance_futures_mcp.egg-info}/PKG-INFO
RENAMED
@@ -1,12 +1,14 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: binance-futures-mcp
|
3
|
-
Version: 1.0.
|
4
|
-
Summary: A Model Context Protocol server for Binance Futures API
|
3
|
+
Version: 1.0.8
|
4
|
+
Summary: A Model Context Protocol server for Binance Futures API with comprehensive trading tools
|
5
5
|
Home-page: https://github.com/alexcandrabersiva/bin-mcp
|
6
6
|
Author: Binance MCP Server
|
7
|
-
|
7
|
+
License-Expression: MIT
|
8
|
+
Project-URL: Homepage, https://github.com/alexcandrabersiva/bin-mcp
|
8
9
|
Project-URL: Repository, https://github.com/alexcandrabersiva/bin-mcp.git
|
9
|
-
|
10
|
+
Project-URL: Issues, https://github.com/alexcandrabersiva/bin-mcp/issues
|
11
|
+
Keywords: mcp,binance,trading,futures,api,model-context-protocol
|
10
12
|
Classifier: Development Status :: 4 - Beta
|
11
13
|
Classifier: Intended Audience :: Developers
|
12
14
|
Classifier: Programming Language :: Python :: 3
|
@@ -20,6 +22,18 @@ Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
20
22
|
Requires-Python: >=3.8
|
21
23
|
Description-Content-Type: text/markdown
|
22
24
|
License-File: LICENSE
|
25
|
+
Requires-Dist: mcp>=1.0.0
|
26
|
+
Requires-Dist: aiohttp>=3.8.0
|
27
|
+
Requires-Dist: pydantic>=2.0.0
|
28
|
+
Provides-Extra: dev
|
29
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
30
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
31
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
32
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
33
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
34
|
+
Dynamic: home-page
|
35
|
+
Dynamic: license-file
|
36
|
+
Dynamic: requires-python
|
23
37
|
|
24
38
|
# Binance MCP Server
|
25
39
|
|
@@ -29,12 +43,12 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
29
43
|
|
30
44
|
1. **Install the package:**
|
31
45
|
```bash
|
32
|
-
pip install
|
46
|
+
pip install binance_futures_mcp
|
33
47
|
```
|
34
48
|
|
35
49
|
2. **Run the server:**
|
36
50
|
```bash
|
37
|
-
uvx
|
51
|
+
uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
|
38
52
|
```
|
39
53
|
|
40
54
|
3. **Or configure in VS Code** by adding to your `settings.json`:
|
@@ -44,7 +58,7 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
44
58
|
"servers": {
|
45
59
|
"binance": {
|
46
60
|
"command": "uvx",
|
47
|
-
"args": ["--from", "
|
61
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_key", "--binance-secret-key", "your_secret"]
|
48
62
|
}
|
49
63
|
}
|
50
64
|
}
|
@@ -85,7 +99,7 @@ A Model Context Protocol (MCP) server that provides comprehensive access to Bina
|
|
85
99
|
## Installation
|
86
100
|
|
87
101
|
```bash
|
88
|
-
pip install
|
102
|
+
pip install binance_futures_mcp
|
89
103
|
```
|
90
104
|
|
91
105
|
### Development Installation
|
@@ -112,7 +126,7 @@ Add to your VS Code `settings.json`:
|
|
112
126
|
"servers": {
|
113
127
|
"binance": {
|
114
128
|
"command": "uvx",
|
115
|
-
"args": ["--from", "
|
129
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
116
130
|
}
|
117
131
|
}
|
118
132
|
}
|
@@ -128,7 +142,7 @@ Add to your Cursor configuration file (`.cursor/mcp.json`):
|
|
128
142
|
"servers": {
|
129
143
|
"binance": {
|
130
144
|
"command": "uvx",
|
131
|
-
"args": ["--from", "
|
145
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
132
146
|
}
|
133
147
|
}
|
134
148
|
}
|
@@ -143,7 +157,7 @@ Add to your Windsurf configuration (`.windsurf/mcp.json`):
|
|
143
157
|
"mcpServers": {
|
144
158
|
"binance": {
|
145
159
|
"command": "uvx",
|
146
|
-
"args": ["--from", "
|
160
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
147
161
|
}
|
148
162
|
}
|
149
163
|
}
|
@@ -161,7 +175,7 @@ Add to your Claude Desktop configuration file:
|
|
161
175
|
"mcpServers": {
|
162
176
|
"binance": {
|
163
177
|
"command": "uvx",
|
164
|
-
"args": ["--from", "
|
178
|
+
"args": ["--from", "binance_futures_mcp", "binance-mcp-server.exe", "--binance-api-key", "your_api_key", "--binance-secret-key", "your_secret_key"]
|
165
179
|
}
|
166
180
|
}
|
167
181
|
}
|
@@ -174,9 +188,9 @@ Add to your Claude Desktop configuration file:
|
|
174
188
|
2. **Set API credentials**: Replace `your_api_key` and `your_secret_key` with your actual Binance API credentials.
|
175
189
|
|
176
190
|
2. **Alternative commands**: You can also use:
|
177
|
-
- `uvx
|
178
|
-
- `uvx --from
|
179
|
-
- `pip install
|
191
|
+
- `uvx binance_futures_mcp` (direct package execution)
|
192
|
+
- `uvx --from binance_futures_mcp binance-mcp-server.exe` (explicit executable)
|
193
|
+
- `pip install binance_futures_mcp && python -m binance_mcp`
|
180
194
|
|
181
195
|
4. **Python environment**: Using `uvx` automatically handles the Python environment.
|
182
196
|
|
@@ -210,15 +224,15 @@ export BINANCE_SECRET_KEY="your_secret_key_here"
|
|
210
224
|
python -m binance_mcp
|
211
225
|
|
212
226
|
# Or using uvx (no installation needed)
|
213
|
-
uvx
|
227
|
+
uvx binance_futures_mcp
|
214
228
|
|
215
229
|
# With API credentials as arguments
|
216
|
-
uvx
|
230
|
+
uvx binance_futures_mcp --binance-api-key "your_key" --binance-secret-key "your_secret"
|
217
231
|
```
|
218
232
|
|
219
233
|
### Available Tools
|
220
234
|
|
221
|
-
The server provides
|
235
|
+
The server provides 35 tools organized into categories:
|
222
236
|
|
223
237
|
#### Account Information (5 tools)
|
224
238
|
- `get_account_info` - Get futures account information
|
@@ -251,7 +265,7 @@ The server provides 37 tools organized into categories:
|
|
251
265
|
- `change_position_mode` - Change position mode
|
252
266
|
- `modify_position_margin` - Modify position margin
|
253
267
|
|
254
|
-
#### Market Data (
|
268
|
+
#### Market Data (10 tools)
|
255
269
|
- `get_exchange_info` - Get trading rules and symbol info
|
256
270
|
- `get_book_ticker` - Get best bid/ask prices
|
257
271
|
- `get_price_ticker` - Get latest prices
|
@@ -261,11 +275,11 @@ The server provides 37 tools organized into categories:
|
|
261
275
|
- `get_klines` - Get candlestick data
|
262
276
|
- `get_mark_price` - Get mark price and funding rate
|
263
277
|
- `get_aggregate_trades` - Get aggregate trade data
|
278
|
+
- `get_funding_rate_history` - Get funding rate history
|
264
279
|
|
265
|
-
#### Trading History (
|
280
|
+
#### Trading History (2 tools)
|
266
281
|
- `get_account_trades` - Get account trade history
|
267
282
|
- `get_income_history` - Get income history
|
268
|
-
- `get_funding_rate_history` - Get funding rate history
|
269
283
|
|
270
284
|
## Example Usage
|
271
285
|
|
@@ -1,9 +1,11 @@
|
|
1
1
|
#!/usr/bin/env python3
|
2
2
|
|
3
3
|
import asyncio
|
4
|
+
import argparse
|
4
5
|
import hashlib
|
5
6
|
import hmac
|
6
7
|
import json
|
8
|
+
import os
|
7
9
|
import time
|
8
10
|
from datetime import datetime
|
9
11
|
from typing import Any, Dict, List, Optional, Union
|
@@ -48,7 +50,7 @@ class BinanceClient:
|
|
48
50
|
timeout=timeout,
|
49
51
|
connector=connector,
|
50
52
|
headers={
|
51
|
-
'User-Agent': 'binance-mcp-server/1.0.
|
53
|
+
'User-Agent': 'binance-mcp-server/1.0.8',
|
52
54
|
'Content-Type': 'application/x-www-form-urlencoded'
|
53
55
|
}
|
54
56
|
)
|
@@ -96,15 +98,21 @@ class BinanceClient:
|
|
96
98
|
try:
|
97
99
|
if method == "GET":
|
98
100
|
async with self.session.get(url, params=params, headers=headers, ssl=False) as response:
|
99
|
-
response.
|
101
|
+
if response.status != 200:
|
102
|
+
error_text = await response.text()
|
103
|
+
raise Exception(f"HTTP {response.status}: {error_text}")
|
100
104
|
return await response.json()
|
101
105
|
elif method == "POST":
|
102
106
|
async with self.session.post(url, data=params, headers=headers, ssl=False) as response:
|
103
|
-
response.
|
107
|
+
if response.status != 200:
|
108
|
+
error_text = await response.text()
|
109
|
+
raise Exception(f"HTTP {response.status}: {error_text}")
|
104
110
|
return await response.json()
|
105
111
|
elif method == "DELETE":
|
106
112
|
async with self.session.delete(url, data=params, headers=headers, ssl=False) as response:
|
107
|
-
response.
|
113
|
+
if response.status != 200:
|
114
|
+
error_text = await response.text()
|
115
|
+
raise Exception(f"HTTP {response.status}: {error_text}")
|
108
116
|
return await response.json()
|
109
117
|
else:
|
110
118
|
raise ValueError(f"Unsupported HTTP method: {method}")
|
@@ -244,26 +252,26 @@ class BinanceMCPServer:
|
|
244
252
|
"properties": {
|
245
253
|
"symbol": {"type": "string", "description": "Trading pair symbol"},
|
246
254
|
"side": {"type": "string", "description": "Order side ('BUY' or 'SELL')"},
|
247
|
-
"
|
255
|
+
"type": {"type": "string", "description": "Order type ('MARKET', 'LIMIT', 'STOP', 'STOP_MARKET', 'TRAILING_STOP_MARKET', etc)"},
|
248
256
|
"quantity": {"type": "number", "description": "Order quantity"},
|
249
257
|
"price": {"type": "number", "description": "Order price (for LIMIT orders)"},
|
250
|
-
"
|
251
|
-
"
|
252
|
-
"
|
253
|
-
"
|
254
|
-
"
|
255
|
-
"
|
256
|
-
"
|
257
|
-
"
|
258
|
-
"
|
259
|
-
"
|
260
|
-
"
|
261
|
-
"
|
258
|
+
"stopPrice": {"type": "number", "description": "Stop price (for STOP orders)"},
|
259
|
+
"timeInForce": {"type": "string", "description": "Time in force (GTC, IOC, FOK)"},
|
260
|
+
"positionSide": {"type": "string", "description": "Position side ('BOTH', 'LONG', 'SHORT')"},
|
261
|
+
"reduceOnly": {"type": "string", "description": "Reduce only flag ('true' or 'false')"},
|
262
|
+
"newClientOrderId": {"type": "string", "description": "Custom order ID"},
|
263
|
+
"closePosition": {"type": "string", "description": "Close position flag ('true' or 'false')"},
|
264
|
+
"activationPrice": {"type": "number", "description": "Activation price (for TRAILING_STOP_MARKET)"},
|
265
|
+
"callbackRate": {"type": "number", "description": "Callback rate (for TRAILING_STOP_MARKET)"},
|
266
|
+
"workingType": {"type": "string", "description": "Working type (MARK_PRICE, CONTRACT_PRICE)"},
|
267
|
+
"priceProtect": {"type": "string", "description": "Price protection flag ('TRUE' or 'FALSE')"},
|
268
|
+
"newOrderRespType": {"type": "string", "description": "Response type ('ACK', 'RESULT')"},
|
269
|
+
"recvWindow": {"type": "integer", "description": "Receive window"},
|
262
270
|
"timestamp": {"type": "integer", "description": "Timestamp"},
|
263
271
|
"quantity_precision": {"type": "integer", "description": "Quantity precision for validation"},
|
264
272
|
"price_precision": {"type": "integer", "description": "Price precision for validation"}
|
265
273
|
},
|
266
|
-
"required": ["symbol", "side", "
|
274
|
+
"required": ["symbol", "side", "type"]
|
267
275
|
}
|
268
276
|
),
|
269
277
|
Tool(
|
@@ -386,6 +394,20 @@ class BinanceMCPServer:
|
|
386
394
|
"required": ["symbol", "order_id"]
|
387
395
|
}
|
388
396
|
),
|
397
|
+
Tool(
|
398
|
+
name="close_position",
|
399
|
+
description="Close current position for a symbol (market order to close all or part of position)",
|
400
|
+
inputSchema={
|
401
|
+
"type": "object",
|
402
|
+
"properties": {
|
403
|
+
"symbol": {"type": "string", "description": "Trading pair symbol"},
|
404
|
+
"position_side": {"type": "string", "description": "Position side to close ('BOTH', 'LONG', 'SHORT'). Default 'BOTH' for One-way mode"},
|
405
|
+
"quantity": {"type": "number", "description": "Quantity to close (optional, if not provided will close entire position)"},
|
406
|
+
"close_all": {"type": "boolean", "description": "If true, closes entire position using closePosition=true parameter"}
|
407
|
+
},
|
408
|
+
"required": ["symbol"]
|
409
|
+
}
|
410
|
+
),
|
389
411
|
|
390
412
|
# Trading Configuration Tools
|
391
413
|
Tool(
|
@@ -656,10 +678,31 @@ class BinanceMCPServer:
|
|
656
678
|
|
657
679
|
# Order Management Tools
|
658
680
|
elif name == "place_order":
|
681
|
+
# Filter out precision parameters and pass through all other parameters directly
|
659
682
|
params = {k: v for k, v in arguments.items() if v is not None and k not in ["quantity_precision", "price_precision"]}
|
660
|
-
|
661
|
-
|
662
|
-
|
683
|
+
|
684
|
+
# Validate mandatory parameters based on order type
|
685
|
+
order_type = params.get("type")
|
686
|
+
if order_type == "LIMIT":
|
687
|
+
required_params = ["timeInForce", "quantity", "price"]
|
688
|
+
missing = [p for p in required_params if p not in params]
|
689
|
+
if missing:
|
690
|
+
raise ValueError(f"LIMIT order missing required parameters: {missing}")
|
691
|
+
elif order_type == "MARKET":
|
692
|
+
if "quantity" not in params:
|
693
|
+
raise ValueError("MARKET order missing required parameter: quantity")
|
694
|
+
elif order_type in ["STOP", "TAKE_PROFIT"]:
|
695
|
+
required_params = ["quantity", "price", "stopPrice"]
|
696
|
+
missing = [p for p in required_params if p not in params]
|
697
|
+
if missing:
|
698
|
+
raise ValueError(f"{order_type} order missing required parameters: {missing}")
|
699
|
+
elif order_type in ["STOP_MARKET", "TAKE_PROFIT_MARKET"]:
|
700
|
+
if "stopPrice" not in params:
|
701
|
+
raise ValueError(f"{order_type} order missing required parameter: stopPrice")
|
702
|
+
elif order_type == "TRAILING_STOP_MARKET":
|
703
|
+
if "callbackRate" not in params:
|
704
|
+
raise ValueError("TRAILING_STOP_MARKET order missing required parameter: callbackRate")
|
705
|
+
|
663
706
|
result = await client._make_request("POST", "/fapi/v1/order", params, "TRADE")
|
664
707
|
elif name == "place_multiple_orders":
|
665
708
|
# This requires special handling for batch orders
|
@@ -697,6 +740,63 @@ class BinanceMCPServer:
|
|
697
740
|
elif name == "query_order":
|
698
741
|
params = {"symbol": arguments["symbol"], "orderId": arguments["order_id"]}
|
699
742
|
result = await client._make_request("GET", "/fapi/v1/order", params, "USER_DATA")
|
743
|
+
elif name == "close_position":
|
744
|
+
# Handle position closing
|
745
|
+
symbol = arguments["symbol"]
|
746
|
+
position_side = arguments.get("position_side", "BOTH")
|
747
|
+
quantity = arguments.get("quantity")
|
748
|
+
close_all = arguments.get("close_all", False)
|
749
|
+
|
750
|
+
# First, get current position to determine the side and quantity to close
|
751
|
+
position_params = {"symbol": symbol}
|
752
|
+
positions = await client._make_request("GET", "/fapi/v2/positionRisk", position_params, "USER_DATA")
|
753
|
+
|
754
|
+
# Find the position to close
|
755
|
+
position_to_close = None
|
756
|
+
for pos in positions:
|
757
|
+
if pos["symbol"] == symbol and float(pos["positionAmt"]) != 0:
|
758
|
+
if position_side == "BOTH" or pos["positionSide"] == position_side:
|
759
|
+
position_to_close = pos
|
760
|
+
break
|
761
|
+
|
762
|
+
if not position_to_close:
|
763
|
+
raise ValueError(f"No open position found for {symbol} with position side {position_side}")
|
764
|
+
|
765
|
+
position_amt = float(position_to_close["positionAmt"])
|
766
|
+
current_position_side = position_to_close["positionSide"]
|
767
|
+
|
768
|
+
# Determine order side (opposite of position)
|
769
|
+
if position_amt > 0: # Long position
|
770
|
+
order_side = "SELL"
|
771
|
+
else: # Short position
|
772
|
+
order_side = "BUY"
|
773
|
+
position_amt = abs(position_amt) # Make positive for order quantity
|
774
|
+
|
775
|
+
# Determine quantity to close
|
776
|
+
if close_all:
|
777
|
+
# Use closePosition parameter to close entire position
|
778
|
+
order_params = {
|
779
|
+
"symbol": symbol,
|
780
|
+
"side": order_side,
|
781
|
+
"type": "MARKET",
|
782
|
+
"closePosition": "true"
|
783
|
+
}
|
784
|
+
if current_position_side != "BOTH":
|
785
|
+
order_params["positionSide"] = current_position_side
|
786
|
+
else:
|
787
|
+
# Close specific quantity or entire position
|
788
|
+
close_quantity = quantity if quantity else position_amt
|
789
|
+
order_params = {
|
790
|
+
"symbol": symbol,
|
791
|
+
"side": order_side,
|
792
|
+
"type": "MARKET",
|
793
|
+
"quantity": close_quantity,
|
794
|
+
"reduceOnly": "true"
|
795
|
+
}
|
796
|
+
if current_position_side != "BOTH":
|
797
|
+
order_params["positionSide"] = current_position_side
|
798
|
+
|
799
|
+
result = await client._make_request("POST", "/fapi/v1/order", order_params, "TRADE")
|
700
800
|
|
701
801
|
# Trading Configuration Tools
|
702
802
|
elif name == "change_leverage":
|
@@ -816,7 +916,7 @@ async def main():
|
|
816
916
|
write_stream,
|
817
917
|
InitializationOptions(
|
818
918
|
server_name="binance-futures-mcp-server",
|
819
|
-
server_version="1.0.
|
919
|
+
server_version="1.0.8",
|
820
920
|
capabilities={
|
821
921
|
"tools": {}
|
822
922
|
}
|
File without changes
|
File without changes
|
File without changes
|
{binance-futures-mcp-1.0.6 → binance_futures_mcp-1.0.8}/src/binance_futures_mcp.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|