bybit-mcp-server
0
The Bybit MCP Server is a quick implementation of the FastMCP server designed for integration with the Bybit exchange API. It supports comprehensive trading features including spot, futures, and options trading, along with real-time market data streaming.
Bybit MCP Server
A FastMCP server implementation for integrating with the Bybit exchange API.
Features
- Full V5 API support
- Unified account trading
- Support for spot, futures, and options trading
- Real-time market data streaming
- Position management
- Order management
- Asset management
System Requirements
- Node.js 16.x or higher
- npm 7.x or higher (or yarn/pnpm)
Installation
Windows
- Install Node.js from official website
- Open PowerShell or Command Prompt
- Install the package:
npm install bybit-mcp
macOS/Linux
- Using nvm (recommended):
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Install Node.js
nvm install 16
nvm use 16
# Install the package
npm install bybit-mcp
- Or using package manager:
For macOS (using Homebrew):
brew install node
npm install bybit-mcp
For Linux (using apt):
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install bybit-mcp
Configuration
Environment Variables
Create a .env
file in your project root:
BYBIT_API_KEY=your_api_key
BYBIT_API_SECRET=your_api_secret
BYBIT_TESTNET=true/false
Windows Specific
You can also set environment variables through System Properties:
- Open System Properties > Advanced > Environment Variables
- Add new System Variables with the above keys and values
macOS/Linux Specific
Add to your shell profile (~/.bash_profile, ~/.zshrc, etc.):
export BYBIT_API_KEY=your_api_key
export BYBIT_API_SECRET=your_api_secret
export BYBIT_TESTNET=true/false
Usage
import { startServer } from 'bybit-mcp';
startServer();
Development Setup
Windows
git clone https://github.com/your-username/bybit-mcp-server.git
cd bybit-mcp-server
npm install
npm run dev
macOS/Linux
git clone https://github.com/your-username/bybit-mcp-server.git
cd bybit-mcp-server
npm install
npm run dev
Documentation
For detailed API documentation, please refer to the Bybit API docs.