Skip to main content
Glama

canlii-mcp

Ein MCP (Model Context Protocol)-Server für die CanLII API für kanadische Rechtsinformationen. Er ermöglicht KI-Assistenten den Zugriff auf kanadische Rechtsprechung und Metadaten zur Gesetzgebung über alle föderalen, provinziellen und territorialen Gerichtsbarkeiten hinweg.

Hinweis: Die CanLII-API stellt nur Metadaten bereit – Titel, Zitate, Daten, Schlagworte und Zitationsbeziehungen. Der vollständige Dokumententext ist über die API nicht verfügbar.

Tools

Tool

Beschreibung

list_case_databases

Listet alle Gerichte und Tribunale in der CanLII-Sammlung auf

list_cases

Durchsucht Entscheidungen einer bestimmten Gerichts-/Tribunaldatenbank

get_case

Ruft Metadaten für einen bestimmten Fall ab (Titel, Zitat, Datum, Schlagworte)

get_case_citations

Ruft Fälle ab, die von einem Fall zitiert werden, Fälle, die ihn zitieren, oder Gesetzgebung, auf die er verweist

list_legislation_databases

Listet alle Datenbanken für Gesetze und Verordnungen auf

list_legislation

Durchsucht Gesetze oder Verordnungen einer bestimmten Datenbank

get_legislation

Ruft Metadaten für ein bestimmtes Gesetz ab

Related MCP server: courtlistener-mcp

Anforderungen

Verwendung

stdio via npx (am schnellsten)

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

stdio (aus dem Quellcode)

npm install
npm run build
node dist/index.js

Fügen Sie dies zu Ihrer MCP-Konfiguration hinzu:

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

HTTP-Server

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

Der MCP-Endpunkt ist unter http://localhost:3000/mcp verfügbar. Der Server läuft im zustandslosen Modus – jede Anfrage ist in sich geschlossen, es ist keine Sitzungs-ID oder Initialisierungs-Handshake erforderlich. Clients können Tools direkt aufrufen:

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

Oder mit 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

Der Server enthält einen Workers-kompatiblen Einstiegspunkt (src/worker.ts).

CLI-Bereitstellung

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

Dashboard-Bereitstellung (Mit Git verbinden)

  1. Gehen Sie zum Cloudflare Dashboard → Workers & Pages → Create → Connect to Git

  2. Wählen Sie Ihr tomilashy/canlii-mcp Repository aus

  3. Auf der Seite Set up your application:

    • Project name: canlii-mcp

    • Build command: npm install && npm run build

    • Deploy command: npx wrangler deploy (vorab ausgefüllt)

  4. Erweitern Sie Advanced settings:

    • Variable name: CANLII_API

    • Variable value: Ihr CanLII-API-Schlüssel

    • Aktivieren Sie Encrypt, um ihn als Geheimnis zu speichern

  5. Klicken Sie auf Deploy

Der MCP-Endpunkt befindet sich unter https://canlii-mcp.<your-subdomain>.workers.dev/mcp.

Konfiguration

Umgebungsvariable

Erforderlich

Standard

Beschreibung

CANLII_API

Ja

—

Ihr CanLII-API-Schlüssel

PORT

Nein

3000

HTTP-Server-Port (nur HTTP-Modus)

MCP_AUTH_TOKEN

Nein

—

Bearer-Token für die HTTP-Authentifizierung. Falls gesetzt, müssen alle HTTP-Anfragen Authorization: Bearer <token> enthalten. Falls nicht gesetzt, läuft der Server ohne Authentifizierung.

Ratenbegrenzungen

Der Server erzwingt automatisch die API-Limits von CanLII:

  • 1 Anfrage gleichzeitig

  • 2 Anfragen pro Sekunde

  • 5.000 Anfragen pro Tag

Anfragen, die das tägliche Limit überschreiten, geben einen Fehler zurück, anstatt die API aufzurufen.

Entwicklung

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

Veröffentlichung

Dieses Projekt verwendet Semantic Versioning via semantic-release. Commit-Nachrichten folgen der Conventional Commits Spezifikation:

Commit-Präfix

Release-Typ

fix:

Patch (1.0.0 → 1.0.1)

feat:

Minor (1.0.0 → 1.1.0)

feat!: oder BREAKING CHANGE

Major (1.0.0 → 2.0.0)

Ein Push auf main löst den Release-Workflow aus. Wenn ein Release erstellt wird, wird das Docker-Image automatisch erstellt und auf ghcr.io veröffentlicht.

Lizenz

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