canlii-mcp
canlii-mcp
CanLII カナダ法情報APIのための MCP (Model Context Protocol) サーバーです。AIアシスタントが、カナダの連邦、州、準州の全管轄区域にわたる判例および法令のメタデータにアクセスできるようにします。
注: CanLII APIが提供するのはメタデータ(タイトル、引用、日付、キーワード、引用関係)のみです。文書の全文はAPIを通じて利用できません。
ツール
ツール | 説明 |
| CanLIIコレクション内のすべての裁判所および審判所を一覧表示 |
| 特定の裁判所/審判所データベースの判決を閲覧 |
| 特定の判例のメタデータ(タイトル、引用、日付、キーワード)を取得 |
| ある判例によって引用された判例、それを引用している判例、またはそれが参照している法令を取得 |
| すべての制定法および規則データベースを一覧表示 |
| 特定のデータベースの制定法または規則を閲覧 |
| 特定の法令のメタデータを取得 |
Related MCP server: courtlistener-mcp
要件
Node.js 22以上
CanLII APIキー — こちらから申請
使用方法
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.jsMCP設定に追加:
{
"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 httpMCPエンドポイントは 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に接続)
Cloudflareダッシュボード → Workers & Pages → 作成 → Gitに接続 に移動
tomilashy/canlii-mcpリポジトリを選択アプリケーションのセットアップ ページで:
プロジェクト名:
canlii-mcpビルドコマンド:
npm install && npm run buildデプロイコマンド:
npx wrangler deploy(事前入力済み)
詳細設定 を展開:
変数名:
CANLII_API変数値: あなたのCanLII APIキー
暗号化 にチェックを入れてシークレットとして保存
デプロイ をクリック
MCPエンドポイントは https://canlii-mcp.<your-subdomain>.workers.dev/mcp になります。
設定
環境変数 | 必須 | デフォルト | 説明 |
| はい | — | あなたのCanLII APIキー |
| いいえ |
| HTTPサーバーポート(HTTPモードのみ) |
| いいえ | — | HTTP認証用のベアラートークン。設定した場合、すべてのHTTPリクエストに |
レート制限
サーバーは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 仕様に従います:
コミットプレフィックス | リリースタイプ |
| パッチ ( |
| マイナー ( |
| メジャー ( |
main ブランチへのプッシュがリリースワークフローをトリガーします。リリースが作成されると、Dockerイメージが自動的にビルドされ、ghcr.io に公開されます。
ライセンス
MIT
Available Tools
7 toolsget_caseGet CaseARead-onlyInspect
Get metadata for a specific case including title, citation, decision date, keywords, and URL.
Inputs: caseId (required), databaseId (required), language.
get_case_citationsGet Case CitationsARead-onlyInspect
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 LegislationARead-onlyInspect
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 DatabasesARead-onlyInspect
List all courts and tribunals in the CanLII collection with their database IDs.
Inputs: language.
list_casesList CasesBRead-onlyInspect
List decisions from a specific caselaw database. Returns case titles, citations, and IDs.
Inputs: databaseId (required), decisionDateAfter, decisionDateBefore, language, +4 more.
list_legislationList LegislationARead-onlyInspect
List statutes or regulations from a specific legislation database.
Inputs: databaseId (required), language.
list_legislation_databasesList Legislation DatabasesARead-onlyInspect
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
Scored across 7 tools
Each tool targets a distinct operation: retrieving specific case metadata, case citations, legislation, or listing various databases and documents. No functional overlap exists.
All tool names follow a consistent verb_noun pattern using snake_case, e.g., get_case, list_cases, get_legislation, making the API predictable.
7 tools is well-scoped for a legal database API, covering core retrieval and listing operations. Slightly on the smaller side but still appropriate.
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
Related MCP Connectors
Connect AI to millions of laws and court cases with the Lawstronaut MCP.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
AI governance MCP server for EU AI Act compliance and jurisdiction verification
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP Server providing AI agents access to over 3 million US court decisions via CourtListener and EU legislation via EUR-Lex, with tools for searching cases, citations, judges, and court information.6MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server providing AI agents access to CourtListener's comprehensive legal database, featuring semantic search, hybrid search, citation verification, and research tools.7MIT
- AlicenseAqualityBmaintenanceMCP server giving AI agents structured access to Canadian federal, provincial, and municipal government data.4562MIT
- AlicenseAqualityDmaintenanceLegalMCP 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.1869MIT