MCP Bybit API接口 logo

MCP Bybit API接口

Community
dlwjdtn535

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…

Publisherdlwjdtn535
Repositorymcp-bybit-server
LanguagePython
Forks
11
Stars
9
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCP Bybit API接口 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    9 stars and 11 forks from the linked repository.

MCP Bybit API Interface

smithery badge Buy Me A Coffee

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.

bash
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:

bash
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):

json
{
  "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"
      }
    }
  }
}

On Windows, use an absolute path with double backslashes (e.g. C:\\Users\\YOUR_USERNAME\\mcp-bybit-server).

Using Docker:

First pull the image: docker pull dlwjdtn535/mcp-bybit-server:latest

json
{
  "mcpServers": {
    "bybit-server-docker": {
      "command": "docker",
      "args": [
        "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"
      ]
    }
  }
}

Note: Always use @latest or a specific version tag for both NPX and Docker to ensure you are using the intended version.

Environment Variables

VariableRequiredDefaultDescription
ACCESS_KEYYes–Bybit API key.
SECRET_KEYYes–Bybit API secret.
MEMBER_IDNo–Bybit member ID (optional).
TESTNETNofalseUse the Bybit testnet when true.
TRADING_ENABLEDNofalseMust be true to allow any mutating/trading tool.
READONLY_MODENofalseWhen true, blocks every mutating tool (takes precedence over TRADING_ENABLED).
MAX_ORDER_SIZE_USDTNo100Caps the estimated notional value (USDT) of a single order.
RESPONSE_VERBOSITYNonormalminimal trims get_tickers/get_positions responses to core fields to save tokens; normal/full return the full payload.

Tools 🛠️

Market data

  • get_orderbook — order book (category, symbol, limit?).
  • get_kline — candlesticks (category, symbol, interval, start?, end?, limit?).
  • get_tickers — ticker info (category, symbol).
  • get_public_trade_history — recent public trades (category, symbol, limit?).
  • get_instruments_info — instrument metadata / limits (category, symbol, status?, baseCoin?).
  • get_funding_rate_history — funding rate history for perps (category, symbol, startTime?, endTime?, limit?).
  • get_open_interest — open interest over time (category, symbol, intervalTime?, ...).
  • get_fee_rate — maker/taker fee rates (category, symbol?, baseCoin?).
  • get_server_time — Bybit server time.
  • market_snapshot — composite market view (orderbook + ticker + kline + instrument + recent trades, plus funding rate & open interest for futures) in a single call.

Account

  • get_wallet_balance — balances (accountType, coin?).
  • get_positions — open positions (category, symbol?).
  • get_order_history — historical orders.
  • get_open_orders — current open orders.
  • get_api_key_information — API key details.

Trading (mutating — requires TRADING_ENABLED=true)

  • validate_order — pre-flight validation; never places an order. Not blocked by trading flags.
  • place_order — place an order; supports dry_run=true to validate without placing.
  • amend_order — modify an existing order in place.
  • cancel_order — cancel a single order.
  • cancel_all_orders — cancel all open orders (optionally scoped).
  • set_trading_stop — set take profit / stop loss / trailing stop.
  • set_margin_mode — set isolated/cross margin.
  • set_leverage — set leverage for a futures symbol.

(Refer to the function docstrings in the code for detailed parameter descriptions and examples.)

API Key Setup

To use this Bybit API interface, create an API key from Bybit:

  1. Log into your Bybit account.
  2. Navigate to API Management.
  3. Create a new API key.
  4. Important security settings:
    • Enable IP restriction if possible, and add ONLY the IP address(es) the server runs from.
    • Never share your API keys or expose them in public repositories.
    • Recommended permissions:
      • Read (required)
      • Trade (required only if you enable order execution)
      • Wallet (required for balance checking)

Development

bash
uv sync --group dev   # install dev dependencies (pytest, ruff)
uv run ruff check .   # lint
uv run pytest -q      # run the unit test suite (no live API calls)

CI (GitHub Actions) runs lint + tests on every push/PR; Docker images are built and published automatically on pushes to main.

Sponsorship & Donations

If you find this project helpful and would like to support its development:

Buy Me a Coffee

"Buy Me A Coffee"

Referral Program

You can also support this project by signing up for Bybit using our referral link:

Your support helps maintain and improve this project. Thank you! 🙏

Contact & Support

For additional inquiries or support, please contact:

We welcome your questions and feedback!

License

MIT License

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "dlwjdtn535-mcp-bybit-server": {
      "command": "",
      "args": []
    }
  }
}

Use MCP Bybit API接口 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP Bybit API接口 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCP Bybit API接口 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCP Bybit API接口 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "dlwjdtn535-mcp-bybit-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-bybit-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP Bybit API接口 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCP Bybit API接口 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP Bybit API接口 to help me with this task?
MCP Bybit API接口
Sure. I read it.
Here is what I found using MCP Bybit API接口.

Frequently asked questions

What is the MCP Bybit API接口 MCP server used for?

MCP Bybit API接口 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP Bybit API接口 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP Bybit API接口 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP Bybit API接口 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP Bybit API接口 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP Bybit API接口 MCP to TypingMind?

MCP Bybit API接口 runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCP Bybit API接口 MCP provide in TypingMind?

MCP Bybit API接口 exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP Bybit API接口 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP Bybit API接口 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇