- Home
- MCP servers
- Bybit
Bybit
- javascript
0
GitHub Stars
javascript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"kondisettyravi-mcp-bybit-node": {
"command": "/Users/rkondis/personalwork/mcp-bybit-node/start-server.sh",
"args": [],
"env": {
"DEMO": "true",
"ACCESS_KEY": "your_access_key_here",
"SECRET_KEY": "your_secret_key_here"
}
}
}
}You can run a Bybit MCP Server to access trading data and execute operations via a Model Context Protocol client. Built with Node.js and TypeScript, this server handles authentication, position validation, and a suite of trading tools in a safe demo environment.
How to use
You connect your MCP client to the Bybit MCP Server to fetch market data, manage your wallet and positions, validate and place orders, and adjust risk and leverage. Use the client’s standard MCP requests to access tools for market data (tickers, order books, K-lines), account information (balances, positions, API key details), and trading operations (validate orders, size calculations, trailing stops, placing and canceling orders, and position management). You can also enable Demo mode to test flows without risking real funds. The server automatically handles authentication and detects position mode to apply correct behavior for hedged or one-way trading.
How to install
cd /Users/rkondis/personalwork/mcp-bybit-node
npm install
npm run build
Configure environment by providing Bybit API credentials in a .env file. Create or edit:
/Users/rkondis/personalwork/mcp-bybit-node/.env
Include keys such as ACCESS_KEY and SECRET_KEY and set DEMO=true for safe testing.
## Additional setup notes
There are multiple startup options to run the server in a way that your MCP client can connect via stdio. Pick the method you prefer and follow the corresponding steps.
## Troubleshooting
If the server does not start correctly, verify that the build completed, the .env file exists, and the startup script runs with the proper permissions. Check that DEMO is set to true for testing and that your environment variables are loaded by the chosen startup method.
## Notes on security and testing
Always run in DEMO mode while testing to avoid real financial impact. Never expose your ACCESS\_KEY or SECRET\_KEY in code or logs. Use environment variables to keep credentials out of source control, and validate all error paths and edge cases in a safe environment before moving to production.
## Available tools
### get\_tickers
Fetch current ticker information for symbols available on Bybit MCP server
### get\_orderbook
Retrieve the order book data for a symbol or symbol pair
### get\_kline
Obtain K-line (candlestick) data for a symbol over a time interval
### get\_instruments\_info
Get information about available instruments/exchanges
### get\_wallet\_balance
Query wallet balance for the connected API key
### get\_positions
Retrieve current positions for the account
### get\_api\_key\_information
Return details about the API keys in use
### validate\_order\_quantity
Check if a proposed order quantity is valid under trading rules
### calculate\_position\_size
Compute recommended position size based on risk and balance inputs
### calculate\_trailing\_stop
Compute trailing stop values with breakeven and profit protection logic
### detect\_position\_mode
Determine current position mode and provide guidance on positionIdx usage
### place\_order
Execute an order with automatic position mode detection
### place\_order\_with\_trailing\_stop
Place an order with an integrated trailing stop loss
### cancel\_order
Cancel an existing order
### get\_order\_history
Fetch the order history for the account
### get\_open\_orders
Retrieve currently open orders
### set\_leverage
Set leverage for a specific symbol
### set\_trading\_stop
Configure a trading stop for risk management
### set\_margin\_mode
Switch margin mode for a symbol