egov-law-mcp

egov-law-mcp

Local 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.

Category
Visit Server

README

@codeagentjp/egov-law-mcp

Local stdio MCP server for searching Japanese laws and retrieving article text from e-Gov Law Search.

This 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.

Design choices were informed by reading Digital Agency's open-sourced Lawsy-Custom-BQ (released 2026-04-24 as part of the Gennai government AI OSS release). See the design notes at codeagent.jp.

Why another e-Gov MCP

There is an existing egov-law-mcp on npm by another author. This package differs in three ways:

  1. 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.
  2. 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.
  3. Single-file .mjs, no build stepbin/egov-law-mcp.mjs runs directly under Node 20+. Easier to audit, smaller install.

Status

MVP. The API surface is intentionally small:

  • search_laws — search current Japanese laws by keyword.
  • get_article — retrieve a specific article from a law by law ID or law number.
  • get_law — retrieve basic metadata and a text preview for a law.
  • find_related_laws — find likely related enforcement orders and regulations.

Requirements

  • Node.js 20 or later
  • Network access to https://laws.e-gov.go.jp

Install

From npm:

{
  "mcpServers": {
    "egov-law": {
      "command": "npx",
      "args": ["-y", "@codeagentjp/egov-law-mcp"]
    }
  }
}

From source for development:

git clone https://github.com/SHAYOUWORLD/egov-law-mcp.git
cd egov-law-mcp
node bin/egov-law-mcp.mjs
{
  "mcpServers": {
    "egov-law": {
      "command": "node",
      "args": ["/absolute/path/to/egov-law-mcp/bin/egov-law-mcp.mjs"]
    }
  }
}

Tools

search_laws

Searches the e-Gov law list.

{
  "keyword": "個人情報",
  "limit": 10
}

get_article

Retrieves article text. Provide either lawId or lawNum.

{
  "lawId": "503AC0000000035",
  "article": "2"
}

get_law

Retrieves basic metadata and a plain text preview of a law.

{
  "lawId": "503AC0000000035",
  "previewChars": 3000
}

find_related_laws

Searches for laws whose names look related to a base law name, including enforcement orders and regulations.

{
  "lawName": "個人情報の保護に関する法律",
  "limit": 10
}

Data Source and Attribution

This package uses the e-Gov Law Search API:

Tool results include source attribution. When you publish or redistribute output based on this package, include an appropriate e-Gov source attribution.

Suggested attribution:

出典: e-Gov法令検索(https://laws.e-gov.go.jp/

Safety Notes

  • 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.
  • It does not execute shell commands.
  • It writes JSON-RPC messages only to stdout and logs only to stderr.
  • It fetches only e-Gov Law Search endpoints.

Related

License

MIT © codeagent.jp

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured