law-openapi-mcp
This server lets you search, retrieve, collect, and cite Korean law/open API data across 72 legal categories for research workflows.
Check API connectivity and whether the required
OCcredential is configured.List supported targets/categories and their measured schemas, response tags, and identifier quirks.
Search a legal category by query, with pagination, record limits, title/body scope, and an explicit option to fetch a full catalog.
Retrieve a single record’s body, including articles, judgments, or interpretation summaries, with optional truncation.
Collect combinations of categories and queries into xlsx, csv, json, or sqlite files.
Map a record to bibliographic/citation fields such as issuing authority, number, promulgation date, enforcement date, and enacting institution.
Work across laws, administrative rules, ordinances, precedents, constitutional decisions, interpretations, treaties, committee decisions, forms, and more.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@law-openapi-mcp search current statutes containing '교육' and export to xlsx"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
law-openapi-mcp
📈 사용량 — 최근 14일 조회 0회(고유 0) · 클론 0회(고유 0) · 릴리스 자산 누적 다운로드 0
2026-11-26 자동 갱신 · 전체 이력은
docs/usage.csv. GitHub 트래픽 통계는 14일 창만 제공하므로 이 저장소가 매일 찍어 누적한다.
법제처 국가법령정보 OPEN API(law.go.kr DRF)를 검색·수집하는 MCP 서버 + CLI.
현행법령·행정규칙·자치법규·판례·헌재결정례·행정심판례·법령해석례(법제처 + 부처 39종)· 위원회 결정문·별표서식·조약·법령용어 등 72종을 한 인터페이스로 조회하고, 결과를 xlsx·csv·json·sqlite 로 내보낸다. 연구 자료수집 단계에서 반복 재사용하기 위한 도구다.
자매 저장소: na-openapi-mcp(국회도서관) · nl-openapi-mcp(국립중앙도서관) · kci-openapi-mcp · scienceON-mcp
수집 단위는 인용 단위다
법령 하나가 문헌 하나다. 조문은 인용할 때의 위치로 넣지, 별도 레코드로 쪼개지 않는다. 「초·중등교육법」은 조문 135개짜리 309KB 문서지만 참고문헌에는 한 줄로 들어간다. 판례는 사건 하나, 법령해석례는 안건 하나, 조약은 조약 하나다.
본문이 필요하면 law_body 로 따로 받는다 — 그때는 조문이 구조로 온다.
Related MCP server: LexLink
준비물
OC 하나면 된다. open.law.go.kr 에서 OPEN API 를 신청할 때
가입 이메일의 @ 앞부분을 본인이 지정하는 값이다.
cp .env.example .env # LAW_OC=your_id 를 채운다OC 는 비밀값이 아니다. 요청 URL에 평문으로 실리고 응답의 상세링크에도 그대로 되돌아온다.
그래도 사람마다 값이 다르므로 환경변수로 받는다.
설치·실행
uv sync
uv run law status # 연결 점검
uv run law search --target law --query 교육 # 현행법령 검색
uv run law body --target law --id 209959 # 본문 조회
uv run law collect --target law,prec --query 교육,평생교육 --format xlsxMCP 등록:
{
"mcpServers": {
"law": {
"command": "uvx",
"args": ["law-openapi-mcp"],
"env": { "LAW_OC": "your_id" }
}
}
}MCP 도구
도구 | 하는 일 |
|
|
| 다룰 수 있는 갈래와 갈래별 실측 스키마·주의사항 |
| 목록 검색. |
| 식별자 1건의 본문(조문·판시사항·질의요지 등) |
| 갈래 × 검색어 조합을 모아 xlsx/csv/json/sqlite 로 저장 |
| 레코드를 서지 필드(발령주체·호·시행일·제정기관)로 매핑 |
다루는 갈래 — 72종
무리 | 종수 | 보기 |
법령·규칙 | 7 |
|
판례·재결 | 3 |
|
법령해석 | 40 |
|
위원회 결정문 | 12 |
|
특별행정심판 | 4 |
|
별표·서식 | 3 |
|
조약·용어 | 2 |
|
그 밖 | 1 |
|
전체 목록과 갈래별 실측 스키마는 law targets / law_targets,
무엇이 있는지의 지도는 docs/DRF_CATALOG.md.
본문이 XML 로 오지 않는 4종: licbyl·ordinbyl(별표·서식은 파일 — 목록의
별표서식파일링크·별표서식PDF파일링크 가 원문) · moefCgmExpc·ntsCgmExpc(목록만).
호출 전에 막고 대신 무엇을 보라고 알려 준다.
lsHistory(법령 연혁)·couseLs(관련법령)는 type=XML 을 무시하고 HTML 을 돌려주므로
이 서버는 다루지 않는다. 호출하면 그 사실을 알려 준다.
알아 둘 것 (전부 실측)
🔴 모든 실패가 HTTP 200 이다. 없는 target 은 0바이트, 잘못된
OC는<Response>, 없는 식별자는<Law>일치하는 … 없습니다</Law>. 상태코드로는 아무것도 알 수 없다.🔴
query를 빼면 전체 카탈로그가 온다 — 오류가 아니다(현행법령 5,614건). 이 서버는 빈 검색어를 거부한다.🔴 판례 본문은 데이터출처에 따라 없다.
데이터출처명=대법원은 본문이 오고,국세법령정보시스템은 목록에만 있고 본문 조회에 "일치하는 판례가 없습니다" 가 온다. 결손으로 기록하고 넘어갈 일이지 오류가 아니다.display상한은 500(1000을 요청하면 500으로 깎이고numOfRows에 정직하게 에코된다).page에는 하드 상한이 없다 —totalCnt전량을 회수할 수 있다.갈래마다 루트 태그·레코드 태그·식별자 파라미터가 전부 다르고 이름에서 유추할 수 없다. 전수 실측 62종 중 45종이 제 이름이 아닌 레코드 태그를 쓴다(부처 해석 39종은 전부
<cgmExpc>,ordin·lsStmd는<law>,school은<admrul>). 식별자 파라미터도ID/MST만이 아니다 —lstrm은trmSeqs.⚠️
totalCnt=0은 target 이 무효라는 뜻이 아니다 — 검색어가 안 맞은 것일 뿐이다.
자세한 근거와 재현 방법은 docs/LAW_API_GUIDE.md.
라이선스
MIT
Available Tools
6 toolslaw_bodyARead-only
식별자 1건의 본문을 받는다(조문·판시사항·질의요지 등).
Args:
target: 갈래 코드.
doc_id: 목록 결과의 일련번호. 갈래마다 파라미터명이 MST/ID 로 다르지만
이 도구가 알아서 맞춘다.
include_articles: 조문 목록을 함께 돌려줄지(법령·자치법규에만 있다).
ef_date: 시행일법령(eflaw) 전용 — 목록의 시행일자. 🔴 없이 부르면 오류가
아니라 HTML 이 온다. 같은 법령의 시행일별 판본이라 (MST, efYd) 가 신원이다.
max_chars: 본문 텍스트 상한. 넘으면 잘라내고 그 사실을 알린다.
Inputs: doc_id (required), target (required), ef_date, max_chars, +1 more.
law_citationDRead-only
한 건을 서지(인용) 필드로 매핑한다 — 발령주체·호·공포일·시행일·제정기관.
목록에서 1건을 다시 찾아 매핑한다. 서지관리 도구(Ibis 의 legislation 유형 등)로
바로 넘길 수 있는 모양이다.
Inputs: doc_id (required), target (required).
law_collectA
갈래 × 검색어의 합집합을 모아 파일로 저장한다.
⚠️ max_records 는 전체에 걸친 예산이다. 앞선 축이 다 쓰면 뒤 축은 조회되지
않으며, 그 사실은 meta 의 stopped_early_note 로 보고된다.
⚠️ 한 축이 실패해도 나머지는 계속 수집한다 — 실패는 failed_axes 로 보고된다.
Inputs: out_dir (required), queries (required), targets (required), name, +4 more.
law_searchARead-only
법령·판례 등 한 갈래를 검색한다.
Args:
target: 갈래 코드. law(현행법령)·admrul(행정규칙)·ordin(자치법규)·prec(판례)·
detc(헌재결정례)·expc(법령해석례)·trty(조약)·eflaw·elaw·lsStmd.
law_targets 로 전체 목록을 볼 수 있다.
query: 검색어. 비울 수 없다 — 비우면 전체 카탈로그가 온다.
max_records: 회수 상한(예산). 이 API 는 page 상한이 없어 올리면 전량도 받는다.
page_size: 한 페이지 건수(최대 500).
scope: 1=제목만(기본), 2=본문 포함.
allow_full_catalog: query="*" 로 갈래 전체를 받겠다고 명시할 때만 True.
Inputs: query (required), target (required), scope, page_size, +2 more.
law_statusARead-only
연결 점검 — OC 보유 여부 + 법제처 OPEN API 실제 왕복 1회.
Inputs: no named parameters.
law_targetsARead-only
다룰 수 있는 갈래와 갈래별 실측 스키마·주의사항.
갈래마다 응답 태그와 식별자 파라미터가 다르고 이름에서 유추할 수 없다 — 이 도구가 그 표다.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a distinct role: connectivity check, schema map, single-target search, document body retrieval, bulk collection, and citation mapping. Overlapping actions such as search vs. collect are clearly differentiated by single-result versus multi-axis file output.
All tools follow a uniform law_ prefix with short, lowercase, predictable names. Some names are nouns and some are verbs, but the pattern is consistent and easy to infer.
Six tools cover the full workflow without redundancy: verify, discover, search, retrieve, collect, and cite. The count is well within the ideal range for a focused API wrapper.
The set supports a complete read-only workflow for legal documents: discovering targets, querying, fetching full bodies, bulk collection, and citation export. No obvious missing operation would prevent an agent from accomplishing the core domain tasks.
Maintenance
Related MCP Connectors
Korean law: statutes, precedents, ordinances, treaties and citation verification (법제처 API).
대한민국 법령·조문·별표·연혁·판례·해석례를 법제처 국가법령정보 OPEN API 로 찾아보는 읽기 전용 MCP 서버. 핵심 도구 12개.
All KR Data tools in one server: Korean business checks, addresses, laws, car flood records & more
Powerful OpenDART API-based Korean corporate disclosure tools for accounting professionals
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables searching and retrieving Korean legal information including laws, court precedents, legal interpretations, and local ordinances from the Korean National Law Information Center API with intelligent search ranking.-
- FlicenseAqualityBmaintenanceEnables AI systems to search, retrieve, and analyze Korean legal information from the National Law Information API (law.go.kr), including laws, administrative rules, English translations, and law-ordinance linkages.262-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search, retrieve, and analyze South Korean legal documents including statutes, precedents, constitutional decisions, and administrative rulings via the Ministry of Government Legislation Open API. Provides 89 specialized tools with features like legal abbreviation auto-recognition, annex extraction, and complex research chain workflows.MIT
- FlicenseNot gradedqualityDmaintenanceEnables searching and retrieving Korean laws, precedents, and administrative rules through the National Law Information Center Open API, optimized for AI agents.-