Skip to main content
Glama
bybit-mcp-server

bybit-mcp-server

by workspace

bybit-mcp-server

A Model Context Protocol server for the Bybit V5 API.

Connect AI assistants (Claude, Cursor, etc.) to Bybit for market data, trading, and account management — locally via stdio or remotely via HTTP with OAuth authentication.

Quick Start

Local (stdio)

uvx bybit-mcp-server

Remote (Docker)

docker pull ghcr.io/workspace/bybit-mcp-server:latest
docker run -p 8000:8000 \
  -e BYBIT_MCP_ADMIN_PASSWORD=your-password \
  -e BYBIT_MCP_SECRET_KEY=$(python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())") \
  -e BYBIT_MCP_ISSUER_URL=https://your-server.example.com \
  -v bybit-data:/app/data \
  ghcr.io/workspace/bybit-mcp-server:latest

Related MCP server: MCP Bitget Trading Server

Transport Modes

Mode

Transport

Auth

Credentials

Use Case

Local

stdio

None

Env vars

Claude Desktop, Cursor

Remote

streamable-http

OAuth 2.0

Web settings page

Claude Custom Connectors, shared servers

MCP Client Configuration

Claude Desktop (Local)

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "bybit": {
      "command": "uvx",
      "args": ["bybit-mcp-server"],
      "env": {
        "BYBIT_API_KEY": "your-api-key",
        "BYBIT_API_SECRET": "your-api-secret",
        "BYBIT_TESTNET": "true"
      }
    }
  }
}

Claude Custom Connectors (Remote)

  1. Deploy the server with Docker (see Deployment)

  2. In Claude settings, add a Custom Connector:

    • URL: https://your-server.example.com

  3. Claude handles OAuth automatically — you'll be prompted to log in with admin credentials

  4. After connecting, visit https://your-server.example.com/settings to enter your Bybit API keys

Cursor (Local)

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "bybit": {
      "command": "uvx",
      "args": ["bybit-mcp-server"],
      "env": {
        "BYBIT_API_KEY": "your-api-key",
        "BYBIT_API_SECRET": "your-api-secret",
        "BYBIT_TESTNET": "true"
      }
    }
  }
}

Available Tools (27)

Category

Tools

Permission

Market

get_tickers, get_kline, get_orderbook, get_instruments_info, get_server_time, get_funding_rate_history, get_public_trades, get_open_interest

read

Account

get_wallet_balance, get_fee_rate, get_account_info

read

Trade

place_order, amend_order, cancel_order, cancel_all_orders, get_open_orders, get_order_history, get_trade_history

trade

Position

get_positions, set_leverage, set_trading_stop, set_auto_add_margin, get_closed_pnl

read / trade

Asset

get_coin_balance, get_coin_info, get_transfer_history, internal_transfer

read / full

Deployment

Docker Compose

services:
  bybit-mcp:
    image: ghcr.io/workspace/bybit-mcp-server:latest
    ports:
      - "8000:8000"
    environment:
      - BYBIT_MCP_ADMIN_PASSWORD=your-secure-password
      - BYBIT_MCP_SECRET_KEY=your-fernet-key
      - BYBIT_MCP_ISSUER_URL=https://your-server.example.com
    volumes:
      - bybit-data:/app/data
    restart: unless-stopped

volumes:
  bybit-data:

Generate a Fernet key:

python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"

Environment Variables

Local Mode (stdio)

Variable

Default

Description

BYBIT_API_KEY

—

API key from Bybit

BYBIT_API_SECRET

—

API secret from Bybit

BYBIT_TESTNET

true

Use testnet (true) or mainnet (false)

BYBIT_MODE

read

Permission mode: read, trade, or full

BYBIT_RECV_WINDOW

—

Request receive window in ms

Remote Mode (streamable-http)

Variable

Default

Description

BYBIT_MCP_TRANSPORT

stdio

Set to streamable-http for remote mode

BYBIT_MCP_HOST

0.0.0.0

HTTP bind address

BYBIT_MCP_PORT

8000

HTTP port

BYBIT_MCP_ADMIN_USERNAME

admin

Admin login username

BYBIT_MCP_ADMIN_PASSWORD

—

Admin login password (required)

BYBIT_MCP_SECRET_KEY

—

Fernet key for encrypting API keys at rest (required)

BYBIT_MCP_ISSUER_URL

—

Public URL with scheme, e.g. https://bybit.example.com (required)

BYBIT_MCP_DB_PATH

./bybit_mcp.db

SQLite database file path

Development

git clone https://github.com/workspace/bybit-mcp-server.git
cd bybit-mcp-server
uv sync --all-extras
uv run pytest
uv run bybit-mcp-server

Documentation

Full docs at workspace.github.io/bybit-mcp-server

License

MIT

Available Tools

28 tools
amend_orderA
Destructive

Amend an existing order (HIGH risk - requires confirmation).

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name
        orderId: Order ID (either orderId or orderLinkId required)
        orderLinkId: User custom order ID
        qty: New order quantity
        price: New order price
        triggerPrice: New trigger price
        takeProfit: New take profit price
        stopLoss: New stop loss price
    

Inputs: symbol (required), category (required), qty, price, +5 more. Returns: result

cancel_all_ordersA
Destructive

Cancel all open orders (HIGH risk - requires confirmation).

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name
        baseCoin: Base coin
        settleCoin: Settle coin
    

Inputs: category (required), symbol, baseCoin, settleCoin. Returns: result

cancel_orderA
Destructive

Cancel an existing order (MEDIUM risk - no confirmation required).

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name
        orderId: Order ID (either orderId or orderLinkId required)
        orderLinkId: User custom order ID
    

Inputs: symbol (required), category (required), orderId, orderLinkId. Returns: result

confirm_orderA
Destructive

Execute a previously prepared HIGH-risk operation after review.

    When a HIGH-risk tool (place_order, amend_order, cancel_all_orders, set_leverage,
    internal_transfer) is called, it returns a confirmation summary instead of executing.
    Call this tool with the confirmation_id to actually execute the operation.

    Args:
        confirmation_id: The confirmation_id returned by the HIGH-risk tool.
    

Inputs: confirmation_id (required). Returns: result

get_account_infoA
Read-only

Get account margin mode and configuration info.

Inputs: no named parameters. Returns: result

get_closed_pnlA
Read-only

Query closed profit and loss records.

    Args:
        category: Product type - linear, inverse
        symbol: Symbol name
        startTime: Start timestamp in milliseconds
        endTime: End timestamp in milliseconds
        limit: Limit per page (max 100, default 50)
        cursor: Pagination cursor
    

Inputs: category (required), limit, cursor, symbol, +2 more. Returns: result

get_coin_balanceA
Read-only

Query coin balance of a specific account type.

    Args:
        accountType: Account type - UNIFIED, CONTRACT, SPOT, OPTION, FUND
        coin: Coin name
        memberId: UID (required when querying sub UID balance)
        withTransferSafeAmount: Query transfer safe amount (0 or 1)
    

Inputs: accountType (required), coin, memberId, withTransferSafeAmount. Returns: result

get_coin_infoA
Read-only

Query coin information including chain info, deposit/withdraw status.

    Args:
        coin: Coin name. If omitted, returns all coins.
    

Inputs: coin. Returns: result

get_fee_rateB
Read-only

Get trading fee rate.

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name
        baseCoin: Base coin
    

Inputs: symbol, baseCoin, category. Returns: result

get_funding_rate_historyA
Read-only

Query historical funding rate.

    Args:
        category: Product type - linear, inverse
        symbol: Symbol name (e.g. BTCUSDT)
        startTime: Start timestamp in milliseconds
        endTime: End timestamp in milliseconds
        limit: Limit for data size per page (max 200, default 200)
    

Inputs: symbol (required), category (required), limit, endTime, +1 more. Returns: result

get_instruments_infoB
Read-only

Query instrument specifications and trading rules.

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name
        status: Symbol status filter - Trading, Settling, etc.
        baseCoin: Base coin
        limit: Limit for data size per page
        cursor: Pagination cursor
    

Inputs: category (required), limit, cursor, status, +2 more. Returns: result

get_klineA
Read-only

Query kline/candlestick data.

    Args:
        category: Product type - spot, linear, inverse
        symbol: Symbol name (e.g. BTCUSDT)
        interval: Kline interval - 1,3,5,15,30,60,120,240,360,720,D,M,W
        start: Start timestamp in milliseconds
        end: End timestamp in milliseconds
        limit: Limit for data size per page (max 200, default 200)
    

Inputs: symbol (required), category (required), interval (required), end, +2 more. Returns: result

get_open_interestA
Read-only

Get open interest for each symbol.

    Args:
        category: Product type - linear, inverse
        symbol: Symbol name (e.g. BTCUSDT)
        intervalTime: Interval - 5min, 15min, 30min, 1h, 4h, 1d
        startTime: Start timestamp in milliseconds
        endTime: End timestamp in milliseconds
        limit: Limit for data size per page (max 200, default 50)
        cursor: Pagination cursor
    

Inputs: symbol (required), category (required), intervalTime (required), limit, +3 more. Returns: result

get_open_ordersA
Read-only

Query unfilled or partially filled orders.

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name
        baseCoin: Base coin (for linear/inverse only)
        orderId: Order ID
        orderLinkId: User custom order ID
        limit: Limit per page (max 50, default 20)
        cursor: Pagination cursor
    

Inputs: category (required), limit, cursor, symbol, +3 more. Returns: result

get_orderbookA
Read-only

Query order book depth data.

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name (e.g. BTCUSDT)
        limit: Depth limit (spot: 1-200, default 1; derivatives: 1-500, default 25)
    

Inputs: symbol (required), category (required), limit. Returns: result

get_order_historyA
Read-only

Query order history.

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name
        orderId: Order ID
        orderLinkId: User custom order ID
        orderStatus: Order status - New, PartiallyFilled, Filled, Cancelled, etc.
        limit: Limit per page (max 50, default 20)
        cursor: Pagination cursor
    

Inputs: category (required), limit, cursor, symbol, +3 more. Returns: result

get_positionsB
Read-only

Query real-time position data.

    Args:
        category: Product type - linear, inverse, option
        symbol: Symbol name
        baseCoin: Base coin
        settleCoin: Settle coin
        limit: Limit per page (max 200, default 20)
        cursor: Pagination cursor
    

Inputs: category (required), limit, cursor, symbol, +2 more. Returns: result

get_public_tradesB
Read-only

Query recent public trading data.

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name (e.g. BTCUSDT)
        baseCoin: Base coin (for option only)
        optionType: Option type - Call, Put (for option only)
        limit: Limit for data size (spot: 1-60 default 60; others: 1-1000 default 500)
    

Inputs: symbol (required), category (required), limit, baseCoin, +1 more. Returns: result

get_server_timeA
Read-only

Get the current Bybit server time.

Inputs: no named parameters. Returns: result

get_tickersA
Read-only

Get latest price ticker for a symbol.

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Trading pair (e.g. BTCUSDT). If omitted, returns all tickers for the category.
    

Inputs: category (required), symbol. Returns: result

get_trade_historyB
Read-only

Query trade execution history.

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name
        orderId: Order ID
        startTime: Start timestamp in milliseconds
        endTime: End timestamp in milliseconds
        limit: Limit per page (max 100, default 50)
        cursor: Pagination cursor
    

Inputs: category (required), limit, cursor, symbol, +3 more. Returns: result

get_transfer_historyB
Read-only

Query internal transfer records.

    Args:
        transferId: UUID of transfer
        coin: Coin name
        status: Transfer status - SUCCESS, PENDING, FAILED
        startTime: Start timestamp in milliseconds
        endTime: End timestamp in milliseconds
        limit: Limit per page (max 50, default 20)
        cursor: Pagination cursor
    

Inputs: coin, limit, cursor, status, +3 more. Returns: result

get_wallet_balanceA
Read-only

Get wallet balance and account risk information.

    Args:
        accountType: Account type - UNIFIED, CONTRACT, SPOT, OPTION, FUND
        coin: Coin name (e.g. BTC). If omitted, returns all coins with balance.
    

Inputs: accountType (required), coin. Returns: result

internal_transferA
Destructive

Transfer funds between account types under same UID (HIGH risk, requires 'full' mode).

    Args:
        transferId: UUID (generate a UUID before calling)
        coin: Coin name (e.g. USDT)
        amount: Transfer amount (as string)
        fromAccountType: Source account type - UNIFIED, CONTRACT, SPOT, OPTION, FUND
        toAccountType: Destination account type
    

Inputs: coin (required), amount (required), transferId (required), toAccountType (required), +1 more. Returns: result

place_orderA
Destructive

Place an order (HIGH risk - requires confirmation).

    Args:
        category: Product type - spot, linear, inverse, option
        symbol: Symbol name (e.g. BTCUSDT)
        side: Buy or Sell
        orderType: Market or Limit
        qty: Order quantity (as string)
        price: Order price (required for Limit orders)
        timeInForce: Time in force - GTC, IOC, FOK, PostOnly
        orderLinkId: User custom order ID
        reduceOnly: Reduce only (true means close position)
        takeProfit: Take profit price
        stopLoss: Stop loss price
    

Inputs: qty (required), side (required), symbol (required), category (required), +7 more. Returns: result

set_auto_add_marginA
Destructive

Turn on/off auto-add-margin for isolated margin position (MEDIUM risk).

    Args:
        category: Product type - linear
        symbol: Symbol name
        autoAddMargin: 0 to turn off, 1 to turn on
        positionIdx: Position index (0: one-way, 1: hedge buy, 2: hedge sell)
    

Inputs: symbol (required), category (required), autoAddMargin (required), positionIdx. Returns: result

set_leverageA
Destructive

Set leverage for a position (HIGH risk - requires confirmation).

    Args:
        category: Product type - linear, inverse
        symbol: Symbol name
        buyLeverage: Buy leverage (0 to max for risk limit)
        sellLeverage: Sell leverage (0 to max for risk limit)
    

Inputs: symbol (required), category (required), buyLeverage (required), sellLeverage (required). Returns: result

set_trading_stopA
Destructive

Set take profit, stop loss, or trailing stop for a position (MEDIUM risk).

    Args:
        category: Product type - linear, inverse
        symbol: Symbol name
        takeProfit: Take profit price
        stopLoss: Stop loss price
        trailingStop: Trailing stop distance
        tpTriggerBy: TP trigger price type - LastPrice, MarkPrice, IndexPrice
        slTriggerBy: SL trigger price type
        tpSize: TP order quantity
        slSize: SL order quantity
        positionIdx: Position index (0: one-way, 1: hedge buy, 2: hedge sell)
    

Inputs: symbol (required), category (required), slSize, tpSize, +6 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 28 tools

    Disambiguation5/5

    Each tool targets a distinct operation, with clear descriptions that prevent confusion. Overlaps like get_wallet_balance and get_coin_balance are differentiated by specific parameters and purposes.

    Naming Consistency5/5

    All tools use a consistent snake_case naming pattern with intuitive prefixes (get_, set_, place_, amend_, cancel_, etc.) that clearly indicate the action.

    Tool Count4/5

    28 tools cover a wide range of exchange operations without being excessive. The count is appropriate for the depth of functionality provided, though slightly on the higher side.

    Completeness4/5

    The tool surface covers the core trading lifecycle (market data, orders, positions, account, transfers) comprehensively. Minor gaps exist, such as the absence of direct deposit/withdraw tools and advanced position margin adjustments.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      Enables cryptocurrency trading on Bybit exchange through comprehensive market data access, account management, and automated trading operations. Features smart position validation, trailing stop losses, and risk management tools with demo mode support for safe testing.
      21
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with Bitget cryptocurrency exchange for spot and futures trading. Supports real-time market data, order management, account balances, leverage control, and position tracking with demo trading capabilities.
      17
      6
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      A production-ready MCP server for Bybit — 206 tools covering market data, trading, positions, account management, assets, and real-time WebSocket streams. Enables AI assistants to interact directly with the Bybit cryptocurrency exchange through natural language.
      400
      1,212 npm
      44
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLM agents to access BingX cryptocurrency exchange market data and execute trades through the official API, with support for account management, order creation, and technical indicators.
      -