egov-law-mcp
@codeagentjp/egov-law-mcp
e-Gov 법령 검색에서 일본 법령을 검색하고 조문 텍스트를 가져오기 위한 로컬 stdio MCP 서버입니다.
이 서버는 LLM을 호출하지 않습니다. 오직 출처가 명시된 법령 데이터와 e-Gov URL만을 반환하므로, MCP 클라이언트(Claude Desktop, Claude Code, Cursor 또는 기타 에이전트)가 원본 출처를 인용할 수 있습니다.
설계 선택은 디지털청이 오픈 소스로 공개한 Lawsy-Custom-BQ(2026년 4월 24일 '겐나이(Gennai)' 정부 AI OSS 릴리스의 일부로 공개)를 참고했습니다. 설계 노트는 codeagent.jp에서 확인하십시오.
왜 또 다른 e-Gov MCP인가
npm에는 이미 다른 작성자가 만든 egov-law-mcp가 존재합니다. 이 패키지는 다음 세 가지 측면에서 차별화됩니다.
find_related_laws— 특정 기본 법령명에 대한 시행령 및 시행규칙을 조회합니다. Lawsy-Custom-BQ도 서버 측에서 동일한 단계를 수행합니다. 정의나 위임된 규칙이 상위 법령 외부에 존재하는 경우가 많기 때문에 유용합니다.모든 도구 결과에 출처 명시 — 모든 응답에는 법령명, 법령 ID, 조 번호, 표준 e-Gov URL이 포함되어 있어 호출하는 LLM이 인용을 누락할 수 없습니다.
단일 파일
.mjs, 빌드 단계 없음 —bin/egov-law-mcp.mjs는 Node 20+ 환경에서 직접 실행됩니다. 감사하기 쉽고 설치 용량이 작습니다.
Related MCP server: Houki e-Gov MCP Server
상태
MVP 버전입니다. API 인터페이스는 의도적으로 작게 유지되었습니다:
search_laws— 키워드로 현재 일본 법령 검색.get_article— 법령 ID 또는 법령 번호로 특정 법령의 조문 검색.get_article— 법령의 기본 메타데이터 및 텍스트 미리보기 검색.find_related_laws— 관련 가능성이 있는 시행령 및 시행규칙 검색.
요구 사항
Node.js 20 이상
https://laws.e-gov.go.jp에 대한 네트워크 접근 권한
설치
npm 사용:
{
"mcpServers": {
"egov-law": {
"command": "npx",
"args": ["-y", "@codeagentjp/egov-law-mcp"]
}
}
}개발을 위한 소스 설치:
git clone https://github.com/SHAYOUWORLD/egov-law-mcp.git
cd egov-law-mcp
node bin/egov-law-mcp.mjs{
"mcpServers": {
"egov-law": {
"command": "node",
"args": ["/absolute/path/to/egov-law-mcp/bin/egov-law-mcp.mjs"]
}
}
}도구
search_laws
e-Gov 법령 목록을 검색합니다.
{
"keyword": "個人情報",
"limit": 10
}get_article
조문 텍스트를 가져옵니다. lawId 또는 lawNum 중 하나를 제공하십시오.
{
"lawId": "503AC0000000035",
"article": "2"
}get_law
법령의 기본 메타데이터와 일반 텍스트 미리보기를 가져옵니다.
{
"lawId": "503AC0000000035",
"previewChars": 3000
}find_related_laws
시행령 및 시행규칙을 포함하여 기본 법령명과 관련이 있어 보이는 법령을 검색합니다.
{
"lawName": "個人情報の保護に関する法律",
"limit": 10
}데이터 출처 및 저작자 표시
이 패키지는 e-Gov 법령 검색 API를 사용합니다:
e-Gov 법령 검색: https://laws.e-gov.go.jp/
법령 API 문서: https://laws.e-gov.go.jp/docs/law-data-basic/8529371-law-api-v1/
e-Gov 이용 약관: https://developer.e-gov.go.jp/contents/terms
MCP stdio 전송: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports
도구 결과에는 출처 정보가 포함됩니다. 이 패키지를 기반으로 결과물을 게시하거나 재배포할 때는 적절한 e-Gov 출처를 명시하십시오.
권장 출처 표기:
출처: e-Gov法令検索(https://laws.e-gov.go.jp/)
안전 주의사항
이 패키지는 법령 참조 도구이며, 법률 자문이 아닙니다. 중요한 법적 결론은 공식 e-Gov 페이지를 통해 확인하고, 필요한 경우 자격을 갖춘 전문가와 상담하십시오.
셸 명령을 실행하지 않습니다.
JSON-RPC 메시지는 stdout으로만 출력하며, 로그는 stderr로만 기록합니다.
e-Gov 법령 검색 엔드포인트만 호출합니다.
관련 자료
겐나이(Gennai) OSS 릴리스 배경: 政府AI「源内」のソースコードが商用利用可能な形で公開 (codeagent.jp)
참고한 참조 구현: digital-go-jp/genai-ai-api/google-cloud/lawsy-custom-bq
라이선스
MIT © codeagent.jp
Available Tools
4 toolsget_articleB
Retrieve a specific article from e-Gov Law Search by law ID or law number.
| Name | Required | Description | Default |
|---|---|---|---|
| lawId | No | e-Gov law ID, for example 503AC0000000035. | |
| lawNum | No | Japanese law number. Either lawId or lawNum is required. | |
| article | Yes | Article number, for example 2. | |
| paragraph | No | Optional paragraph number. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description only states 'retrieve' without disclosing behavioral traits such as idempotency, authentication needs, rate limits, or error handling for missing articles.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the core purpose. However, it may be too brief for a tool with four parameters, missing important details about parameter dependencies.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with four parameters and no output schema or annotations, the description omits crucial context: it does not mention that the 'article' parameter is required, nor does it explain what the return value contains or how errors are handled.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description's mention of 'by law ID or law number' adds minimal value beyond the existing schema descriptions, which already specify parameter purposes and constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the action (retrieve), resource (a specific article from e-Gov Law Search), and method (by law ID or law number). It distinguishes from sibling tools like get_law and search_laws by targeting articles specifically.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context (retrieving a specific article) but provides no explicit when-to-use or when-not-to-use guidance, nor does it reference alternatives among sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_lawA
Retrieve law metadata and a plain text preview from e-Gov Law Search.
| Name | Required | Description | Default |
|---|---|---|---|
| lawId | No | e-Gov law ID. Either lawId or lawNum is required. | |
| lawNum | No | Japanese law number. Either lawId or lawNum is required. | |
| previewChars | No | Maximum preview length. Defaults to 5000. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description implies a read operation but doesn't explicitly confirm idempotency, authentication needs, or rate limits. It only states what is retrieved, which is adequate but not exhaustive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, clear, no unnecessary words. Front-loads the key action and resource.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 3 parameters, no output schema, and no annotations, the description is brief but covers the essential purpose. However, it lacks details about return format or side effects, which could be useful for a tool with no output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 100% of parameters with descriptions. The description adds no extra meaning beyond the schema (e.g., 'metdata and preview' is generic). Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it retrieves law metadata and plain text preview from e-Gov. It specifies the source and distinguishes from sibling tools like search_laws (search) and get_article (specific article).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus siblings, nor any prerequisites (e.g., need a law ID from search_laws). The description is silent on usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_lawsB
Search current Japanese laws from e-Gov Law Search by keyword.
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | Keyword to search in law name, law number, or law ID. | |
| category | No | Law category. Defaults to all. | |
| limit | No | Maximum number of results. Defaults to 10. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description must disclose behavioral traits. It only mentions 'current' laws, but lacks details on authorization, rate limits, data freshness, or any side effects. The bare statement is insufficient for a search tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single concise sentence with no superfluous words. It front-loads the action and resource, perfect for quick comprehension.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and only three parameters, the description fails to explain return format, pagination, or result structure. Given the tool's complexity (search across categories), completeness is lacking.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the description adds no extra meaning beyond the schema. The search logic (e.g., partial matching, case sensitivity) is not explained, meeting the baseline for high coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'search', the resource 'current Japanese laws', and the source 'e-Gov Law Search by keyword', distinguishing it from siblings like find_related_laws and get_article which target specific relations or articles.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies general keyword search but does not explicitly state when to use this tool versus alternatives, nor does it mention when not to use it. No exclusions or prerequisites are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
find_related_laws - First observed
get_article - First observed
get_law - First observed
search_laws
TDQS
Scored across 4 tools
Each tool has a distinct purpose: searching laws, retrieving law metadata, retrieving specific articles, and finding related laws. No overlap in functionality.
All tool names follow a consistent verb_noun pattern in snake_case, e.g., search_laws, get_law, get_article, find_related_laws.
With 4 tools, the server is well-scoped for a focused legal search assistant. The count is neither excessive nor insufficient.
The tool set covers the core operations for searching and retrieving Japanese laws and articles. A minor gap is the lack of a tool to list all laws, but for search purposes this is acceptable.
Maintenance
Related MCP Connectors
Japan Law MCP — Japanese national laws & ordinances via the e-Gov Law API.
MCP server for Firecrawl — web search, scraping, and biomedical/arXiv paper search.
Japanese law, corporation & statistics data as MCP, normalized to English with source attribution.
MCP server for Japan geodata: cadastral lot numbers (chiban) and reverse geocoding, for AI agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables searching and retrieving Japanese legal information from the e-Gov Law API, including law searches by keyword, detailed law data retrieval, and revision history tracking.32,645 npm49MIT
- AlicenseAqualityAmaintenanceEnables LLMs to search and retrieve Japanese laws from the e-Gov API v2, including keyword search, article fetching, table of contents, and revision history.71,637 npm2MIT
- AlicenseNot gradedqualityBmaintenanceEnables querying Japanese national laws and ordinances via the e-Gov Law API, allowing AI agents to access legal data through natural language questions.404 npmMIT
- AlicenseAqualityDmaintenanceMCP server for searching and retrieving Japanese laws from the e-Gov API, enabling natural language queries for legal information.39 npmMIT