{"_id":"@codeagentjp/egov-law-mcp","name":"@codeagentjp/egov-law-mcp","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@codeagentjp/egov-law-mcp","version":"0.1.0","description":"Local stdio MCP server for searching Japanese laws and retrieving article text from e-Gov Law Search. Includes related-law lookup (enforcement orders/regulations) inspired by Gennai Lawsy.","type":"module","bin":{"egov-law-mcp":"bin/egov-law-mcp.mjs"},"keywords":["mcp","model-context-protocol","egov","japanese-law","law","legal-tech","lawsy","gennai","japan","rag"],"author":{"name":"codeagent.jp"},"license":"MIT","engines":{"node":">=20.0.0"},"repository":{"type":"git","url":"git+https://github.com/SHAYOUWORLD/egov-law-mcp.git"},"homepage":"https://codeagent.jp/tools/egov-law-mcp","bugs":{"url":"https://github.com/SHAYOUWORLD/egov-law-mcp/issues"},"publishConfig":{"access":"public"},"_id":"@codeagentjp/egov-law-mcp@0.1.0","gitHead":"040645badc6af2a2a2dfd087bc851f674727b1f8","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-o9AtjiqzdRgGyUPMjoVCgG/UXu36G76d56VB/fv7+KXSvrdwSnCHX7qNZEeYgtCDXNUP089H0wndiEaNKep1yg==","shasum":"3deec0e2736df3e13d6aafcb2b4ce98e7e9112f5","tarball":"https://registry.npmjs.org/@codeagentjp/egov-law-mcp/-/egov-law-mcp-0.1.0.tgz","fileCount":4,"unpackedSize":21935,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codeagentjp%2fegov-law-mcp@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDmixWuRf/lZa1dKLUrdaGSWHbZR3PM0zEkBX7ELeOnewIhAO2fxMyD+jm9Im9zZzhGIXYf3qxfs8C4oNa5FJBQMdOi"}]},"_npmUser":{"name":"codeagentjp","email":"contact@codeagent.jp"},"directories":{},"maintainers":[{"name":"codeagentjp","email":"contact@codeagent.jp"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/egov-law-mcp_0.1.0_1777087145082_0.33028523674448573"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-25T03:19:04.950Z","0.1.0":"2026-04-25T03:19:05.235Z","modified":"2026-04-25T03:19:05.663Z"},"maintainers":[{"name":"codeagentjp","email":"contact@codeagent.jp"}],"description":"Local stdio MCP server for searching Japanese laws and retrieving article text from e-Gov Law Search. Includes related-law lookup (enforcement orders/regulations) inspired by Gennai Lawsy.","homepage":"https://codeagent.jp/tools/egov-law-mcp","keywords":["mcp","model-context-protocol","egov","japanese-law","law","legal-tech","lawsy","gennai","japan","rag"],"repository":{"type":"git","url":"git+https://github.com/SHAYOUWORLD/egov-law-mcp.git"},"author":{"name":"codeagent.jp"},"bugs":{"url":"https://github.com/SHAYOUWORLD/egov-law-mcp/issues"},"license":"MIT","readme":"# @codeagentjp/egov-law-mcp\n\nLocal stdio MCP server for searching Japanese laws and retrieving article text from [e-Gov Law Search](https://laws.e-gov.go.jp/).\n\nThis server does not call an LLM. It only returns source-backed law data and e-Gov URLs so your MCP client (Claude Desktop, Claude Code, Cursor, or any other agent) can cite the original source.\n\nDesign choices were informed by reading Digital Agency's open-sourced [Lawsy-Custom-BQ](https://github.com/digital-go-jp/genai-ai-api/tree/main/google-cloud/lawsy-custom-bq) (released 2026-04-24 as part of the Gennai government AI OSS release). See the design notes at [codeagent.jp](https://codeagent.jp/posts/gennai-lawsy-mcp-architecture/).\n\n## Why another e-Gov MCP\n\nThere is an existing `egov-law-mcp` on npm by another author. This package differs in three ways:\n\n1. **`find_related_laws`** — looks up enforcement orders (施行令) and regulations (施行規則) for a given base law name. Lawsy-Custom-BQ has the same step server-side; useful because definitions and delegated rules often live outside the parent act.\n2. **Source attribution baked into every tool result** — every response includes the law name, law ID, article number, and the canonical e-Gov URL, so the calling LLM cannot drop the citation.\n3. **Single-file `.mjs`, no build step** — `bin/egov-law-mcp.mjs` runs directly under Node 20+. Easier to audit, smaller install.\n\n## Status\n\nMVP. The API surface is intentionally small:\n\n- `search_laws` — search current Japanese laws by keyword.\n- `get_article` — retrieve a specific article from a law by law ID or law number.\n- `get_law` — retrieve basic metadata and a text preview for a law.\n- `find_related_laws` — find likely related enforcement orders and regulations.\n\n## Requirements\n\n- Node.js 20 or later\n- Network access to `https://laws.e-gov.go.jp`\n\n## Install\n\nFrom npm:\n\n```json\n{\n  \"mcpServers\": {\n    \"egov-law\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@codeagentjp/egov-law-mcp\"]\n    }\n  }\n}\n```\n\nFrom source for development:\n\n```bash\ngit clone https://github.com/SHAYOUWORLD/egov-law-mcp.git\ncd egov-law-mcp\nnode bin/egov-law-mcp.mjs\n```\n\n```json\n{\n  \"mcpServers\": {\n    \"egov-law\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/egov-law-mcp/bin/egov-law-mcp.mjs\"]\n    }\n  }\n}\n```\n\n## Tools\n\n### `search_laws`\n\nSearches the e-Gov law list.\n\n```json\n{\n  \"keyword\": \"個人情報\",\n  \"limit\": 10\n}\n```\n\n### `get_article`\n\nRetrieves article text. Provide either `lawId` or `lawNum`.\n\n```json\n{\n  \"lawId\": \"503AC0000000035\",\n  \"article\": \"2\"\n}\n```\n\n### `get_law`\n\nRetrieves basic metadata and a plain text preview of a law.\n\n```json\n{\n  \"lawId\": \"503AC0000000035\",\n  \"previewChars\": 3000\n}\n```\n\n### `find_related_laws`\n\nSearches for laws whose names look related to a base law name, including enforcement orders and regulations.\n\n```json\n{\n  \"lawName\": \"個人情報の保護に関する法律\",\n  \"limit\": 10\n}\n```\n\n## Data Source and Attribution\n\nThis package uses the e-Gov Law Search API:\n\n- e-Gov Law Search: <https://laws.e-gov.go.jp/>\n- Law API documentation: <https://laws.e-gov.go.jp/docs/law-data-basic/8529371-law-api-v1/>\n- e-Gov terms: <https://developer.e-gov.go.jp/contents/terms>\n- MCP stdio transport: <https://modelcontextprotocol.io/specification/2025-06-18/basic/transports>\n\nTool results include source attribution. When you publish or redistribute output based on this package, include an appropriate e-Gov source attribution.\n\nSuggested attribution:\n\n> 出典: e-Gov法令検索（<https://laws.e-gov.go.jp/>）\n\n## Safety Notes\n\n- This package is a **law reference tool, not legal advice**. Verify important legal conclusions against the official e-Gov page and, where necessary, consult a qualified professional.\n- It does not execute shell commands.\n- It writes JSON-RPC messages only to stdout and logs only to stderr.\n- It fetches only e-Gov Law Search endpoints.\n\n## Related\n\n- Design notes: [源内のLawsy実装をMCP化するなら、どこを残してどこを捨てるべきか (codeagent.jp)](https://codeagent.jp/posts/gennai-lawsy-mcp-architecture/)\n- Background on Gennai OSS release: [政府AI「源内」のソースコードが商用利用可能な形で公開 (codeagent.jp)](https://codeagent.jp/posts/government-ai-gennai-oss-release-2026-04-24/)\n- Reference implementation we learned from: [digital-go-jp/genai-ai-api/google-cloud/lawsy-custom-bq](https://github.com/digital-go-jp/genai-ai-api/tree/main/google-cloud/lawsy-custom-bq)\n\n## License\n\n[MIT](./LICENSE) © codeagent.jp\n","readmeFilename":"README.md","_rev":"1-40081524054d7a53af4ae6725508023a"}