legalize-kr MCP
# legalize-kr MCP
[legalize-kr](https://github.com/legalize-kr/legalize-kr) 로컬 Git 클론을 대상으로, README **빠른 시작**과 같은 작업(현재 본문, `git log`, `diff`, 전역 검색, 특정 일자 시점 본문)을 [Model Context Protocol](https://modelcontextprotocol.io) 도구로 노출하는 stdio 서버입니다.
## 요구 사항
- Node.js 18+
- 환경 변수 **`LEGALIZE_KR_ROOT`**: `legalize-kr` 저장소 루트 절대 경로 (`kr/` 포함)
- Git 기반 도구(`kr_git_log`, `kr_diff`, `kr_file_at_date`)는 해당 경로가 **Git 저장소**여야 합니다.
## 설치 및 빌드
```bash
cd /path/to/search
npm install
npm run build
```
## Cursor에서 사용
`mcp.json` 예시:
```json
{
"mcpServers": {
"legalize-kr": {
"command": "node",
"args": ["/absolute/path/to/search/dist/index.js"],
"env": {
"LEGALIZE_KR_ROOT": "/absolute/path/to/legalize-kr"
}
}
}
}
```
전역 설치 없이 `npx tsx src/index.ts`로 개발 실행할 수 있습니다 (`tsx` 설치 필요).
## 도구
| 도구 | 설명 |
|------|------|
| `kr_read_file` | `kr/{법령명}/{파일}.md` 워킹 트리 내용 읽기 |
| `kr_list_laws` | `kr/` 직계 법령 폴더 목록 |
| `kr_search` | `kr/**/*.md` 문자열 검색 (ripgrep 우선, 없으면 Node 순회) |
| `kr_git_log` | 경로별 `git log` |
| `kr_diff` | 동일 법령 폴더 안 두 Markdown 파일 `git diff` |
| `kr_file_at_date` | `git log -1 --before=날짜`로 커밋 조회, 선택 시 해당 시점 본문 |
특정 일자 결과는 **커밋 날짜 기준 근사**입니다. 공포일은 각 파일 YAML `공포일자`를 참고하세요.
## 라이선스
MIT
TDQS
Scored across 6 tools
Each tool targets a distinct operation: reading current files, listing law directories, diffing files, searching, viewing git history, and retrieving historical versions. The only slight overlap between kr_read_file and kr_file_at_date is clearly differentiated by temporal focus.
All tools share the 'kr_' prefix, and most follow a verb_noun pattern (read_file, list_laws, git_log, file_at_date). However, kr_diff and kr_search are verb-only, creating a minor inconsistency in naming style.
With 6 tools, the set is well-scoped for a legal document browsing server. Each tool serves a clear purpose without unnecessary redundancy, fitting comfortably within the ideal 3-15 range.
The server covers core read-only workflows: discovering laws, reading current and historical content, searching, diffing, and viewing git history. A notable gap is the lack of a tool to list individual files within a law directory, which prevents agents from enumerating files without guessing.