Skip to main content
Glama
HiroakiKatoh

legal-impact-mapper

by HiroakiKatoh

Legal Impact Mapper (LIM)

法律文書の変更影響シミュレーター - 1行の変更がどこまで影響するかを即座に可視化するMCPサーバー

概要

Legal Impact Mapper は、弁護士・パラリーガル向けの MCP (Model Context Protocol) サーバーです。Claude Code、Cursor などの AI エディタから呼び出し、法律文書の1箇所を変更した際の影響範囲を構造的に分析します。

このツールがやること:

  • 契約書・法律文書をノード(事実・義務・条件等)とエッジ(依存関係)のグラフに構造化

  • ノードの変更を検出し、依存グラフを辿って影響範囲を自動伝播

  • 各影響ノードへの影響理由とリスクレベルを提示

このツールがやらないこと:

  • 文書生成

  • 要約

  • 法的助言

Related MCP server: contract-risk-analyzer

インストール

npm install legal-impact-mapper

または、ローカルでビルド:

git clone https://github.com/HiroakiKatoh/legal-impact-mapper.git
cd legal-impact-mapper
npm install
npm run build

設定

環境変数

変数名

必須

説明

ANTHROPIC_API_KEY

Yes

Anthropic API キー

LIM_MODEL

No

使用するモデル(デフォルト: claude-sonnet-4-20250514

Claude Desktop での設定

claude_desktop_config.json に以下を追加:

{
  "mcpServers": {
    "legal-impact-mapper": {
      "command": "node",
      "args": ["path/to/Legal_Impact_Mapper/dist/server.js"],
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-xxxxx"
      }
    }
  }
}

Cursor での設定

.cursor/mcp.json に以下を追加:

{
  "mcpServers": {
    "legal-impact-mapper": {
      "command": "node",
      "args": ["path/to/Legal_Impact_Mapper/dist/server.js"],
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-xxxxx"
      }
    }
  }
}

提供ツール

1. extract_fact_graph

テキストから事実分類ノードと依存関係グラフを抽出します。

入力:

{
  "text": "第5条(支払条件)\n甲は乙に対し、本業務の対価として月額50万円を..."
}

出力:

{
  "nodes": [
    {
      "id": "n1",
      "type": "obligation",
      "text": "甲は乙に月額50万円を支払う",
      "confidence": 0.95
    },
    {
      "id": "n2",
      "type": "timing",
      "text": "支払期限:翌月末",
      "confidence": 0.9
    }
  ],
  "edges": [
    { "from": "n2", "to": "n1", "type": "enables" }
  ]
}

2. update_fact_classification

ノードのテキストや分類を変更し、差分情報を返します。

入力:

{
  "graph": { "nodes": [...], "edges": [...] },
  "node_id": "n2",
  "new_text": "支払期限:翌月10日",
  "mark_verified": true
}

出力:

{
  "graph": { "nodes": [...], "edges": [...] },
  "changed_node_ids": ["n2"],
  "diff_summary": {
    "modified_nodes": 1,
    "details": [
      {
        "id": "n2",
        "old_text": "支払期限:翌月末",
        "new_text": "支払期限:翌月10日"
      }
    ]
  }
}

3. analyze_impact

変更ノードから影響範囲を分析し、理由とリスクレベルを返します。

入力:

{
  "graph": { "nodes": [...], "edges": [...] },
  "changed_node_ids": ["n2"]
}

出力:

{
  "changed_node_ids": ["n2"],
  "affected_node_ids": ["n1"],
  "directly_affected": ["n1"],
  "indirectly_affected": [],
  "explanations": [
    {
      "node_id": "n1",
      "node_text": "甲は乙に月額50万円を支払う",
      "reason": "支払タイミングが短縮されるため甲の資金負担に影響",
      "impact_level": "direct"
    }
  ],
  "risk_level": "medium",
  "warning": "この変更は支払条件だけでなく契約全体の資金設計に影響します"
}

使い方の流れ

Step 1: extract_fact_graph(text)     → テキストをグラフ化
Step 2: update_fact_classification() → ノードを変更
Step 3: analyze_impact()             → 影響範囲を分析

実践例:業務委託契約の支払期限変更

  1. グラフ化: 契約書テキストを extract_fact_graph に渡す

  2. 変更: 「支払期限:翌月末」→「支払期限:翌月10日」に update_fact_classification で変更

  3. 影響分析: analyze_impact で影響範囲を確認

    • 直接影響:支払義務のキャッシュフロー変化

    • 間接影響:支払留保条項の運用負荷増加

    • 潜在影響:契約バランスの再交渉リスク

主要機能

世界線分岐(group_id)

同一事実に対する複数の解釈を group_id で管理し、法的評価の分岐を表現します。

{
  "id": "n6a", "type": "interpretation",
  "text": "アルバイトとしての就労",
  "group_id": "employment_type"
},
{
  "id": "n6b", "type": "interpretation",
  "text": "正社員としての雇用",
  "group_id": "employment_type"
}

弁護士修正保護(user_verified)

弁護士が修正したノードは user_verified: true となり、以降のLLM再生成から保護されます。

開発

npm install          # 依存パッケージのインストール
npm run build        # TypeScriptのビルド
npm test             # テストの実行
npm run dev          # 開発モード(watchビルド)

ライセンス

ISC

Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HiroakiKatoh/legal-impact-mapper'

If you have feedback or need assistance with the MCP directory API, please join our Discord server