korean-law-mcp 2.1.5 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +307 -279
  3. package/build/cli.js +3 -303
  4. package/build/lib/api-client.js +5 -3
  5. package/build/lib/cli-executor.d.ts +16 -0
  6. package/build/lib/cli-executor.js +189 -0
  7. package/build/lib/cli-format.d.ts +39 -0
  8. package/build/lib/cli-format.js +155 -0
  9. package/build/lib/date-parser.d.ts +18 -0
  10. package/build/lib/date-parser.js +172 -0
  11. package/build/lib/query-router.d.ts +3 -0
  12. package/build/lib/query-router.js +18 -0
  13. package/build/lib/risk-rules.d.ts +52 -0
  14. package/build/lib/risk-rules.js +452 -0
  15. package/build/lib/xml-parser.d.ts +23 -1
  16. package/build/lib/xml-parser.js +41 -9
  17. package/build/server/sse-server.js +13 -9
  18. package/build/tool-registry.js +153 -6
  19. package/build/tools/admin-appeals.js +5 -16
  20. package/build/tools/admin-rule.d.ts +13 -0
  21. package/build/tools/admin-rule.js +86 -16
  22. package/build/tools/advanced-search.js +3 -8
  23. package/build/tools/annex.js +3 -5
  24. package/build/tools/article-compare.js +3 -8
  25. package/build/tools/article-detail.d.ts +22 -0
  26. package/build/tools/article-detail.js +134 -0
  27. package/build/tools/article-history.js +3 -8
  28. package/build/tools/article-link-parser.js +3 -8
  29. package/build/tools/article-with-precedents.js +3 -8
  30. package/build/tools/autocomplete.js +3 -8
  31. package/build/tools/batch-articles.js +3 -8
  32. package/build/tools/chains.d.ts +7 -1
  33. package/build/tools/chains.js +84 -0
  34. package/build/tools/committee-decisions.d.ts +32 -0
  35. package/build/tools/committee-decisions.js +32 -65
  36. package/build/tools/comparison.js +3 -8
  37. package/build/tools/constitutional-decisions.js +5 -16
  38. package/build/tools/customs-interpretations.js +18 -59
  39. package/build/tools/document-analysis.d.ts +20 -0
  40. package/build/tools/document-analysis.js +112 -0
  41. package/build/tools/english-law.js +19 -52
  42. package/build/tools/external-links.js +2 -7
  43. package/build/tools/historical-law.js +5 -16
  44. package/build/tools/institutional-rules.d.ts +98 -0
  45. package/build/tools/institutional-rules.js +152 -0
  46. package/build/tools/interpretations.d.ts +2 -0
  47. package/build/tools/interpretations.js +27 -21
  48. package/build/tools/knowledge-base.js +15 -35
  49. package/build/tools/law-history.js +3 -8
  50. package/build/tools/law-linkage.d.ts +45 -0
  51. package/build/tools/law-linkage.js +105 -0
  52. package/build/tools/law-statistics.js +3 -8
  53. package/build/tools/law-system-tree.js +3 -8
  54. package/build/tools/law-text.js +3 -8
  55. package/build/tools/law-tree.js +3 -8
  56. package/build/tools/legal-terms.js +15 -52
  57. package/build/tools/life-law.js +49 -97
  58. package/build/tools/ordinance-search.js +25 -52
  59. package/build/tools/ordinance.js +3 -8
  60. package/build/tools/precedent-keywords.js +3 -8
  61. package/build/tools/precedent-summary.js +3 -8
  62. package/build/tools/precedents.d.ts +2 -0
  63. package/build/tools/precedents.js +36 -41
  64. package/build/tools/search-all.js +3 -8
  65. package/build/tools/search.js +3 -8
  66. package/build/tools/similar-precedents.js +3 -8
  67. package/build/tools/special-admin-appeals.d.ts +70 -0
  68. package/build/tools/special-admin-appeals.js +151 -0
  69. package/build/tools/tax-tribunal-decisions.js +5 -16
  70. package/build/tools/three-tier.js +3 -8
  71. package/build/tools/treaties.d.ts +45 -0
  72. package/build/tools/treaties.js +134 -0
  73. package/build/tools/utils.d.ts +14 -0
  74. package/build/tools/utils.js +55 -5
  75. package/package.json +78 -78
  76. package/build/tools/easy-law.d.ts +0 -88
  77. package/build/tools/easy-law.js +0 -355
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Chris
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chris
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,279 +1,307 @@
1
- # Korean Law MCP Server & CLI
2
-
3
- 법제처 Open API 기반 한국 법령 MCP 서버 + CLI. 64개 도구로 법령, 판례, 행정규칙, 자치법규, 법령해석례 등을 검색·조회·분석할 수 있다.
4
-
5
- [![MCP Compatible](https://img.shields.io/badge/MCP-1.27-blue)](https://modelcontextprotocol.io)
6
- [![CLI](https://img.shields.io/badge/CLI-korean--law-green)](#cli-사용법)
7
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue)](https://www.typescriptlang.org/)
9
-
10
- ## 주요 특징
11
-
12
- - **MCP + CLI 동시 지원**: MCP 서버(Claude Desktop 등)와 CLI(터미널/스크립트) 모두 사용 가능
13
- - **법률 도메인 특화**: 약칭 자동 인식(`화관법` → `화학물질관리법`), 조문번호 변환(`제38조` ↔ `003800`), 3단 위임 구조 시각화
14
- - **별표/별지서식 본문 추출**: HWPX·HWP 파일을 자동 다운로드 → 텍스트/표를 Markdown으로 변환. PDF는 링크 반환
15
- - **64개 도구**: 법령·판례·행정규칙·자치법규·헌재결정·행정심판·조세심판·관세해석·법령용어 등 포괄
16
- - **캐시**: 검색 1시간, 조문 24시간 TTL
17
-
18
- ## 설치
19
-
20
- ### 사전 준비
21
-
22
- - Node.js 18+
23
- - [법제처 API 키](https://open.law.go.kr/LSO/openApi/guideResult.do) (무료)
24
-
25
- ### npm 글로벌 설치
26
-
27
- ```bash
28
- npm install -g korean-law-mcp
29
- ```
30
-
31
- ### MCP 클라이언트 설정
32
-
33
- 아래 JSON을 각 클라이언트 설정 파일에 추가한다.
34
-
35
- ```json
36
- {
37
- "mcpServers": {
38
- "korean-law": {
39
- "command": "korean-law-mcp",
40
- "env": {
41
- "LAW_OC": "your-api-key"
42
- }
43
- }
44
- }
45
- }
46
- ```
47
-
48
- | 클라이언트 | 설정 파일 |
49
- |-----------|----------|
50
- | Claude Desktop | `%APPDATA%\Claude\claude_desktop_config.json` (Win) / `~/Library/Application Support/Claude/claude_desktop_config.json` (Mac) |
51
- | Cursor | `.cursor/mcp.json` |
52
- | Windsurf | `.windsurf/mcp.json` |
53
- | Continue | `~/.continue/config.json` (배열 형식: `"mcpServers": [...]`) |
54
- | Zed | `~/.config/zed/settings.json` (`"context_servers"` 키 사용) |
55
-
56
- 설정 후 클라이언트를 재시작하면 바로 사용 가능.
57
-
58
- ### 원격 MCP (설치 없이 바로 사용)
59
-
60
- 공개 엔드포인트를 MCP 클라이언트에 등록하면 설치 없이 사용 가능하다.
61
-
62
- ```json
63
- {
64
- "mcpServers": {
65
- "korean-law": {
66
- "url": "https://korean-law-mcp.fly.dev/mcp"
67
- }
68
- }
69
- }
70
- ```
71
-
72
- > API 키를 헤더로 전달하려면 `x-law-oc` 헤더를 사용한다.
73
-
74
- ## CLI 사용법
75
-
76
- MCP 클라이언트 없이 터미널에서 직접 64개 도구를 실행할 수 있다.
77
-
78
- ### CLI 실행
79
-
80
- ```bash
81
- # 글로벌 설치
82
- npm install -g korean-law-mcp
83
- export LAW_OC=your-api-key
84
-
85
- # 법령 검색
86
- korean-law search_law --query "관세법"
87
-
88
- # 조문 조회
89
- korean-law get_law_text --mst 160001 --jo "제38조"
90
-
91
- # 판례 검색
92
- korean-law search_precedents --query "부당해고"
93
-
94
- # 도구 목록
95
- korean-law list
96
-
97
- # 카테고리별 필터
98
- korean-law list --category 판례
99
-
100
- # 도구 상세 도움말
101
- korean-law help search_law
102
-
103
- # JSON으로 파라미터 전달
104
- korean-law get_law_text --json-input '{"mst":"160001","jo":"제38조"}'
105
- ```
106
-
107
- ### npm run으로 실행 (로컬 개발)
108
-
109
- ```bash
110
- npm run cli -- search_law --query "민법"
111
- npm run cli -- list
112
- ```
113
-
114
- ### 파이프 조합
115
-
116
- ```bash
117
- # 검색 결과에서 MST만 추출
118
- korean-law search_law --query "관세법" | grep MST
119
-
120
- # 여러 법령 순차 조회
121
- for mst in 160001 160002; do
122
- korean-law get_law_text --mst "$mst" --jo "제1조"
123
- done
124
- ```
125
-
126
- ### Docker / 자체 배포
127
-
128
- ```bash
129
- docker build -t korean-law-mcp .
130
- docker run -e LAW_OC=your-api-key -p 3000:3000 korean-law-mcp
131
- ```
132
-
133
- MCP 엔드포인트: `https://your-host:3000/mcp`
134
-
135
- ## 도구 목록 (64개)
136
-
137
- ### 검색 (11개)
138
-
139
- | 도구 | 설명 |
140
- |------|------|
141
- | `search_law` | 법령 검색 (약칭 자동 인식) |
142
- | `search_admin_rule` | 행정규칙 검색 (훈령/예규/고시) |
143
- | `search_ordinance` | 자치법규 검색 |
144
- | `search_precedents` | 판례 검색 |
145
- | `search_interpretations` | 법령해석례 검색 |
146
- | `search_all` | 통합 검색 |
147
- | `suggest_law_names` | 법령명 자동완성 |
148
- | `advanced_search` | 고급 검색 (기간/키워드 필터) |
149
- | `get_law_history` | 날짜별 법령 변경이력 |
150
- | `get_annexes` | 별표/별지서식 조회 + HWPX/HWP 본문 추출 |
151
- | `parse_jo_code` | 조문번호 JO 코드 변환 |
152
-
153
- ### 조회 (9개)
154
-
155
- | 도구 | 설명 |
156
- |------|------|
157
- | `get_law_text` | 법령 조문 전문 |
158
- | `get_admin_rule` | 행정규칙 전문 |
159
- | `get_ordinance` | 자치법규 전문 |
160
- | `get_precedent_text` | 판례 전문 |
161
- | `get_interpretation_text` | 법령해석례 전문 |
162
- | `get_batch_articles` | 여러 조문 일괄 조회 (`laws` 배열로 복수 법령 지원) |
163
- | `get_article_with_precedents` | 조문 + 관련 판례 |
164
- | `compare_old_new` | 신구법 대조 |
165
- | `get_three_tier` | 법률→시행령→시행규칙 3단 비교 |
166
-
167
- ### 분석 (9개)
168
-
169
- | 도구 | 설명 |
170
- |------|------|
171
- | `compare_articles` | 법령 간 조문 비교 |
172
- | `get_law_tree` | 위임 구조 트리 |
173
- | `get_article_history` | 조문 개정 연혁 |
174
- | `summarize_precedent` | 판례 요약 |
175
- | `extract_precedent_keywords` | 판례 키워드 추출 |
176
- | `find_similar_precedents` | 유사 판례 검색 |
177
- | `get_law_statistics` | 법령 통계 |
178
- | `parse_article_links` | 조문 참조 파싱 |
179
- | `get_external_links` | 외부 링크 생성 |
180
-
181
- ### 전문 분야 (4개)
182
-
183
- | 도구 | 설명 |
184
- |------|------|
185
- | `search_tax_tribunal_decisions` | 조세심판원 재결례 검색 |
186
- | `get_tax_tribunal_decision_text` | 재결례 전문 |
187
- | `search_customs_interpretations` | 관세청 법령해석 검색 |
188
- | `get_customs_interpretation_text` | 관세 해석 전문 |
189
-
190
- ### 헌재·행심·위원회 결정 (6개)
191
-
192
- | 도구 | 설명 |
193
- |------|------|
194
- | `search_constitutional_decisions` | 헌법재판소 결정례 검색 |
195
- | `get_constitutional_decision_text` | 헌재 결정 전문 |
196
- | `search_admin_appeals` | 행정심판례 검색 |
197
- | `get_admin_appeal_text` | 행정심판 전문 |
198
- | `search_ftc_decisions` / `search_nlrc_decisions` / `search_pipc_decisions` | 공정위/노동위/개보위 결정 검색 |
199
- | `get_ftc_decision_text` / `get_nlrc_decision_text` / `get_pipc_decision_text` | 결정 전문 |
200
-
201
- ### 지식베이스 (7개)
202
-
203
- | 도구 | 설명 |
204
- |------|------|
205
- | `get_legal_term_kb` | 법령용어 지식베이스 검색 |
206
- | `get_legal_term_detail` | 용어 상세 정의 |
207
- | `get_daily_term` | 일상용어 검색 |
208
- | `get_daily_to_legal` | 일상용어 → 법령용어 |
209
- | `get_legal_to_daily` | 법령용어 → 일상용어 |
210
- | `get_term_articles` | 용어 사용 조문 |
211
- | `get_related_laws` | 관련법령 조회 |
212
-
213
- ### 기타 (2개)
214
-
215
- | 도구 | 설명 |
216
- |------|------|
217
- | `search_ai_law` | 자연어 지능형 검색 (`lawTypes` 필터 지원) |
218
- | `search_english_law` / `get_english_law_text` | 영문법령 검색/조회 |
219
- | `search_historical_law` / `get_historical_law` | 연혁법령 검색/조회 |
220
- | `search_legal_terms` | 법령용어 사전 검색 |
221
-
222
- ### 체인 도구 (7개)
223
-
224
- 여러 도구를 자동 조합하여 복합 리서치를 한 번의 호출로 수행한다.
225
-
226
- | 도구 | 설명 |
227
- |------|------|
228
- | `chain_law_system` | 법체계 파악 (법령검색→3단비교→조문 일괄 조회) |
229
- | `chain_action_basis` | 처분/허가 근거 확인 (법체계→해석례→판례→행심 병렬) |
230
- | `chain_dispute_prep` | 불복/쟁송 대비 (판례+행심+전문결정례 병렬) |
231
- | `chain_amendment_track` | 개정 추적 (신구대조+조문이력) |
232
- | `chain_ordinance_compare` | 조례 비교 연구 (상위법→전국 조례 검색) |
233
- | `chain_full_research` | 종합 리서치 (AI검색→법령→판례→해석) |
234
- | `chain_procedure_detail` | 절차/비용/서식 (법체계→별표→시행규칙별표) |
235
-
236
- ## 사용 예시
237
-
238
- ```
239
- 사용자: "관세법 제38조 알려줘"
240
- search_law("관세법") MST 획득get_law_text(mst, jo="003800")
241
-
242
- 사용자: "화관법 최근 개정 비교"
243
- "화관법""화학물질관리법" 자동 변환 compare_old_new(mst)
244
-
245
- 사용자: "근로기준법 제74조 해석례"
246
- → search_interpretations("근로기준법 제74조") → get_interpretation_text(id)
247
-
248
- 사용자: "산업안전보건법 별표1 내용 알려줘"
249
- get_annexes(lawName="산업안전보건법 별표1") HWPX 파일 다운로드 → 표/텍스트 Markdown 변환
250
- ```
251
-
252
- ## 환경변수
253
-
254
- | 변수 | 필수 | 기본값 | 설명 |
255
- |------|------|--------|------|
256
- | `LAW_OC` | O | - | 법제처 API 키 ([발급](https://open.law.go.kr/LSO/openApi/guideResult.do)) |
257
- | `PORT` | X | 3000 | HTTP 서버 포트 |
258
- | `CORS_ORIGIN` | X | `*` | CORS 허용 오리진 (프로덕션 배포 시 반드시 설정 권장) |
259
- | `RATE_LIMIT_RPM` | X | 60 | IP당 분당 요청 제한 (0=비활성화) |
260
-
261
- ## 문서
262
-
263
- - [docs/API.md](docs/API.md) - 64개 도구 레퍼런스
264
- - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) - 시스템 설계
265
- - [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) - 개발 가이드
266
-
267
- ## 라이선스
268
-
269
- MIT - [LICENSE](LICENSE) 참조
270
-
271
- ## 감사
272
-
273
- - [법제처](https://www.law.go.kr) Open API
274
- - [LexDiff](https://github.com/chrisryugj/lexdiff) 검색어 정규화 코드
275
- - [Anthropic](https://anthropic.com) MCP 프로토콜
276
-
277
- ---
278
-
279
- <sub>Made by 류주임 @ 광진구청 AI동호회 AI.Do</sub>
1
+ # Korean Law MCP
2
+
3
+ **87 tools to search, retrieve, and analyze Korean law** statutes, precedents, ordinances, treaties, and more.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/korean-law-mcp.svg)](https://www.npmjs.com/package/korean-law-mcp)
6
+ [![MCP 1.27](https://img.shields.io/badge/MCP-1.27-blue)](https://modelcontextprotocol.io)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue)](https://www.typescriptlang.org/)
9
+
10
+ > MCP server + CLI for Korea's official legal database (법제처 Open API). Works with Claude Desktop, Cursor, Windsurf, Zed, and any MCP-compatible client.
11
+
12
+ [한국어](./README-KR.md)
13
+
14
+ ---
15
+
16
+ ## Why this exists
17
+
18
+ South Korea has **1,600+ active laws**, **10,000+ administrative rules**, and a precedent system spanning Supreme Court, Constitutional Court, tax tribunals, and customs rulings. All of this lives behind a clunky government API with zero developer experience.
19
+
20
+ This project wraps that entire legal system into **87 structured tools** that any AI assistant or script can call. Built by a Korean civil servant who got tired of manually searching [법제처](https://www.law.go.kr) for the hundredth time.
21
+
22
+ ---
23
+
24
+ ## Features
25
+
26
+ - **87 Legal Tools** — Statutes, precedents, admin rules, ordinances, constitutional decisions, tax rulings, customs interpretations, treaties, institutional rules, legal terminology
27
+ - **MCP + CLI** — Use from Claude Desktop or from your terminal. Same 87 tools.
28
+ - **Korean Law Intelligence** — Auto-resolves abbreviations (`화관법` → `화학물질관리법`), converts article numbers (`제38조` ↔ `003800`), visualizes 3-tier delegation
29
+ - **Annex Extraction** — Downloads HWPX/HWP annexes and converts tables to Markdown automatically
30
+ - **8 Chain Tools** — Composite research workflows in a single call (e.g. `chain_full_research`: AI search → statutes → precedents → interpretations)
31
+ - **Caching** 1-hour search cache, 24-hour article cache
32
+ - **Remote Endpoint** — Use without installation via `https://korean-law-mcp.fly.dev/mcp`
33
+
34
+ ---
35
+
36
+ ## Quick Start
37
+
38
+ ### Option 1: MCP Server (Claude Desktop / Cursor / Windsurf)
39
+
40
+ ```bash
41
+ npm install -g korean-law-mcp
42
+ ```
43
+
44
+ Add to your MCP client config:
45
+
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "korean-law": {
50
+ "command": "korean-law-mcp",
51
+ "env": {
52
+ "LAW_OC": "your-api-key"
53
+ }
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ Get your free API key at [법제처 Open API](https://open.law.go.kr/LSO/openApi/guideResult.do).
60
+
61
+ | Client | Config File |
62
+ |--------|------------|
63
+ | Claude Desktop | `%APPDATA%\Claude\claude_desktop_config.json` (Win) / `~/Library/Application Support/Claude/claude_desktop_config.json` (Mac) |
64
+ | Cursor | `.cursor/mcp.json` |
65
+ | Windsurf | `.windsurf/mcp.json` |
66
+ | Continue | `~/.continue/config.json` |
67
+ | Zed | `~/.config/zed/settings.json` |
68
+
69
+ ### Option 2: Remote (No Install)
70
+
71
+ ```json
72
+ {
73
+ "mcpServers": {
74
+ "korean-law": {
75
+ "url": "https://korean-law-mcp.fly.dev/mcp"
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ ### Option 3: CLI
82
+
83
+ ```bash
84
+ npm install -g korean-law-mcp
85
+ export LAW_OC=your-api-key
86
+
87
+ korean-law search_law --query "관세법"
88
+ korean-law get_law_text --mst 160001 --jo "제38조"
89
+ korean-law search_precedents --query "부당해고"
90
+ korean-law list # all 87 tools
91
+ korean-law list --category 판례 # filter by category
92
+ korean-law help search_law # tool help
93
+ ```
94
+
95
+ ### Option 4: Docker
96
+
97
+ ```bash
98
+ docker build -t korean-law-mcp .
99
+ docker run -e LAW_OC=your-api-key -p 3000:3000 korean-law-mcp
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Tool Categories (87 total)
105
+
106
+ ### Search (11)
107
+
108
+ | Tool | Description |
109
+ |------|-------------|
110
+ | `search_law` | Search statutes (auto-resolves abbreviations) |
111
+ | `search_admin_rule` | Search administrative rules |
112
+ | `search_ordinance` | Search local ordinances |
113
+ | `search_precedents` | Search court precedents |
114
+ | `search_interpretations` | Search legal interpretations |
115
+ | `search_all` | Unified search across all categories |
116
+ | `suggest_law_names` | Law name autocomplete |
117
+ | `advanced_search` | Advanced search with date/keyword filters |
118
+ | `get_law_history` | Law amendment history by date |
119
+ | `get_annexes` | Retrieve annexes + extract HWPX/HWP to Markdown |
120
+ | `parse_jo_code` | Article number ↔ JO code conversion |
121
+
122
+ ### Retrieve (9)
123
+
124
+ | Tool | Description |
125
+ |------|-------------|
126
+ | `get_law_text` | Full statute text |
127
+ | `get_admin_rule` | Full administrative rule |
128
+ | `get_ordinance` | Full local ordinance |
129
+ | `get_precedent_text` | Full precedent text |
130
+ | `get_interpretation_text` | Full interpretation text |
131
+ | `get_batch_articles` | Batch article retrieval (multiple laws) |
132
+ | `get_article_with_precedents` | Article + related precedents |
133
+ | `compare_old_new` | Old vs. new law comparison |
134
+ | `get_three_tier` | Law → Decree → Rule 3-tier comparison |
135
+
136
+ ### Analyze (10)
137
+
138
+ | Tool | Description |
139
+ |------|-------------|
140
+ | `compare_articles` | Cross-law article comparison |
141
+ | `get_law_tree` | Delegation structure tree |
142
+ | `get_article_history` | Article amendment history |
143
+ | `summarize_precedent` | Precedent summary |
144
+ | `extract_precedent_keywords` | Precedent keyword extraction |
145
+ | `find_similar_precedents` | Similar precedent search |
146
+ | `get_law_statistics` | Law statistics |
147
+ | `parse_article_links` | Parse in-text legal references |
148
+ | `get_external_links` | Generate external links |
149
+ | `analyze_document` | Document analysis with legal context |
150
+
151
+ ### Specialized: Tax & Customs (4)
152
+
153
+ | Tool | Description |
154
+ |------|-------------|
155
+ | `search_tax_tribunal_decisions` | Tax tribunal decision search |
156
+ | `get_tax_tribunal_decision_text` | Tax tribunal decision full text |
157
+ | `search_customs_interpretations` | Customs interpretation search |
158
+ | `get_customs_interpretation_text` | Customs interpretation full text |
159
+
160
+ ### Specialized: Constitutional & Admin Appeals (4)
161
+
162
+ | Tool | Description |
163
+ |------|-------------|
164
+ | `search_constitutional_decisions` | Constitutional Court decision search |
165
+ | `get_constitutional_decision_text` | Constitutional Court decision full text |
166
+ | `search_admin_appeals` | Administrative appeal decision search |
167
+ | `get_admin_appeal_text` | Administrative appeal decision full text |
168
+
169
+ ### Specialized: Committee Decisions (8)
170
+
171
+ | Tool | Description |
172
+ |------|-------------|
173
+ | `search_ftc_decisions` | Fair Trade Commission decision search |
174
+ | `get_ftc_decision_text` | Fair Trade Commission decision full text |
175
+ | `search_pipc_decisions` | Privacy Commission decision search |
176
+ | `get_pipc_decision_text` | Privacy Commission decision full text |
177
+ | `search_nlrc_decisions` | Labor Relations Commission decision search |
178
+ | `get_nlrc_decision_text` | Labor Relations Commission decision full text |
179
+ | `search_acr_decisions` | Board of Audit & Inspection decision search |
180
+ | `get_acr_decision_text` | Board of Audit & Inspection decision full text |
181
+
182
+ ### Specialized: Special Admin Appeals (4) `NEW`
183
+
184
+ | Tool | Description |
185
+ |------|-------------|
186
+ | `search_acr_special_appeals` | Special administrative appeal search |
187
+ | `get_acr_special_appeal_text` | Special administrative appeal full text |
188
+ | `search_appeal_review_decisions` | Appeal review decision search |
189
+ | `get_appeal_review_decision_text` | Appeal review decision full text |
190
+
191
+ ### Law-Ordinance Linkage (4) `NEW`
192
+
193
+ | Tool | Description |
194
+ |------|-------------|
195
+ | `get_linked_ordinances` | Find ordinances linked to a law |
196
+ | `get_linked_ordinance_articles` | Get linked ordinance article details |
197
+ | `get_delegated_laws` | Find laws delegating to ordinances |
198
+ | `get_linked_laws_from_ordinance` | Find parent laws from an ordinance |
199
+
200
+ ### Treaties (2) `NEW`
201
+
202
+ | Tool | Description |
203
+ |------|-------------|
204
+ | `search_treaties` | Treaty search |
205
+ | `get_treaty_text` | Treaty full text |
206
+
207
+ ### Institutional Rules (6) `NEW`
208
+
209
+ | Tool | Description |
210
+ |------|-------------|
211
+ | `search_school_rules` | School rule search |
212
+ | `get_school_rule_text` | School rule full text |
213
+ | `search_public_corp_rules` | Public corporation rule search |
214
+ | `get_public_corp_rule_text` | Public corporation rule full text |
215
+ | `search_public_institution_rules` | Public institution rule search |
216
+ | `get_public_institution_rule_text` | Public institution rule full text |
217
+
218
+ ### Knowledge Base (7)
219
+
220
+ | Tool | Description |
221
+ |------|-------------|
222
+ | `get_legal_term_kb` | Legal terminology search |
223
+ | `get_legal_term_detail` | Term definition |
224
+ | `get_daily_term` | Everyday language search |
225
+ | `get_daily_to_legal` | Everyday → legal term mapping |
226
+ | `get_legal_to_daily` | Legal → everyday term mapping |
227
+ | `get_term_articles` | Articles using a term |
228
+ | `get_related_laws` | Related laws |
229
+
230
+ ### Chain Tools (8)
231
+
232
+ Composite research workflows multiple tools in a single call.
233
+
234
+ | Tool | Workflow |
235
+ |------|----------|
236
+ | `chain_law_system` | Search → 3-tier comparison → batch articles |
237
+ | `chain_action_basis` | Law system → interpretations → precedents → appeals |
238
+ | `chain_dispute_prep` | Precedents + appeals + specialized decisions |
239
+ | `chain_amendment_track` | Old/new comparison + article history |
240
+ | `chain_ordinance_compare` | Parent lawnationwide ordinance search |
241
+ | `chain_full_research` | AI search → statutes → precedents → interpretations |
242
+ | `chain_procedure_detail` | Law system → annexes → enforcement rule annexes |
243
+ | `chain_document_review` | Document analysis related lawsprecedents |
244
+
245
+ ### Other (10)
246
+
247
+ | Tool | Description |
248
+ |------|-------------|
249
+ | `search_ai_law` | Natural language AI search |
250
+ | `search_english_law` | English law search |
251
+ | `get_english_law_text` | English law full text |
252
+ | `search_historical_law` | Historical law search |
253
+ | `get_historical_law` | Historical law full text |
254
+ | `search_legal_terms` | Legal dictionary search |
255
+ | `get_law_system_tree` | Law system tree visualization |
256
+ | `get_law_abbreviations` | Law abbreviation list |
257
+ | `get_article_detail` | Single article detail retrieval |
258
+ | `compare_admin_rule_old_new` | Admin rule old vs. new comparison |
259
+
260
+ ---
261
+
262
+ ## Usage Examples
263
+
264
+ ```
265
+ User: "관세법 제38조 알려줘"
266
+ → search_law("관세법") → get_law_text(mst, jo="003800")
267
+
268
+ User: "화관법 최근 개정 비교"
269
+ "화관법" → "화학물질관리법" auto-resolved → compare_old_new(mst)
270
+
271
+ User: "근로기준법 제74조 해석례"
272
+ → search_interpretations("근로기준법 제74조") → get_interpretation_text(id)
273
+
274
+ User: "산업안전보건법 별표1 내용"
275
+ get_annexes("산업안전보건법 별표1") HWPX download → Markdown table
276
+ ```
277
+
278
+ ---
279
+
280
+ ## Environment Variables
281
+
282
+ | Variable | Required | Default | Description |
283
+ |----------|----------|---------|-------------|
284
+ | `LAW_OC` | Yes | — | 법제처 API key ([get one free](https://open.law.go.kr/LSO/openApi/guideResult.do)) |
285
+ | `PORT` | No | 3000 | HTTP server port |
286
+ | `CORS_ORIGIN` | No | `*` | CORS allowed origin |
287
+ | `RATE_LIMIT_RPM` | No | 60 | Requests per minute per IP |
288
+
289
+ ## Documentation
290
+
291
+ - [docs/API.md](docs/API.md) — 87-tool reference
292
+ - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — System design
293
+ - [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) — Development guide
294
+
295
+ ## Credits
296
+
297
+ - [법제처](https://www.law.go.kr) Open API — Korea's official legal database
298
+ - [Anthropic](https://anthropic.com) — Model Context Protocol
299
+ - [kordoc](https://github.com/chrisryugj/kordoc) — HWP/HWPX parser (same author)
300
+
301
+ ## License
302
+
303
+ [MIT](./LICENSE)
304
+
305
+ ---
306
+
307
+ <sub>Made by a Korean civil servant @ 광진구청 AI동호회 AI.Do</sub>