Skip to main content
Glama

canlii-mcp

CanLII カナダ法情報APIのための MCP (Model Context Protocol) サーバーです。AIアシスタントが、カナダの連邦、州、準州の全管轄区域にわたる判例および法令のメタデータにアクセスできるようにします。

注: CanLII APIが提供するのはメタデータ(タイトル、引用、日付、キーワード、引用関係)のみです。文書の全文はAPIを通じて利用できません。

ツール

ツール

説明

list_case_databases

CanLIIコレクション内のすべての裁判所および審判所を一覧表示

list_cases

特定の裁判所/審判所データベースの判決を閲覧

get_case

特定の判例のメタデータ(タイトル、引用、日付、キーワード)を取得

get_case_citations

ある判例によって引用された判例、それを引用している判例、またはそれが参照している法令を取得

list_legislation_databases

すべての制定法および規則データベースを一覧表示

list_legislation

特定のデータベースの制定法または規則を閲覧

get_legislation

特定の法令のメタデータを取得

Related MCP server: courtlistener-mcp

要件

使用方法

npxによるstdio(最も簡単)

{
  "mcpServers": {
    "canlii": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@tomilashy/canlii-mcp"],
      "env": {
        "CANLII_API": "your_api_key"
      }
    }
  }
}

stdio(ソースから)

npm install
npm run build
node dist/index.js

MCP設定に追加:

{
  "mcpServers": {
    "canlii": {
      "command": "node",
      "args": ["/path/to/canlii-mcp/dist/index.js"],
      "env": {
        "CANLII_API": "your_api_key"
      }
    }
  }
}

HTTPサーバー

PORT=3000 CANLII_API=your_api_key node dist/index.js --transport http

MCPエンドポイントは http://localhost:3000/mcp で利用可能です。サーバーはステートレスモードで動作します。各リクエストは自己完結型であり、セッションIDや初期化ハンドシェイクは不要です。クライアントは直接ツールを呼び出すことができます:

curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_case_databases","arguments":{"language":"en"}}}'

Docker

docker run -e CANLII_API=your_api_key -e MCP_AUTH_TOKEN=your_secret -p 3000:3000 ghcr.io/tomilashy/canlii-mcp

またはDocker Composeを使用する場合:

services:
  canlii-mcp:
    image: ghcr.io/tomilashy/canlii-mcp
    environment:
      CANLII_API: your_api_key
      MCP_AUTH_TOKEN: your_secret  # optional
    ports:
      - "3000:3000"

Cloudflare Workers

サーバーにはWorkers互換のエントリポイント (src/worker.ts) が含まれています。

CLIデプロイ

npx wrangler secret put CANLII_API
npx wrangler secret put MCP_AUTH_TOKEN  # optional
npx wrangler deploy

ダッシュボードデプロイ(Gitに接続)

  1. Cloudflareダッシュボード → Workers & Pages → 作成 → Gitに接続 に移動

  2. tomilashy/canlii-mcp リポジトリを選択

  3. アプリケーションのセットアップ ページで:

    • プロジェクト名: canlii-mcp

    • ビルドコマンド: npm install && npm run build

    • デプロイコマンド: npx wrangler deploy (事前入力済み)

  4. 詳細設定 を展開:

    • 変数名: CANLII_API

    • 変数値: あなたのCanLII APIキー

    • 暗号化 にチェックを入れてシークレットとして保存

  5. デプロイ をクリック

MCPエンドポイントは https://canlii-mcp.<your-subdomain>.workers.dev/mcp になります。

設定

環境変数

必須

デフォルト

説明

CANLII_API

はい

—

あなたのCanLII APIキー

PORT

いいえ

3000

HTTPサーバーポート(HTTPモードのみ)

MCP_AUTH_TOKEN

いいえ

—

HTTP認証用のベアラートークン。設定した場合、すべてのHTTPリクエストに Authorization: Bearer <token> を含める必要があります。設定しない場合、サーバーは認証なしで動作します。

レート制限

サーバーはCanLIIのAPI制限を自動的に適用します:

  • 同時リクエスト数: 1

  • 1秒あたりのリクエスト数: 2

  • 1日あたりのリクエスト数: 5,000

1日の制限を超えたリクエストは、APIに到達する前にエラーを返します。

開発

npm install
npm run build      # compile TypeScript
npm run watch      # watch mode

リリース

このプロジェクトは semantic-release を介して セマンティックバージョニング を使用しています。コミットメッセージは Conventional Commits 仕様に従います:

コミットプレフィックス

リリースタイプ

fix:

パッチ (1.0.0 → 1.0.1)

feat:

マイナー (1.0.0 → 1.1.0)

feat!: または BREAKING CHANGE

メジャー (1.0.0 → 2.0.0)

main ブランチへのプッシュがリリースワークフローをトリガーします。リリースが作成されると、Dockerイメージが自動的にビルドされ、ghcr.io に公開されます。

ライセンス

MIT

Available Tools

7 tools
get_caseGet CaseA
Read-only
Inspect

Get metadata for a specific case including title, citation, decision date, keywords, and URL.

Inputs: caseId (required), databaseId (required), language.

get_case_citationsGet Case CitationsA
Read-only
Inspect

Get citation information for a case: what it cites, what cites it, or what legislation it references. Note: the CanLII API currently only supports English for this endpoint; French requests will fall back to English.

Inputs: caseId (required), citationType (required), databaseId (required), language.

get_legislationGet LegislationA
Read-only
Inspect

Get metadata for a specific piece of legislation including title, citation, dates, and repeal status.

Inputs: databaseId (required), legislationId (required), language.

list_case_databasesList Case DatabasesA
Read-only
Inspect

List all courts and tribunals in the CanLII collection with their database IDs.

Inputs: language.

list_casesList CasesB
Read-only
Inspect

List decisions from a specific caselaw database. Returns case titles, citations, and IDs.

Inputs: databaseId (required), decisionDateAfter, decisionDateBefore, language, +4 more.

list_legislationList LegislationA
Read-only
Inspect

List statutes or regulations from a specific legislation database.

Inputs: databaseId (required), language.

list_legislation_databasesList Legislation DatabasesA
Read-only
Inspect

List all legislation and regulation databases in the CanLII collection.

Inputs: language.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a distinct operation: retrieving specific case metadata, case citations, legislation, or listing various databases and documents. No functional overlap exists.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, e.g., get_case, list_cases, get_legislation, making the API predictable.

    Tool Count4/5

    7 tools is well-scoped for a legal database API, covering core retrieval and listing operations. Slightly on the smaller side but still appropriate.

    Completeness3/5

    The set covers basic CRUD-like read operations for cases and legislation, but lacks search/full-text query capabilities, which are common in legal research APIs.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      MCP server giving AI agents structured access to Canadian federal, provincial, and municipal government data.
      4
      5
      62
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      LegalMCP is a comprehensive US legal MCP server that enables AI assistants to search over 4 million US court opinions, manage Clio practice data, and access PACER federal filings through natural language.
      18
      69
      MIT