canlii-mcp
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 |
| Listet alle Gerichte und Tribunale in der CanLII-Sammlung auf |
| Durchsucht Entscheidungen einer bestimmten Gerichts-/Tribunaldatenbank |
| Ruft Metadaten für einen bestimmten Fall ab (Titel, Zitat, Datum, Schlagworte) |
| Ruft Fälle ab, die von einem Fall zitiert werden, Fälle, die ihn zitieren, oder Gesetzgebung, auf die er verweist |
| Listet alle Datenbanken für Gesetze und Verordnungen auf |
| Durchsucht Gesetze oder Verordnungen einer bestimmten Datenbank |
| Ruft Metadaten für ein bestimmtes Gesetz ab |
Related MCP server: courtlistener-mcp
Anforderungen
Node.js 22+
Ein CanLII-API-Schlüssel — hier beantragen
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.jsFü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 httpDer 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-mcpOder 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 deployDashboard-Bereitstellung (Mit Git verbinden)
Gehen Sie zum Cloudflare Dashboard → Workers & Pages → Create → Connect to Git
Wählen Sie Ihr
tomilashy/canlii-mcpRepository ausAuf der Seite Set up your application:
Project name:
canlii-mcpBuild command:
npm install && npm run buildDeploy command:
npx wrangler deploy(vorab ausgefüllt)
Erweitern Sie Advanced settings:
Variable name:
CANLII_APIVariable value: Ihr CanLII-API-Schlüssel
Aktivieren Sie Encrypt, um ihn als Geheimnis zu speichern
Klicken Sie auf Deploy
Der MCP-Endpunkt befindet sich unter https://canlii-mcp.<your-subdomain>.workers.dev/mcp.
Konfiguration
Umgebungsvariable | Erforderlich | Standard | Beschreibung |
| Ja | — | Ihr CanLII-API-Schlüssel |
| Nein |
| HTTP-Server-Port (nur HTTP-Modus) |
| Nein | — | Bearer-Token für die HTTP-Authentifizierung. Falls gesetzt, müssen alle HTTP-Anfragen |
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 modeVeröffentlichung
Dieses Projekt verwendet Semantic Versioning via semantic-release. Commit-Nachrichten folgen der Conventional Commits Spezifikation:
Commit-Präfix | Release-Typ |
| Patch ( |
| Minor ( |
| Major ( |
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 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