canlii-mcp
It gives AI assistants access to Canadian case law and legislation metadata via the CanLII API.
List all courts/tribunals and legislation databases available in CanLII.
Browse case decisions from a specific court or tribunal, with optional filters for publication/decision dates and pagination.
Get case metadata: title, citation, decision date, keywords, and URL.
Get citation relationships: cases cited by a case, cases citing it, and legislation it references.
List statutes or regulations from a specific legislation database.
Get legislation metadata: title, citation, dates, and repeal status.
Run via stdio or HTTP, using your own CanLII API key (header or URL parameter), with an optional hosted public endpoint.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@canlii-mcp search for cases citing R v Oakes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
canlii-mcp
An MCP (Model Context Protocol) server for the CanLII Canadian legal information API. Gives AI assistants access to Canadian case law and legislation metadata across all federal, provincial, and territorial jurisdictions.
Forked from tomilashy/canlii-mcp. This fork adds bring-your-own-key (BYOK) auth, a
/healthroute, and a hosted endpoint atcanlii-mcp.vaquill.ai. Tools are unchanged.
Note: The CanLII API provides metadata only — titles, citations, dates, keywords, and citation relationships. Full document text is not available through the API.
Use the hosted endpoint (no install)
https://canlii-mcp.vaquill.ai/mcpThe hosted instance is public. No Vaquill token is required. Provide your own CanLII key one of two ways:
Header (recommended, keeps the key out of the URL):
X-CanLII-Token: <your_canlii_api_key>URL parameter (simplest; works in header-less clients like the Claude Desktop connector UI and claude.ai web): append
?token=<your_canlii_api_key>to the URL:https://canlii-mcp.vaquill.ai/mcp?token=YOUR_CANLII_API_KEY
Apply for a key via the CanLII API request form. The server never stores your key, and there is no server-side fallback key, so every call counts against your own CanLII quota.
Claude Desktop / Claude Code
{
"mcpServers": {
"canlii": {
"url": "https://canlii-mcp.vaquill.ai/mcp",
"headers": {
"X-CanLII-Token": "YOUR_CANLII_API_KEY"
}
}
}
}Cursor / VS Code / Windsurf
Same pattern: any client supporting MCP streamable HTTP with custom headers works. For stdio-only clients use mcp-remote to proxy.
Related MCP server: courtlistener-mcp
Authentication
Mode | Header | When |
BYOK header (preferred) |
| Hosted / shared deployments |
BYOK URL param |
| Header-less clients: Claude Desktop connector UI, claude.ai web |
Server fallback | (env | Self-hosted single-tenant. Required for stdio. |
MCP gate |
| Optional, self-host only. The public hosted endpoint at |
Tools
Tool | Description |
| List all courts and tribunals in the CanLII collection |
| Browse decisions from a specific court/tribunal database |
| Get metadata for a specific case (title, citation, date, keywords) |
| Get cases cited by a case, cases citing it, or legislation it references |
| List all statute and regulation databases |
| Browse statutes or regulations from a specific database |
| Get metadata for a specific piece of legislation |
Requirements
Node.js 22+
A CanLII API key — apply here
Usage
stdio via npx (quickest)
{
"mcpServers": {
"canlii": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@tomilashy/canlii-mcp"],
"env": {
"CANLII_API": "your_api_key"
}
}
}
}stdio (from source)
npm install
npm run build
node dist/index.jsAdd to your MCP config:
{
"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 httpThe MCP endpoint is available at http://localhost:3000/mcp. The server runs in stateless mode — each request is self-contained, no session ID or initialize handshake required. Clients can call tools directly:
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-mcpOr with 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
The server includes a Workers-compatible entry point (src/worker.ts).
CLI deploy
npx wrangler secret put CANLII_API
npx wrangler secret put MCP_AUTH_TOKEN # optional
npx wrangler deployDashboard deploy (Connect to Git)
Go to Cloudflare Dashboard → Workers & Pages → Create → Connect to Git
Select your
tomilashy/canlii-mcprepositoryOn the Set up your application page:
Project name:
canlii-mcpBuild command:
npm install && npm run buildDeploy command:
npx wrangler deploy(pre-filled)
Expand Advanced settings:
Variable name:
CANLII_APIVariable value: your CanLII API key
Check Encrypt to store it as a secret
Click Deploy
The MCP endpoint will be at https://canlii-mcp.<your-subdomain>.workers.dev/mcp.
Configuration
Environment Variable | Required | Default | Description |
| Only for stdio and self-hosted single-tenant | — | Your CanLII API key. Not needed in HTTP mode, where clients bring their own key per request. |
| No |
| HTTP server port (HTTP mode only) |
| No | — | Bearer token for HTTP authentication. If set, all HTTP requests must include |
Rate Limits
The server enforces CanLII's API limits automatically, per CanLII key, so one caller's usage never throttles another's:
1 request at a time
2 requests per second
5,000 requests per day
These mirror CanLII's own per-key limits. Each X-CanLII-Token gets its own independent budget (keyed by a hash of the key; raw keys are never retained). Requests that exceed the daily limit return an error rather than hitting the API.
Development
npm install
npm run build # compile TypeScript
npm run watch # watch modeRelease
This project uses Semantic Versioning via semantic-release. Commit messages follow the Conventional Commits spec:
Commit prefix | Release type |
| Patch ( |
| Minor ( |
| Major ( |
Pushing to main triggers the release workflow. If a release is cut, the Docker image is automatically built and published to ghcr.io.
License
MIT
Community
Questions, ideas, or want to contribute? Join the Vaquill community on Discord.
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.621 PyPIMIT
- 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.4553 PyPI62MIT
- AlicenseAqualityCmaintenanceLegalMCP 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