npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cafe24-admin-mcp

v0.2.10

Published

Cafe24 Admin API MCP Server with Memory Optimization

Readme

🚀 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"
      }
    }
  }
}

🚀 사용법

🔐 인증 설정

  1. 토큰 직접 설정 (권장):
토큰을 가지고 있다면 cafe24_set_tokens를 사용하세요.
  1. 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 초과 | 15ms | 200배 | | 복합 집계 분석 | N×3초 (불가능) | 45ms | 무한대 | | 필터링 + 정렬 | 2초 + 메모리 부족 | 8ms | 250배 | | 반복 분석 | 매번 2-3초 | 1-10ms | 300배 |

🛠️ 전체 도구 목록

🔐 인증 관리 (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개)

📖 상세 가이드

🔧 고급 설정

청크 크기 최적화

# 데이터 특성에 따른 청크 크기 조정
# 간단한 테이블: 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 시계열

🤝 기여하기

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

📄 라이선스

MIT License


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