Socket
Book a DemoInstallSign in
Socket

cafe24-admin-mcp

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cafe24-admin-mcp

Cafe24 Admin API MCP Server with Memory Optimization

latest
npmnpm
Version
0.2.10
Version published
Weekly downloads
18
-41.94%
Maintainers
1
Weekly downloads
 
Created
Source

🚀 Cafe24 Admin API MCP Server with Universal Table Caching

"어떤 테이블이 와도" 확장 가능한 범용 캐싱·분석 시스템

Claude Desktop과 Cafe24 Admin API를 연결하여 초고속 데이터 분석을 제공하는 MCP 서버입니다.

✨ 핵심 특징

🧩 범용 테이블 캐싱 (Universal Table Caching)

  • 스키마-프리: 새 API/DB 테이블이 추가돼도 코드 수정 없이 즉시 지원
  • 토큰 절감: 원본 데이터는 Redis에 저장, Claude에는 집계 결과만 전송 (98% 절약)
  • Ultra Performance: 100-1000배 성능 향상 (1-50ms 응답)

메모리 최적화

  • Context 한계 돌파: 100MB+ 데이터도 OOM 없이 처리
  • 청크 기반 저장으로 메모리 효율성 극대화
  • 자동 압축 및 TTL 관리

📊 고급 분석 기능

  • SQL-like 쿼리 (필터링, 정렬, 페이지네이션)
  • 복합 집계 분석 (GROUP BY + 다중 메트릭)
  • 실시간 대시보드 지원

🛠️ 설치 및 설정

1. 의존성 설치

cd cafe24-admin
npm install

2. 환경 변수 설정

cp .env.example .env
# .env 파일 편집

필수 설정:

MALL_ID=your_mall_id
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret

# Redis 캐싱 (권장)
ENABLE_REDIS_CACHE=true
REDIS_URL=redis://localhost:6379
REDIS_TTL=3600

3. Redis 서버 설치 (선택사항이지만 강력 권장)

macOS:

brew install redis
brew services start redis

Ubuntu/Debian:

sudo apt update
sudo apt install redis-server
sudo systemctl start redis-server

Docker:

docker run -d -p 6379:6379 redis:alpine

4. 빌드 및 실행

npm run build

5. Claude Desktop 설정

claude_desktop_config.json에 추가:

{
  "mcpServers": {
    "cafe24-admin": {
      "command": "node",
      "args": ["/path/to/cafe24-admin/build/index.js"],
      "env": {
        "MALL_ID": "your_mall_id",
        "CLIENT_ID": "your_client_id", 
        "CLIENT_SECRET": "your_client_secret",
        "ENABLE_REDIS_CACHE": "true",
        "REDIS_URL": "redis://localhost:6379"
      }
    }
  }
}

🚀 사용법

🔐 인증 설정

  • 토큰 직접 설정 (권장):
토큰을 가지고 있다면 cafe24_set_tokens를 사용하세요.
  • OAuth 플로우:
1. Cafe24 앱 설정에서 Redirect URI 등록
2. cafe24_exchange_code로 토큰 교환

🧩 범용 테이블 캐싱 워크플로우

1단계: 테이블 데이터 캐싱

// Cafe24 API에서 자동 캐싱
cache_table_data({
  table: "products",
  apiEndpoint: "/api/v2/admin/products",
  chunkSize: 200,
  maxRows: 10000
})

// 커스텀 데이터 캐싱
cache_table_data({
  table: "custom_analytics",
  data: [
    {metric: "sales", value: 1000000, date: "2025-01"},
    {metric: "orders", value: 450, date: "2025-01"}
  ]
})

2단계: 초고속 데이터 조회

// SQL-like 쿼리 (1-50ms)
query_cached_table({
  table: "products",
  filter: {
    display: "T",
    price: {$gte: 10000}
  },
  columns: ["product_no", "product_name", "price"],
  limit: 100,
  orderBy: "price"
})

3단계: 복합 집계 분석

// 다중 그룹화 + 메트릭 (5-100ms)
aggregate_cached_table({
  table: "orders",
  groupBy: ["product_no", "order_status"],
  metrics: ["count", "sum", "avg"],
  sumField: "total_amount",
  filter: {order_date: {$gte: "2025-01-01"}},
  limit: 20
})

4단계: 캐시 관리

// 캐시 상태 확인
list_cached_tables({action: "list"})

// 성능 통계
list_cached_tables({action: "stats"})

// 캐시 정리
list_cached_tables({action: "clear_table", table: "products"})

📊 성능 비교

작업기존 API 방식범용 캐시 방식성능 향상
10,000개 상품 조회3초 + Context 초과15ms200배
복합 집계 분석N×3초 (불가능)45ms무한대
필터링 + 정렬2초 + 메모리 부족8ms250배
반복 분석매번 2-3초1-10ms300배

🛠️ 전체 도구 목록

🔐 인증 관리 (5개)

  • cafe24_exchange_code - OAuth 코드 교환
  • cafe24_refresh_token - 토큰 갱신
  • cafe24_set_tokens - 기존 토큰 직접 설정
  • cafe24_get_token_status - 토큰 상태 확인
  • cafe24_clear_tokens - 토큰 삭제

🛍️ 상품 관리 (4개)

  • products_search_by_name - 상품명 검색
  • products_list - 상품 목록 조회
  • products_count - 상품 개수 확인
  • products_detail - 상품 상세 정보

📦 주문 관리 (3개)

  • orders_list - 주문 목록 조회
  • orders_count - 주문 개수 확인
  • orders_detail - 주문 상세 정보

📈 매출 분석 (3개)

  • sales_volume - 매출량 데이터
  • sales_volume_analyze - 매출 분석
  • sales_top_selling_products - 인기 상품

📁 대량 다운로드 (3개)

  • products_download_csv - 상품 CSV 다운로드
  • orders_download_csv - 주문 CSV 다운로드
  • sales_download_csv - 매출 CSV 다운로드

🧩 범용 테이블 캐싱 (4개) - ⭐ 신규

  • cache_table_data - 어떤 테이블이든 Redis 캐싱
  • query_cached_table - 초고속 테이블 쿼리
  • aggregate_cached_table - 복합 집계 분석
  • list_cached_tables - 캐시 관리

총 22개 도구 (기존 18개 + 범용 캐싱 4개)

📖 상세 가이드

  • 범용 캐싱 시스템 가이드 - 스키마-프리 테이블 캐싱의 모든 것
  • Redis 캐싱 가이드 - Redis 설치부터 최적화까지

🔧 고급 설정

청크 크기 최적화

# 데이터 특성에 따른 청크 크기 조정
# 간단한 테이블: 200-500
# 복잡한 테이블: 50-100
# 대용량 텍스트: 25-50

TTL 전략

REDIS_TTL=3600    # 1시간 (기본)
REDIS_TTL=86400   # 24시간 (안정적 데이터)
REDIS_TTL=1800    # 30분 (자주 변경되는 데이터)

AWS S3 연동 (대용량 파일)

AWS_REGION=ap-northeast-2
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
S3_BUCKET_NAME=your-bucket

🚨 문제 해결

Redis 연결 실패

# Redis 서버 상태 확인
redis-cli ping

# 연결 테스트
redis-cli -h localhost -p 6379 ping

메모리 부족

# 메모리 사용량 확인
redis-cli info memory

# 캐시 정리
# Claude에서: list_cached_tables({action: "clear"})

토큰 만료

# 토큰 상태 확인
# Claude에서: cafe24_get_token_status()

# 토큰 갱신
# Claude에서: cafe24_refresh_token({refresh_token: "..."})

📈 로드맵

Phase 1: 범용 캐싱 (✅ 완료)

  • ✅ 스키마-프리 테이블 캐싱
  • ✅ 초고속 쿼리 및 집계
  • ✅ 자동 TTL 및 메모리 관리

Phase 2: 고급 분석 (🔄 진행중)

  • 🔄 Range 쿼리 ($gte, $lte, $between)
  • 🔄 LIKE 패턴 매칭
  • 🔄 교차 테이블 분석

Phase 3: Redis 모듈 (🔄 계획중)

  • 🔄 RedisJSON 통합
  • 🔄 RediSearch 전문 검색
  • 🔄 RedisTimeSeries 시계열

🤝 기여하기

  • Fork the repository
  • Create a feature branch
  • Commit your changes
  • Push to the branch
  • Create a Pull Request

📄 라이선스

MIT License

범용 테이블 캐싱으로 어떤 크기의 데이터든 Claude Desktop에서 실시간 분석하세요! 🚀

Keywords

mcp

FAQs

Package last updated on 18 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts