DM

dlwjdtn535/mcp-bybit-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

9 stars 11 forks 质量 79 趋势 11MIT

Bybit MCP(模式上下文协议)服务器. 为使用MCP工具与Bybit V5 API交互提供方便的界面.

概览

Bybit MCP(模式上下文协议)服务器. 为使用MCP工具与Bybit V5 API交互提供方便的界面. 允许获取市场数据,管理账户信息,通过API调用将订单放出/取消作为工具包裹. 此服务器可以放置 。 在配置前读取 : - 变换工具(位置 命令、取消 命令、修正 命令、取消 所有 命令、设置 交易 停止、设置 边距 模式、设置 杠杆)返回出错,除非你明确设置TRADING ENABLED=real。 - 在实验时设定 TESTNET=正确 组合到 TRADING ENABLED=false 一个完全只读的设置,或者设置 READONLY MODE= true 到硬块 每个变异工具,不管其他设置如何. {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}大号 {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080} (违约100)限制防止意外大宗交易的命令的估计名义价值。 - 没有工具返回您的密钥;仅记录是否存在密钥。 - 仅通过环境变量提供。 需要 Python 3.12+. (中文(简体) ). 这个项目使用uv.

概述(AI 翻译)

Bybit MCP(模式上下文协议)服务器. 为使用MCP工具与Bybit V5 API交互提供方便的界面. 允许获取市场数据,管理账户信息,通过API调用将订单放出/取消作为工具包裹.

安全保卫

这个服务器可以用真钱进行真交易. 在配置前读取 :

-** 电路默认已禁用。** 变换工具([[[T0]、[[T1]、[T2]、[[T3]、[T4]、[[T5]、[[T6])返回出错,除非你明确设置TRADING_ENABLED=true。 -**先用测试网。**在试验时设定[(T8)]。 与 TRADING_ENABLED=false 组合,用于一个完全只读的设置,或设置 READONLY_MODE=true,以硬封住每个变异工具,而不论其他设置如何.

  • ** 命令大小为上限。 ** MAX_ORDER_SIZE_USDT(默认[T12])限制命令的估计名义价值,以防意外的大型贸易。
  • ** API 密钥从未被登录或曝光。 ** 没有工具返回您的密钥; 日志只报告是否存在密钥 。
  • ** 永远不要输入您的 API 密钥。 ** 仅通过环境变量提供.

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Bybit API Interface

Bybit MCP (Model Context Protocol) Server. Provides a convenient interface to interact with the Bybit V5 API using MCP tools. Allows fetching market data, managing account information, and placing/canceling orders via API calls wrapped as tools.

⚠️ Security & Safety

This server can place real trades with real money. Read this before configuring it:

  • Trading is disabled by default. Mutating tools (place_order, cancel_order, amend_order, cancel_all_orders, set_trading_stop, set_margin_mode, set_leverage) return an error unless you explicitly set TRADING_ENABLED=true.
  • Use the testnet first. Set TESTNET=true while you experiment. Combine with TRADING_ENABLED=false for a fully read-only setup, or set READONLY_MODE=true to hard-block every mutating tool regardless of other settings.
  • Order size is capped. MAX_ORDER_SIZE_USDT (default 100) limits the estimated notional value of an order to guard against accidental large trades.
  • API keys are never logged or exposed. No tool returns your keys; logs only report whether a key is present.
  • Never commit your API keys. Provide them through environment variables only.

Installation

Requires Python 3.12+. This project uses uv.

git clone https://github.com/dlwjdtn535/mcp-bybit-server.git
cd mcp-bybit-server
uv sync
uv run mcp-bybit-server   # runs the MCP server over stdio

After install, the mcp-bybit-server command is the entry point used by the MCP client configs below.

Installing via Smithery

To install this Bybit API Interface server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @dlwjdtn535/mcp-bybit-server --client claude

Configuration (Claude Desktop, Cline, Roo Code, etc.)

Add one of the following to your MCP settings file (e.g. claude_desktop_config.json / mcp_settings.json).

Using uv (run from a cloned repo):

{
  "mcpServers": {
    "bybit": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/absolute/path/to/mcp-bybit-server",
        "mcp-bybit-server"
      ],
      "env": {
        "ACCESS_KEY": "YOUR_BYBIT_API_KEY",
        "SECRET_KEY": "YOUR_BYBIT_SECRET_KEY",
        "TESTNET": "true",
        "TRADING_ENABLED": "false"
      }
    }
  }
}
在 GitHub 查看完整 README

安装

docker run -i --rm --init -e ACCESS_KEY=YOUR_BYBIT_API_KEY -e SECRET_KEY=YOUR_BYBIT_SECRET_KEY -e TESTNET=true -e TRADING_ENABLED=false -e MAX_ORDER_SIZE_USDT=100 dlwjdtn535/mcp-bybit-server:latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "bybit": { "command": "uv", "args": [ "run", "--directory", "/absolute/path/to/mcp-bybit-server", "mcp-bybit-server" ], "env": { "ACCESS_KEY": "YOUR_BYBIT_API_KEY", "SECRET_KEY": "YOUR_BYBIT_SECRET_KEY", "TESTNET": "true", "TRADING_ENABLED": "false" } } } }