BB

bcusack/bybit-py-mcp

开发工具

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

6 stars 3 forks 质量 58 趋势 14

A comprehensive Model Context Protocol (MCP) server that provides full access to Bybit's v5 API. This server enables AI assistants to fetch real-time market data, execute trading operations, manage...

概览

A comprehensive Model Context Protocol (MCP) server that provides full access to Bybit's v5 API. This server enables AI assistants to fetch real-time market data, execute trading operations, manage positions, and access account information from the Bybit cryptocurrency exchange. ✅ - All endpoints tested and working ✅ - Published image available at falconiun/bybit-mcp ✅ - Ready-to-use configurations provided ✅ - Market data, trading, positions, and account management - : Get current Bybit server time - : Retrieve ticker information for trading symbols - : Get order book depth for any symbol - : Access recent trade history - : Get OHLCV candlestick data - : Get mark price historical data - : Get index price historical data - : Get premium index price data - : Get detailed trading instrument information - : Access historical funding rates - : Get open interest statistics - : Retrieve risk limit information - : Get insurance fund data - : Access long/short ratio statistics - :...

README

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

Bybit MCP Server

⚠️ TRADING WARNING ⚠️
This MCP server can execute REAL TRADING OPERATIONS on Bybit when BYBIT_TRADING_ENABLED=true.
Trading operations use REAL MONEY and can result in FINANCIAL LOSSES.
Always test on testnet first (BYBIT_TESTNET=true) and understand the risks before enabling trading.
Trading is DISABLED by default for safety.

A comprehensive Model Context Protocol (MCP) server that provides full access to Bybit’s v5 API. This server enables AI assistants to fetch real-time market data, execute trading operations, manage positions, and access account information from the Bybit cryptocurrency exchange.

🚀 Production Ready

✅ Fully Tested - All endpoints tested and working
✅ Docker Support - Published image available at falconiun/bybit-mcp
✅ VS Code Integration - Ready-to-use configurations provided
✅ Comprehensive API Coverage - Market data, trading, positions, and account management

Features

Core Market Data

  • Server Time: Get current Bybit server time
  • Tickers: Retrieve ticker information for trading symbols
  • Order Book: Get order book depth for any symbol
  • Recent Trades: Access recent trade history

Kline/Candlestick Data

  • Standard Klines: Get OHLCV candlestick data
  • Mark Price Klines: Get mark price historical data
  • Index Price Klines: Get index price historical data
  • Premium Index Klines: Get premium index price data

Trading Information

  • Instruments Info: Get detailed trading instrument information
  • Funding Rate History: Access historical funding rates
  • Open Interest: Get open interest statistics
  • Risk Limits: Retrieve risk limit information

Market Statistics

  • Insurance Fund: Get insurance fund data
  • Long/Short Ratio: Access long/short ratio statistics

Trading Operations (Requires BYBIT_TRADING_ENABLED=true)

  • Order Management: Place, amend, and cancel orders with full control
  • Advanced Order Types: Support for Market, Limit, and conditional/trigger orders
  • Batch Operations: Execute multiple orders in a single request for efficiency
  • Order History: View comprehensive open/closed orders and trade history
  • Real-time Execution: Get immediate feedback on order status and fills
  • Trigger Orders: Conditional orders with price triggers and advanced stop/take profit logic

Position Management (Requires BYBIT_TRADING_ENABLED=true)

  • Position Info: Query real-time position data with detailed metrics
  • Leverage Control: Set and modify position leverage dynamically
  • Margin Management: Switch between cross/isolated margin modes
  • Trading Stops: Set take profit, stop loss, and trailing stops
  • Auto Add Margin: Configure automatic margin addition
  • Position Modes: Switch between one-way and hedge position modes
  • P&L Tracking: Access closed profit and loss records

Account & Wallet Management

在 GitHub 查看完整 README

安装

docker run -i --rm --init -e BYBIT_API_KEY=your_api_key_here -e BYBIT_API_SECRET=your_api_secret_here -e BYBIT_TESTNET=false -e BYBIT_TRADING_ENABLED=false falconiun/bybit-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "bybit-mcp": { "command": "docker", "args": [ "run", "-i", "--rm", "--init", "-e", "BYBIT_API_KEY=your_api_key_here", "-e", "BYBIT_API_SECRET=your_api_secret_here", "-e", "BYBIT_TESTNET=false", "-e", "BYBIT_TRADING_ENABLED=false", "falconiun/bybit-mcp" ] } } }