japan-law-util-mcp-server
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., "@japan-law-util-mcp-server which Japanese laws mention カスタマーハラスメント?"
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.
japan-law-util-mcp-server
An MCP server for e-Gov法令検索's 法令API Version 2, the Digital Agency's API for Japanese national law: find a law, read its articles, search the text of every law, and pin any point in time.
e-Gov法令検索の法令API(Version 2)を使って、日本の法令の検索・条文の閲覧・全文の キーワード検索・施行時点の指定ができる MCP サーバーです。
Unofficial. This project is not affiliated with or endorsed by the Digital Agency (デジタル庁), which operates e-Gov法令検索. It is written against the published API specification.
Tools
Tool | What it does |
| The usage guideline for the whole tool set: how to find a law, how to read it by |
| Find laws by title, law number, type, subject category or promulgation date; paged. |
| Search the text of every law for a keyword or search expression; returns the laws it appears in with the matching sentences. |
| One law's amendment history: enforcement dates, amending laws, revision ids, and whether each revision is in force, not yet in force or repealed. |
| One law's table of contents — parts, chapters, sections, articles with their captions, supplementary provisions and appendices — each with the |
| A law's text as plain text, whole or the one part |
The server follows a skill-style layout. Its MCP instructions are one sentence
saying what the tools are for and to call load_guideline first. Everything that
concerns the tool set as a whole — including the conditions of use — lives in the
guideline, and each tool's description covers only that tool. Agents that load many MCP
servers keep only a short entry per server in their prompt, and read the guideline when
they need it.
Reading a law
A law's text is addressed with the API's elm paths. get_law_outline returns the one
to use for each entry, so the agent never has to build one:
MainProvision-Article_17 本則第十七条
MainProvision-Article_3_2 本則第三条の二
MainProvision-Chapter_4-Section_2 本則第四章第二節
SupplProvision[1]-Article_1 附則第一条
AppdxTable[1] 別表第一The law text arrives as the API's light JSON (json_format=light) and is rendered to
plain text: captions, article and paragraph numbers, items, tables as |-separated
rows, 振り仮名 resolved to the word itself. A whole act is tens of thousands of
characters, so read_law_text returns it in pieces and the fetched law is cached for
ten minutes.
The supplementary provisions of the laws that amended this one are left out unless
include_amendment_supplements is true — an act can carry twenty of them. That choice
decides which SupplProvision[n] each index names, so get_law_outline takes the same
argument and the two have to agree.
Related MCP server: Houki e-Gov MCP Server
Run
Python 3.11 or later.
pip install -e .
japan-law-util-mcp-server --host 127.0.0.1 --port 8000 # Streamable HTTP at /mcp
japan-law-util-mcp-server --transport stdio # for clients that start it themselvesBehind a reverse proxy, accept the public host name as well; otherwise the server's DNS
rebinding protection rejects requests whose Host is not localhost:
japan-law-util-mcp-server --host 127.0.0.1 --port 8000 --allowed-host demo.mcp.gotoai.comWhen bound to a non-loopback address (for example --host 0.0.0.0 on a LAN), that
protection is off; restrict access with a firewall or a proxy.
In Kari
Add a custom extension of type Streamable HTTP with the URL http://<host>:<port>/mcp.
Give it an ASCII name such as japanlaw — the name becomes part of every tool name the
agent sees.
Conditions of use
These are in the guideline the agent reads; they apply to anyone presenting the results:
Credit the source as 「出典:e-Gov法令検索(デジタル庁)」 with the law's URL.
Say so when the text has been summarised, excerpted or rearranged, and do not present the result as if the government had written it.
Where e-Gov法令検索 differs from the 官報, the 官報 prevails; confirm anything that matters against the law's own page.
Avoid excessive repeated access to the API.
e-Gov法令検索's content is published by the Digital Agency under the 公共データ利用規約(第1.0版); its own terms are at https://laws.e-gov.go.jp/terms/ and apply to whoever runs this server.
Coverage
e-Gov法令検索 holds national law only — 憲法・法律・政令・勅令・府令・省令・規則. It does not hold 告示・通達, treaties, local ordinances or case law. Its data starts from the text in force on 2017-04-01, covering acts and cabinet orders in force since 2015-08-01 and ministerial ordinances and rules since 2016-10-01, so amendment history before then is incomplete.
Development
pip install -e ".[dev]"
pytest # offline tests
JAPAN_LAW_LIVE=1 pytest # also the live tests against the real API
ruff check src testsLicense
MIT — see LICENSE.
Available Tools
6 toolsget_law_outlineARead-only
Get one law's table of contents: every part, chapter, section, article (with its caption), supplementary provision and appendix, in order, each with the elm value that reads it with read_law_text. Read this before reading a long law, and pass the elm it gives rather than building one yourself. Call read_law_text with the same include_amendment_supplements, which changes which supplementary provisions each elm names. Paged with offset.
Inputs: law_id_or_num (required), asof, limit, offset, +1 more. Returns: object
list_law_revisionsARead-only
List one law's amendment history: each revision's enforcement date, the amending law, its revision id and whether that revision is in force now, not yet in force or repealed. Use it to choose the asof date or revision id to read, or to see when a change takes effect.
Inputs: law_id_or_num (required), limit, offset, current_revision_status. Returns: object
load_guidelineARead-only
Usage guideline for the Japanese law tools: how to find a law, read its articles by elm, search the text of every law, pin a point in time, what e-Gov法令検索 covers, and the conditions of use. Read it before your first search.
Inputs: no named parameters. Returns: result
read_law_textARead-only
Read a law's text as plain text: the whole law, or the one part elm names, such as MainProvision-Article_17, MainProvision-Chapter_4-Section_2, SupplProvision[1]-Article_1 or AppdxTable[1]. The text comes back in pieces of max_chars; continue from next_offset. The law's 目次 is not included — get_law_outline returns it — and the supplementary provisions of amending laws are left out unless include_amendment_supplements is true.
Inputs: law_id_or_num (required), elm, asof, offset, +2 more. Returns: object
search_lawsARead-only
Find Japanese laws (acts, cabinet orders, ministerial ordinances) by title, law number, type, subject category or promulgation date. Returns one page of laws with each law's law_id, law number, enforcement date, repeal status and e-Gov URL; total_count and next_offset tell whether more pages exist. Use the law_id with the other tools.
Inputs: asof, limit, order, law_id, +11 more. Returns: object
search_law_textARead-only
Search the text of every Japanese law for a keyword and get the laws it appears in with the matching sentences, each hit marked with 【】. The keyword may be a search expression: space for AND, | for OR, ! to exclude, () to group, or * and ? as wildcards (wildcards cannot be combined with the operators). scan_limit counts hit positions scanned, not laws; lower hits_per_law and raise scan_limit to see more laws.
Inputs: keyword (required), asof, offset, category, +6 more. Returns: object
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 targets a clearly distinct operation: metadata search, full-text search, revision history, table of contents, article text reading, and usage guidance. The only potentially similar pair, search_laws and search_law_text, is explicitly separated by metadata vs. full-text search behavior.
All tool names follow a consistent snake_case verb_noun pattern such as search_laws, list_law_revisions, get_law_outline, and read_law_text. The minor singular/plural variation between law and laws is natural and does not break predictability.
Six tools is well-scoped for a read-only Japanese law research server. Each tool has a clear role in the workflow and no redundant tools appear to be present.
The surface covers the full research lifecycle: onboarding guidance, law discovery, full-text search, revision history, structural outline, and detailed text reading. It also handles pagination and point-in-time/revision selection, leaving no obvious dead ends for the stated domain.
Maintenance
Related MCP Connectors
Japan Law MCP — Japanese national laws & ordinances via the e-Gov Law API.
Search Japanese statutes via the e-Gov Law API. Free law_search tool.
Search Japanese subsidies and public company data using J-Grants, gBizINFO, and EDINET.
Japan data tools for AI agents: calendar (rokuyo), address, name splitting, corporate number lookup
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.34,033 npm49MIT
- AlicenseAqualityBmaintenanceEnables LLMs to search and retrieve Japanese laws from the e-Gov API v2, including keyword search, article fetching, table of contents, and revision history.7177 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.145 npmMIT
- AlicenseAqualityBmaintenanceEnables AI assistants to look up Japanese statutes and articles as of a chosen date, compare old and new versions, full-text search law bodies, and search National Diet session records. It also verifies whether legal citations in a document actually exist and traces which provisions cite or are cited by a given article.9283 npmApache 2.0