CCXT MCP Server

by jcwleo
MIT License
2
  • Linux
  • Apple

Integrations

  • Allows interaction with cryptocurrency exchanges like Binance, providing tools for fetching balances, market data, creating and canceling orders, managing positions, setting leverage, and handling withdrawals.

CCXT MCP 서버

이 프로젝트는 CCXT 라이브러리의 다양한 기능을 대규모 언어 모델(LLM) 도구로 제공하는 MCP(모델 컨텍스트 프로토콜) 서버를 제공합니다.

LLM은 이를 통해 잔액, 시장 데이터 가져오기, 주문 생성 등의 작업을 위해 암호화폐 거래소와 표준화되고 비동기 방식으로 상호 작용할 수 있습니다.

이 서버는 Python에서 MCP 서버를 만드는 과정을 단순화하는 FastMCP를 사용하여 구축되었습니다.

특징

  • CCXT 통합 : 거래소 상호작용을 위한 일반적인 CCXT 함수를 래핑합니다.
  • 비동기 : 효율적인 비차단 작업을 위해 asyncioccxt.async_support 사용하여 구축되었습니다.
  • 명확한 도구 정의 : 매개변수 설명과 제약 조건을 명확히 하기 위해 typing.Annotatedpydantic.Field 를 사용하여 LLM(및 개발자)이 도구를 더 쉽게 이해하고 사용할 수 있도록 합니다.
  • 인증 처리 : 개인 엔드포인트에 대한 API 키, 비밀번호 및 암호문구 인증을 지원합니다.
  • 공개 및 비공개 도구 : 공개 시장 데이터와 비공개 계정 작업에 대한 별도의 도구를 제공합니다.

설치

  1. 저장소를 복제합니다(아직 복제하지 않았다면):지엑스피1
  2. 가상 환경을 만들고 활성화합니다(권장):
    python -m venv .venv source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
  3. 종속성 설치: 필요한 라이브러리는 requirements.txt 에 나열되어 있습니다. pip 또는 uv 사용하여 설치할 수 있습니다.
    • pip 사용하기:
      pip install -r requirements.txt
    • uv 사용(설치된 경우):
      uv pip install -r requirements.txt # Or, if you prefer uv's environment management: # uv sync

서버 실행

종속성이 설치되면 MCP 서버를 직접 실행할 수 있습니다.

python mcp_server.py

다음과 유사하게 서버가 시작되었음을 나타내는 출력이 표시됩니다.

Starting CCXT MCP Server (Async with Annotated Params and Tool Metadata)... # ... (FastMCP server startup logs)

그러면 MCP 클라이언트가 서버에 연결할 수 있게 됩니다(일반적으로 FastMCP가 관리하는 기본 포트에서, 달리 구성하지 않는 한).

사용 가능한 MCP 도구

이 서버는 API 인증이 필요한지 여부에 따라 분류된 다음 도구를 제공합니다.

API 인증이 필요한 도구(비공개)

  • fetch_account_balance : 현재 계좌 잔액을 가져옵니다.
  • fetch_deposit_address : 통화의 입금 주소를 가져옵니다.
  • withdraw_cryptocurrency : 지정된 주소로 암호화폐를 인출합니다.
  • fetch_open_positions : 오픈 포지션(주로 선물/파생상품)을 가져옵니다.
  • set_trading_leverage : 거래 심볼(주로 선물)에 대한 레버리지를 설정합니다.
  • create_spot_limit_order : 새로운 스팟 제한 주문을 생성합니다.
  • create_spot_market_order : 새로운 현물 시장 주문을 합니다.
  • create_futures_limit_order : 새로운 선물 지정가 주문을 넣습니다.
  • create_futures_market_order : 새로운 선물 시장 주문을 합니다.
  • cancel_order : 기존의 미체결 주문을 취소합니다.
  • fetch_order_history : 주문 내역(열림/닫힘)을 가져옵니다.
  • fetch_my_trade_history : 사용자가 실행한 거래 내역을 가져옵니다.

공공 데이터 도구(인증 필요 없음)

  • fetch_ohlcv : 과거 OHLCV(캔들스틱) 데이터를 가져옵니다.
  • fetch_funding_rate : 무기한 선물 계약에 대한 자금 조달 비율을 가져옵니다.
  • fetch_long_short_ratio : 롱/숏 비율을 가져옵니다(거래소별 params 필요).
  • fetch_option_contract_data : 옵션 계약에 대한 시장 데이터를 가져옵니다.
  • fetch_market_ticker : 해당 심볼의 최신 가격 티커 데이터를 가져옵니다.
  • fetch_public_market_trades : 해당 심볼에 대한 최근 공개 거래를 가져옵니다.

각 도구에는 Annotatedpydantic.Field 를 사용하여 MCP 프로토콜 자체를 통해 자세한 매개변수 설명이 제공됩니다.

사용 참고 사항

  • 선물/옵션 : 선물이나 옵션과 관련된 도구(예: fetch_open_positions , create_futures_limit_order , fetch_funding_rate )를 사용할 때, 거래소에서 요구하거나 원하는 시장 유형을 기본값으로 설정하지 않는 경우 params 인수를 통해 CCXT 클라이언트를 올바르게 구성해야 합니다. 특히 {'options': {'defaultType': 'future'}} (또는 필요에 따라 'swap' , 'option' )을 전달해야 합니다.
  • fetch_long_short_ratio : 이는 표준 CCXT 통합 방식이 아닙니다. params 인수에 특정 거래소 방식 이름과 매개변수를 입력 해야 합니다 (예: 바이낸스 선물의 경우 params={'method_name': 'fapiPublicGetGlobalLongShortAccountRatio', 'method_params': {'symbol': 'BTCUSDT', 'period': '5m'}} ).
  • 오류 처리 : CCXT 호출 중에 문제가 발생하면 도구는 "error" 키가 포함된 사전을 반환합니다.
-
security - not tested
A
license - permissive license
-
quality - not tested

CCXT를 통해 LLM이 암호화폐 거래소와 상호 작용할 수 있도록 하는 모델 컨텍스트 프로토콜 서버로, 잔액, 시장 데이터 가져오기, 주문 생성, 거래 작업 등의 작업을 표준화된 방식으로 수행할 수 있습니다.

  1. 특징
    1. 설치
      1. 서버 실행
        1. 사용 가능한 MCP 도구
          1. API 인증이 필요한 도구(비공개)
          2. 공공 데이터 도구(인증 필요 없음)
        2. 사용 참고 사항

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.
            Last updated -
            31
            323
            2
            TypeScript
            MIT License
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that enables LLMs to access Binance Smart Chain data, perform blockchain queries, and create Four.meme tokens.
            Last updated -
            TypeScript
            • Linux
            • Apple
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables LLMs like Claude to interact with the Alpaca trading API, allowing for trading stocks, checking positions, fetching market data, and managing accounts through natural language.
            Last updated -
            Python
            MIT License
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that exposes Binance cryptocurrency exchange data to LLMs, allowing agents to access real-time prices, order books, and historical market data without requiring API keys.
            Last updated -
            4
            Python
            MIT License

          View all related MCP servers

          ID: tnuvm84aij