Skip to main content
Glama

egov-law-mcp

e-Gov法令API v2の公式APIを参照する読み取り専用のMCPサーバーです。Python 3.12以上とuv(0.13.4で検証)を使います。上流APIのキー設定は不要です。

MCPクライアント設定

GitHubリポジトリへのアクセス権がある環境でクローンします。

git clone https://github.com/koizumikento/egov-law-mcp.git
cd egov-law-mcp
uv sync --locked

クライアントの設定に、クローン先の絶対パスを指定します。

{
  "mcpServers": {
    "egov-law-mcp": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/egov-law-mcp", "run", "--locked", "egov-law-mcp"]
    }
  }
}

Related MCP server: e-Gov Law MCP Server

ツール

ツール

用途

search_laws

法令名・任意の基準日で検索

get_law_article

法令ID・条番号で本則の条文と版情報を取得

法令名で検索し、法令IDまたは改正履歴IDで本則の条文を取得します。日付を指定した場合は指定時点の版を参照します。

CLI

uv run egov-law-mcp search-laws --title "民法" --limit 1
uv run egov-law-mcp get-law-article --law-id 129AC0000000089 --article 709

結果は標準出力にUTF-8のJSONで出力します。コマンドの引数は uv run egov-law-mcp search-laws --help で確認できます。

Pythonライブラリ

パッケージをインストールしたPython環境で、下記の非同期関数を直接呼び出せます。

import asyncio

from egov_law_mcp import search_laws

result = asyncio.run(search_laws(title="民法", limit=1))
print(result)

公開関数 search_laws、get_law_article を利用できます。イベントループがある環境では、関数を直接 await します。

出典と利用条件

コードはMIT Licenseです。取得するデータの権利と利用条件は、API提供元と各データ提供機関の定めに従います。公式API仕様 · 利用案内

開発

uv sync --locked
uv run ruff check .
uv run ty check
uv run pytest
uv build

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables intelligent search and retrieval of Japanese legal statutes through the e-Gov API. Supports smart lookup of laws and articles with abbreviation recognition, batch processing, and multi-tier caching for high-performance legal research.
      8
      15
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables querying Japanese national laws and ordinances via the e-Gov Law API, allowing AI agents to access legal data through natural language questions.
      145 npm
      MIT