This MCP server provides read-only access to Bybit's cryptocurrency exchange API through the Model Context Protocol (MCP). It allows AI models to retrieve real-time cryptocurrency data including prices, orderbooks, and market information from Bybit's exchange.
To install and run the Bybit MCP server, you'll need:
npm i -g pnpm
pnpm i
cp .env.example .env
.env
file with your Bybit API credentials:BYBIT_API_KEY=your-api-key
BYBIT_API_SECRET=your-api-secret
BYBIT_USE_TESTNET=false
DEBUG=false
Important: Only ever use a read-only API key with this server for security!
To run just the MCP server:
pnpm serve
To run both the MCP server and the included Ollama client:
(cd client && pnpm i)
cp client/.env.example client/.env
.env
file:OLLAMA_HOST=http://localhost:11434
DEFAULT_MODEL=llama-3.2-11b-instruct:Q8_0
pnpm start
To use with Claude Desktop, add this server to your configuration file at ~/Library/Application\ Support/Claude/claude_desktop_config.json
:
{
"mcpServers": {
"bybit": {
"command": "node",
"args": ["/path/to/bybit-mcp/build/index.js"],
"env": {
"BYBIT_API_KEY": "your-api-key",
"BYBIT_API_SECRET": "your-api-secret",
"BYBIT_USE_TESTNET": "false"
}
}
}
}
To use with gomcp, add this to ~/.config/gomcp/config.yaml
:
mcp_servers:
- name: "bybit"
command: "cd /path/to/bybit-mcp && pnpm run serve"
arguments: []
env:
BYBIT_API_KEY: "" # Add your Bybit API READ ONLY key
BYBIT_API_SECRET: "" # Add your Bybit API READ ONLY secret
BYBIT_USE_TESTNET: "true" # Set to false for production
DEBUG: "false" # Optional: Set to true for debug logging
Retrieves real-time price information for a trading pair:
{
"name": "get_ticker",
"arguments": {
"symbol": "BTCUSDT",
"category": "spot"
}
}
Retrieves market depth information:
{
"name": "get_orderbook",
"arguments": {
"symbol": "BTCUSDT",
"category": "spot",
"limit": 25
}
}
Retrieves historical price data:
{
"name": "get_kline",
"arguments": {
"symbol": "BTCUSDT",
"category": "spot",
"interval": "1",
"limit": 200
}
}
Retrieves detailed market data:
{
"name": "get_market_info",
"arguments": {
"category": "spot",
"symbol": "BTCUSDT",
"limit": 200
}
}
Retrieves recent execution data:
{
"name": "get_trades",
"arguments": {
"symbol": "BTCUSDT",
"category": "spot",
"limit": 200
}
}
Retrieves detailed trading pair specifications:
{
"name": "get_instrument_info",
"arguments": {
"symbol": "BTCUSDT",
"category": "spot"
}
}
Retrieves account balance information:
{
"name": "get_wallet_balance",
"arguments": {
"accountType": "UNIFIED",
"coin": "BTC"
}
}
Retrieves current positions (for futures trading):
{
"name": "get_positions",
"arguments": {
"category": "linear",
"symbol": "BTCUSDT",
"limit": 200
}
}
Retrieves historical order information:
{
"name": "get_order_history",
"arguments": {
"category": "spot",
"symbol": "BTCUSDT",
"limit": 200
}
}
spot
: Spot trading pairslinear
: Linear perpetual contracts (quoted in USDT/USDC)inverse
: Inverse perpetual contracts (quoted in the cryptocurrency)There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.