bybit-mcp-server
A Model Context Protocol server for the Bybit V5 API.
Connect AI assistants (Claude, Cursor, etc.) to Bybit for market data, trading, and account management — locally via stdio or remotely via HTTP with OAuth authentication.
Quick Start
Local (stdio)
uvx bybit-mcp-server
Remote (Docker)
docker pull ghcr.io/workspace/bybit-mcp-server:latest
docker run -p 8000:8000 \
-e BYBIT_MCP_ADMIN_PASSWORD=your-password \
-e BYBIT_MCP_SECRET_KEY=$(python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())") \
-e BYBIT_MCP_ISSUER_URL=https://your-server.example.com \
-v bybit-data:/app/data \
ghcr.io/workspace/bybit-mcp-server:latest
Transport Modes
| Mode | Transport | Auth | Credentials | Use Case |
|---|---|---|---|---|
| Local | stdio |
None | Env vars | Claude Desktop, Cursor |
| Remote | streamable-http |
OAuth 2.0 | Web settings page | Claude Custom Connectors, shared servers |
MCP Client Configuration
Claude Desktop (Local)
Add to claude_desktop_config.json:
{
"mcpServers": {
"bybit": {
"command": "uvx",
"args": ["bybit-mcp-server"],
"env": {
"BYBIT_API_KEY": "your-api-key",
"BYBIT_API_SECRET": "your-api-secret",
"BYBIT_TESTNET": "true"
}
}
}
}
Claude Custom Connectors (Remote)
- Deploy the server with Docker (see Deployment)
- In Claude settings, add a Custom Connector:
- URL:
https://your-server.example.com
- URL:
- Claude handles OAuth automatically — you'll be prompted to log in with admin credentials
- After connecting, visit
https://your-server.example.com/settingsto enter your Bybit API keys
Cursor (Local)
Add to .cursor/mcp.json:
{
"mcpServers": {
"bybit": {
"command": "uvx",
"args": ["bybit-mcp-server"],
"env": {
"BYBIT_API_KEY": "your-api-key",
"BYBIT_API_SECRET": "your-api-secret",
"BYBIT_TESTNET": "true"
}
}
}
}
Available Tools (27)
| Category | Tools | Permission |
|---|---|---|
| Market | get_tickers, get_kline, get_orderbook, get_instruments_info, get_server_time, get_funding_rate_history, get_public_trades, get_open_interest |
read |
| Account | get_wallet_balance, get_fee_rate, get_account_info |
read |
| Trade | place_order, amend_order, cancel_order, cancel_all_orders, get_open_orders, get_order_history, get_trade_history |
trade |
| Position | get_positions, set_leverage, set_trading_stop, set_auto_add_margin, get_closed_pnl |
read / trade |
| Asset | get_coin_balance, get_coin_info, get_transfer_history, internal_transfer |
read / full |
Deployment
Docker Compose
services:
bybit-mcp:
image: ghcr.io/workspace/bybit-mcp-server:latest
ports:
- "8000:8000"
environment:
- BYBIT_MCP_ADMIN_PASSWORD=your-secure-password
- BYBIT_MCP_SECRET_KEY=your-fernet-key
- BYBIT_MCP_ISSUER_URL=https://your-server.example.com
volumes:
- bybit-data:/app/data
restart: unless-stopped
volumes:
bybit-data:
Generate a Fernet key:
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
Environment Variables
Local Mode (stdio)
| Variable | Default | Description |
|---|---|---|
BYBIT_API_KEY |
— | API key from Bybit |
BYBIT_API_SECRET |
— | API secret from Bybit |
BYBIT_TESTNET |
true |
Use testnet (true) or mainnet (false) |
BYBIT_MODE |
read |
Permission mode: read, trade, or full |
BYBIT_RECV_WINDOW |
— | Request receive window in ms |
Remote Mode (streamable-http)
| Variable | Default | Description |
|---|---|---|
BYBIT_MCP_TRANSPORT |
stdio |
Set to streamable-http for remote mode |
BYBIT_MCP_HOST |
0.0.0.0 |
HTTP bind address |
BYBIT_MCP_PORT |
8000 |
HTTP port |
BYBIT_MCP_ADMIN_USERNAME |
admin |
Admin login username |
BYBIT_MCP_ADMIN_PASSWORD |
— | Admin login password (required) |
BYBIT_MCP_SECRET_KEY |
— | Fernet key for encrypting API keys at rest (required) |
BYBIT_MCP_ISSUER_URL |
— | Public URL with scheme, e.g. https://bybit.example.com (required) |
BYBIT_MCP_DB_PATH |
./bybit_mcp.db |
SQLite database file path |
Development
git clone https://github.com/workspace/bybit-mcp-server.git
cd bybit-mcp-server
uv sync --all-extras
uv run pytest
uv run bybit-mcp-server
Documentation
Full docs at workspace.github.io/bybit-mcp-server
License
MIT
Metadata
Release files for bybit-mcp-server 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bybit_mcp_server-0.4.0.tar.gz | 234.8 kB | Without provenance | Details for bybit_mcp_server-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bybit_mcp_server-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for bybit_mcp_server-0.4.0-py3-none-any.whl |
Total release size: 259.9 kB
Release files / bybit_mcp_server-0.4.0.tar.gz
| Download URL | bybit_mcp_server-0.4.0.tar.gz |
|---|---|
| Size | 234.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2f72697e3e07bca82457a12c3aec4f4978913fec146ad6677a7749823f9303e
|
|
BLAKE2b-256 checksum How to use checksums |
71aa1c102ba1ec6adaf51efedbcc6399ff8ec8e8c27b347bb8a6fa5d66099b2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / bybit_mcp_server-0.4.0-py3-none-any.whl
| Download URL | bybit_mcp_server-0.4.0-py3-none-any.whl |
|---|---|
| Size | 25.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c492617da92e1bd4243ae9335144da82d10e61accb03fff6f889a25f39d5f6c
|
|
BLAKE2b-256 checksum How to use checksums |
a15d7aa0e4fe7d31b4b045774c6ae31aebc4b723087f81e26167d446d28fc9a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for bybit-mcp-server 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.