Skip to content

v0.9.0 — Multi-Client Edition (Claude · Gemini CLI · ChatGPT)

Choose a tag to compare

@lapiogga lapiogga released this 07 May 15:22
· 12 commits to main since this release

v0.9.0 — Multi-Client Edition

법제처 OpenAPI 기반 한국 판례·법령 MCP 서버. 활성 MCP Tool 44종, 단위 테스트 267 PASS, 5언어(ko/en/zh/vi/ja).

v0.9.0의 변화 한 줄: Claude Desktop 외 Gemini CLI + (HTTP transport 통한) ChatGPT 등 원격 클라이언트도 같은 서버를 공유.

지원 클라이언트 매트릭스

클라이언트 Transport 가이드 추가 인프라
Claude Desktop stdio INSTALL.md · 원클릭 scripts/install-caselaw-mcp.ps1 없음
Gemini CLI (Google 공식) stdio INSTALL_GEMINI.md · 원클릭 scripts/install-caselaw-gemini.ps1 없음
Cursor / VS Code stdio INSTALL.md §2~3 없음
ChatGPT (Apps SDK / Developer Mode) streamable-http INSTALL_CHATGPT.md Cloudflare Tunnel + (현재 베타) OAuth 2.1

핵심 추가

1. HTTP transport 모드

caselaw-mcp --transport http --host 0.0.0.0 --port 8000
  • FastMCP stateless_http=True, json_response=True (Cloudflare Tunnel · 원격 클라이언트 호환)
  • Starlette + uvicorn 위에 mcp.streamable_http_app() 마운트
  • 기본 endpoint: http://127.0.0.1:8000/mcp

2. Bearer 토큰 인증

export CASELAW_AUTH_TOKEN="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
  • CASELAW_AUTH_TOKEN 환경변수 설정 시 모든 HTTP 요청에 Authorization: Bearer 검증
  • secrets.compare_digest 로 타이밍 공격 방어
  • 미설정 시 인증 비활성 (로컬 신뢰 네트워크 한정)
  • 401 응답에 WWW-Authenticate: Bearer 헤더

3. 가이드 + 원클릭 등록 스크립트

  • docs/INSTALL_GEMINI.md — gemini mcp add 명령 + settings.json 직접 편집 두 경로
  • docs/INSTALL_CHATGPT.md — Cloudflare Tunnel(권장, 무료) / ngrok(대안) + Developer Mode 커넥터 등록 절차
  • scripts/install-caselaw-gemini.ps1 — -UseUvx 스위치 (PyPI / 로컬 클론 자동 분기)

클라이언트별 라이브 검증 결과

Claude Desktop ✅

  • 음주운전 대법원 판례 5건 자연어 검색 + 사건번호 표 정리 (v0.3.0 시점부터 통과 유지)

Gemini CLI ✅ — v0.9.0 신규

  • gemini mcp add 등록 → OAuth Google 인증 → 헤드리스 모드(gemini -p ... --yolo)에서 ping + search_precedent 정상 호출
  • 사건번호 5건 (2025도15970·6752·8137·9717·7665) 회수 — Claude Desktop 결과와 일치

HTTP + Bearer 인증 ✅

  • 127.0.0.1:18765 라이브 boot
  • 토큰 누락 → HTTP 401 / 잘못된 토큰 → HTTP 401 / 정상 토큰 → HTTP 200 + initialize 응답
  • 외부 cloudflared 임시 도메인 통한 실제 인터넷 호출도 동일 결과

통계

항목 v0.8.0 v0.9.0 차이
활성 MCP Tool 44 44 동일 (transport 추가만)
단위 테스트 250 PASS 267 PASS +17 (auth 11 + transport_cli 6)
지원 transport stdio stdio + streamable-http +1
지원 클라이언트 Claude Desktop · Cursor · VS Code + Gemini CLI · ChatGPT +2
Python 모듈 20 22 (auth.py 추가) +1 (config 갱신)

Bug Fixes

  • fix(auth): .env 의 CASELAW_AUTH_TOKEN 이 인증 미들웨어에 도달 못 하는 silent bypass 결함 해소. pydantic-settings 가 .env 를 자기 Settings 객체에만 로드하고 os.environ 에는 주입하지 않아, os.environ 직접 호출이 항상 None 을 리턴 → 인증이 비활성 모드로 fallback 되던 문제. Settings 기반으로 일관 경로 변경. (26bed9c)
  • build(sdist): GitHub Release sdist 가 promo 영상까지 포함해 62MB 로 비대해지던 문제 해소 (157KB 로 정상화). (94c89b2)
  • style: docs/promo/automation/capture_pages.py ruff format — CI 빨강 해소. (2a438cc)

Out of Scope (Phase 13+ 후보)

  • OAuth 2.1 Resource Server — ChatGPT custom MCP 가 Bearer 직접 인증 대신 OAuth 2.1 + Dynamic Client Registration 만 정식 지원 (OpenAI Apps SDK Auth). Auth0/Stytch 같은 IdP 와의 통합이 필요한 별도 큰 작업이라 v0.9.0 에는 미포함. v0.9.0 은 ChatGPT 직결 시 "인증 없음" 임시 검증만 가능.
  • 외국 판례 (CourtListener, Case Law Access Project) 통합
  • Vector DB 의미 검색
  • open-webui 자체 호스팅 가이드 (Chrome 웹 UI 대안)

동결 코드 영역 (v0.9.0)

이후 변경 시 후방호환 책임:

  • src/caselaw_mcp/server.py 의 44 tool signature
  • src/caselaw_mcp/server.py 의 CLI flag 4 (--transport, --host, --port, --path) — 인자 이름·기본값
  • src/caselaw_mcp/auth.py 의 CASELAW_AUTH_TOKEN 환경변수 + Authorization: Bearer 검증 동작
  • src/caselaw_mcp/parsers.py 의 응답 키 매핑 (영문 snake_case)
  • client.py 의 OC 환경변수·캐시 경로
  • tools/citizen/{mode,locale}.py 의 파일 기반 상태 (~/.caselaw_mcp/{mode,locale}.json)
  • citizen_data/*.json 시드 (추가만, 기존 ID 변경·제거 금지)
  • docs/API_REFERENCE.md 에 명시된 입출력 스키마
  • HTTP 엔드포인트 기본값 127.0.0.1:8000/mcp (변경 시 가이드 동시 갱신)

설치

한 줄 설치 (uvx, PyPI)

주의: PyPI v0.9.0 배포는 본 Release 와 별도. 미배포 시 uvx caselaw-mcp 가 v0.8.0 받음. 첨부 wheel 직접 사용 권장.

uvx --from caselaw_mcp-0.9.0-py3-none-any.whl caselaw-mcp --help

로컬 클론

git clone https://github.com/lapiogga/caseLaw.git
cd caseLaw
git checkout v0.9.0
uv sync

자세한 등록 절차는 클라이언트별 가이드 참조.