Get the FREE Ultimate OpenClaw Setup Guide →

bybit

A Model Context Protocol (MCP) server for integrating AI assistants with Bybit cryptocurrency exchange APIs, enabling automated trading, market data access, and account management.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ethancod1ng-bybit-mcp-server npx bybit-mcp-server \
  --env BYBIT_API_KEY="your_bybit_api_key" \
  --env BYBIT_API_SECRET="your_bybit_api_secret" \
  --env BYBIT_ENVIRONMENT="testnet"

How to use

This MCP server enables AI coding assistants to interact with Bybit's trading platform via the MCP interface. It exposes Bybit's market data, account management, and trading capabilities through a structured set of MCP calls. You can use tools like Claude Code or Cursor to query real-time prices, order books, historical candles, and 24-hour statistics, as well as manage your account, open and cancel orders, or retrieve trade history. Note that trading operations can affect real funds when used on the mainnet, so you should stick to testnet during development and testing. To get started, configure your MCP client to connect to this server using the provided command and environment variables, then invoke the available methods such as get_price, get_orderbook, get_account_info, place_order, or cancel_order via natural-language prompts or scripted intents.

How to install

Prerequisites:

  • Node.js (LTS) and npm installed on your system
  • Basic familiarity with command-line usage
  1. Install the MCP server globally using npm:
npm install -g bybit-mcp-server
  1. Ensure you have an API key pair for Bybit (testnet preferred for development):
  • Obtain BYBIT_API_KEY and BYBIT_API_SECRET from Bybit's API Management page (preferably in testnet environment)
  • Set BYBIT_ENVIRONMENT to testnet (or mainnet when you're ready to go live)
  1. Start or test the MCP server using npx (as configured in mcp_config):
npx bybit-mcp-server
  1. If you prefer to run directly without npx, you can install locally and run via node (depending on your setup):
npm install bybit-mcp-server
node path/to/server.js
  1. Verify connectivity from your MCP client (Claude/Cursor) by pointing to the server and using the supported MCP calls.

Additional notes

Tips and considerations:

  • Use BYBIT_ENVIRONMENT=testnet for safe testing; mainnet requires real funds and carries risk.
  • Do not commit BYBIT_API_KEY or BYBIT_API_SECRET into version control; use environment-secure storage.
  • The server implements Bybit's V5 API; refer to Bybit V5 docs for endpoint behavior and rate limits.
  • You can override BYBIT_BASE_URL if you have a custom Bybit instance; otherwise it will auto-detect.
  • The API keys are redacted in error messages to prevent accidental exposure.
  • When testing, start with the market-data tools (get_price, get_orderbook, get_klines, get_24hr_ticker) before performing any trading operations (place_order, cancel_order).
  • For production, consider enabling IP restrictions on API keys and using secure secret management for credentials.

Related MCP Servers

Sponsor this space

Reach thousands of developers