npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bybit-mcp-server

v1.0.1

Published

MCP server for Bybit trading API access

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 Cursor

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

  • get_account_info - Get account information and balances
  • get_wallet_balance - Get wallet balance for specific account type
  • get_open_orders - Get list of open/active orders
  • get_order_history - Get historical orders

Trading (⚠️ Can use real funds on mainnet)

  • place_order - Place a new order
  • cancel_order - Cancel an existing order
  • cancel_all_orders - Cancel all orders for a symbol or category

Usage Examples

Ask your AI assistant to:

  • "Get the current price of BTCUSDT on Bybit"
  • "Show me the order book for ETHUSDT with 50 levels"
  • "Get my account balance"
  • "Place a limit buy order for 0.1 BTC at $45000"
  • "Cancel all my open orders for BTCUSDT"
  • "Get my trading history for the last 20 orders"

Security

⚠️ Important Security Notes:

  • TESTNET is the default and recommended environment for safety
  • MAINNET operations use real funds - use with extreme caution
  • API keys are automatically redacted from error messages
  • Always test thoroughly on testnet before using mainnet
  • Trading operations will display warnings when using mainnet

🔐 API Key Safety:

  • Never commit API keys to version control
  • Use environment variables for credentials
  • Regularly rotate your API keys
  • Use IP restrictions in Bybit API settings

Development

npm run build     # Compile TypeScript
npm run dev       # Development mode
npm run lint      # Run linting
npm run typecheck # Type checking
npm run watch     # Watch mode

Local Development

  1. Clone the repository:
git clone https://github.com/your-username/bybit-mcp-server.git
cd bybit-mcp-server
  1. Install dependencies:
npm install
  1. Set up environment:
cp .env.example .env
# Edit .env with your API credentials
  1. Run in development mode:
npm run dev

Configuration Options

| Variable | Description | Default | Required | |----------|-------------|---------|----------| | BYBIT_API_KEY | Your Bybit API key | - | ✅ | | BYBIT_API_SECRET | Your Bybit API secret | - | ✅ | | BYBIT_ENVIRONMENT | testnet or mainnet | testnet | ❌ | | BYBIT_BASE_URL | Custom API base URL | Auto-detected | ❌ | | DEBUG | Enable debug logging | false | ❌ |

API Reference

This server implements Bybit's V5 API endpoints. For detailed API documentation:

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE file for details.

Support