MCP Server for Binance Spot Trading

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Provides comprehensive integration with Binance's spot and futures trading operations, including executing trades, monitoring account balances, managing orders, setting leverage, tracking funding rates, and supporting various position modes.

mcp-server-cex-bn

이 MCP 서버는 바이낸스의 현물 및 선물 거래 운영과 포괄적인 통합을 제공합니다.

중국어 설명

특징

현물 거래 운영

  • 현물 거래 작업 실행(LIMIT/MARKET 주문)
  • 계좌 잔액 모니터링
  • 미결 주문을 추적하고 관리하세요
  • 기존 주문 취소

선물 거래 운영

  • 다양한 유형의 선물 주문을 생성합니다(LIMIT, MARKET, STOP, TAKE_PROFIT 등)
  • 레버리지 설정 관리(1~125배)
  • 선물 포지션 및 계좌 정보 모니터링
  • 자금 조달 비율 추적
  • 일방향 및 헤지 모드 포지션 모두 지원
  • 트레일링 스톱 및 리듀스 온리 주문을 포함한 고급 주문 유형

도구

API 구성

configure_api_keys

Binance API 자격 증명을 안전하게 저장하세요.

지엑스피1

현물 거래 도구

create_spot_order

LIMIT 또는 MARKET 주문을 생성합니다.

// LIMIT order await createSpotOrder({ symbol: 'BTCUSDT', side: 'BUY', type: 'LIMIT', quantity: '0.001', price: '40000' }); // MARKET order await createSpotOrder({ symbol: 'BTCUSDT', side: 'BUY', type: 'MARKET', quantity: '0.001' });
cancel_order

기존 주문 취소:

await cancelOrder({ symbol: 'BTCUSDT', orderId: '12345678' });
get_balances

계좌 잔액을 확인하세요:

const balances = await getBalances(); // Returns: { BTC: '0.1', USDT: '1000', ... }
get_open_orders

모든 미결 주문 나열:

const orders = await getOpenOrders({ symbol: 'BTCUSDT' // Optional: specify symbol });

선물 거래 도구

create_futures_order

다양한 유형의 선물 주문을 생성합니다.

// LIMIT order await createFuturesOrder({ symbol: 'BTCUSDT', side: 'BUY', type: 'LIMIT', quantity: '0.001', price: '40000', timeInForce: 'GTC' }); // STOP MARKET order await createFuturesOrder({ symbol: 'BTCUSDT', side: 'SELL', type: 'STOP_MARKET', quantity: '0.001', stopPrice: '38000' }); // TRAILING STOP order await createFuturesOrder({ symbol: 'BTCUSDT', side: 'SELL', type: 'TRAILING_STOP_MARKET', quantity: '0.001', callbackRate: '1.0' // 1% callback rate });
set_futures_leverage

거래 쌍의 레버리지 조정:

await setFuturesLeverage({ symbol: 'BTCUSDT', leverage: 10 // 1-125x });
get_futures_positions

모든 공개 선물 포지션을 확인하세요:

const positions = await getFuturesPositions();
get_futures_account

자세한 선물 계좌 정보를 확인하세요:

const account = await getFuturesAccount();
get_funding_rate

선물 기호에 대한 자금 조달 비율을 알아보세요:

const fundingRate = await getFundingRate({ symbol: 'BTCUSDT' });
cancel_futures_order

기존 선물 주문 취소:

await cancelFuturesOrder({ symbol: 'BTCUSDT', orderId: '12345678' });

선물 거래 세부 정보

위치 모드

  • 단방향 모드: 심볼당 단일 위치
    • 기본 모드, 더 간단한 위치 관리
    • 총 포지션 크기는 모든 주문의 합계입니다.
  • 헤지 모드: 롱 포지션과 숏 포지션 분리
    • 롱 포지션과 숏 포지션을 동시에 유지할 수 있습니다.
    • 각 직책에는 독립적인 마진 요구 사항이 있습니다.

여백 유형

  • 격리된 마진: 위치당 고정 마진
    • 위험은 할당된 마진으로 제한됩니다.
    • 각 포지션에는 자체 레버리지 설정이 있습니다.
  • 교차 마진: 포지션 간 공유 마진
    • 더 높은 자본 효율성
    • 모든 직책에 걸쳐 공유되는 위험

자금 조달 비율

영구 선물 계약은 자금 조달 비율을 사용하여 선물 가격을 현물 가격과 일치시킵니다.

  • 양의 비율: 롱은 숏에게 지불
  • 마이너스 금리: 숏 포지션은 롱 포지션에 지불
  • 지불은 8시간마다 이루어집니다.

보안 고려 사항

현물 거래 보안

  • API 키를 버전 제어에 커밋하지 마십시오.
  • 환경 변수 또는 보안 키 저장소를 사용하세요
  • API 키 권한을 필수 작업에만 제한합니다.
  • API 키를 정기적으로 순환하세요

선물 거래 보안

  • 위험 허용도에 따라 적절한 레버리지 한도를 설정하세요.
  • 잠재적 손실을 제한하려면 항상 손절매 주문을 사용하세요.
  • 청산 가격을 주의 깊게 모니터링하세요
  • 정기적으로 포지션 위험과 마진 비율을 확인하세요
  • 위험 관리를 위해 축소 전용 주문 사용을 고려하세요
  • 공유 위험으로 인해 교차 마진에 주의하세요

요금 제한

  • Binance API 요금 제한을 준수하세요
  • 기본 요금 한도:
    • 주문 작업을 위한 분당 1200개 요청
    • 시장 데이터에 대한 초당 100개 요청
  • 비율 제한 오류에 대한 적절한 오류 처리를 구현합니다.

오류 처리

일반적인 오류 시나리오

  • 잘못된 API 자격 증명
  • 잔액 또는 마진이 부족합니다
  • 잘못된 주문 매개변수
  • 요금 제한을 초과했습니다
  • 네트워크 연결 문제

선물 관련 오류

  • InsufficientMarginError: 작업에 필요한 마진이 충분하지 않습니다.
  • InvalidPositionModeError: 잘못된 위치 모드 설정
  • OrderValidationError: 잘못된 선물 주문 매개변수

오류 처리 예시:

try { await createFuturesOrder({ symbol: 'BTCUSDT', side: 'BUY', type: 'LIMIT', quantity: '0.001', price: '40000', timeInForce: 'GTC' }); } catch (error) { if (error instanceof InsufficientMarginError) { console.error('Insufficient margin available'); } else if (error instanceof InvalidPositionModeError) { console.error('Invalid position mode'); } else if (error instanceof OrderValidationError) { console.error('Invalid order parameters'); } }

프로젝트 구조

. ├── src/ │ ├── index.ts # Server entry point │ ├── services/ │ │ ├── binance.ts # Binance API integration │ │ ├── keystore.ts # API key management │ │ └── tools.ts # Trading tools implementation │ └── types/ │ ├── binance.ts # Binance types │ └── binance-connector.d.ts # API client types ├── README.md ├── README_CN.md ├── package.json ├── pnpm-lock.yaml └── tsconfig.json

개발

  1. 환경 변수 설정:

루트 디렉토리에 .env 파일을 만들고 Binance API 자격 증명을 설정하세요.

BINANCE_API_KEY=your_api_key_here BINANCE_API_SECRET=your_secret_key_here
  1. 종속성 설치:
pnpm install

서버를 빌드하세요:

pnpm build

자동 재빌드를 사용한 개발의 경우:

pnpm watch

설치

Smithery를 통해 설치

Smithery 를 통해 Claude Desktop에 Binance Trading Server를 자동으로 설치하는 방법:

npx -y @smithery/cli install mcp-server-cex-bn --client claude

수동 설치

  1. 저장소를 복제합니다
  2. 종속성 설치:
pnpm install
  1. .env 에서 Binance API 자격 증명을 구성하세요.
  2. 서버를 빌드하고 시작합니다.
pnpm build pnpm start

디버깅

MCP 서버는 stdio를 통해 통신하므로 디버깅이 어려울 수 있습니다. 패키지 스크립트로 제공되는 MCP Inspector를 사용하는 것이 좋습니다.

pnpm inspector

검사기는 브라우저에서 디버깅 도구에 액세스할 수 있는 URL을 제공합니다.

mcp-server-bn

-
security - not tested
F
license - not found
-
quality - not tested

이 서버는 API 자격 증명의 안전한 관리, 현물 주문의 실행 및 관리, 계좌 잔액 및 미결제 주문의 모니터링을 포함하여 바이낸스 현물 거래 운영을 위한 강력한 인터페이스를 제공합니다.

  1. Features
    1. Spot Trading Operations
    2. Futures Trading Operations
    3. Tools
  2. Futures Trading Details
    1. Position Modes
    2. Margin Types
    3. Funding Rate
  3. Security Considerations
    1. Spot Trading Security
    2. Futures Trading Security
  4. Rate Limits
    1. Error Handling
      1. Common Error Scenarios
      2. Futures-Specific Errors
    2. Project Structure
      1. Development
        1. Installation
          1. Installing via Smithery
          2. Installing manually
          3. Debugging
        2. mcp-server-bn
          ID: kbmjzs3g81