e-Gov (Japanese Legal Database) logo

e-Gov (Japanese Legal Database)

Community
groundcobra009

e-Gov法令APIを使用して日本の法令情報を検索・取得するModel Context Protocolサーバー

Publishergroundcobra009
Repositoryhourei-mcp-server
LanguageJavaScript
Forks
6
Stars
48
Available tools
3
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    e-Gov (Japanese Legal Database) exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 3 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    48 stars and 6 forks from the linked repository.

法令MCP Server

e-Gov法令APIを使用して日本の法令情報を検索・取得するMCPサーバーです。

npm version License: MIT

機能

このMCPサーバーは以下のツールを提供します:

1. search_law

法令名や法令番号で法令を検索します。

パラメータ:

  • keyword (必須): 検索キーワード(法令名の一部や法令番号)
  • category (オプション): 法令の種別
    • 1: 法律
    • 2: 政令
    • 3: 省令
    • 4: 規則
    • 5: その他
  • limit (オプション): 取得する最大件数(デフォルト: 100)

2. get_law_data

法令番号を指定して法令の詳細データを取得します。

パラメータ:

  • lawNum (必須): 法令番号(例: 平成十七年法律第百十七号)

3. get_law_revision

法令の改正履歴を取得します。

パラメータ:

  • lawNum (必須): 法令番号

インストール

npm経由でインストール(推奨)

bash
npx hourei-mcp-server

ローカル開発

bash
git clone <repository-url>
cd hourei-mcp-server
npm install

使用方法

MCPクライアントでの設定

Claude Desktopなどのクライアントの設定ファイル(~/Library/Application Support/Claude/claude_desktop_config.json)に以下を追加:

json
{
  "mcpServers": {
    "hourei": {
      "command": "npx",
      "args": ["-y", "hourei-mcp-server"]
    }
  }
}

設定後、Claude Desktopを再起動してください。

Cursor AI での設定

Cursorの設定ファイル(.cursor/mcp_config.json または設定画面)に以下を追加:

json
{
  "mcpServers": {
    "hourei": {
      "command": "npx",
      "args": ["-y", "hourei-mcp-server"]
    }
  }
}

ChatGPT Desktop での設定

ChatGPTでは、MCPサーバーのURLを指定する形式で設定します。

オプション1: npxコマンドで実行(他のクライアントと同じ)

json
{
  "mcpServers": {
    "hourei": {
      "command": "npx",
      "args": ["-y", "hourei-mcp-server"]
    }
  }
}

オプション2: URL形式で指定(SSEサーバー経由)

SSE対応サーバーを別途立ち上げた場合:

json
{
  "mcpServers": {
    "hourei": {
      "url": "http://localhost:3000/sse"
    }
  }
}

または、リモートサーバーにデプロイした場合:

json
{
  "mcpServers": {
    "hourei": {
      "url": "https://your-server.com/sse"
    }
  }
}

注意: 現在のバージョン(v1.0.5)はstdio接続のみ対応しています。URL形式で使用する場合は、別途SSE対応のラッパーサーバーが必要です。

Manus での設定

Manusの設定ファイルに以下を追加:

json
{
  "mcpServers": {
    "hourei": {
      "command": "npx",
      "args": ["-y", "hourei-mcp-server"]
    }
  }
}

Dify での設定

DifyのエージェントでMCPツールを使用する場合:

  1. Difyの設定ファイルに追加

環境変数またはDifyの設定で以下を指定:

json
{
  "mcpServers": {
    "hourei": {
      "command": "npx",
      "args": ["-y", "hourei-mcp-server"]
    }
  }
}
  1. エージェントブロックでの使用

Difyのワークフロー内で「ツール」ブロックを追加し、以下のMCPツールを選択:

  • search_law - 法令検索
  • get_law_data - 法令詳細取得
  • get_law_revision - 改正履歴取得
  1. 使用例:法令検索エージェント
入力ブロック → LLMブロック → ツールブロック(search_law) → 出力ブロック

ツールブロックのパラメータ設定例:

json
{
  "keyword": "{{user_input}}",
  "category": "1",
  "limit": 100
}

ローカルパスで実行(開発用)

json
{
  "mcpServers": {
    "hourei": {
      "command": "node",
      "args": ["/path/to/hourei-mcp-server/index.js"]
    }
  }
}

使用例

このMCPサーバーでできることの具体例です。

1. 法令のキーワード検索

個人情報保護関連の法律を検索:

javascript
{
  "keyword": "個人情報保護",
  "category": "1"  // 法律のみ
}

労働基準法を検索:

javascript
{
  "keyword": "労働基準法"
}

消費税に関する政令を検索:

javascript
{
  "keyword": "消費税",
  "category": "2",  // 政令
  "limit": 50
}

2. 法令の詳細データ取得

個人情報保護法の全文を取得:

javascript
{
  "lawNum": "平成十五年法律第五十七号"
}

民法の全文を取得:

javascript
{
  "lawNum": "明治二十九年法律第八十九号"
}

刑法の全文を取得:

javascript
{
  "lawNum": "明治四十年法律第四十五号"
}

3. 法令の改正履歴を確認

個人情報保護法の改正履歴:

javascript
{
  "lawNum": "平成十五年法律第五十七号"
}

できること

✅ 法令の検索

  • キーワードで法令を検索
  • 法律、政令、省令など種別で絞り込み
  • 最大100件まで一度に取得可能

✅ 法令データの取得

  • 法令番号を指定して全文取得
  • XML形式で構造化されたデータ
  • 条文、項、号などの階層構造を含む

✅ 改正履歴の確認

  • いつ、どのように法令が改正されたか
  • 改正法令の情報を取得
  • 施行日の確認

✅ 活用例

  • 法的調査・リサーチ
  • コンプライアンスチェック
  • 契約書作成時の参照
  • 法令遵守の確認
  • 法律相談の補助
  • 法改正の追跡
  • Difyエージェントでの法令検索自動化
  • チャットボットへの法令知識統合

対応クライアント

  • ✅ Claude Desktop(npx経由)
  • ✅ Cursor AI(npx経由)
  • ✅ ChatGPT Desktop(npxまたはURL形式)
  • ✅ Manus(npx経由)
  • ✅ Dify(エージェントワークフロー)
  • ✅ その他MCP対応クライアント(stdio接続対応)

技術仕様

  • Node.js ESM形式
  • MCP SDK v0.5.0
  • e-Gov法令API v2を使用
  • 対応フォーマット: XML

開発

リポジトリのクローン

bash
git clone https://github.com/yourusername/hourei-mcp-server.git
cd hourei-mcp-server
npm install

ローカルでテスト

bash
node index.js

ライセンス

MIT

貢献

Pull Requestsを歓迎します!

サポート

問題が発生した場合は、Issuesで報告してください。

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "hourei": {
      "command": "npx",
      "args": [
        "-y",
        "hourei-mcp-server"
      ]
    }
  }
}

Available Tools

  • search_law

    法令名や法令番号で法令を検索します。キーワード検索に対応しています。

  • get_law_data

    法令番号を指定して法令の詳細データを取得します。

  • get_law_revision

    法令の改正履歴を取得します。

Use e-Gov (Japanese Legal Database) MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once e-Gov (Japanese Legal Database) is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add e-Gov (Japanese Legal Database) as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the e-Gov (Japanese Legal Database) MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "e-gov-japanese-legal-database": {
      "command": "npx",
      "args": [
        "-y",
        "hourei-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the e-Gov (Japanese Legal Database) MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the e-Gov (Japanese Legal Database) MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use e-Gov (Japanese Legal Database) to help me with this task?
e-Gov (Japanese Legal Database)
Sure. I read it.
Here is what I found using e-Gov (Japanese Legal Database).

Frequently asked questions

What is the e-Gov (Japanese Legal Database) MCP server used for?

e-Gov (Japanese Legal Database) is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use e-Gov (Japanese Legal Database) MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use e-Gov (Japanese Legal Database) with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use e-Gov (Japanese Legal Database) MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With e-Gov (Japanese Legal Database) connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect e-Gov (Japanese Legal Database) MCP to TypingMind?

e-Gov (Japanese Legal Database) runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does e-Gov (Japanese Legal Database) MCP provide in TypingMind?

e-Gov (Japanese Legal Database) exposes 3 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use e-Gov (Japanese Legal Database) MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If e-Gov (Japanese Legal Database) requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇