Japanese Statutes MCP Server

Lilambd Crossing · Server version 1.0.0 · Last updated 2026-11-29

Introduction

This MCP server gives an AI client read-only access to the national statutes of Japan: every Act, Cabinet Order and Ministerial Ordinance in force that e-Gov publishes, split into article, paragraph and item units, with four layers added on top of the official text:

This document covers the MCP version, authentication, the tool catalog, each tool's arguments and return types, the data and its provenance, and security and privacy. The same information is published by the protocol at the tool-listing step; this page is the durable reference.

Endpoint

URLhttps://mcp.lilambd.com/mcp
TransportStreamable HTTP over HTTPS (TLS 1.2+), JSON-RPC 2.0. POST only; responses are application/json. The server opens no SSE stream (GET returns 405). Batches of up to 20 messages are accepted.
Server namelilambd-jp-statutes-mcp
Server version1.0.0
Protocol revisions2025-11-25, 2025-06-18, 2025-03-26. The server answers initialize with the client's requested revision when it is one of these, otherwise 2025-11-25.
SessionStateless. No Mcp-Session-Id is issued; every request is authorized by its bearer token.
HostingCloudflare Workers (global edge), data in Cloudflare D1, OAuth grants in Cloudflare Workers KV.

Authentication

All MCP requests require an OAuth 2.1 bearer access token. Requests without a valid token receive HTTP 401 with a WWW-Authenticate header pointing to the protected resource metadata. No tool can be called before authentication.

FlowAuthorization Code with PKCE. Only S256 is accepted; plain is refused. PKCE is mandatory for public clients and accepted for confidential clients.
Grants supportedauthorization_code, refresh_token
Token endpoint authclient_secret_basic, client_secret_post, none (public clients, PKCE required), private_key_jwt (Client ID Metadata Document clients only)
Client registrationDynamic Client Registration (RFC 7591) at /oauth/register, or Client ID Metadata Documents (HTTPS client_id URLs). A pre-registered client can be issued on request.
Authorization server metadataGET https://mcp.lilambd.com/.well-known/oauth-authorization-server (RFC 8414)
Protected resource metadataGET https://mcp.lilambd.com/.well-known/oauth-protected-resource/mcp (RFC 9728)
EndpointsAuthorize /authorize · Token /oauth/token · Revocation /oauth/token (RFC 7009) · Registration /oauth/register
Audience bindingTokens are issued for the resource https://mcp.lilambd.com/mcp (RFC 8707) and are refused elsewhere.
Authorization responseIncludes the iss parameter (RFC 9207). Redirect URIs must match the registered value exactly.
Implementation@cloudflare/workers-oauth-provider 1.4.0. Tokens are stored only as hashes; the grant's properties are encrypted at rest with a key derived from the token.

User identity. The server holds public statutory data only and has no user accounts, workspaces or client-matter content. The consent page asks the person to approve the client and its scopes; each approval creates an anonymous grant (anon-<uuid>) that identifies that connection for rate limiting and revocation. No name, email or firm identifier is collected.

Scopes

ScopePurposeNotes
jpstatutes_mcpConnect to the MCP server, initialize, and list tools.Mandatory. Without it every MCP request is refused with HTTP 403 insufficient_scope.
jpstatutes_readCall the read-only tools (all eight).Without it tools/call returns a JSON-RPC error.
offline_accessReceive a refresh token.Optional.

No scope allows writing, uploading or deleting anything: the server has no write tools.

Token security

ComponentTime-to-liveNotes
Authorization code10 minutesSingle use. Bound to client, redirect URI and PKCE challenge.
Consent page handle10 minutesSingle use, bound to the browser that opened it by a __Host- cookie; the page cannot be framed.
Access token1 hour
Refresh token30 days from the code exchangeRotated on every use; the previous token stays valid only until its replacement is first used.

MCP features

ElementProvidedDescription
ToolsYesEight read-only tools, listed below.
Tools: input schemaYesJSON Schema for every tool, with types, lengths, enumerations and ranges. Unknown arguments are rejected.
Tools: output schemaYesEvery tool declares an outputSchema and returns structuredContent, plus the same JSON as a text block for older clients.
Tool annotationsYesAll tools: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false.
ResourcesNo
PromptsNo
Sampling, elicitation, rootsNoThe server never calls back into the client.

Pagination

List tools return totalAvailable, paginationStart and items. When more results exist they return paginationCursor, an opaque URL-safe string of at most 255 characters; send it back with the same other arguments to get the next page. An invalid cursor returns a tool error. Page size is 1 to 50 (default 20).

Errors

ConditionResponse
Missing or invalid tokenHTTP 401 with WWW-Authenticate: Bearer resource_metadata=…
Token without jpstatutes_mcpHTTP 403 insufficient_scope
Rate limit (120 requests per minute per grant)HTTP 429, Retry-After: 60, JSON-RPC error -32002
Body over 64 KBHTTP 413
Malformed JSON / not JSON-RPC-32700 / -32600
Unknown method / unknown tool-32601 / -32602
tools/call without jpstatutes_read-32001
Invalid argument value, unknown law ID, bad cursorTool result with isError: true and a one-line message
Internal failureTool result with isError: true; no stack traces or internals are returned

Tool catalog

ToolSummaryScopes
search_lawsSearch Japanese laws by titlejpstatutes_mcp + jpstatutes_read
get_lawGet one law with its amendment schedulejpstatutes_mcp + jpstatutes_read
get_provisionsRead provisions of a lawjpstatutes_mcp + jpstatutes_read
search_provisionsFull-text search of provisionsjpstatutes_mcp + jpstatutes_read
get_normsGet extracted legal normsjpstatutes_mcp + jpstatutes_read
find_definitionsFind statutory definitions of a termjpstatutes_mcp + jpstatutes_read
get_referencesGet cross-law referencesjpstatutes_mcp + jpstatutes_read
list_upcoming_amendmentsList amendments not yet in forcejpstatutes_mcp + jpstatutes_read

Reference

search_laws

Search Japanese laws by title. Find Japanese Acts, Cabinet Orders and Ministerial Ordinances (9,044 instruments in force, from e-Gov) whose title, abbreviation or law number contains every given word. Returns law IDs to use with the other tools. Titles are in Japanese (e.g. 民法, 個人情報の保護に関する法律, 会社法施行規則).

Scopes required: jpstatutes_mcp, jpstatutes_read. Annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false.

Call arguments

ArgumentTypeRestrictionsDescription
titleWordsstringRequired. 1 to 200 characters.Space-separated words; all must appear in the title, abbreviation or law number.
lawTypestringOptional. One of: Act, CabinetOrder, MinisterialOrdinance.
limitintegerOptional. 1 to 50. Default 20.
paginationCursorstringOptional. 0 to 255 characters.Opaque cursor from a previous call. Supply with the same other arguments.

Unknown arguments are rejected with a tool error.

Return result (structuredContent; the same JSON is also returned as one text content block)

AttributeTypePresenceDescription
totalAvailableintegerAlways present.Total matches across all pages (capped at 10000 for full-text search).
paginationStartintegerAlways present.
paginationCursorstringPresent when applicable.Present when more results exist.
itemslist[object]Always present.
items[].lawIdstringAlways present.
items[].lawTypestringAlways present.
items[].titlestringAlways present.
items[].abbrevstring or nullPresent when applicable.
items[].categorystring or nullPresent when applicable.
items[].lawNumberstring or nullPresent when applicable.
items[].promulgationDatestring or nullPresent when applicable.
items[].currentRevisionIdstring or nullPresent when applicable.
items[].currentRevisionEnforcedstring or nullPresent when applicable.
items[].sourceUrlstringAlways present.

get_law

Get one law with its amendment schedule. Metadata for one law, the number of provisions in force, and every amendment that is promulgated but not yet in force (with enforcement dates).

Scopes required: jpstatutes_mcp, jpstatutes_read. Annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false.

Call arguments

ArgumentTypeRestrictionsDescription
lawIdstringRequired. 0 to 32 characters.

Unknown arguments are rejected with a tool error.

Return result (structuredContent; the same JSON is also returned as one text content block)

AttributeTypePresenceDescription
lawobjectAlways present.
law.lawIdstringAlways present.
law.lawTypestringAlways present.
law.titlestringAlways present.
law.abbrevstring or nullPresent when applicable.
law.categorystring or nullPresent when applicable.
law.lawNumberstring or nullPresent when applicable.
law.promulgationDatestring or nullPresent when applicable.
law.currentRevisionIdstring or nullPresent when applicable.
law.currentRevisionEnforcedstring or nullPresent when applicable.
law.sourceUrlstringAlways present.
provisionCountintegerAlways present.
upcomingAmendmentslist[object]Always present.
upcomingAmendments[].revisionIdstringPresent when applicable.
upcomingAmendments[].amendmentLawTitlestring or nullPresent when applicable.
upcomingAmendments[].promulgateDatestring or nullPresent when applicable.
upcomingAmendments[].enforcementDatestring or nullPresent when applicable.
upcomingAmendments[].changedProvisionsAvailablebooleanPresent when applicable.
attributionstringAlways present.

get_provisions

Read provisions of a law. Return provision units (article / paragraph / item) of one law in document order. Without article, returns the whole law page by page. Article accepts 1, 3-2, 第3条の2 or 第三条の二. With versionId (from get_law upcomingAmendments), returns only the provisions whose text changes in that not-yet-in-force version.

Scopes required: jpstatutes_mcp, jpstatutes_read. Annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false.

Call arguments

ArgumentTypeRestrictionsDescription
lawIdstringRequired. 0 to 32 characters.
articlestringOptional. 0 to 64 characters.
versionIdstringOptional. 0 to 64 characters.
limitintegerOptional. 1 to 50. Default 20.
paginationCursorstringOptional. 0 to 255 characters.Opaque cursor from a previous call. Supply with the same other arguments.

Unknown arguments are rejected with a tool error.

Return result (structuredContent; the same JSON is also returned as one text content block)

AttributeTypePresenceDescription
totalAvailableintegerAlways present.Total matches across all pages (capped at 10000 for full-text search).
paginationStartintegerAlways present.
paginationCursorstringPresent when applicable.Present when more results exist.
itemslist[object]Always present.
items[].provisionIdintegerAlways present.
items[].lawIdstringAlways present.
items[].partstring or nullPresent when applicable.
items[].articlestring or nullPresent when applicable.
items[].captionstring or nullPresent when applicable.
items[].paragraphstring or nullPresent when applicable.
items[].itemstring or nullPresent when applicable.
items[].parentProvisionIdinteger or nullPresent when applicable.
items[].textstring or nullAlways present.
items[].versionIdstring or nullPresent when applicable.null for the text in force now; a revision ID for a not-yet-in-force version.
items[].sourceUrlstringAlways present.
attributionstringPresent when applicable.

search_provisions

Full-text search of provisions. Full-text search over the Japanese text of every provision in force (1.45 million units). Each space-separated phrase must appear; phrases need at least 3 characters (for shorter terms, give lawId and the search runs inside that law). Optionally restrict to one law or law type, or include not-yet-in-force versions.

Scopes required: jpstatutes_mcp, jpstatutes_read. Annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false.

Call arguments

ArgumentTypeRestrictionsDescription
textstringRequired. 1 to 200 characters.
lawIdstringOptional. 0 to 32 characters.
lawTypestringOptional. One of: Act, CabinetOrder, MinisterialOrdinance.
includeFutureVersionsbooleanOptional. Default false.
limitintegerOptional. 1 to 50. Default 20.
paginationCursorstringOptional. 0 to 255 characters.Opaque cursor from a previous call. Supply with the same other arguments.

Unknown arguments are rejected with a tool error.

Return result (structuredContent; the same JSON is also returned as one text content block)

AttributeTypePresenceDescription
totalAvailableintegerAlways present.Total matches across all pages (capped at 10000 for full-text search).
paginationStartintegerAlways present.
paginationCursorstringPresent when applicable.Present when more results exist.
itemslist[object]Always present.
items[].provisionobjectPresent when applicable.
items[].provision.provisionIdintegerAlways present.
items[].provision.lawIdstringAlways present.
items[].provision.partstring or nullPresent when applicable.
items[].provision.articlestring or nullPresent when applicable.
items[].provision.captionstring or nullPresent when applicable.
items[].provision.paragraphstring or nullPresent when applicable.
items[].provision.itemstring or nullPresent when applicable.
items[].provision.parentProvisionIdinteger or nullPresent when applicable.
items[].provision.textstring or nullAlways present.
items[].provision.versionIdstring or nullPresent when applicable.null for the text in force now; a revision ID for a not-yet-in-force version.
items[].provision.sourceUrlstringAlways present.
items[].lawTitlestringPresent when applicable.
items[].snippetstringPresent when applicable.

get_norms

Get extracted legal norms. Machine-extracted norms of one law: who must, must not, may, or is delegated to do what. Kinds: obligation, prohibition, power, delegation, penalty, exception, exception_item, evidence, gate, non_application, effort, attribution, duration, entity, role, anyone. Each norm links to its provision. Kind accuracy measured at 87% on a random sample; verify against the provision text.

Scopes required: jpstatutes_mcp, jpstatutes_read. Annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false.

Call arguments

ArgumentTypeRestrictionsDescription
lawIdstringRequired. 0 to 32 characters.
articlestringOptional. 0 to 64 characters.
kindstringOptional. One of: obligation, prohibition, power, delegation, penalty, exception, exception_item, evidence, gate, non_application, effort, attribution, duration, entity, role, anyone.
limitintegerOptional. 1 to 50. Default 20.
paginationCursorstringOptional. 0 to 255 characters.Opaque cursor from a previous call. Supply with the same other arguments.

Unknown arguments are rejected with a tool error.

Return result (structuredContent; the same JSON is also returned as one text content block)

AttributeTypePresenceDescription
totalAvailableintegerAlways present.Total matches across all pages (capped at 10000 for full-text search).
paginationStartintegerAlways present.
paginationCursorstringPresent when applicable.Present when more results exist.
itemslist[object]Always present.
items[].provisionIdintegerPresent when applicable.
items[].articlestring or nullPresent when applicable.
items[].paragraphstring or nullPresent when applicable.
items[].itemstring or nullPresent when applicable.
items[].kindstringPresent when applicable.
items[].subjectstring or nullPresent when applicable.
items[].detailstring or nullPresent when applicable.
items[].conditionstring or nullPresent when applicable.

find_definitions

Find statutory definitions of a term. Where a term is defined in Japanese statutes (e.g. 個人情報, 事業者, 電磁的記録), with the defining text and provision. Exact match first, then terms that start with the given text.

Scopes required: jpstatutes_mcp, jpstatutes_read. Annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false.

Call arguments

ArgumentTypeRestrictionsDescription
termstringRequired. 1 to 100 characters.
lawIdstringOptional. 0 to 32 characters.
limitintegerOptional. 1 to 50. Default 20.
paginationCursorstringOptional. 0 to 255 characters.Opaque cursor from a previous call. Supply with the same other arguments.

Unknown arguments are rejected with a tool error.

Return result (structuredContent; the same JSON is also returned as one text content block)

AttributeTypePresenceDescription
totalAvailableintegerAlways present.Total matches across all pages (capped at 10000 for full-text search).
paginationStartintegerAlways present.
paginationCursorstringPresent when applicable.Present when more results exist.
itemslist[object]Always present.
items[].termstringPresent when applicable.
items[].definitionstring or nullPresent when applicable.
items[].lawIdstringPresent when applicable.
items[].lawTitlestringPresent when applicable.
items[].provisionIdintegerPresent when applicable.
items[].articlestring or nullPresent when applicable.
items[].paragraphstring or nullPresent when applicable.
items[].sourceUrlstringPresent when applicable.

get_references

Get cross-law references. References between laws. direction=outgoing: laws that this law cites (optionally from one article). direction=incoming: provisions in other laws that cite this law. kind is mention or exception (an exception the citing provision makes to the cited law).

Scopes required: jpstatutes_mcp, jpstatutes_read. Annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false.

Call arguments

ArgumentTypeRestrictionsDescription
lawIdstringRequired. 0 to 32 characters.
directionstringRequired. One of: outgoing, incoming.
articlestringOptional. 0 to 64 characters.
limitintegerOptional. 1 to 50. Default 20.
paginationCursorstringOptional. 0 to 255 characters.Opaque cursor from a previous call. Supply with the same other arguments.

Unknown arguments are rejected with a tool error.

Return result (structuredContent; the same JSON is also returned as one text content block)

AttributeTypePresenceDescription
totalAvailableintegerAlways present.Total matches across all pages (capped at 10000 for full-text search).
paginationStartintegerAlways present.
paginationCursorstringPresent when applicable.Present when more results exist.
itemslist[object]Always present.
items[].fromLawIdstringPresent when applicable.
items[].fromLawTitlestring or nullPresent when applicable.
items[].fromProvisionIdintegerPresent when applicable.
items[].fromArticlestring or nullPresent when applicable.
items[].toLawIdstring or nullPresent when applicable.
items[].toLawTitlestring or nullPresent when applicable.
items[].kindstringPresent when applicable.

list_upcoming_amendments

List amendments not yet in force. Amendments promulgated but not yet in force, ordered by enforcement date. Filter by date range or law.

Scopes required: jpstatutes_mcp, jpstatutes_read. Annotations: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false.

Call arguments

ArgumentTypeRestrictionsDescription
fromDatestringOptional. 0 to 10 characters.YYYY-MM-DD, default today (UTC).
toDatestringOptional. 0 to 10 characters.
lawIdstringOptional. 0 to 32 characters.
limitintegerOptional. 1 to 50. Default 20.
paginationCursorstringOptional. 0 to 255 characters.Opaque cursor from a previous call. Supply with the same other arguments.

Unknown arguments are rejected with a tool error.

Return result (structuredContent; the same JSON is also returned as one text content block)

AttributeTypePresenceDescription
totalAvailableintegerAlways present.Total matches across all pages (capped at 10000 for full-text search).
paginationStartintegerAlways present.
paginationCursorstringPresent when applicable.Present when more results exist.
itemslist[object]Always present.
items[].lawIdstringPresent when applicable.
items[].lawTitlestring or nullPresent when applicable.
items[].revisionIdstringPresent when applicable.
items[].amendmentLawTitlestring or nullPresent when applicable.
items[].promulgateDatestring or nullPresent when applicable.
items[].enforcementDatestring or nullPresent when applicable.

Data and provenance

Sourcee-Gov Law Data (Digital Agency of Japan), API v2 bulk, fetched 2026-09-23. Each law carries its e-Gov URL (sourceUrl) so every answer can be checked against the official page.
Licence of the sourcePublic Data License (Government of Japan Standard Terms of Use v2.0, compatible with CC BY 4.0). Japanese statutes, orders and notices are excluded from copyright (Copyright Act Art. 13).
Coverage9,044 instruments (2,165 Acts, 2,443 Cabinet Orders, 4,436 Ministerial Ordinances); 1,451,945 provision units in force; 56,015 changed provisions in 1,117 not-yet-in-force versions; 1,663 amendments not yet in force; 571,306 norms; 139,378 definitions; 282,390 cross-law references.
Added structureNorms, definitions and references were extracted by rule-based parsing of the statute text. Norm kind accuracy was 87% on a fresh random sample. They are aids for finding provisions; the provision text is authoritative.
Not includedLocal ordinances, case law, official English translations, notices (告示) and guidelines.
UpdatesThe dataset is rebuilt from e-Gov; the fetch date is returned per law (currentRevisionEnforced, sourceUrl).

Security and privacy

Data received from clientsOnly tool arguments (search words, law IDs, article numbers). No documents, files or client-matter content can be sent; the server has no upload or write tools.
LoggingRequest metadata (time, status, duration) through Cloudflare Workers observability, kept up to 7 days. Tool arguments and results are not logged. Bearer tokens are never logged.
Data stored per connectionThe OAuth client record and grant (anonymous ID, scopes, token hashes) in Workers KV until the grant expires or is revoked.
Use of queriesQueries are not stored, sold, shared or used for training.
Database accessThe Worker reads D1 through parameterized statements only; user input is never concatenated into SQL. Full-text input is quoted as FTS5 phrases.
Third partiesCloudflare (hosting, database, TLS). No other processors. No outbound calls are made while answering a request.
TransportHTTPS only, certificates managed by Cloudflare.
Abuse limits120 requests per minute per grant; request bodies up to 64 KB; at most 50 items per page; batches up to 20 messages.
AvailabilityBest effort on Cloudflare's network; health check at /health.
Security contacthello@lilambd.com

Revision history

DateChanges
2026-11-29First public version.