Provides full Bybit v5 data, trading, positions, and account management via MCP.
Configuration
View docs{
"mcpServers": {
"bcusack-bybit-py-mcp": {
"command": "uvx",
"args": [
"bybit-mcp"
],
"env": {
"BYBIT_API_KEY": "abcd1234efgh5678",
"BYBIT_TESTNET": "true",
"BYBIT_API_SECRET": "secret1234abcd5678",
"BYBIT_TRADING_ENABLED": "true"
}
}
}
}You can use this MCP server to access Bybit v5 data and trading capabilities through a single, consistent interface. It exposes market data, trading operations, positions, and account management so your AI assistants or clients can query information or place trades safely and with validation.
Connect to the Bybit MCP Server from any MCP-compatible client. You will be able to request real-time market data, fetch instrument details, and, when trading is enabled, place and manage orders, view positions, and monitor account information. Start with market data to explore what the server can return, then enable trading only after you’ve tested thoroughly in a safe environment.
Prerequisites: ensure Python 3.13+ and uv (or uvx) are available on your system.
Install and run using uvx (no local installation required) to try the MCP server quickly.
Safety: trading operations are disabled by default. You must explicitly enable trading by setting BYBIT_TRADING_ENABLED to true in your environment. Test on the Bybit testnet first (BYBIT_TESTNET=true) to avoid real funds.
Environment variables you may configure include BYBIT_API_KEY, BYBIT_API_SECRET, BYBIT_TESTNET, and BYBIT_TRADING_ENABLED. Use BYBIT_TESTNET=true for safe testing, and BYBIT_TRADING_ENABLED=false until you are ready to enable live trading.
You can run the MCP server through several approaches. Choose the one that matches your workflow.
# Easiest: run directly from PyPI without cloning
uvx bybit-mcp
# Local development: clone, install, then run
git clone <repository-url>
cd bybit-mcp
uv sync
# Copy and customize environment variables as needed
# BYBIT_API_KEY, BYBIT_API_SECRET, BYBIT_TESTNET, BYBIT_TRADING_ENABLEDTrading-enabled tools are shown only when BYBIT_TRADING_ENABLED=true. Market data tools remain available regardless of this setting.
Testnet support is recommended for development. Use BYBIT_TESTNET=true to point requests at Bybit's test environment.
Ensure your Bybit API key has the appropriate permissions: Read-only for market data; Trade for orders; Position for position management.
If you encounter issues, verify environment variables are passed correctly to the runtime. For Docker usage, use the -e flags to set BYBIT_API_KEY, BYBIT_API_SECRET, BYBIT_TESTNET, and BYBIT_TRADING_ENABLED.
If you see validation or type errors, the server automatically normalizes common API inconsistencies and provides detailed error messages to guide fixes.
The server provides an extensive set of endpoints to access market data, execute trades, manage positions, and obtain account information. Each tool includes parameter schemas to help you construct valid requests and receive predictable responses.
Retrieve the current Bybit server time.
Fetch ticker information for specified symbols.
Obtain the order book depth for a symbol.
Show recent trade history.
Get standard OHLCV candlestick data.
Retrieve mark price historical data.
Get trading instrument details.
Access historical funding rates.
Get open interest statistics.
Get insurance fund data.
Obtain risk limit information.
Fetch long/short ratio data.
Place standard market or limit orders.
Place conditional/trigger orders with stop/trigger logic.
Amend an existing pending order.
Cancel a specific pending order.
Cancel all open orders.
Place multiple orders in a single request.
Amend multiple orders at once.
Cancel multiple orders at once.
Retrieve open and closed orders.
Fetch order history.
Get trade execution history.
Get comprehensive wallet balance information.
Get balance for a specific coin.
Get detailed account information and settings.
Query real-time position data.
Get closed profit and loss records.
Set position leverage.
Switch between cross and isolated margin.
Switch between one-way and hedge position modes.
Configure automatic margin addition.
Set take profit, stop loss, and trailing stops.