The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Canlii MCP listing page.
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.
The 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:
Apply for a key at canlii.org/en/api/. The server never stores your key, and there is no server-side fallback key, so every call counts against your own CanLII quota.
Same pattern: any client supporting MCP streamable HTTP with custom headers works. For stdio-only clients use mcp-remote to proxy.
| Mode | Header | When |
|---|---|---|
| BYOK header (preferred) | X-CanLII-Token: <key> | Hosted / shared deployments |
| BYOK URL param | ?token=<key> (or ?canlii_token=) | Header-less clients: Claude Desktop connector UI, claude.ai web |
| Server fallback | (env CANLII_API) | Self-hosted single-tenant. Required for stdio. |
| MCP gate | Authorization: Bearer <MCP_AUTH_TOKEN> | Optional, self-host only. The public hosted endpoint at canlii-mcp.vaquill.ai does not use it, so no bearer token is required. |
| Tool | Description |
|---|---|
list_case_databases | List all courts and tribunals in the CanLII collection |
list_cases | Browse decisions from a specific court/tribunal database |
get_case | Get metadata for a specific case (title, citation, date, keywords) |
get_case_citations | Get cases cited by a case, cases citing it, or legislation it references |
list_legislation_databases | List all statute and regulation databases |
list_legislation | Browse statutes or regulations from a specific database |
get_legislation | Get metadata for a specific piece of legislation |
Add to your MCP config:
The 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:
Or with Docker Compose:
The server includes a Workers-compatible entry point (src/worker.ts).
tomilashy/canlii-mcp repositorycanlii-mcpnpm install && npm run buildnpx wrangler deploy (pre-filled)CANLII_APIThe MCP endpoint will be at https://canlii-mcp.<your-subdomain>.workers.dev/mcp.
| Environment Variable | Required | Default | Description |
|---|---|---|---|
CANLII_API | Yes | — | Your CanLII API key |
PORT | No | 3000 | HTTP server port (HTTP mode only) |
MCP_AUTH_TOKEN | No | — | Bearer token for HTTP authentication. If set, all HTTP requests must include Authorization: Bearer <token>. If not set, the server runs without authentication. |
The server enforces CanLII's API limits automatically, per CanLII key, so one caller's usage never throttles another's:
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.
This project uses Semantic Versioning via semantic-release. Commit messages follow the Conventional Commits spec:
| Commit prefix | Release type |
|---|---|
fix: | Patch (1.0.0 → 1.0.1) |
feat: | Minor (1.0.0 → 1.1.0) |
feat!: or BREAKING CHANGE | Major (1.0.0 → 2.0.0) |
Pushing to main triggers the release workflow. If a release is cut, the Docker image is automatically built and published to ghcr.io.
MIT
Questions, ideas, or want to contribute? Join the Vaquill community on Discord.