Uses .env files for secure configuration management of API credentials
Built with Node.js runtime for executing the MCP server implementation
Package management and build tooling through npm
Implemented in TypeScript providing type safety and IntelliSense support
Bybit MCP Server (Node.js)
A Model Context Protocol (MCP) server for Bybit trading operations, built with Node.js and TypeScript.
Features
- ✅ Perfect Authentication - Uses exact Cloud Functions signature logic 
- ✅ Smart Position Validation - Automatic validation against Bybit trading rules 
- ✅ Position Mode Detection - Automatically detects one-way vs hedge mode 
- ✅ 16 Trading Tools - Complete market data, account, and trading operations 
- ✅ Demo Mode Support - Safe testing environment 
Installation
- Build the server: cd /Users/rkondis/personalwork/mcp-bybit-node npm install npm run build
- Configure environment: - Copy - .envfile with your Bybit API credentials
- Set - DEMO=truefor safe testing
 
Claude MCP Integration
Method 1: Using the startup script (Recommended)
Step 1: Ensure your .env file exists with your API keys:
Step 2: Add to Claude MCP:
The startup script automatically loads API keys from the
Method 2: Direct node execution with environment variables
Method 3: Using working directory (reads .env automatically)
This method uses the existing
Available Tools
- Market Data: - get_tickers- Get ticker information
- get_orderbook- Get orderbook data
- get_kline- Get K-line (candlestick) data
- get_instruments_info- Get exchange information
 
- Account Management: - get_wallet_balance- Get wallet balance
- get_positions- Get position information
- get_api_key_information- Get API key information
 
- Trading Operations: - validate_order_quantity- Validate order quantity against trading rules
- calculate_position_size- Calculate optimal position size based on risk management
- calculate_trailing_stop- Calculate trailing stop loss with breakeven and profit protection
- detect_position_mode- Detect position mode and get recommended positionIdx
- place_order- Execute order with automatic position mode detection
- place_order_with_trailing_stop- Place order with built-in trailing stop loss
- cancel_order- Cancel order
- get_order_history- Get order history
- get_open_orders- Get open orders
 
- Position Management: - set_leverage- Set leverage for a specific symbol
- set_trading_stop- Set trading stop
- set_margin_mode- Set margin mode
 
- Utility: - get_access_key- Get access key from environment
- get_secret_key- Get secret key from environment
 
Testing
Test the MCP server:
Test trade execution:
Usage Examples
Validate order before placing:
Place a validated order:
Calculate position size with risk management:
Calculate trailing stop loss with profit protection:
Place order with trailing stop loss:
Set leverage:
Check positions:
Key Improvements Over Python Version
- ✅ No signature errors - Perfect authentication with Bybit API 
- ✅ Smart validation - Automatic position size and mode validation 
- ✅ Better error handling - Comprehensive error messages and recovery 
- ✅ TypeScript support - Full type safety and IntelliSense 
Troubleshooting
If Claude MCP fails to start:
- Check file permissions: ls -la /Users/rkondis/personalwork/mcp-bybit-node/dist/index.js # Should show: -rwxr-xr-x (executable)
- Test server directly: cd /Users/rkondis/personalwork/mcp-bybit-node node dist/index.js # Should show: "Bybit MCP Server (Node.js) running on stdio"
- Check environment variables: cat /Users/rkondis/personalwork/mcp-bybit-node/.env
- Use the startup script: /Users/rkondis/personalwork/mcp-bybit-node/start-server.sh
Security Notes
- Always use - DEMO=truefor testing
- Never commit API keys to version control 
- Use environment variables for sensitive data 
- Test thoroughly in demo mode before production use 
Support
The server includes comprehensive logging and error handling. Check the console output for detailed information about any issues.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
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.
Related MCP Servers
- Asecurity-licenseAqualityA 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 -12115MIT License
- Asecurity-licenseAqualityInteract with Upbit cryptocurrency exchange services to retrieve market data, manage accounts, and execute trades. Simplify your trading experience with tools for order management, deposits, withdrawals, and technical analysis.Last updated -1013MIT License
- Asecurity-licenseAqualityInteract seamlessly with the Bybit API to fetch market data, manage your account, and execute trades. Leverage powerful tools to enhance your trading experience and automate your strategies effortlessly. If you wish to use an API key restricted to your personal IP address, you must configure the MCPLast updated -157MIT License
- Asecurity-licenseAqualityEnables interaction with the Upbit cryptocurrency exchange through public market data tools and optional private trading tools. Supports getting ticker data, orderbooks, trades, account information, and executing trading operations through natural language.Last updated -842MIT License