EB

ethancod1ng/bybit-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

13 stars 8 forks 质量 59 趋势 20

A Model Context Protocol (MCP) server for integrating AI assistants with Bybit cryptocurrency exchange APIs, enabling automated trading, market data access, and account management.

概览

A Model Context Protocol (MCP) server for Bybit exchange, enabling AI coding tools like Claude Code and Cursor to interact with Bybit's trading platform. This MCP server can be used with various AI tools that support MCP: Use the same configuration as Claude Code above, but add to .cursor/mcp_config.json with mcp.servers instead of mcpServers. 1. Visit Bybit Testnet 2. Register an account 3. Go to API Management and create API keys 4. Enable required permissions (read, trade) 1. Visit Bybit 2. Complete account verification 3. Go to API Management and create API keys 4. Enable required permissions (read, trade) 5.

README

以下为原文 README 节选,完整内容请查看原文。

Bybit MCP Server

Multi-language Documentation

A Model Context Protocol (MCP) server for Bybit exchange, enabling AI coding tools like Claude Code and Cursor to interact with Bybit’s trading platform.

Quick Start

Installation

npm install -g bybit-mcp-server

Configuration

This MCP server can be used with various AI tools that support MCP:

Claude Code Configuration

For Testnet (Recommended - Safe for testing): Add to claude_desktop_config.json:

{
  "mcpServers": {
    "bybit": {
      "command": "npx",
      "args": ["bybit-mcp-server"],
      "env": {
        "BYBIT_API_KEY": "your_testnet_api_key",
        "BYBIT_API_SECRET": "your_testnet_api_secret",
        "BYBIT_ENVIRONMENT": "testnet"
      }
    }
  }
}

For Mainnet (⚠️ WARNING: Uses real funds): Add to claude_desktop_config.json:

{
  "mcpServers": {
    "bybit": {
      "command": "npx",
      "args": ["bybit-mcp-server"],
      "env": {
        "BYBIT_API_KEY": "your_mainnet_api_key",
        "BYBIT_API_SECRET": "your_mainnet_api_secret",
        "BYBIT_ENVIRONMENT": "mainnet"
      }
    }
  }
}

Cursor Configuration

Use the same configuration as Claude Code above, but add to .cursor/mcp_config.json with mcp.servers instead of mcpServers.

Environment Setup

Option 1: Testnet (Recommended)

BYBIT_API_KEY=your_testnet_api_key_here
BYBIT_API_SECRET=your_testnet_api_secret_here
BYBIT_ENVIRONMENT=testnet
DEBUG=false

Option 2: Mainnet (⚠️ Real funds)

BYBIT_API_KEY=your_mainnet_api_key_here
BYBIT_API_SECRET=your_mainnet_api_secret_here
BYBIT_ENVIRONMENT=mainnet
DEBUG=false

Getting API Keys

For Testnet:

  1. Visit Bybit Testnet
  2. Register an account
  3. Go to API Management and create API keys
  4. Enable required permissions (read, trade)

For Mainnet:

  1. Visit Bybit
  2. Complete account verification
  3. Go to API Management and create API keys
  4. Enable required permissions (read, trade)
  5. Set IP restrictions for additional security

Available Tools

Market Data

  • get_price - Get current price for a trading symbol
  • get_orderbook - Get order book depth for a trading symbol
  • get_klines - Get historical candlestick data
  • get_24hr_ticker - Get 24-hour trading statistics

Account Management

在 GitHub 查看完整 README

安装

npx bybit-mcp-server
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "bybit": { "command": "npx", "args": ["bybit-mcp-server"], "env": { "BYBIT_API_KEY": "your_testnet_api_key", "BYBIT_API_SECRET": "your_testnet_api_secret", "BYBIT_ENVIRONMENT": "testnet" } } } }