The Bybit MCP Server provides read-only access to Bybit's cryptocurrency exchange API, enabling programmatic interaction with trading data and account management.
- Access Market Data: Get real-time ticker information, orderbook data, kline/candlestick data, market information, and recent trades for trading pairs
- Retrieve Instrument Details: Obtain detailed information about trading pairs, including base/quote currencies and trading parameters
- Manage User Data: Access wallet balances, current positions, and order history (requires authentication)
- Multiple Trading Categories: Supports spot, linear, and inverse trading
- Interactive Tools: Includes CLI for Ollama LLM interaction and direct access to trading functions
- Customizable: Configure server and client through environment variables
Provides integration with Ollama's LLM server, allowing interactive chat with Ollama models while using the Bybit tools to access cryptocurrency data.
Bybit MCP Server
A Model Context Protocol (MCP) server that provides read-only access to Bybit's cryptocurrency exchange API.
THIS IS ALPHA QUALITY SOFTWARE - USE AT YOUR OWN RISK!
Only ever use a read-only API key with this server. I wouldn't trust my code with your "money" and neither should you!
Features
This MCP server provides the following tools for interacting with Bybit's API:
get_ticker
: Get real-time ticker information for a trading pairget_orderbook
: Get orderbook (market depth) data for a trading pairget_kline
: Get kline/candlestick data for a trading pairget_market_info
: Get detailed market information for trading pairsget_trades
: Get recent trades for a trading pairget_instrument_info
: Get detailed instrument information for a specific trading pairget_wallet_balance
: Get wallet balance information for the authenticated userget_positions
: Get current positions information for the authenticated userget_order_history
: Get order history for the authenticated userget_ml_rsi
: Get machine learning-based RSI (Relative Strength Index) for a trading pairget_market_structure
: Get market structure information for a trading pairget_order_blocks
: Detect institutional order accumulation zonesget_order_history
: Get order history for the authenticated userget_orderbook
: Get orderbook (market depth) data for a trading pairget_ticker
: Get real-time ticker information for a trading pair
There is also a highly experimental WebUI, see WebUI README for details.
All code is subject to breaking changes and feature additions / removals as I continue to develop this project.
Requirements & Installation
- Node.js (v22+)
- pnpm (
npm i -g pnpm
) - If you want to run the Ollama client as shown in the quick start below, you'll need Ollama installed and running, as well as your model of choice.
Quick Start
To install packages build everything and start the interactive client:
Copy the .env.example file to .env and fill in your details.
MCP-Server (Only)
Stdio Transport (Default)
HTTP/SSE Transport
The HTTP server runs on port 8080 by default and provides both modern Streamable HTTP and legacy SSE transports, making it compatible with web applications and various MCP clients. See HTTP Server Documentation for detailed information.
MCP-Server and Ollama client
Install required client packages:
Copy the client .env.example file to .env and fill in your details.
Then to start the client and server in one command:
Configuration
Environment Variables
The server requires Bybit API credentials to be set as environment variables:
BYBIT_API_KEY
: Your Bybit API key (required)BYBIT_API_SECRET
: Your Bybit API secret (required) - IMPORTANT - Only ever create a read-only API key!BYBIT_USE_TESTNET
: Set to "true" to use testnet instead of mainnet (optional, defaults to false)DEBUG
: Set to "true" to enable debug logging (optional, defaults to false)
Client environment variables (./client/.env):
OLLAMA_HOST
: The host of the Ollama server (defaults to http://localhost:11434)DEFAULT_MODEL
: The default model to use for chat (defaults to qwen3-30b-a3b-ud-nothink-128k:q4_k_xl)
MCP Settings Configuration
To use this server with MCP clients, you need to add it to your MCP settings configuration file. The file location depends on your client:
MCP Example - Claude Desktop
Location: ~/Library/Application\ Support/Claude/claude_desktop_config.json
MCP Example - gomcp
Location: ~/.config/gomcp/config.yaml
Client Integration
This package includes a TypeScript client that provides a command-line interface for interacting with both Ollama LLMs and the bybit-mcp server. The client supports:
- Interactive chat with Ollama models
- Direct access to all bybit-mcp trading tools
- Automatic server management
- Environment-based configuration
- Debug logging
For detailed client documentation, see the client README.
Running the Server
Production
- Build the server:
- Run the server:
Development
For development with automatic TypeScript recompilation:
To inspect the MCP server during development:
Tool Documentation
Get Ticker Information
Get Orderbook Data
Get Kline/Candlestick Data
Get Market Information
Get Recent Trades
Get Instrument Information
Returns detailed information about a trading instrument including:
- Base and quote currencies
- Trading status
- Lot size filters (min/max order quantities)
- Price filters (tick size)
- Leverage settings (for futures)
- Contract details (for futures)
Get Wallet Balance
Get Positions
Get Order History
Supported Categories
spot
: Spot tradinglinear
: Linear perpetual contractsinverse
: Inverse perpetual contracts
License
MIT
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
A 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.
- Features
- Requirements & Installation
- Quick Start
- Configuration
- Client Integration
- Running the Server
- Tool Documentation
- Supported Categories
- License
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that provides access to CoinMarketCap's cryptocurrency data, enabling AI applications to retrieve cryptocurrency listings, quotes, and detailed information.Last updated -310Python
- -securityAlicense-qualityA Model Context Protocol server that exposes Binance cryptocurrency exchange data to LLMs, allowing agents to access real-time prices, order books, and historical market data without requiring API keys.Last updated -4PythonMIT License
- -security-license-qualityA server that provides real-time cryptocurrency data through the Model Context Protocol, allowing access to detailed exchange information and current cryptocurrency rates from the CoinCap API.Last updated -1TypeScriptMIT License
Satstream MCP Serverofficial
AsecurityAlicenseAqualityA Model Context Protocol server that enables querying Bitcoin blockchain data, including address information, transaction details, mempool statistics, and ordinals/runes data through the Satstream API.Last updated -37TypeScriptMIT License