Cover image
Try Now
2025-04-11

3 years

Works with Finder

1

Github Watches

0

Github Forks

2

Github Stars

MCP Bybit API Interface

smithery badge Buy Me A Coffee

Bybit MCP (Model Context Protocol) Server. Provides a convenient interface to interact with the Bybit API using MCP tools. Allows fetching market data, managing account information, and placing/canceling orders via API calls wrapped as tools.

Usage

Installing via Smithery

To install this Bybit API Interface server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @dlwjdtn535/mcp-bybit-server --client claude

Using with Claude, Roo Code, Cline, etc.

Add the following configuration to your MCP settings file (e.g., mcp_settings.json): Using uv With Windows:

{
  "mcpServers": {
    "mcp-server-demo": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Programs\\mcp-server-demo\\src",
        "server.py"
      ],
      "env": {
          "ACCESS_KEY": "{ACCESS_KEY}",
          "SECRET_KEY": "{ACCESS_KEY}"
        }
    }
    // ... other servers might be here ...
  }
}

(Remember to replace YOUR_USERNAME and use double backslashes \)

Using uv With macOS:

{
  "mcpServers": {
    "mcp-server-demo": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/usr/local/bin/mcp-server-demo/src",
        "server.py"
      ],
      "env": {
        "ACCESS_KEY": "{ACCESS_KEY}",
        "SECRET_KEY": "{ACCESS_KEY}"
      }
    }
    // ... other servers might be here ...
  }
}

(Replace YOUR_USERNAME if using ~/bin)

Using uv With Linux:

{
  "mcpServers": {
    "mcp-server-demo": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/home/YOUR_USERNAME/bin/mcp-server-demo/src",
        "server.py"
      ],
      "env": {
        "ACCESS_KEY": "{ACCESS_KEY}",
        "SECRET_KEY": "{ACCESS_KEY}"
      }
    }
    // ... other servers might be here ...
  }
}

Using Docker (Requires Docker)

Make sure you have pulled the image first: docker pull dlwjdtn535/mcp-bybit-server:latest

{
  "mcpServers": {
    "bybit-server-docker": {
      "command": "docker",
      "args": [
        "run",
        "-i", 
        "--rm",
        "--init",
        "-e", "ACCESS_KEY={ACCESS_KEY}",
        "-e", "SECRET_KEY={SECRET_KEY}",
        "dlwjdtn535/mcp-bybit-server:latest"
      ]
    }
  }
}

Note: Always use @latest or a specific version tag for both NPX and Docker to ensure you are using the intended version.

Tools 🛠️

This MCP server provides the following tools for interacting with the Bybit API:

  1. get_orderbook: Fetches order book information.
    • Inputs: category, symbol, limit (optional)
    • Returns: Order book details.
  2. get_kline: Fetches K-line (candlestick) data.
    • Inputs: category, symbol, interval, start (optional), end (optional), limit (optional)
    • Returns: Candlestick data.
  3. get_tickers: Fetches cryptocurrency ticker information.
    • Inputs: category, symbol
    • Returns: Ticker information.
  4. get_wallet_balance: Fetches account balance.
    • Inputs: accountType, coin (optional)
    • Returns: Balance information.
  5. get_positions: Fetches position information.
    • Inputs: category, symbol (optional)
    • Returns: Position information.
  6. place_order: Places a limit or market order.
    • Inputs: category, symbol, side, orderType, qty, price (optional for limit), positionIdx (optional for futures), and other optional parameters (e.g., timeInForce, takeProfit, stopLoss).
    • Returns: Order placement confirmation.
  7. cancel_order: Cancels an existing order.
    • Inputs: category, symbol, orderId (optional), orderLinkId (optional)
    • Returns: Cancellation confirmation.
  8. get_order_history: Fetches historical order details.
    • Inputs: category, symbol (optional), orderId (optional), limit (optional), etc.
    • Returns: Order history.
  9. get_open_orders: Fetches current open orders.
    • Inputs: category, symbol (optional), limit (optional), etc.
    • Returns: Open order details.
  10. set_trading_stop: Sets take profit, stop loss, or trailing stop for a position.
    • Inputs: category, symbol, takeProfit (optional), stopLoss (optional), trailingStop (optional), positionIdx (optional)
    • Returns: Setting confirmation.
  11. set_margin_mode: Sets the margin mode (isolated or cross).
    • Inputs: category, symbol, tradeMode, buyLeverage, sellLeverage
    • Returns: Setting confirmation.
  12. get_api_key_information: Fetches information about the current API key.
    • Inputs: None
    • Returns: API key details.
  13. get_instruments_info: Fetches details about trading instruments (symbols).
    • Inputs: category, symbol, status (optional), baseCoin (optional)
    • Returns: Instrument details.

(Refer to the function docstrings in the code for detailed parameter descriptions and examples.)

Environment Variables

Before running the server, you must set the following environment variables:

ACCESS_KEY=YOUR_BYBIT_API_KEY
SECRET_KEY=YOUR_BYBIT_SECRET_KEY
TESTNET=false # Optional: set to true for testnet

API Key Setup

To use this Bybit API interface, you need to create an API key from Bybit. Follow these important steps:

  1. Go to Bybit and log into your account.
  2. Navigate to API Management.
  3. Create a new API key.
  4. Important Security Settings:
    • Enable IP restriction if possible.
    • Add ONLY the IP address(es) from which the server will run (your local PC IP, server IP, or Docker container's external IP).
    • Never share your API keys or expose them in public repositories.
    • Recommended permissions:
      • Read (Required)
      • Trade (Required for order execution)
      • Wallet (Required for balance checking)

Sponsorship & Donations

If you find this project helpful and would like to support its development, you can contribute in the following ways:

Buy Me a Coffee

"Buy Me A Coffee"

Referral Program

You can also support this project by signing up for Bybit using our referral link:

Your support helps maintain and improve this project. Thank you! 🙏

Contact & Support

For additional inquiries or support, please contact:

We welcome your questions and feedback!

License

MIT License

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • 林乔安妮
  • A fashion stylist GPT offering outfit suggestions for various scenarios.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • pontusab
  • La communauté du curseur et de la planche à voile, recherchez des règles et des MCP

  • av
  • Exécutez sans effort LLM Backends, API, Frontends et Services avec une seule commande.

  • jae-jae
  • MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.

  • ravitemer
  • Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)

  • 1Panel-dev
  • 🔥 1Panel fournit une interface Web intuitive et un serveur MCP pour gérer des sites Web, des fichiers, des conteneurs, des bases de données et des LLM sur un serveur Linux.

  • patruff
  • Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle

  • Mintplex-Labs
  • L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.

  • GeyserMC
  • Une bibliothèque de communication avec un client / serveur Minecraft.

    Reviews

    5 (1)
    Avatar
    user_M9JMdNeV
    2025-04-17

    I have been using mcp-bybit-server by dlwjdtn535, and it is incredible! The integration is seamless, and the performance is top-notch. The documentation on the GitHub page is clear and helpful, making setup a breeze. It's a must-have for anyone needing a reliable server for Bybit API. Highly recommended!