Bybit MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Bybit MCP Server what's the current price of BTCUSDT?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Bybit MCP Server
A secure, read-only Model Context Protocol (MCP) server for the Bybit cryptocurrency exchange V5 API.
Security First: This server implements read-only operations only. No trading, withdrawals, or account modifications are possible by design.
Table of Contents
Related MCP server: Bybit MCP Server
Features
Feature | Description |
Read-only by design | Cannot execute trades or withdrawals |
Secure authentication | Uses official bybit-api SDK with HMAC SHA256 signing |
Testnet support | Safe testing without real funds |
Full V5 API coverage | 26 tools covering market data, account info, positions, and orders |
API key sanitization | Keys are never exposed in error messages or logs |
Graceful rate limiting | Automatic throttling with exponential backoff retry |
Quick Start
1. Clone and Install
git clone https://github.com/trenerok/bybit-mcp-server.git
cd bybit-mcp-server
npm install2. Configure
cp .env.example .env
# Edit .env with your Bybit API credentials3. Build
npm run build4. Add to Your MCP Client
See MCP Client Setup for configuration examples.
Configuration
Environment Variables
Variable | Required | Default | Description |
| Yes* | - | Your Bybit API key |
| Yes* | - | Your Bybit API secret |
| No |
| Set to |
| No |
| Request timeout in milliseconds |
*Required only for authenticated endpoints (account, positions, orders). Market data tools work without credentials.
Getting API Keys
Testnet (Recommended for Testing)
Visit testnet.bybit.com
Create an account or login
Go to API Management → Create New Key
Enable Read permissions only
Copy your API Key and Secret
Mainnet (Production)
Visit bybit.com
Go to API Management → Create New Key
Enable Read permissions only
Recommended: Set IP restrictions for additional security
Copy your API Key and Secret
MCP Client Setup
Claude Desktop
Add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"bybit": {
"command": "node",
"args": ["/absolute/path/to/bybit-mcp-server/dist/index.js"],
"env": {
"BYBIT_API_KEY": "your_api_key",
"BYBIT_API_SECRET": "your_api_secret",
"BYBIT_TESTNET": "false"
}
}
}
}Cursor IDE
Add to .cursor/mcp.json in your project or global config:
{
"mcpServers": {
"bybit": {
"command": "node",
"args": ["/absolute/path/to/bybit-mcp-server/dist/index.js"],
"env": {
"BYBIT_API_KEY": "your_api_key",
"BYBIT_API_SECRET": "your_api_secret",
"BYBIT_TESTNET": "false"
}
}
}
}Other MCP Clients
Use similar configuration with the appropriate config file format for your client.
Available Tools
Overview
Category | Tools | Auth Required | Description |
Market | 12 | No | Public market data |
Account | 7 | Yes | Wallet and account info |
Position | 3 | Yes | Position management |
Order | 4 | Yes | Order queries |
Total | 26 | - | - |
Market Data Tools (No Auth Required)
Tool | Description |
| Get Bybit server time for synchronization |
| Get candlestick/OHLCV data for charting |
| Get current prices, 24h change, volume, funding rate |
| Get order book depth (bids and asks) |
| Get trading pair specifications and limits |
| Get historical funding rates for perpetuals |
| Get open interest data for futures |
| Get recent public trades |
| Get implied volatility history (options) |
| Get risk limit tiers for futures |
| Get insurance fund history |
| Get long/short ratio data |
Account Tools (Auth Required)
Tool | Description |
| Get wallet balances for all or specific coins |
| Get account type, margin mode, status |
| Get your trading fee rates |
| Get transaction history |
| Get margin borrow records |
| Get collateral settings and ratios |
| Get options greeks for positions |
Position Tools (Auth Required)
Tool | Description |
| Get current open positions with PnL |
| Get realized profit/loss history |
| Get trade execution history |
Order Tools (Auth Required)
Tool | Description |
| Get active/pending orders |
| Get historical orders (30 days) |
| Get filled trades history |
| Get spot margin borrow quota |
Tool Reference
Common Parameters
Category Types
Value | Description |
| Spot trading |
| USDT perpetual futures |
| Coin-margined futures |
| Options trading |
Kline Intervals
Value | Description |
| Minutes |
| Hours (as minutes) |
| Daily |
| Weekly |
| Monthly |
Example Tool Calls
Get BTC/USDT Price
{
"tool": "get_tickers",
"arguments": {
"category": "linear",
"symbol": "BTCUSDT"
}
}Get 1-Hour Candles
{
"tool": "get_klines",
"arguments": {
"category": "linear",
"symbol": "BTCUSDT",
"interval": "60",
"limit": 100
}
}Get Wallet Balance
{
"tool": "get_wallet_balance",
"arguments": {
"accountType": "UNIFIED"
}
}Get Order Book
{
"tool": "get_orderbook",
"arguments": {
"category": "linear",
"symbol": "BTCUSDT",
"limit": 25
}
}Get Open Positions
{
"tool": "get_positions",
"arguments": {
"category": "linear"
}
}Get Funding Rate History
{
"tool": "get_funding_rate_history",
"arguments": {
"category": "linear",
"symbol": "BTCUSDT",
"limit": 50
}
}Rate Limiting
This server implements graceful rate limiting according to Bybit V5 API documentation.
Applied Limits
Category | Limit | Window |
IP (Global) | 600 requests | 5 seconds |
Market Data | 120 req/sec | Rolling |
Account | 50 req/sec | Rolling |
Position | 50 req/sec | Rolling |
Order | 20 req/sec | Rolling |
Rate Limit Features
Token Bucket Algorithm: Tracks requests per endpoint category
Automatic Throttling: Delays requests when approaching limits
Exponential Backoff: Retries on rate limit errors (10006, 10018)
Graceful Degradation: Queues requests instead of failing
Retry Behavior
When a rate limit error occurs:
Wait 1 second (initial delay)
Retry up to 3 times
Each retry doubles the wait time
Maximum wait: 30 seconds
For AI Agents
This section provides guidance for AI agents using this MCP server.
Server Capabilities
Read-only: This server cannot execute trades, place orders, or modify account settings
Real-time data: Market data is fetched live from Bybit
Authentication: Some tools require API credentials (account, positions, orders)
Best Practices for AI Agents
Start with market data: Use
get_tickersorget_klinesfor price informationCheck authentication: If account tools fail, credentials may not be configured
Use appropriate categories:
linearfor USDT perpetual futures (most common)spotfor spot tradinginversefor coin-margined futures
Handle rate limits gracefully: The server handles this automatically
Verify data freshness: Use
get_server_timeto check connectivity
Common Workflows
Get Current Market Overview
1. get_tickers(category: "linear") - Get all perpetual prices
2. get_funding_rate_history(symbol: "BTCUSDT") - Check funding rates
3. get_open_interest(symbol: "BTCUSDT") - Check market positioningCheck Account Status
1. get_account_info() - Verify account type and status
2. get_wallet_balance(accountType: "UNIFIED") - Check balances
3. get_positions(category: "linear") - View open positionsAnalyze Trading Pair
1. get_instruments_info(category: "linear", symbol: "BTCUSDT") - Get specs
2. get_klines(symbol: "BTCUSDT", interval: "60", limit: 200) - Price history
3. get_orderbook(symbol: "BTCUSDT", limit: 50) - Current depth
4. get_long_short_ratio(symbol: "BTCUSDT", period: "1h") - SentimentError Handling
Error | Meaning | Action |
"API credentials not configured" | Missing API key/secret | Configure environment variables |
"Too many requests" (10006) | Rate limited | Server will auto-retry |
"Invalid symbol" | Symbol doesn't exist | Check |
"Permission denied" | API key lacks permissions | Create new key with read permissions |
Response Format
All tools return JSON responses from the Bybit API:
{
"retCode": 0,
"retMsg": "OK",
"result": {
// Tool-specific data
},
"time": 1699999999999
}retCode: 0indicates successCheck
retMsgfor error details ifretCode != 0
Project Structure
bybit-mcp-server/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── client.ts # Bybit API client with rate limiting
│ ├── rate-limiter.ts # Token bucket rate limiter
│ ├── types.ts # TypeScript type definitions
│ └── tools/
│ ├── index.ts # Tool aggregator and exports
│ ├── market.ts # Market data tools (12)
│ ├── account.ts # Account tools (7)
│ ├── position.ts # Position tools (3)
│ └── orders.ts # Order tools (4)
├── dist/ # Compiled JavaScript output
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── .env.example # Environment template
├── .gitignore # Git ignore rules
├── LICENSE # MIT License
└── README.md # This fileSecurity
Recommendations
Use read-only API keys — This server only needs read permissions
Enable IP restrictions — Whitelist specific IPs in Bybit API settings
Use testnet first — Always test with testnet before mainnet
Never commit keys — Use environment variables or secret managers
Rotate keys regularly — Create new keys periodically
Security Features
API keys are never logged or exposed in error messages
Keys are sanitized from all error outputs
No trading or withdrawal endpoints are implemented
Read-only by design — cannot modify account state
Troubleshooting
Common Issues
"Cannot find module" Error
# Ensure you've built the project
npm run build"API credentials not configured"
Verify
.envfile exists with correct valuesCheck environment variables are being passed to the MCP server
Ensure no spaces around
=in.envfile
Rate Limit Errors
The server handles rate limits automatically. If you see persistent rate limit errors:
Reduce request frequency
The server will retry with exponential backoff
Check if other applications are using the same API key
Connection Timeouts
Increase
BYBIT_RECV_WINDOW(default: 5000ms)Check network connectivity
Verify Bybit service status
Wrong Network (Testnet vs Mainnet)
Check
BYBIT_TESTNETenvironment variableTestnet and mainnet require different API keys
Testnet:
testnet.bybit.comMainnet:
bybit.com
Development
# Install dependencies
npm install
# Build TypeScript
npm run build
# Watch mode for development
npm run dev
# Run directly (after build)
npm startContributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes
Run
npm run buildto ensure no errorsSubmit a pull request
API Reference
This server implements the Bybit V5 API. For detailed API documentation, visit:
License
MIT License - see LICENSE file.
Disclaimer
This software is provided "as is" without warranty of any kind. Use at your own risk. The authors are not responsible for any financial losses. Always verify data and test thoroughly before making trading decisions.
This is not financial advice. Always do your own research.
Available Tools
26 toolsget_account_infoA
Get account information including margin mode and account type. Auth required.
Inputs: no named parameters.
get_borrow_historyB
Get borrow records for margin trading. Auth required.
Inputs: limit, cursor, endTime, currency, +1 more.
get_borrow_quotaC
Get spot margin borrow quota. Auth required.
Inputs: side (required), symbol (required), category (required).
get_closed_pnlA
Get realized profit and loss history from closed positions. Shows entry/exit prices and actual PnL. Auth required.
Inputs: limit, cursor, symbol, endTime, +2 more.
get_coin_greeksB
Get greeks for options positions. Auth required.
Inputs: baseCoin.
get_collateral_infoC
Get collateral information and settings. Auth required.
Inputs: currency.
get_execution_listC
Get trade/execution history. Auth required.
Inputs: limit, cursor, symbol, endTime, +6 more.
get_fee_rateB
Get trading fee rates for your account. Auth required.
Inputs: category (required), symbol, baseCoin.
get_funding_rate_historyA
Get historical funding rates for perpetual contracts. Public endpoint (no auth required).
Inputs: symbol (required), category (required), limit, endTime, +1 more.
get_historical_volatilityB
Get historical implied volatility for options. Public endpoint (no auth required).
Inputs: category (required), period, endTime, baseCoin, +1 more.
get_instruments_infoB
Get trading pair/instrument specifications. Public endpoint (no auth required).
Inputs: category (required), limit, cursor, symbol, +1 more.
get_insuranceA
Get insurance fund history. Public endpoint (no auth required).
Inputs: coin.
get_klinesA
Get candlestick/OHLCV data for a trading pair. Public endpoint (no auth required).
Inputs: symbol (required), category (required), interval (required), end, +2 more.
get_long_short_ratioA
Get long/short ratio data for futures. Public endpoint (no auth required).
Inputs: period (required), symbol (required), category (required), limit.
get_open_interestB
Get open interest data for futures contracts. Public endpoint (no auth required).
Inputs: symbol (required), category (required), intervalTime (required), limit, +3 more.
get_open_ordersC
Get active/open orders. Auth required.
Inputs: limit, cursor, symbol, orderId, +6 more.
get_orderbookA
Get order book depth for a trading pair. Public endpoint (no auth required).
Inputs: symbol (required), category (required), limit.
get_order_historyB
Get historical orders (filled, cancelled, etc.) from the last 30 days. Auth required.
Inputs: limit, cursor, symbol, endTime, +7 more.
get_positionsB
Get current open positions for futures/options. Shows size, entry price, unrealized PnL, leverage, and liquidation price. Auth required.
Inputs: limit, cursor, symbol, baseCoin, +2 more.
get_recent_tradesA
Get recent public trades for a trading pair. Public endpoint (no auth required).
Inputs: category (required), limit, symbol, baseCoin, +1 more.
get_risk_limitA
Get risk limit tiers for futures trading. Public endpoint (no auth required).
Inputs: category (required), symbol.
get_server_timeA
Get Bybit server time. Public endpoint (no auth required).
Inputs: no named parameters.
get_tickersA
Get current ticker prices for one or all trading pairs. Shows last price, 24h change, volume, funding rate, and bid/ask. Public endpoint (no auth required).
Inputs: category (required), symbol, expDate, baseCoin.
get_trade_historyC
Get filled trades history. Auth required.
Inputs: limit, cursor, symbol, endTime, +6 more.
get_transaction_logA
Get transaction history (deposits, withdrawals, trades, etc.). Auth required.
Inputs: type, limit, cursor, endTime, +5 more.
get_wallet_balanceA
Get wallet balance for all or specific coins. Auth required.
Inputs: coin, accountType.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
The public market-data tools (klines, tickers, orderbook, funding, OI, etc.) are clearly distinct, but several auth-only history tools overlap heavily: get_execution_list ('trade/execution history'), get_trade_history ('filled trades history'), and get_order_history are easy to confuse, and get_transaction_log also mentions trades. Descriptions help somewhat but boundaries between execution, trade, and transaction history remain fuzzy.
Every one of the 26 tools follows the same get_noun pattern (get_klines, get_orderbook, get_wallet_balance, get_order_history). The convention is uniform and highly predictable, reflecting the uniformly read-only nature of the surface.
At 26 tools the set is on the heavy side, though a broad exchange API naturally spans many data endpoints. It's borderline: many tools are thin single-endpoint wrappers, and a few overlapping history tools could be consolidated rather than each earning a distinct slot.
The surface is entirely read-only: there is no place_order, cancel_order, amend_order, or any position/withdrawal management, so the core trading lifecycle implied by a 'Bybit' server is absent. Data reading is well covered, but an agent cannot actually trade, creating a hard dead end for the primary use case.
Maintenance
Related MCP Connectors
Read-only crypto, equities, FX and commodities market data. No trading tools. API key required.
Read-only access to your MetaTrader 4 and 5 accounts for AI agents: balances, open positions, trade history with win rate, live quotes, symbol specs and candles. It cannot place, modify or close orders.
Free crypto-futures paper trading and live market data for AI agents. 31 tools; no key for data.
Read-only market charts, OHLC, backtests and a view of your connected broker accounts
Related MCP Servers
- AlicenseAqualityDmaintenanceExposes a Bitvavo crypto exchange account as read-only tools for Claude, allowing portfolio queries, trade history, and market data without enabling trading.1419 npm1MIT
- AlicenseCqualityDmaintenanceEnables LLMs to interact with Bybit V5 API for market data, trading, account management, and position tracking.9MIT

PredMCPofficial
AlicenseNot gradedqualityDmaintenanceSafe, read-only market data for AI trading agents, offering 44 tools to query prediction markets, perpetuals, and cross-venue signals without the ability to execute trades.1MIT- AlicenseNot gradedqualityCmaintenanceEnables read-only access to Hyperliquid's public market, user, vault, and staking data via 61 MCP tools, covering perpetuals, spot, and borrow-lend information.MIT