Skip to main content
Glama

Bybit MCP 서버

Bybit의 암호화폐 거래소 API에 대한 읽기 전용 액세스를 제공하는 MCP(Model Context Protocol) 서버입니다.

이것은 알파 품질의 소프트웨어입니다. 사용 시 모든 위험은 사용자에게 있습니다!

이 서버에서는 읽기 전용 API 키만 사용하세요. 제 코드를 당신의 "돈"에 맡기지 않을 거고, 당신도 마찬가지일 겁니다!

지엑스피1

특징

이 MCP 서버는 Bybit API와 상호 작용하기 위한 다음과 같은 도구를 제공합니다.

  • get_ticker : 거래 쌍에 대한 실시간 티커 정보를 가져옵니다.

  • get_orderbook : 거래 쌍에 대한 주문장(시장 심도) 데이터를 가져옵니다.

  • get_kline : 거래 쌍에 대한 클라인/캔들스틱 데이터를 가져옵니다.

  • get_market_info : 거래 쌍에 대한 자세한 시장 정보를 얻습니다.

  • get_trades : 거래 쌍에 대한 최근 거래를 가져옵니다.

  • get_instrument_info : 특정 거래 쌍에 대한 자세한 악기 정보를 가져옵니다.

  • get_wallet_balance : 인증된 사용자의 지갑 잔액 정보를 가져옵니다.

  • get_positions : 인증된 사용자의 현재 위치 정보를 가져옵니다.

  • get_order_history : 인증된 사용자의 주문 내역을 가져옵니다.

Related MCP server: Coin MCP Server

요구 사항 및 설치

  1. Node.js(v20+)

  2. pnpm ( npm i -g pnpm )

  3. 아래 빠른 시작에 표시된 대로 Ollama 클라이언트를 실행하려면 Ollama가 설치되어 실행 중이어야 하며, 선택한 모델도 필요합니다.

pnpm i

빠른 시작

패키지를 설치하려면 모든 것을 빌드하고 대화형 클라이언트를 시작하세요.

pnpm i

.env.example 파일을 .env로 복사하고 세부 정보를 입력하세요.

cp .env.example .env code .env

MCP 서버(전용)

pnpm serve

MCP-서버 및 Ollama 클라이언트

필요한 클라이언트 패키지를 설치하세요:

(cd client && pnpm i)

클라이언트 .env.example 파일을 .env로 복사하고 세부 정보를 입력합니다.

cp client/.env.example client/.env code client/.env

그런 다음 한 명령으로 클라이언트와 서버를 시작합니다.

pnpm start

구성

환경 변수

서버에서는 Bybit API 자격 증명을 환경 변수로 설정해야 합니다.

  • BYBIT_API_KEY : Bybit API 키 (필수)

  • BYBIT_API_SECRET : Bybit API 비밀번호(필수) - 중요 - 읽기 전용 API 키만 생성하세요!

  • BYBIT_USE_TESTNET : 메인넷 대신 테스트넷을 사용하려면 "true"로 설정합니다(선택 사항, 기본값은 false)

  • DEBUG : 디버그 로깅을 활성화하려면 "true"로 설정합니다(선택 사항, 기본값은 false)

클라이언트 환경 변수(./client/.env):

  • OLLAMA_HOST : Ollama 서버의 호스트(기본값은 http://localhost:11434 )

  • DEFAULT_MODEL : 채팅에 사용할 기본 모델(기본값은 llama-3.2-11b-instruct:Q8_0)

MCP 설정 구성

이 서버를 MCP 클라이언트와 함께 사용하려면 MCP 설정 구성 파일에 추가해야 합니다. 파일 위치는 클라이언트에 따라 다릅니다.

MCP 예제 - Claude Desktop

위치: ~/Library/Application\ Support/Claude/claude_desktop_config.json

{ "mcpServers": { "bybit": { "command": "node", "args": ["/path/to/bybit-mcp/build/index.js"], "env": { "BYBIT_API_KEY": "your-api-key", "BYBIT_API_SECRET": "your-api-secret", "BYBIT_USE_TESTNET": "false" } } } }

MCP 예제 - gomcp

위치: ~/.config/gomcp/config.yaml

mcp_servers: - name: "bybit" command: "cd /path/to/bybit-mcp && pnpm run serve" arguments: [] env: BYBIT_API_KEY: "" # Add your Bybit API **READ ONLY** key here BYBIT_API_SECRET: "" # Add your Bybit API **READ ONLY** secret here BYBIT_USE_TESTNET: "true" # Set to false for production DEBUG: "false" # Optional: Set to true for debug logging

클라이언트 통합

이 패키지에는 Ollama LLM 및 bybit-mcp 서버와 상호 작용할 수 있는 명령줄 인터페이스를 제공하는 TypeScript 클라이언트가 포함되어 있습니다. 클라이언트는 다음을 지원합니다.

  • Ollama 모델과의 대화형 채팅

  • 모든 bybit-mcp 거래 도구에 직접 액세스

  • 자동 서버 관리

  • 환경 기반 구성

  • 디버그 로깅

자세한 클라이언트 설명서는 클라이언트 README를 참조하세요.

서버 실행

생산

  1. 서버를 빌드하세요:

pnpm build
  1. 서버를 실행합니다:

node build/index.js

개발

자동 TypeScript 재컴파일을 사용한 개발의 경우:

pnpm watch

개발 중에 MCP 서버를 검사하려면:

pnpm inspector

도구 문서

티커 정보 받기

{ "name": "get_ticker", "arguments": { "symbol": "BTCUSDT", "category": "spot" // optional, defaults to "spot" } }

주문서 데이터 가져오기

{ "name": "get_orderbook", "arguments": { "symbol": "BTCUSDT", "category": "spot", // optional, defaults to "spot" "limit": 25 // optional, defaults to 25 (available: 1, 25, 50, 100, 200) } }

클라인/캔들스틱 데이터 가져오기

{ "name": "get_kline", "arguments": { "symbol": "BTCUSDT", "category": "spot", // optional, defaults to "spot" "interval": "1", // optional, defaults to "1" (available: "1", "3", "5", "15", "30", "60", "120", "240", "360", "720", "D", "M", "W") "limit": 200 // optional, defaults to 200 (max 1000) } }

시장 정보 얻기

{ "name": "get_market_info", "arguments": { "category": "spot", // optional, defaults to "spot" "symbol": "BTCUSDT", // optional, if not provided returns info for all symbols in the category "limit": 200 // optional, defaults to 200 (max 1000) } }

최근 거래 가져오기

{ "name": "get_trades", "arguments": { "symbol": "BTCUSDT", "category": "spot", // optional, defaults to "spot" "limit": 200 // optional, defaults to 200 (max 1000) } }

악기 정보 얻기

{ "name": "get_instrument_info", "arguments": { "symbol": "BTCUSDT", // required "category": "spot" // optional, defaults to "spot" } }

다음을 포함하여 거래 수단에 대한 자세한 정보를 반환합니다.

  • 기준 통화 및 인용 통화

  • 거래 상태

  • 로트 크기 필터(최소/최대 주문 수량)

  • 가격 필터(틱 크기)

  • 레버리지 설정(선물용)

  • 계약 세부 사항(선물용)

지갑 잔액 받기

{ "name": "get_wallet_balance", "arguments": { "accountType": "UNIFIED", // required (available: "UNIFIED", "CONTRACT", "SPOT") "coin": "BTC" // optional, if not provided returns all coins } }

위치 가져오기

{ "name": "get_positions", "arguments": { "category": "linear", // required (available: "linear", "inverse") "symbol": "BTCUSDT", // optional "baseCoin": "BTC", // optional "settleCoin": "USDT", // optional "limit": 200 // optional, defaults to 200 } }

주문 내역 가져오기

{ "name": "get_order_history", "arguments": { "category": "spot", // required (available: "spot", "linear", "inverse") "symbol": "BTCUSDT", // optional "baseCoin": "BTC", // optional "orderId": "1234567890", // optional "orderLinkId": "myCustomId", // optional "orderStatus": "Filled", // optional (available: "Created", "New", "Rejected", "PartiallyFilled", "PartiallyFilledCanceled", "Filled", "Cancelled", "Untriggered", "Triggered", "Deactivated") "orderFilter": "Order", // optional (available: "Order", "StopOrder") "limit": 200 // optional, defaults to 200 } }

지원되는 카테고리

  • spot : 현물 거래

  • linear : 선형 영구 계약

  • inverse : 역 무기한 계약

특허

MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sammcj/bybit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server