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에서 사용할 수 있습니다. 서버는 상태 비저장(stateless) 모드로 실행되며, 각 요청은 독립적이므로 세션 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 → Create → Connect to 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 인증을 위한 Bearer 토큰. 설정 시 모든 HTTP 요청에 |
속도 제한
서버는 CanLII의 API 제한을 자동으로 적용합니다:
한 번에 1개의 요청
초당 2개의 요청
일일 5,000개의 요청
일일 제한을 초과하는 요청은 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