japan-legislation-mcp-server
Overview
Search Japan’s Constitution, Acts, cabinet orders, ministerial ordinances, and rules in the original Japanese. The corpus covers national legislation. Prefectural and municipal 条例 fall outside it. Historical date selection begins on 2017-04-01, which includes the version then in force for laws already in effect. Repealed or expired laws may still have a last published text. Scheduled revisions carry the UnEnforced status.
出典:e-Gov法令検索. This server reformats Japanese legal text from the Digital Agency’s e-Gov Law API v2 under the e-Gov Law Search terms. For English reference translations, see the Ministry of Justice’s Japanese Law Translation.
Tools
Tool | Description |
| Search by Japanese title, abbreviation, subject, promulgation, or amendment dates |
| Search Japanese statutory text and preview matches grouped by law and revision |
| Resolve law numbers or Japanese citations and parse provision addresses |
| Browse a revision outline, read selected text, and find official downloads |
| Read up to ten articles, paragraphs, or items in one revision |
| Trace amendment history and find exact revision IDs |
| Find possible implementing orders, ordinances, and rules with supporting evidence |
| Look up law types, category codes, identifiers, query syntax, and coverage |
Related MCP server: e-gov-law-mcp
Capability reference
jplaw_search_laws tool
Start with
{"title":"個人情報保護法"}. Uselaw_types,categories,law_num_era, andlaw_num_yearto narrow the catalog. Get the accepted codes fromjplaw_list_reference.The inclusive ranges
promulgation_fromandpromulgation_tofilter the law’s own promulgation date. Theamendment_promulgation_fromandamendment_promulgation_tooramendment_enforcement_fromandamendment_enforcement_topairs filter the amendment in the selectedasofview.statusdefaults toin_force. Useallor filter forRepeal,Expire,Suspend, orLossOfEffectiveness.sortacceptslaw_number(default),promulgated, oramended.Up to 500 results per page. Pass
page.next_offsetback asoffsetwith the same filters and sort.
jplaw_search_text tool
Try
{"keyword":"個人情報 第三者提供","sections":["mainprovision"],"limit":10}. Thekeywordexpression uses a space for AND,|for OR,!for NOT, and*and?as wildcards.Use
law_types,categories,asof, andsectionsto narrow matches. Section values aremainprovision,supplprovision,amendsupplprovision,caption,enactstatement, andrelatedarticlenum.Up to 1,000 snippets per page. Continue at
next_offseteven when a filtered page shows zero matches. Anyupstream_total_countcounts matches before section filtering. Follow up with a pinned law read for complete text.
jplaw_lookup_citation tool
Supply 1–25
citations, for example["平成15年法律第57号","個人情報保護法第二十七条第一項"]. Exact Japanese titles, abbreviations, and e-Gov law IDs also work, as do Gregorian law-number years and kanji numerals.Each citation resolves separately. For ambiguous results, select a returned law ID. Confirm parsed provision addresses with
jplaw_get_provisionin the relevant revision.
jplaw_get_law tool
{"law":"個人情報保護法"}opens the outline. Passpart: "第二十七条", a Japanese structure path, or a canonical selector from that revision for text. Usepart: "全部"for whole-law text andinclude_amendment_suppl: trueto include amending supplementary provisions there.Use
asof(YYYY-MM-DD) orlaw_revision_idto select a version. The revision ID can identify the law by itself. Results include pinned links to available attachments and document downloads.The paged outline and text return complete units. Continue with
next_offsetasoffset, keepingpart,include_amendment_suppland the returnedlaw_revision_idfixed. Ifrevision.updatedchanges, start again at zero because an upstream correction can change the document without changing its revision ID.
jplaw_get_provision tool
Try
{"law":"個人情報保護法","asof":"2024-04-01","provisions":["第二十七条第一項"]}. Pass up to ten addresses using Japanese 条/項/号 (including branches such as 第二十七条の二), supplementary notation such as 附則第二条, or structured coordinates.Version selection works the same way as in
jplaw_get_law. Results distinguish found, deleted, and unresolved provisions. For large provisions returned as an outline, follow the child addresses or pass the canonical selector tojplaw_get_law.
jplaw_list_revisions tool
Pass
{"law":"平成15年法律第57号"}to see versions in e-Gov’s newest-first order. Filter bystatuses, or by inclusiveenforcement_from/enforcement_toandpromulgation_from/promulgation_toranges.Pass
page.next_offsetasoffsetto continue. Copy the chosenlaw_revision_idinto a law or provision read to retrieve that exact version.
jplaw_find_subordinate_laws tool
Pass the exact title, number, abbreviation, or law ID of an Act, for example
{"law":"個人情報保護法"}.statusdefaults toin_force. Useallto include inactive candidates andnext_offsetto page through the unique instruments.Title extensions such as 施行令 or 施行規則 and enactment-statement matches are evidence to inspect. e-Gov does not provide a formal parent relationship.
jplaw_list_reference tool
Omit
topicto list topics, or chooselaw_types,categories,law_numbers,identifiers,provision_addresses,keyword_syntax,coverage, orupstream_errors. This tool works offline.
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Date and revision selection for Japanese law text, including supplementary provisions and appendices
Revision-specific source links and explicit continuation offsets
Catalog snapshots refresh after two hours. Revision lists and parsed law documents are cached for up to five minutes, and text reads check the source update timestamp.
Search and browse calls default to
offset: 0andlimit: 25. A null continuation offset marks the end of the list.
Getting started
Run it locally with Claude Code:
claude mcp add japan-legislation-mcp-server -- npx -y @cyanheads/japan-legislation-mcp-serverFor other clients, add this to the MCP config file:
{
"mcpServers": {
"japan-legislation-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/japan-legislation-mcp-server"]
}
}
}For a client using Bun, use "command": "bunx" with "args": ["@cyanheads/japan-legislation-mcp-server"]. e-Gov access needs no API key.
For Docker or a source build, see Running the server.
Configuration
Variable | Description | Default |
| Transport ( |
|
| HTTP bind address. |
|
| HTTP server port. |
|
| Streamable HTTP endpoint path. |
|
| HTTP session mode ( |
|
| Authentication mode ( |
|
| Log level ( |
|
| Enable OpenTelemetry. |
|
See .env.example for common framework overrides.
Running the server
Local development
Requires Bun v1.4.4 or higher to build and Node.js v24+ for the built entry point.
git clone https://github.com/cyanheads/japan-legislation-mcp-server.git
cd japan-legislation-mcp-server
bun install
bun run rebuild
bun run start:httpConnect a Streamable HTTP client to http://127.0.0.1:3010/mcp, or use bun run start:stdio to launch the built server as a stdio process.
Docker
docker run --rm -p 127.0.0.1:3010:3010 ghcr.io/cyanheads/japan-legislation-mcp-server:latestThe image uses HTTP and stateless sessions by default. For stdio, set MCP_TRANSPORT_TYPE=stdio and use docker run -i. To build locally, run docker build -t japan-legislation-mcp-server ..
Project structure
Directory | Purpose |
| Eight read-only MCP tools. |
| e-Gov transport, upstream schemas, and reference data. |
| Catalog search, exact law resolution, and revision history. |
| XML parsing, provision addressing, and revision text. |
| Snippet search and filtered continuation. |
| Contract and service tests. |
See the file tree for the full layout.
Development guide
See CLAUDE.md for development guidelines and architectural rules.
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
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.
Kokkai Diet MCP — Japan National Diet proceedings, speech-level full-text search via the National…
Japanese law, corporation & statistics data as MCP, normalized to English with source attribution.
Related MCP Servers
- AlicenseAqualityCmaintenanceLocal stdio MCP server for searching Japanese laws and retrieving article text from e-Gov Law Search. Includes related-law lookup for enforcement orders and regulations, with source attribution baked into every tool result.450 npmMIT
- AlicenseAqualityCmaintenanceMCP server wrapping the e-Gov law API v2 to search and retrieve Japanese law data, including law lists, revision histories, full text, attachments, and keyword search.64MIT
- AlicenseBqualityBmaintenanceEnables searching Japanese laws by title and reference date, and retrieving main-provision articles and version information via Japan's e-Gov Law API v2.5MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables MCP clients to search Japanese laws and fetch specific articles, paragraphs, and items from the e-Gov Law API v2. Supports natural-language legal research with caching and citation formatting.-