Bybit MCP Server
Multi-language Documentation
A Model Context Protocol (MCP) server for Bybit exchange, enabling AI coding tools like Claude Code and Cursor to interact with Bybit's trading platform.
Quick Start
Installation
Configuration
This MCP server can be used with various AI tools that support MCP:
Claude Code Configuration
For Testnet (Recommended - Safe for testing):
Add to claude_desktop_config.json
:
For Mainnet (⚠️ WARNING: Uses real funds):
Add to claude_desktop_config.json
:
Cursor Configuration
Use the same configuration as Claude Code above, but add to .cursor/mcp_config.json
with mcp.servers
instead of mcpServers
.
Environment Setup
Option 1: Testnet (Recommended)
Option 2: Mainnet (⚠️ Real funds)
Getting API Keys
For Testnet:
- Visit Bybit Testnet
- Register an account
- Go to API Management and create API keys
- Enable required permissions (read, trade)
For Mainnet:
- Visit Bybit
- Complete account verification
- Go to API Management and create API keys
- Enable required permissions (read, trade)
- Set IP restrictions for additional security
Available Tools
Market Data
get_price
- Get current price for a trading symbolget_orderbook
- Get order book depth for a trading symbolget_klines
- Get historical candlestick dataget_24hr_ticker
- Get 24-hour trading statistics
Account Management
get_account_info
- Get account information and balancesget_wallet_balance
- Get wallet balance for specific account typeget_open_orders
- Get list of open/active ordersget_order_history
- Get historical orders
Trading (⚠️ Can use real funds on mainnet)
place_order
- Place a new ordercancel_order
- Cancel an existing ordercancel_all_orders
- Cancel all orders for a symbol or category
Usage Examples
Ask your AI assistant to:
- "Get the current price of BTCUSDT on Bybit"
- "Show me the order book for ETHUSDT with 50 levels"
- "Get my account balance"
- "Place a limit buy order for 0.1 BTC at $45000"
- "Cancel all my open orders for BTCUSDT"
- "Get my trading history for the last 20 orders"
Security
⚠️ Important Security Notes:
- TESTNET is the default and recommended environment for safety
- MAINNET operations use real funds - use with extreme caution
- API keys are automatically redacted from error messages
- Always test thoroughly on testnet before using mainnet
- Trading operations will display warnings when using mainnet
🔐 API Key Safety:
- Never commit API keys to version control
- Use environment variables for credentials
- Regularly rotate your API keys
- Use IP restrictions in Bybit API settings
Development
Local Development
- Clone the repository:
- Install dependencies:
- Set up environment:
- Run in development mode:
Configuration Options
Variable | Description | Default | Required |
---|---|---|---|
BYBIT_API_KEY | Your Bybit API key | - | ✅ |
BYBIT_API_SECRET | Your Bybit API secret | - | ✅ |
BYBIT_ENVIRONMENT | testnet or mainnet | testnet | ❌ |
BYBIT_BASE_URL | Custom API base URL | Auto-detected | ❌ |
DEBUG | Enable debug logging | false | ❌ |
API Reference
This server implements Bybit's V5 API endpoints. For detailed API documentation:
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
MIT License - see LICENSE file for details.
Support
This server cannot be installed
A Model Context Protocol server that enables AI coding tools like Claude Code and Cursor to interact with Bybit's trading platform for market data retrieval, account management, and trading operations.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides read-only access to Bybit's cryptocurrency exchange API, allowing users to query real-time cryptocurrency data using natural language.Last updated -9312TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.Last updated -5Python
- -securityFlicense-qualityA Model Context Protocol server that enables Claude AI to interact with Paybyrd's payment processing API, allowing for creating payment links, processing refunds, and retrieving order information.Last updated -1TypeScript
- -securityFlicense-qualityA Model Context Protocol server that provides Claude with access to AI-powered trading predictions and analysis from the aiprediction.us API, handling authentication, date formatting, and data retrieval.Last updated -Python