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에서 사용할 수 있습니다. 서버는 상태 비저장(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 연결)

  1. Cloudflare 대시보드 → Workers & Pages → Create → Connect to 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 인증을 위한 Bearer 토큰. 설정 시 모든 HTTP 요청에 Authorization: Bearer <token>이 포함되어야 합니다. 설정하지 않으면 서버가 인증 없이 실행됩니다.

속도 제한

서버는 CanLII의 API 제한을 자동으로 적용합니다:

  • 한 번에 1개의 요청

  • 초당 2개의 요청

  • 일일 5,000개의 요청

일일 제한을 초과하는 요청은 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