iflow-mcp_dlwjdtn535-mcp-bybit-server 0.1.4__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.
@@ -0,0 +1,3 @@
1
+ ACCESS_KEY=test_key
2
+ SECRET_KEY=test_secret
3
+ TESTNET=true
@@ -0,0 +1,110 @@
1
+ name: Build and Push Docker Image
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ env:
9
+ IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/mcp-bybit-server
10
+
11
+ jobs:
12
+ build-docker:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ platform:
18
+ - linux/amd64
19
+ - linux/arm64
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Prepare
25
+ run: |
26
+ platform=${{ matrix.platform }}
27
+ echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
28
+
29
+ - name: Docker meta
30
+ id: meta
31
+ uses: docker/metadata-action@v5
32
+ with:
33
+ images: ${{ env.IMAGE_NAME }}
34
+
35
+ - name: Log in to Docker Hub
36
+ uses: docker/login-action@v3
37
+ with:
38
+ username: ${{ secrets.DOCKER_USERNAME }}
39
+ password: ${{ secrets.DOCKER_PASSWORD }}
40
+
41
+ - name: Set up QEMU
42
+ uses: docker/setup-qemu-action@v3
43
+
44
+ - name: Set up Docker Buildx
45
+ uses: docker/setup-buildx-action@v3
46
+
47
+ - name: Build and push by digest
48
+ id: build
49
+ uses: docker/build-push-action@v6
50
+ with:
51
+ context: .
52
+ platforms: ${{ matrix.platform }}
53
+ labels: ${{ steps.meta.outputs.labels }}
54
+ cache-from: type=gha
55
+ cache-to: type=gha,mode=max
56
+ outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
57
+
58
+ - name: Export digest
59
+ run: |
60
+ mkdir -p ${RUNNER_TEMP}/digests
61
+ digest="${{ steps.build.outputs.digest }}"
62
+ touch "${RUNNER_TEMP}/digests/${digest#sha256:}"
63
+
64
+ - name: Upload digest
65
+ uses: actions/upload-artifact@v4
66
+ with:
67
+ name: digests-${{ env.PLATFORM_PAIR }}
68
+ path: "${{ runner.temp }}/digests/*"
69
+ if-no-files-found: error
70
+ retention-days: 1
71
+
72
+ merge:
73
+ runs-on: ubuntu-latest
74
+ needs:
75
+ - build-docker
76
+ steps:
77
+ - name: Download digests
78
+ uses: actions/download-artifact@v4
79
+ with:
80
+ path: "${{ runner.temp }}/digests"
81
+ pattern: digests-*
82
+ merge-multiple: true
83
+
84
+ - name: Log in to Docker Hub
85
+ uses: docker/login-action@v3
86
+ with:
87
+ username: ${{ secrets.DOCKER_USERNAME }}
88
+ password: ${{ secrets.DOCKER_PASSWORD }}
89
+
90
+ - name: Set up Docker Buildx
91
+ uses: docker/setup-buildx-action@v3
92
+
93
+ - name: Docker meta
94
+ id: meta
95
+ uses: docker/metadata-action@v5
96
+ with:
97
+ images: ${{ env.IMAGE_NAME }}
98
+ tags: |
99
+ type=raw,value=latest,enable={{is_default_branch}}
100
+ type=sha
101
+
102
+ - name: Create manifest list and push
103
+ working-directory: "${{ runner.temp }}/digests"
104
+ run: |
105
+ docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
106
+ $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *)
107
+
108
+ - name: Inspect image
109
+ run: |
110
+ docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
@@ -0,0 +1,10 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
@@ -0,0 +1,4 @@
1
+ [2026-02-06 14:55:26] [✅] 步骤1: 获取项目 - Fork和克隆 GitHub 仓库
2
+ [2026-02-06 14:55:45] [✅] 步骤2: 阅读代码 - Python项目,使用FastMCP框架,支持stdio协议
3
+ [2026-02-06 15:01:54] [✅] 步骤3: 本地测试 - 测试通过,发现15个工具,环境变量: ACCESS_KEY=test_key SECRET_KEY=test_secret TESTNET=true
4
+ [2026-02-06 15:02:18] [✅] 步骤4: 创建并推送分支 - 成功推送到iflow分支
@@ -0,0 +1,42 @@
1
+ # Use a Python image with uv pre-installed
2
+ FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS uv
3
+
4
+ # Install the project into `/app`
5
+ WORKDIR /app
6
+
7
+ # Enable bytecode compilation
8
+ ENV UV_COMPILE_BYTECODE=1
9
+
10
+ # Copy from the cache instead of linking since it's a mounted volume
11
+ ENV UV_LINK_MODE=copy
12
+
13
+ # Create necessary directories
14
+ RUN mkdir -p /root/.local
15
+
16
+ # Install the project's dependencies using the lockfile and settings
17
+ RUN --mount=type=cache,target=/root/.cache/uv \
18
+ --mount=type=bind,source=uv.lock,target=uv.lock \
19
+ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
20
+ uv sync --frozen --no-install-project --no-dev --no-editable
21
+
22
+ # Then, add the rest of the project source code and install it
23
+ # Installing separately from its dependencies allows optimal layer caching
24
+ ADD . /app
25
+ RUN --mount=type=cache,target=/root/.cache/uv \
26
+ uv sync --frozen --no-dev --no-editable
27
+
28
+ FROM python:3.12-slim-bookworm
29
+
30
+ WORKDIR /app
31
+
32
+ # Create necessary directories in the second stage
33
+ RUN mkdir -p /root/.local
34
+
35
+ COPY --from=uv /root/.local /root/.local
36
+ COPY --from=uv --chown=app:app /app/.venv /app/.venv
37
+
38
+ # Place executables in the environment at the front of the path
39
+ ENV PATH="/app/.venv/bin:$PATH"
40
+
41
+ # when running the container, add --db-path and a bind mount to the host's db file
42
+ ENTRYPOINT ["mcp-bybit-server"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Dana K. Williams
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,246 @@
1
+ Metadata-Version: 2.4
2
+ Name: iflow-mcp_dlwjdtn535-mcp-bybit-server
3
+ Version: 0.1.4
4
+ Summary: Bybit server for mcp
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.11
7
+ Requires-Dist: mcp[cli]>=1.6.0
8
+ Requires-Dist: pybit>=2.4.0
9
+ Requires-Dist: python-dotenv>=0.19.0
10
+ Description-Content-Type: text/markdown
11
+
12
+ # MCP Bybit API Interface
13
+ [![smithery badge](https://smithery.ai/badge/@dlwjdtn535/mcp-bybit-server)](https://smithery.ai/server/@dlwjdtn535/mcp-bybit-server)
14
+ [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-support-yellow.svg)](https://buymeacoffee.com/dlwjdtn535)
15
+
16
+ Bybit MCP (Model Context Protocol) Server. Provides a convenient interface to interact with the Bybit API using MCP tools. Allows fetching market data, managing account information, and placing/canceling orders via API calls wrapped as tools.
17
+
18
+ <a href="https://glama.ai/mcp/servers/@dlwjdtn535/mcp-bybit-server">
19
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/@dlwjdtn535/mcp-bybit-server/badge" alt="Bybit Server MCP server" />
20
+ </a>
21
+
22
+ ## Usage
23
+
24
+ ### Installing via Smithery
25
+
26
+ To install this Bybit API Interface server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@dlwjdtn535/mcp-bybit-server):
27
+
28
+ ```bash
29
+ npx -y @smithery/cli install @dlwjdtn535/mcp-bybit-server --client claude
30
+ ```
31
+
32
+ ### Using with Claude, Roo Code, Cline, etc.
33
+
34
+ Add the following configuration to your MCP settings file (e.g., `mcp_settings.json`):
35
+ **Using uv With Windows:**
36
+
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "mcp-server-demo": {
41
+ "command": "uv",
42
+ "args": [
43
+ "run",
44
+ "--directory",
45
+ "C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Programs\\mcp-server-demo\\src",
46
+ "server.py"
47
+ ],
48
+ "env": {
49
+ "ACCESS_KEY": "{ACCESS_KEY}",
50
+ "SECRET_KEY": "{ACCESS_KEY}"
51
+ }
52
+ }
53
+ // ... other servers might be here ...
54
+ }
55
+ }
56
+ ```
57
+
58
+ (Remember to replace YOUR_USERNAME and use double backslashes \\)
59
+
60
+ **Using uv With macOS:**
61
+
62
+ ```json
63
+ {
64
+ "mcpServers": {
65
+ "mcp-server-demo": {
66
+ "command": "uv",
67
+ "args": [
68
+ "run",
69
+ "--directory",
70
+ "/usr/local/bin/mcp-server-demo/src",
71
+ "server.py"
72
+ ],
73
+ "env": {
74
+ "ACCESS_KEY": "{ACCESS_KEY}",
75
+ "SECRET_KEY": "{ACCESS_KEY}"
76
+ }
77
+ }
78
+ // ... other servers might be here ...
79
+ }
80
+ }
81
+ ```
82
+ (Replace YOUR_USERNAME if using ~/bin)
83
+
84
+ **Using uv With Linux:**
85
+
86
+ ```json
87
+ {
88
+ "mcpServers": {
89
+ "mcp-server-demo": {
90
+ "command": "uv",
91
+ "args": [
92
+ "run",
93
+ "--directory",
94
+ "/home/YOUR_USERNAME/bin/mcp-server-demo/src",
95
+ "server.py"
96
+ ],
97
+ "env": {
98
+ "ACCESS_KEY": "{ACCESS_KEY}",
99
+ "SECRET_KEY": "{ACCESS_KEY}"
100
+ }
101
+ }
102
+ // ... other servers might be here ...
103
+ }
104
+ }
105
+ ```
106
+
107
+
108
+ **Using Docker (Requires Docker)**
109
+
110
+ Make sure you have pulled the image first: `docker pull dlwjdtn535/mcp-bybit-server:latest`
111
+
112
+ ```json
113
+ {
114
+ "mcpServers": {
115
+ "bybit-server-docker": {
116
+ "command": "docker",
117
+ "args": [
118
+ "run",
119
+ "-i",
120
+ "--rm",
121
+ "--init",
122
+ "-e", "ACCESS_KEY={ACCESS_KEY}",
123
+ "-e", "SECRET_KEY={SECRET_KEY}",
124
+ "dlwjdtn535/mcp-bybit-server:latest"
125
+ ]
126
+ }
127
+ }
128
+ }
129
+ ```
130
+
131
+ **Using Docker with .env (Requires Docker)**
132
+
133
+ Make sure you have pulled the image first: `docker pull dlwjdtn535/mcp-bybit-server:latest`
134
+
135
+ ```json
136
+ {
137
+ "mcpServers": {
138
+ "bybit-server-docker": {
139
+ "command": "/bin/sh",
140
+ "args": [
141
+ "-c",
142
+ "source .env && docker run -i --rm --init -e ACCESS_KEY=$BYBIT_API_KEY -e SECRET_KEY=$BYBIT_API_SECRET -e TESTNET=true dlwjdtn535/mcp-bybit-server:latest"
143
+ ]
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ > **Note**: Always use `@latest` or a specific version tag for both NPX and Docker to ensure you are using the intended version.
150
+
151
+ ## Tools 🛠️
152
+
153
+ This MCP server provides the following tools for interacting with the Bybit API:
154
+
155
+ 1. **`get_orderbook`**: Fetches order book information.
156
+ * Inputs: `category`, `symbol`, `limit` (optional)
157
+ * Returns: Order book details.
158
+ 2. **`get_kline`**: Fetches K-line (candlestick) data.
159
+ * Inputs: `category`, `symbol`, `interval`, `start` (optional), `end` (optional), `limit` (optional)
160
+ * Returns: Candlestick data.
161
+ 3. **`get_tickers`**: Fetches cryptocurrency ticker information.
162
+ * Inputs: `category`, `symbol`
163
+ * Returns: Ticker information.
164
+ 4. **`get_wallet_balance`**: Fetches account balance.
165
+ * Inputs: `accountType`, `coin` (optional)
166
+ * Returns: Balance information.
167
+ 5. **`get_positions`**: Fetches position information.
168
+ * Inputs: `category`, `symbol` (optional)
169
+ * Returns: Position information.
170
+ 6. **`place_order`**: Places a limit or market order.
171
+ * Inputs: `category`, `symbol`, `side`, `orderType`, `qty`, `price` (optional for limit), `positionIdx` (optional for futures), and other optional parameters (e.g., `timeInForce`, `takeProfit`, `stopLoss`).
172
+ * Returns: Order placement confirmation.
173
+ 7. **`cancel_order`**: Cancels an existing order.
174
+ * Inputs: `category`, `symbol`, `orderId` (optional), `orderLinkId` (optional)
175
+ * Returns: Cancellation confirmation.
176
+ 8. **`get_order_history`**: Fetches historical order details.
177
+ * Inputs: `category`, `symbol` (optional), `orderId` (optional), `limit` (optional), etc.
178
+ * Returns: Order history.
179
+ 9. **`get_open_orders`**: Fetches current open orders.
180
+ * Inputs: `category`, `symbol` (optional), `limit` (optional), etc.
181
+ * Returns: Open order details.
182
+ 10. **`set_trading_stop`**: Sets take profit, stop loss, or trailing stop for a position.
183
+ * Inputs: `category`, `symbol`, `takeProfit` (optional), `stopLoss` (optional), `trailingStop` (optional), `positionIdx` (optional)
184
+ * Returns: Setting confirmation.
185
+ 11. **`set_margin_mode`**: Sets the margin mode (isolated or cross).
186
+ * Inputs: `category`, `symbol`, `tradeMode`, `buyLeverage`, `sellLeverage`
187
+ * Returns: Setting confirmation.
188
+ 12. **`get_api_key_information`**: Fetches information about the current API key.
189
+ * Inputs: None
190
+ * Returns: API key details.
191
+ 13. **`get_instruments_info`**: Fetches details about trading instruments (symbols).
192
+ * Inputs: `category`, `symbol`, `status` (optional), `baseCoin` (optional)
193
+ * Returns: Instrument details.
194
+
195
+ _(Refer to the function docstrings in the code for detailed parameter descriptions and examples.)_
196
+
197
+ ## Environment Variables
198
+
199
+ Before running the server, you **must** set the following environment variables:
200
+
201
+ ```bash
202
+ ACCESS_KEY=YOUR_BYBIT_API_KEY
203
+ SECRET_KEY=YOUR_BYBIT_SECRET_KEY
204
+ TESTNET=false # Optional: set to true for testnet
205
+ ```
206
+
207
+ ## API Key Setup
208
+
209
+ To use this Bybit API interface, you need to create an API key from Bybit. Follow these important steps:
210
+
211
+ 1. Go to Bybit and log into your account.
212
+ 2. Navigate to API Management.
213
+ 3. Create a new API key.
214
+ 4. **Important Security Settings:**
215
+ * Enable IP restriction if possible.
216
+ * Add ONLY the IP address(es) from which the server will run (your local PC IP, server IP, or Docker container's external IP).
217
+ * Never share your API keys or expose them in public repositories.
218
+ * Recommended permissions:
219
+ * Read (Required)
220
+ * Trade (Required for order execution)
221
+ * Wallet (Required for balance checking)
222
+
223
+ ## Sponsorship & Donations
224
+
225
+ If you find this project helpful and would like to support its development, you can contribute in the following ways:
226
+
227
+ ### Buy Me a Coffee
228
+ [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/dlwjdtn535)
229
+
230
+ ### Referral Program
231
+ You can also support this project by signing up for Bybit using our referral link:
232
+ - [My Bybit Referral Link](https://www.bybit.com/invite?ref=J1O4JK)
233
+ - Referral Code: J1O4JK
234
+
235
+ Your support helps maintain and improve this project. Thank you! 🙏
236
+
237
+ ## Contact & Support
238
+
239
+ For additional inquiries or support, please contact:
240
+ - Email: dlwjdtn5624@naver.com
241
+
242
+ We welcome your questions and feedback!
243
+
244
+ ## License
245
+
246
+ MIT License
@@ -0,0 +1,235 @@
1
+ # MCP Bybit API Interface
2
+ [![smithery badge](https://smithery.ai/badge/@dlwjdtn535/mcp-bybit-server)](https://smithery.ai/server/@dlwjdtn535/mcp-bybit-server)
3
+ [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-support-yellow.svg)](https://buymeacoffee.com/dlwjdtn535)
4
+
5
+ Bybit MCP (Model Context Protocol) Server. Provides a convenient interface to interact with the Bybit API using MCP tools. Allows fetching market data, managing account information, and placing/canceling orders via API calls wrapped as tools.
6
+
7
+ <a href="https://glama.ai/mcp/servers/@dlwjdtn535/mcp-bybit-server">
8
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/@dlwjdtn535/mcp-bybit-server/badge" alt="Bybit Server MCP server" />
9
+ </a>
10
+
11
+ ## Usage
12
+
13
+ ### Installing via Smithery
14
+
15
+ To install this Bybit API Interface server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@dlwjdtn535/mcp-bybit-server):
16
+
17
+ ```bash
18
+ npx -y @smithery/cli install @dlwjdtn535/mcp-bybit-server --client claude
19
+ ```
20
+
21
+ ### Using with Claude, Roo Code, Cline, etc.
22
+
23
+ Add the following configuration to your MCP settings file (e.g., `mcp_settings.json`):
24
+ **Using uv With Windows:**
25
+
26
+ ```json
27
+ {
28
+ "mcpServers": {
29
+ "mcp-server-demo": {
30
+ "command": "uv",
31
+ "args": [
32
+ "run",
33
+ "--directory",
34
+ "C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Programs\\mcp-server-demo\\src",
35
+ "server.py"
36
+ ],
37
+ "env": {
38
+ "ACCESS_KEY": "{ACCESS_KEY}",
39
+ "SECRET_KEY": "{ACCESS_KEY}"
40
+ }
41
+ }
42
+ // ... other servers might be here ...
43
+ }
44
+ }
45
+ ```
46
+
47
+ (Remember to replace YOUR_USERNAME and use double backslashes \\)
48
+
49
+ **Using uv With macOS:**
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "mcp-server-demo": {
55
+ "command": "uv",
56
+ "args": [
57
+ "run",
58
+ "--directory",
59
+ "/usr/local/bin/mcp-server-demo/src",
60
+ "server.py"
61
+ ],
62
+ "env": {
63
+ "ACCESS_KEY": "{ACCESS_KEY}",
64
+ "SECRET_KEY": "{ACCESS_KEY}"
65
+ }
66
+ }
67
+ // ... other servers might be here ...
68
+ }
69
+ }
70
+ ```
71
+ (Replace YOUR_USERNAME if using ~/bin)
72
+
73
+ **Using uv With Linux:**
74
+
75
+ ```json
76
+ {
77
+ "mcpServers": {
78
+ "mcp-server-demo": {
79
+ "command": "uv",
80
+ "args": [
81
+ "run",
82
+ "--directory",
83
+ "/home/YOUR_USERNAME/bin/mcp-server-demo/src",
84
+ "server.py"
85
+ ],
86
+ "env": {
87
+ "ACCESS_KEY": "{ACCESS_KEY}",
88
+ "SECRET_KEY": "{ACCESS_KEY}"
89
+ }
90
+ }
91
+ // ... other servers might be here ...
92
+ }
93
+ }
94
+ ```
95
+
96
+
97
+ **Using Docker (Requires Docker)**
98
+
99
+ Make sure you have pulled the image first: `docker pull dlwjdtn535/mcp-bybit-server:latest`
100
+
101
+ ```json
102
+ {
103
+ "mcpServers": {
104
+ "bybit-server-docker": {
105
+ "command": "docker",
106
+ "args": [
107
+ "run",
108
+ "-i",
109
+ "--rm",
110
+ "--init",
111
+ "-e", "ACCESS_KEY={ACCESS_KEY}",
112
+ "-e", "SECRET_KEY={SECRET_KEY}",
113
+ "dlwjdtn535/mcp-bybit-server:latest"
114
+ ]
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ **Using Docker with .env (Requires Docker)**
121
+
122
+ Make sure you have pulled the image first: `docker pull dlwjdtn535/mcp-bybit-server:latest`
123
+
124
+ ```json
125
+ {
126
+ "mcpServers": {
127
+ "bybit-server-docker": {
128
+ "command": "/bin/sh",
129
+ "args": [
130
+ "-c",
131
+ "source .env && docker run -i --rm --init -e ACCESS_KEY=$BYBIT_API_KEY -e SECRET_KEY=$BYBIT_API_SECRET -e TESTNET=true dlwjdtn535/mcp-bybit-server:latest"
132
+ ]
133
+ }
134
+ }
135
+ }
136
+ ```
137
+
138
+ > **Note**: Always use `@latest` or a specific version tag for both NPX and Docker to ensure you are using the intended version.
139
+
140
+ ## Tools 🛠️
141
+
142
+ This MCP server provides the following tools for interacting with the Bybit API:
143
+
144
+ 1. **`get_orderbook`**: Fetches order book information.
145
+ * Inputs: `category`, `symbol`, `limit` (optional)
146
+ * Returns: Order book details.
147
+ 2. **`get_kline`**: Fetches K-line (candlestick) data.
148
+ * Inputs: `category`, `symbol`, `interval`, `start` (optional), `end` (optional), `limit` (optional)
149
+ * Returns: Candlestick data.
150
+ 3. **`get_tickers`**: Fetches cryptocurrency ticker information.
151
+ * Inputs: `category`, `symbol`
152
+ * Returns: Ticker information.
153
+ 4. **`get_wallet_balance`**: Fetches account balance.
154
+ * Inputs: `accountType`, `coin` (optional)
155
+ * Returns: Balance information.
156
+ 5. **`get_positions`**: Fetches position information.
157
+ * Inputs: `category`, `symbol` (optional)
158
+ * Returns: Position information.
159
+ 6. **`place_order`**: Places a limit or market order.
160
+ * Inputs: `category`, `symbol`, `side`, `orderType`, `qty`, `price` (optional for limit), `positionIdx` (optional for futures), and other optional parameters (e.g., `timeInForce`, `takeProfit`, `stopLoss`).
161
+ * Returns: Order placement confirmation.
162
+ 7. **`cancel_order`**: Cancels an existing order.
163
+ * Inputs: `category`, `symbol`, `orderId` (optional), `orderLinkId` (optional)
164
+ * Returns: Cancellation confirmation.
165
+ 8. **`get_order_history`**: Fetches historical order details.
166
+ * Inputs: `category`, `symbol` (optional), `orderId` (optional), `limit` (optional), etc.
167
+ * Returns: Order history.
168
+ 9. **`get_open_orders`**: Fetches current open orders.
169
+ * Inputs: `category`, `symbol` (optional), `limit` (optional), etc.
170
+ * Returns: Open order details.
171
+ 10. **`set_trading_stop`**: Sets take profit, stop loss, or trailing stop for a position.
172
+ * Inputs: `category`, `symbol`, `takeProfit` (optional), `stopLoss` (optional), `trailingStop` (optional), `positionIdx` (optional)
173
+ * Returns: Setting confirmation.
174
+ 11. **`set_margin_mode`**: Sets the margin mode (isolated or cross).
175
+ * Inputs: `category`, `symbol`, `tradeMode`, `buyLeverage`, `sellLeverage`
176
+ * Returns: Setting confirmation.
177
+ 12. **`get_api_key_information`**: Fetches information about the current API key.
178
+ * Inputs: None
179
+ * Returns: API key details.
180
+ 13. **`get_instruments_info`**: Fetches details about trading instruments (symbols).
181
+ * Inputs: `category`, `symbol`, `status` (optional), `baseCoin` (optional)
182
+ * Returns: Instrument details.
183
+
184
+ _(Refer to the function docstrings in the code for detailed parameter descriptions and examples.)_
185
+
186
+ ## Environment Variables
187
+
188
+ Before running the server, you **must** set the following environment variables:
189
+
190
+ ```bash
191
+ ACCESS_KEY=YOUR_BYBIT_API_KEY
192
+ SECRET_KEY=YOUR_BYBIT_SECRET_KEY
193
+ TESTNET=false # Optional: set to true for testnet
194
+ ```
195
+
196
+ ## API Key Setup
197
+
198
+ To use this Bybit API interface, you need to create an API key from Bybit. Follow these important steps:
199
+
200
+ 1. Go to Bybit and log into your account.
201
+ 2. Navigate to API Management.
202
+ 3. Create a new API key.
203
+ 4. **Important Security Settings:**
204
+ * Enable IP restriction if possible.
205
+ * Add ONLY the IP address(es) from which the server will run (your local PC IP, server IP, or Docker container's external IP).
206
+ * Never share your API keys or expose them in public repositories.
207
+ * Recommended permissions:
208
+ * Read (Required)
209
+ * Trade (Required for order execution)
210
+ * Wallet (Required for balance checking)
211
+
212
+ ## Sponsorship & Donations
213
+
214
+ If you find this project helpful and would like to support its development, you can contribute in the following ways:
215
+
216
+ ### Buy Me a Coffee
217
+ [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/dlwjdtn535)
218
+
219
+ ### Referral Program
220
+ You can also support this project by signing up for Bybit using our referral link:
221
+ - [My Bybit Referral Link](https://www.bybit.com/invite?ref=J1O4JK)
222
+ - Referral Code: J1O4JK
223
+
224
+ Your support helps maintain and improve this project. Thank you! 🙏
225
+
226
+ ## Contact & Support
227
+
228
+ For additional inquiries or support, please contact:
229
+ - Email: dlwjdtn5624@naver.com
230
+
231
+ We welcome your questions and feedback!
232
+
233
+ ## License
234
+
235
+ MIT License