Lilambd Crossing · Server version 1.0.0 · Last updated 2026-11-29
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.
| URL | https://mcp.lilambd.com/mcp |
|---|---|
| Transport | Streamable 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 name | lilambd-jp-statutes-mcp |
| Server version | 1.0.0 |
| Protocol revisions | 2025-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. |
| Session | Stateless. No Mcp-Session-Id is issued; every request is authorized by its bearer token. |
| Hosting | Cloudflare Workers (global edge), data in Cloudflare D1, OAuth grants in Cloudflare Workers KV. |
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.
| Flow | Authorization Code with PKCE. Only S256 is accepted; plain is refused. PKCE is mandatory for public clients and accepted for confidential clients. |
|---|---|
| Grants supported | authorization_code, refresh_token |
| Token endpoint auth | client_secret_basic, client_secret_post, none (public clients, PKCE required), private_key_jwt (Client ID Metadata Document clients only) |
| Client registration | Dynamic 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 metadata | GET https://mcp.lilambd.com/.well-known/oauth-authorization-server (RFC 8414) |
| Protected resource metadata | GET https://mcp.lilambd.com/.well-known/oauth-protected-resource/mcp (RFC 9728) |
| Endpoints | Authorize /authorize · Token /oauth/token · Revocation /oauth/token (RFC 7009) · Registration /oauth/register |
| Audience binding | Tokens are issued for the resource https://mcp.lilambd.com/mcp (RFC 8707) and are refused elsewhere. |
| Authorization response | Includes 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.
| Scope | Purpose | Notes |
|---|---|---|
jpstatutes_mcp | Connect to the MCP server, initialize, and list tools. | Mandatory. Without it every MCP request is refused with HTTP 403 insufficient_scope. |
jpstatutes_read | Call the read-only tools (all eight). | Without it tools/call returns a JSON-RPC error. |
offline_access | Receive a refresh token. | Optional. |
No scope allows writing, uploading or deleting anything: the server has no write tools.
| Component | Time-to-live | Notes |
|---|---|---|
| Authorization code | 10 minutes | Single use. Bound to client, redirect URI and PKCE challenge. |
| Consent page handle | 10 minutes | Single use, bound to the browser that opened it by a __Host- cookie; the page cannot be framed. |
| Access token | 1 hour | |
| Refresh token | 30 days from the code exchange | Rotated on every use; the previous token stays valid only until its replacement is first used. |
| Element | Provided | Description |
|---|---|---|
| Tools | Yes | Eight read-only tools, listed below. |
| Tools: input schema | Yes | JSON Schema for every tool, with types, lengths, enumerations and ranges. Unknown arguments are rejected. |
| Tools: output schema | Yes | Every tool declares an outputSchema and returns structuredContent, plus the same JSON as a text block for older clients. |
| Tool annotations | Yes | All tools: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false. |
| Resources | No | |
| Prompts | No | |
| Sampling, elicitation, roots | No | The server never calls back into the client. |
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).
| Condition | Response |
|---|---|
| Missing or invalid token | HTTP 401 with WWW-Authenticate: Bearer resource_metadata=… |
Token without jpstatutes_mcp | HTTP 403 insufficient_scope |
| Rate limit (120 requests per minute per grant) | HTTP 429, Retry-After: 60, JSON-RPC error -32002 |
| Body over 64 KB | HTTP 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 cursor | Tool result with isError: true and a one-line message |
| Internal failure | Tool result with isError: true; no stack traces or internals are returned |
| Tool | Summary | Scopes |
|---|---|---|
search_laws | Search Japanese laws by title | jpstatutes_mcp + jpstatutes_read |
get_law | Get one law with its amendment schedule | jpstatutes_mcp + jpstatutes_read |
get_provisions | Read provisions of a law | jpstatutes_mcp + jpstatutes_read |
search_provisions | Full-text search of provisions | jpstatutes_mcp + jpstatutes_read |
get_norms | Get extracted legal norms | jpstatutes_mcp + jpstatutes_read |
find_definitions | Find statutory definitions of a term | jpstatutes_mcp + jpstatutes_read |
get_references | Get cross-law references | jpstatutes_mcp + jpstatutes_read |
list_upcoming_amendments | List amendments not yet in force | jpstatutes_mcp + jpstatutes_read |
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.
| Argument | Type | Restrictions | Description |
|---|---|---|---|
titleWords | string | Required. 1 to 200 characters. | Space-separated words; all must appear in the title, abbreviation or law number. |
lawType | string | Optional. One of: Act, CabinetOrder, MinisterialOrdinance. | |
limit | integer | Optional. 1 to 50. Default 20. | |
paginationCursor | string | Optional. 0 to 255 characters. | Opaque cursor from a previous call. Supply with the same other arguments. |
Unknown arguments are rejected with a tool error.
| Attribute | Type | Presence | Description |
|---|---|---|---|
totalAvailable | integer | Always present. | Total matches across all pages (capped at 10000 for full-text search). |
paginationStart | integer | Always present. | |
paginationCursor | string | Present when applicable. | Present when more results exist. |
items | list[object] | Always present. | |
items[].lawId | string | Always present. | |
items[].lawType | string | Always present. | |
items[].title | string | Always present. | |
items[].abbrev | string or null | Present when applicable. | |
items[].category | string or null | Present when applicable. | |
items[].lawNumber | string or null | Present when applicable. | |
items[].promulgationDate | string or null | Present when applicable. | |
items[].currentRevisionId | string or null | Present when applicable. | |
items[].currentRevisionEnforced | string or null | Present when applicable. | |
items[].sourceUrl | string | Always present. |
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.
| Argument | Type | Restrictions | Description |
|---|---|---|---|
lawId | string | Required. 0 to 32 characters. |
Unknown arguments are rejected with a tool error.
| Attribute | Type | Presence | Description |
|---|---|---|---|
law | object | Always present. | |
law.lawId | string | Always present. | |
law.lawType | string | Always present. | |
law.title | string | Always present. | |
law.abbrev | string or null | Present when applicable. | |
law.category | string or null | Present when applicable. | |
law.lawNumber | string or null | Present when applicable. | |
law.promulgationDate | string or null | Present when applicable. | |
law.currentRevisionId | string or null | Present when applicable. | |
law.currentRevisionEnforced | string or null | Present when applicable. | |
law.sourceUrl | string | Always present. | |
provisionCount | integer | Always present. | |
upcomingAmendments | list[object] | Always present. | |
upcomingAmendments[].revisionId | string | Present when applicable. | |
upcomingAmendments[].amendmentLawTitle | string or null | Present when applicable. | |
upcomingAmendments[].promulgateDate | string or null | Present when applicable. | |
upcomingAmendments[].enforcementDate | string or null | Present when applicable. | |
upcomingAmendments[].changedProvisionsAvailable | boolean | Present when applicable. | |
attribution | string | Always present. |
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.
| Argument | Type | Restrictions | Description |
|---|---|---|---|
lawId | string | Required. 0 to 32 characters. | |
article | string | Optional. 0 to 64 characters. | |
versionId | string | Optional. 0 to 64 characters. | |
limit | integer | Optional. 1 to 50. Default 20. | |
paginationCursor | string | Optional. 0 to 255 characters. | Opaque cursor from a previous call. Supply with the same other arguments. |
Unknown arguments are rejected with a tool error.
| Attribute | Type | Presence | Description |
|---|---|---|---|
totalAvailable | integer | Always present. | Total matches across all pages (capped at 10000 for full-text search). |
paginationStart | integer | Always present. | |
paginationCursor | string | Present when applicable. | Present when more results exist. |
items | list[object] | Always present. | |
items[].provisionId | integer | Always present. | |
items[].lawId | string | Always present. | |
items[].part | string or null | Present when applicable. | |
items[].article | string or null | Present when applicable. | |
items[].caption | string or null | Present when applicable. | |
items[].paragraph | string or null | Present when applicable. | |
items[].item | string or null | Present when applicable. | |
items[].parentProvisionId | integer or null | Present when applicable. | |
items[].text | string or null | Always present. | |
items[].versionId | string or null | Present when applicable. | null for the text in force now; a revision ID for a not-yet-in-force version. |
items[].sourceUrl | string | Always present. | |
attribution | string | Present when applicable. |
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.
| Argument | Type | Restrictions | Description |
|---|---|---|---|
text | string | Required. 1 to 200 characters. | |
lawId | string | Optional. 0 to 32 characters. | |
lawType | string | Optional. One of: Act, CabinetOrder, MinisterialOrdinance. | |
includeFutureVersions | boolean | Optional. Default false. | |
limit | integer | Optional. 1 to 50. Default 20. | |
paginationCursor | string | Optional. 0 to 255 characters. | Opaque cursor from a previous call. Supply with the same other arguments. |
Unknown arguments are rejected with a tool error.
| Attribute | Type | Presence | Description |
|---|---|---|---|
totalAvailable | integer | Always present. | Total matches across all pages (capped at 10000 for full-text search). |
paginationStart | integer | Always present. | |
paginationCursor | string | Present when applicable. | Present when more results exist. |
items | list[object] | Always present. | |
items[].provision | object | Present when applicable. | |
items[].provision.provisionId | integer | Always present. | |
items[].provision.lawId | string | Always present. | |
items[].provision.part | string or null | Present when applicable. | |
items[].provision.article | string or null | Present when applicable. | |
items[].provision.caption | string or null | Present when applicable. | |
items[].provision.paragraph | string or null | Present when applicable. | |
items[].provision.item | string or null | Present when applicable. | |
items[].provision.parentProvisionId | integer or null | Present when applicable. | |
items[].provision.text | string or null | Always present. | |
items[].provision.versionId | string or null | Present when applicable. | null for the text in force now; a revision ID for a not-yet-in-force version. |
items[].provision.sourceUrl | string | Always present. | |
items[].lawTitle | string | Present when applicable. | |
items[].snippet | string | Present when applicable. |
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.
| Argument | Type | Restrictions | Description |
|---|---|---|---|
lawId | string | Required. 0 to 32 characters. | |
article | string | Optional. 0 to 64 characters. | |
kind | string | Optional. One of: obligation, prohibition, power, delegation, penalty, exception, exception_item, evidence, gate, non_application, effort, attribution, duration, entity, role, anyone. | |
limit | integer | Optional. 1 to 50. Default 20. | |
paginationCursor | string | Optional. 0 to 255 characters. | Opaque cursor from a previous call. Supply with the same other arguments. |
Unknown arguments are rejected with a tool error.
| Attribute | Type | Presence | Description |
|---|---|---|---|
totalAvailable | integer | Always present. | Total matches across all pages (capped at 10000 for full-text search). |
paginationStart | integer | Always present. | |
paginationCursor | string | Present when applicable. | Present when more results exist. |
items | list[object] | Always present. | |
items[].provisionId | integer | Present when applicable. | |
items[].article | string or null | Present when applicable. | |
items[].paragraph | string or null | Present when applicable. | |
items[].item | string or null | Present when applicable. | |
items[].kind | string | Present when applicable. | |
items[].subject | string or null | Present when applicable. | |
items[].detail | string or null | Present when applicable. | |
items[].condition | string or null | Present when applicable. |
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.
| Argument | Type | Restrictions | Description |
|---|---|---|---|
term | string | Required. 1 to 100 characters. | |
lawId | string | Optional. 0 to 32 characters. | |
limit | integer | Optional. 1 to 50. Default 20. | |
paginationCursor | string | Optional. 0 to 255 characters. | Opaque cursor from a previous call. Supply with the same other arguments. |
Unknown arguments are rejected with a tool error.
| Attribute | Type | Presence | Description |
|---|---|---|---|
totalAvailable | integer | Always present. | Total matches across all pages (capped at 10000 for full-text search). |
paginationStart | integer | Always present. | |
paginationCursor | string | Present when applicable. | Present when more results exist. |
items | list[object] | Always present. | |
items[].term | string | Present when applicable. | |
items[].definition | string or null | Present when applicable. | |
items[].lawId | string | Present when applicable. | |
items[].lawTitle | string | Present when applicable. | |
items[].provisionId | integer | Present when applicable. | |
items[].article | string or null | Present when applicable. | |
items[].paragraph | string or null | Present when applicable. | |
items[].sourceUrl | string | Present when applicable. |
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.
| Argument | Type | Restrictions | Description |
|---|---|---|---|
lawId | string | Required. 0 to 32 characters. | |
direction | string | Required. One of: outgoing, incoming. | |
article | string | Optional. 0 to 64 characters. | |
limit | integer | Optional. 1 to 50. Default 20. | |
paginationCursor | string | Optional. 0 to 255 characters. | Opaque cursor from a previous call. Supply with the same other arguments. |
Unknown arguments are rejected with a tool error.
| Attribute | Type | Presence | Description |
|---|---|---|---|
totalAvailable | integer | Always present. | Total matches across all pages (capped at 10000 for full-text search). |
paginationStart | integer | Always present. | |
paginationCursor | string | Present when applicable. | Present when more results exist. |
items | list[object] | Always present. | |
items[].fromLawId | string | Present when applicable. | |
items[].fromLawTitle | string or null | Present when applicable. | |
items[].fromProvisionId | integer | Present when applicable. | |
items[].fromArticle | string or null | Present when applicable. | |
items[].toLawId | string or null | Present when applicable. | |
items[].toLawTitle | string or null | Present when applicable. | |
items[].kind | string | Present when applicable. |
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.
| Argument | Type | Restrictions | Description |
|---|---|---|---|
fromDate | string | Optional. 0 to 10 characters. | YYYY-MM-DD, default today (UTC). |
toDate | string | Optional. 0 to 10 characters. | |
lawId | string | Optional. 0 to 32 characters. | |
limit | integer | Optional. 1 to 50. Default 20. | |
paginationCursor | string | Optional. 0 to 255 characters. | Opaque cursor from a previous call. Supply with the same other arguments. |
Unknown arguments are rejected with a tool error.
| Attribute | Type | Presence | Description |
|---|---|---|---|
totalAvailable | integer | Always present. | Total matches across all pages (capped at 10000 for full-text search). |
paginationStart | integer | Always present. | |
paginationCursor | string | Present when applicable. | Present when more results exist. |
items | list[object] | Always present. | |
items[].lawId | string | Present when applicable. | |
items[].lawTitle | string or null | Present when applicable. | |
items[].revisionId | string | Present when applicable. | |
items[].amendmentLawTitle | string or null | Present when applicable. | |
items[].promulgateDate | string or null | Present when applicable. | |
items[].enforcementDate | string or null | Present when applicable. |
| Source | e-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 source | Public 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). |
| Coverage | 9,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 structure | Norms, 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 included | Local ordinances, case law, official English translations, notices (告示) and guidelines. |
| Updates | The dataset is rebuilt from e-Gov; the fetch date is returned per law (currentRevisionEnforced, sourceUrl). |
| Data received from clients | Only 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. |
|---|---|
| Logging | Request 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 connection | The OAuth client record and grant (anonymous ID, scopes, token hashes) in Workers KV until the grant expires or is revoked. |
| Use of queries | Queries are not stored, sold, shared or used for training. |
| Database access | The Worker reads D1 through parameterized statements only; user input is never concatenated into SQL. Full-text input is quoted as FTS5 phrases. |
| Third parties | Cloudflare (hosting, database, TLS). No other processors. No outbound calls are made while answering a request. |
| Transport | HTTPS only, certificates managed by Cloudflare. |
| Abuse limits | 120 requests per minute per grant; request bodies up to 64 KB; at most 50 items per page; batches up to 20 messages. |
| Availability | Best effort on Cloudflare's network; health check at /health. |
| Security contact | hello@lilambd.com |
| Date | Changes |
|---|---|
| 2026-11-29 | First public version. |