This server provides a comprehensive Model Context Protocol (MCP) interface for programmatic trading and interaction with the Bybit cryptocurrency exchange API.
Market Data Retrieval: Fetch real-time order book data, K-line/candlestick charts with various time intervals (1m to monthly), current ticker prices (including volume and metrics), and detailed instrument information for trading pairs.
Trading Operations: Execute market or limit orders for spot and futures trading with support for buy/sell orders, take profit/stop loss settings, leverage configuration, and position indexing for long/short positions. Cancel existing orders by order ID or link ID.
Account Management: Check wallet balances across different account types (UNIFIED, CONTRACT, SPOT), view current open positions for spot and futures trading, and retrieve API key permissions and details.
Order Management: Monitor open orders, access historical order execution records with filtering options, and view comprehensive order details.
Risk Management: Set take profit, stop loss, and trailing stop levels for positions. Configure margin modes (isolated/cross) with custom leverage settings for futures trading.
Supported Trading Categories: Spot trading, linear futures (USDT-margined perpetual contracts), and inverse futures (coin-margined contracts).
Security: Securely access API credentials through environment variables with proper authentication.
Provides a donation option to support the developer of the MCP server through the Buy Me A Coffee platform.
Offers deployment through Docker containers, allowing users to run the Bybit API interface in an isolated environment with proper environment variable configuration.
Provides specific installation and configuration instructions for Linux environments, ensuring the Bybit API interface can run on Linux operating systems.
Includes specific setup instructions for macOS, enabling users to run the Bybit API interface on Apple's operating system.
MCP Bybit API Interface
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.
Usage
Installing via Smithery
To install this Bybit API Interface server for Claude Desktop automatically via Smithery:
Using with Claude, Roo Code, Cline, etc.
Add the following configuration to your MCP settings file (e.g., mcp_settings.json):
Using uv With Windows:
(Remember to replace YOUR_USERNAME and use double backslashes \)
Using uv With macOS:
(Replace YOUR_USERNAME if using ~/bin)
Using uv With Linux:
Using Docker (Requires Docker)
Make sure you have pulled the image first: docker pull dlwjdtn535/mcp-bybit-server:latest
Note: Always use
@latestor a specific version tag for both NPX and Docker to ensure you are using the intended version.
Related MCP server: XTBApiServer
Tools 🛠️
This MCP server provides the following tools for interacting with the Bybit API:
get_orderbook: Fetches order book information.Inputs:
category,symbol,limit(optional)Returns: Order book details.
get_kline: Fetches K-line (candlestick) data.Inputs:
category,symbol,interval,start(optional),end(optional),limit(optional)Returns: Candlestick data.
get_tickers: Fetches cryptocurrency ticker information.Inputs:
category,symbolReturns: Ticker information.
get_wallet_balance: Fetches account balance.Inputs:
accountType,coin(optional)Returns: Balance information.
get_positions: Fetches position information.Inputs:
category,symbol(optional)Returns: Position information.
place_order: Places a limit or market order.Inputs:
category,symbol,side,orderType,qty,price(optional for limit),positionIdx(optional for futures), and other optional parameters (e.g.,timeInForce,takeProfit,stopLoss).Returns: Order placement confirmation.
cancel_order: Cancels an existing order.Inputs:
category,symbol,orderId(optional),orderLinkId(optional)Returns: Cancellation confirmation.
get_order_history: Fetches historical order details.Inputs:
category,symbol(optional),orderId(optional),limit(optional), etc.Returns: Order history.
get_open_orders: Fetches current open orders.Inputs:
category,symbol(optional),limit(optional), etc.Returns: Open order details.
set_trading_stop: Sets take profit, stop loss, or trailing stop for a position.Inputs:
category,symbol,takeProfit(optional),stopLoss(optional),trailingStop(optional),positionIdx(optional)Returns: Setting confirmation.
set_margin_mode: Sets the margin mode (isolated or cross).Inputs:
category,symbol,tradeMode,buyLeverage,sellLeverageReturns: Setting confirmation.
get_api_key_information: Fetches information about the current API key.Inputs: None
Returns: API key details.
get_instruments_info: Fetches details about trading instruments (symbols).Inputs:
category,symbol,status(optional),baseCoin(optional)Returns: Instrument details.
(Refer to the function docstrings in the code for detailed parameter descriptions and examples.)
Environment Variables
Before running the server, you must set the following environment variables:
API Key Setup
To use this Bybit API interface, you need to create an API key from Bybit. Follow these important steps:
Go to Bybit and log into your account.
Navigate to API Management.
Create a new API key.
Important Security Settings:
Enable IP restriction if possible.
Add ONLY the IP address(es) from which the server will run (your local PC IP, server IP, or Docker container's external IP).
Never share your API keys or expose them in public repositories.
Recommended permissions:
Read (Required)
Trade (Required for order execution)
Wallet (Required for balance checking)
Sponsorship & Donations
If you find this project helpful and would like to support its development, you can contribute in the following ways:
Buy Me a Coffee

Referral Program
You can also support this project by signing up for Bybit using our referral link:
Referral Code: J1O4JK
Your support helps maintain and improve this project. Thank you! 🙏
Contact & Support
For additional inquiries or support, please contact:
Email: dlwjdtn5624@naver.com
We welcome your questions and feedback!
License
MIT License