Skip to main content
Glama
ymadd

e-Gov Law MCP Server

by ymadd

e-Gov Law MCP Server

日本政府の e-Gov 法令 API をラップした Model Context Protocol (MCP) サーバーです。

機能

  • 法令検索 (search_laws) - キーワードやカテゴリで法令を検索

  • 法令本文取得 (get_law_text) - 法令 ID または法令番号から全文を取得

  • 条文取得 (get_article) - 特定の条文を取得

Related MCP server: financial-law-mcp

インストール

Claude Code で使う

npx -y egov-law-mcp

claude_desktop_config.json に追加

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

ツール

search_laws

法令を検索します。

パラメータ:

  • keyword (string, 必須): 検索キーワード

  • category (number, optional): 法令カテゴリ

    • 1: 憲法・法律

    • 2: 政令・勅令

    • 3: 府省令

    • 4: その他

例:

search_laws({ keyword: "個人情報保護" })
search_laws({ keyword: "契約", category: 1 })

get_law_text

法令の全文を取得します。

パラメータ:

  • law_id (string): 法令 ID (例: "405AC0000000089")

  • law_number (string): 法令番号 (例: "平成十五年法律第五十七号")

どちらか一方が必須です。

例:

get_law_text({ law_id: "405AC0000000089" })
get_law_text({ law_number: "平成十五年法律第五十七号" })

get_article

特定の条文を取得します。

パラメータ:

  • law_id (string, 必須): 法令 ID

  • article (string, 必須): 条番号 (例: "第一条", "第二十条")

  • paragraph (number, optional): 項番号

例:

get_article({ law_id: "405AC0000000089", article: "第一条" })
get_article({ law_id: "405AC0000000089", article: "第二条", paragraph: 2 })

キャッシュ

API レスポンスは自動的にキャッシュされます:

データ種別

キャッシュ期間

法令一覧

24時間

法令本文

7日間

更新一覧

1時間

キャッシュは ~/.cache/egov-law-mcp/ に保存されます。

対象法令の例

  • 印紙税法 - 契約書への収入印紙

  • 下請法 - 下請取引の公正化

  • 個人情報保護法 - データ保護義務

  • 民法 - 契約の基本原則

  • 消費者契約法 - B2C 契約の制限

  • 会社法 - 企業統治

e-Gov API について

このサーバーは e-Gov 法令 API を使用しています。API は無料で利用可能で、認証不要です。

ライセンス

MIT

Available Tools

3 tools
get_articleA

特定の条文を取得します。法令IDと条番号を指定して、特定の条文を取得できます。

使用例:

  • 民法第1条を取得: law_id="129AC0000000089", article="第一条"

  • 民法第2条第2項を取得: law_id="129AC0000000089", article="第二条", paragraph=2

条番号の指定方法:

  • 漢数字: "第一条", "第二十条", "第百二十三条"

  • アラビア数字: "1", "20", "123"

主な法令ID:

  • 民法: 129AC0000000089

  • 会社法: 417AC0000000086

  • 個人情報保護法: 415AC0000000057

  • 下請法: 331AC0000000120

  • 消費者契約法: 412AC0000000061

ParametersJSON Schema
NameRequiredDescriptionDefault
law_idYes法令ID (例: "129AC0000000089")
articleYes条番号 (例: "第一条", "1")
paragraphNo項番号 (省略時は全項を取得)

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the transparency burden. It explains the retrieval behavior and paragraph selection via examples, but does not describe return format, error cases, or any special behavior. For a simple read operation this is adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with usage examples, article format guidance, and a law ID list, all relevant to invocation. It repeats the core statement twice at the start, which is a minor inefficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter read-only tool with no output schema, the description is sufficiently complete: it covers all parameters, gives examples, and includes authoritative law ID values. A return-format note would be nice but is not essential for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds meaningful value by explaining article number formats (漢数字/アラビア数字) and providing a list of common law IDs, which helps an agent construct valid parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action (取得) and resource (条文) with law_id and article number. It is distinguishable from search_laws and get_law_text by its focus on a specific article, but it does not explicitly contrast itself with those siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides concrete usage examples and conditions: use it when you know the law_id and article number. It does not mention exclusions or alternatives, but the examples make the intended use case clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_law_textA

法令の全文を取得します。法令IDまたは法令番号で指定できます。

使用例:

  • 法令IDで取得: law_id="405AC0000000089"

  • 法令番号で取得: law_number="平成十五年法律第五十七号"

主な法令ID:

  • 民法: 129AC0000000089

  • 会社法: 417AC0000000086

  • 個人情報保護法: 415AC0000000057

  • 下請法: 331AC0000000120

  • 印紙税法: 342AC0000000023

ParametersJSON Schema
NameRequiredDescriptionDefault
law_idNo法令ID (例: "405AC0000000089")
law_numberNo法令番号 (例: "平成十五年法律第五十七号")

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly implies a read-only retrieval operation and gives example parameters, but it does not disclose the output format, error handling, or the expectation that at least one parameter should be supplied.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: a brief opening sentence, a 'Usage examples' section, and a 'Main law IDs' section with bullet points. Every section is useful, though the reference list adds length; still, the core purpose is front-loaded and the layout keeps it scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter tool, the description is fairly complete: it defines the purpose, shows example usage, and gives helpful law ID references. It could explicitly note that at least one parameter is required and describe the returned text format, but the statement that it returns the full text of the law partially compensates for the lack of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema already documents both parameters (100% coverage), the description goes beyond it by providing concrete example values and a curated list of law IDs for major laws such as the Civil Code and Companies Act. This adds real guidance for constructing valid parameter values without external lookups.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: '法令の全文を取得します' (gets the full text of a law), and clearly indicates two specification methods (law ID or law number). This distinguishes it from siblings like search_laws and get_article, as it is about retrieving entire law text rather than searching or fetching a single article.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context through examples showing exactly how to use law_id and law_number, and lists common law IDs for quick reference. However, it does not explicitly name alternative tools or state when not to use this tool, leaving some inference to the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_lawsB

法令を検索します。キーワードやカテゴリで日本の法令を検索できます。

カテゴリ:

  • 1: 憲法・法律

  • 2: 政令・勅令

  • 3: 府省令

  • 4: その他

使用例:

  • 個人情報保護に関する法令を検索

  • 契約に関する法律を検索

  • 特定のカテゴリの法令を検索

ParametersJSON Schema
NameRequiredDescriptionDefault
keywordYes検索キーワード(法令名、条文内容など)
categoryNo法令カテゴリ (1: 憲法・法律, 2: 政令・勅令, 3: 府省令, 4: その他)

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden of behavioral disclosure. It makes the basic search behavior clear and enumerates the category values. It does not disclose result format, matching behavior, pagination, or any side effects, but the operation is a simple read-oriented search and the description is not misleading.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded with the core purpose, followed by a clear category list and illustrative examples. There is slight redundancy between the opening sentence and the second sentence, but nothing bloated or irrelevant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema or annotations, so some burden falls on the description to explain behavior. It adequately covers inputs and categories but does not describe what the search returns or any limitations. For a straightforward search tool this is workable, but richer detail would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters. The description adds useful examples and repeats the category mapping, but it does not add substantial semantic meaning beyond the schema's own parameter descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the operation ('法令を検索します') and the resource (Japanese laws), and adds the search dimensions keyword/category. It is meaningfully differentiated from the sibling names get_law_text and get_article by the search vs. retrieval framing, though it does not explicitly call out that distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The examples imply when to use the tool: searching for laws by topic, contract-related laws, or category. However, the description does not explicitly explain when to prefer search_laws over get_law_text or get_article, nor does it state exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 3 tool updatesv0.1.0
    • First observedget_article
    • First observedget_law_text
    • First observedsearch_laws

TDQS

A4/5.0

Scored across 3 tools

Disambiguation5/5

search_laws locates laws, get_law_text retrieves full texts, and get_article fetches a specific provision. The boundaries are clear and there is no meaningful overlap between the tools.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern: search_laws, get_law_text, get_article. The naming is predictable and easy for an agent to navigate.

Tool Count5/5

The server has exactly three tools, each covering a distinct and necessary step in the legal document retrieval workflow. This is well-scoped for a focused law lookup server.

Completeness5/5

The toolset provides a complete read-only lifecycle for legal information: search for relevant laws, retrieve the full text, and fetch specific articles. No obvious dead ends or essential missing operations are apparent.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    MCP server to fetch Japanese financial laws and regulations from the e-Gov API, preventing hallucinations in Claude's responses. Supports 9 domains including Financial Instruments and Exchange Act, Banking Act, etc.
    5
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    MCP server for Legalize.dev, enabling AI to query and understand legal frameworks across countries via a structured legislation API.
    13
    1
    -
  • F
    license
    B
    quality
    D
    maintenance
    MCP server for searching Japanese government procurement notices via the Kanpou API. Enables LLMs to search by date, keyword, or detailed criteria.
    3
    1
    -