Skip to main content
Glama

CCXT MCP 서버

npm version npm downloads GitHub stars License: MIT

한국어 버전(Korean version)

CCXT MCP 서버는 AI 모델이 Model Context Protocol (MCP)을 통해 암호화폐 거래소 API와 상호작용할 수 있게 해주는 서버입니다. 이 서버는 CCXT 라이브러리를 사용하여 100개 이상의 암호화폐 거래소와 그 거래 기능에 대한 접근을 제공합니다.

🚀 빠른 시작

# Install the package globally
npm install -g @lazydino/ccxt-mcp

# Run with default settings
ccxt-mcp

# or run without installation
npx @lazydino/ccxt-mcp

Related MCP server: EVM MCP Server

설치 및 사용법

전역 설치

# Install the package globally
npm install -g @lazydino/ccxt-mcp

npx로 실행하기

설치 없이 바로 실행할 수 있습니다:

# Using default settings
npx @lazydino/ccxt-mcp

# Using custom configuration file
npx @lazydino/ccxt-mcp --config /path/to/config.json

도움말 보기:

npx @lazydino/ccxt-mcp --help

설정

Claude Desktop에 MCP 서버 등록하기

  1. Claude Desktop 설정 열기:

    • Claude Desktop 앱의 설정 메뉴로 이동합니다.

    • "MCP Servers" 섹션을 찾습니다.

  2. 새 MCP 서버 추가:

    • "Add Server" 버튼을 클릭합니다.

    • 서버 이름: ccxt-mcp

    • 명령어: npx @lazydino/ccxt-mcp

    • 추가 인수(선택 사항): --config /path/to/config.json

  3. 서버 저장 및 테스트:

    • 설정을 저장합니다.

    • "Test Connection" 버튼으로 연결을 테스트합니다.

설정 방법 - 두 가지 옵션

옵션 1: Claude Desktop 설정에 계정 정보를 직접 포함 (기본 방법)

이 방법은 CCXT 계정 정보를 Claude Desktop 설정 파일(claude_desktop_config.json)에 직접 포함합니다:

{
  "mcpServers": {
    "ccxt-mcp": {
      "command": "npx",
      "args": ["-y", "@lazydino/ccxt-mcp"],
      "mcpBearerToken": "YOUR_MCP_TOKEN",
      "accounts": [
        {
          "name": "bybit_main",
          "exchangeId": "bybit",
          "apiKey": "YOUR_API_KEY",
          "secret": "YOUR_SECRET_KEY",
          "defaultType": "spot"
        },
        {
          "name": "bybit_futures",
          "exchangeId": "bybit",
          "apiKey": "YOUR_API_KEY",
          "secret": "YOUR_SECRET_KEY",
          "defaultType": "swap"
        }
      ]
    }
  }
}

이 방법을 사용하면 별도의 설정 파일이 필요하지 않습니다. 모든 설정이 Claude Desktop 설정 파일에 통합됩니다.

옵션 2: 별도의 설정 파일 사용 (고급 방법)

계정 정보를 별도의 설정 파일로 분리하려면 다음과 같이 설정하십시오:

  1. 별도의 설정 파일 생성 (예: ccxt-config.json):

{
  "mcpBearerToken": "YOUR_MCP_TOKEN",
  "accounts": [
    {
      "name": "bybit_main",
      "exchangeId": "bybit",
      "apiKey": "YOUR_API_KEY",
      "secret": "YOUR_SECRET_KEY",
      "defaultType": "spot"
    },
    {
      "name": "bybit_futures",
      "exchangeId": "bybit",
      "apiKey": "YOUR_API_KEY",
      "secret": "YOUR_SECRET_KEY",
      "defaultType": "swap"
    }
  ]
}

중요: 설정 파일은 위와 같이 루트 레벨에 accounts 배열을 포함해야 합니다.

중요: 서버를 HTTP+SSE 모드(--sse)로 실행하는 경우, 동일한 설정 파일에 mcpBearerToken을 설정하십시오. 클라이언트는 요청 시 Authorization: Bearer <mcpBearerToken>을 전송해야 합니다.

  1. Claude Desktop 설정에서 설정 파일 경로 지정:

{
  "mcpServers": {
    "ccxt-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@lazydino/ccxt-mcp",
        "--config",
        "/path/to/ccxt-config.json"
      ]
    }
  }
}

참고: --config 옵션으로 별도의 설정 파일을 사용할 때, 서버는 mcpServers.ccxt-mcp.accounts 경로가 아닌 JSON 파일의 루트에서 accounts 배열을 찾습니다.

  1. 명령줄에서 외부 설정 파일로 실행하기:

# Using custom configuration file
npx @lazydino/ccxt-mcp --config /path/to/ccxt-config.json

저장소의 config/ccxt-config.example.json에서 설정 파일 예시를 확인할 수 있습니다.

별도의 설정 파일을 사용하는 이유:

  • 재귀 참조 문제 방지

  • API 키와 같은 민감한 정보 분리

  • 다중 환경 설정 용이성(개발, 테스트, 운영)

  • 설정 파일 버전 관리 개선

주요 기능

  • 시장 정보 조회:

    • 거래소 목록 조회

    • 거래소별 시장 정보 확인

    • 특정 심볼의 가격 정보 조회

    • 특정 심볼의 호가창(Order Book) 정보 조회

    • 과거 OHLCV 데이터 검색

  • 거래 기능:

    • 시장가/지정가 주문 생성

    • 주문 취소 및 상태 확인

    • 계정 잔액 조회

    • 거래 내역 확인

  • 거래 분석:

    • 일간/주간/월간 성과 분석

    • 승률 계산 (최근 7일, 30일, 전체)

    • 평균 손익비 (R-multiple)

    • 최대 연속 손실/수익 시리즈 분석

    • 자산 변동 추적

    • 종합 성과 지표

    • 거래 패턴 인식

    • 기간별 수익률 계산

  • 포지션 관리:

    • 자본 비율 거래 (예: 계정 자본의 5%로 진입)

    • 선물 시장 레버리지 설정 (1-100배)

    • 동적 포지션 사이징 (변동성 기반)

    • 분할 매수/매도 전략 구현

  • 리스크 관리:

    • 기술적 지표 기반 손절매 설정 (예: 5분봉 차트 기준 10개 캔들 중 최저점)

    • 변동성 기반 손절매/익절매 (ATR 배수)

    • 최대 허용 손실 제한 (일간/주간)

    • 동적 익절매 설정 (트레일링 수익)

작동 원리

User <--> AI Model(Claude/GPT) <--> MCP Protocol <--> CCXT MCP Server <--> Cryptocurrency Exchange API
  1. 사용자: "비트코인 가격 알려줘" 또는 "내 바이낸스 계정으로 이더리움 사줘"와 같은 요청

  2. AI 모델: 사용자 요청을 이해하고 사용할 MCP 도구/리소스 결정

  3. MCP 프로토콜: AI와 CCXT MCP 서버 간의 표준화된 통신

  4. CCXT MCP 서버: CCXT 라이브러리를 사용하여 암호화폐 거래소 API와 통신

  5. 거래소 API: 실제 데이터 제공 및 거래 주문 실행

AI 모델과 함께 사용하기

Claude Desktop에 등록하면 AI 모델에 다음과 같은 유형의 요청을 할 수 있습니다:

주의 사항 및 권장 프롬프트

AI 모델을 사용할 때는 다음 주의 사항을 고려하고, 효과적인 거래를 위해 아래 프롬프트를 사용하십시오:

Your goal is to execute trades using the ccxt tools as much as possible
Cautions:
- Accurately identify whether it's a futures market or spot market before proceeding with trades
- If there's no instruction about percentage of capital or amount to use, always calculate and execute trades using the entire available capital

참고:

  • AI 모델은 때때로 선물 거래와 현물 거래를 혼동할 수 있습니다.

  • 거래 자본 규모에 대한 명확한 지침이 없으면 AI가 혼란을 겪을 수 있습니다.

  • 위 프롬프트를 사용하면 거래 의도를 명확하게 전달하는 데 도움이 됩니다.

기본 쿼리 예시

Check and compare the current Bitcoin price on binance and coinbase.

고급 거래 쿼리 예시

포지션 관리

Open a long position on BTC/USDT futures market in my Bybit account (bybit_futures) with 5% of capital using 10x leverage.
Enter based on moving average crossover strategy and set stop loss at the lowest point among the 12 most recent 5-minute candles.

성과 분석

Analyze my Binance account (bybit_main) trading records for the last 7 days and show me the win rate, average profit, and maximum consecutive losses.

상세 거래 분석

Analyze my trading performance on the bybit_futures account for BTC/USDT over the last 30 days. Calculate win rate, profit factor, and identify any patterns in my winning trades.
Show me the monthly returns for my bybit_main account over the past 90 days and identify my best and worst trading months.
Analyze my consecutive wins and losses on my bybit_futures account and tell me if I have any psychological patterns affecting my trading after losses.

개발

소스에서 빌드하기

# Clone repository
git clone https://github.com/lazy-dinosaur/ccxt-mcp.git

# Navigate to project directory
cd ccxt-mcp

# Install dependencies
npm install

# Build
npm run build

Docker

Docker Compose로 빌드 및 실행

  1. 설정 파일 생성:

cp config/ccxt-config.example.json config/ccxt-config.json

그런 다음 config/ccxt-config.json에 실제 API 키를 입력하십시오. 또한 동일한 설정 파일에 mcpBearerToken을 설정하십시오. 2. 이미지 빌드:

docker compose build
  1. 백그라운드에서 MCP 서버 시작 (localhost:2298에서 SSE 모드):

docker compose up -d
  1. 로컬 상태 확인 엔드포인트 검증:

curl -H "Authorization: Bearer YOUR_MCP_TOKEN" http://127.0.0.1:2298/healthz

이 Compose 설정은 리버스 프록시를 위해 localhost:2298에서 HTTP+SSE(/sse + /messages)를 통해 MCP를 실행합니다.

원격 MCP 클라이언트 설정

MCP 클라이언트가 다른 호스트에서 실행되는 경우, 이 머신에서 Nginx 리버스 프록시를 사용하십시오.

  1. ccxt-mcp.nginx를 Nginx 설정 위치로 복사하고 인증서 경로를 업데이트하십시오:

sudo cp ccxt-mcp.nginx /etc/nginx/conf.d/ccxt-mcp.conf
  1. /etc/nginx/conf.d/ccxt-mcp.conf를 편집하고 다음을 설정하십시오:

  • ssl_certificate

  • ssl_certificate_key

  • Authorization 헤더 전달 (이 파일에 이미 포함됨)

  1. Nginx 재로드:

sudo nginx -t && sudo systemctl reload nginx
  1. MCP 클라이언트에서 MCP 서버 URL을 TLS 엔드포인트로 설정하십시오:

  • SSE URL: https://YOUR_HOSTNAME_OR_IP:42299/sse

  • 메시지 URL: https://YOUR_HOSTNAME_OR_IP:42299/messages

  • 헤더: Authorization: Bearer YOUR_MCP_TOKEN

다음 명령으로 강력한 토큰을 생성할 수 있습니다:

openssl rand -hex 32

설정 예시:

{
  "mcpBearerToken": "YOUR_MCP_TOKEN",
  "accounts": [
    {
      "name": "bybit_main",
      "exchangeId": "bybit",
      "apiKey": "YOUR_API_KEY",
      "secret": "YOUR_SECRET_KEY"
    }
  ]
}

포트 참고:

  • 42298은 HTTP (리다이렉트 전용)

  • 42299는 HTTPS

  • 2298은 전화 키패드의 CCXT에서 유래

MCP 클라이언트가 URL 설정 대신 명령 기반 MCP 서버를 허용하는 경우, ccxt-mcp를 다음과 같이 설정하십시오:

  • 명령어: docker

  • 인수:

[
  "run",
  "--rm",
  "-i",
  "-p",
  "127.0.0.1:2298:2298",
  "-v",
  "/absolute/path/to/ccxt-mcp/config/ccxt-config.json:/config/ccxt-config.json:ro",
  "ccxt-mcp:local",
  "--sse",
  "--host",
  "0.0.0.0",
  "--port",
  "2298",
  "--config",
  "/config/ccxt-config.json"
]

먼저 docker compose build로 이미지를 빌드하십시오.

🤝 기여하기

기여를 환영합니다! 자유롭게 Pull Request를 제출해 주세요.

📄 라이선스

MIT 라이선스 하에 배포됩니다. 자세한 내용은 LICENSE 파일을 참조하십시오.

❤️ 지원

이 프로젝트가 유용하다면 GitHub에서 ⭐️를 눌러주세요!

Install Server
A
license - permissive license
B
quality
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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/lazy-dinosaur/ccxt-mcp'

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