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-serverwhich 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.
This server cannot be deployed
Maintenance
Related MCP Connectors
Japan Law MCP — Japanese national laws & ordinances via the e-Gov Law API.
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
Search U.S. case law, fetch opinions, and ask matter-aware legal questions over your documents.
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.3354 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.7130 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.157 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to query Japanese public data (laws, corporations, statistics) from official government APIs, returning normalized English metadata with source attribution.1MIT