CanLII MCP Server
MCP for CanLII: Canadian case law and legislation metadata (federal, provincial, territorial).
CanLII scores 64 (Good), licensed MIT and written in TypeScript. It can be reached as a remote MCP endpoint. It declares 7 tools. Filed under Databases. GitHub shows 9 stars. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
64 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade A
90/100 for listing completeness. Lost points: short summary, no docs link.
How quality is graded
Where the 64 comes from
22 + 15 + 3 + 10 + 4 + 10 = 64. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 15 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 3 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
Remote auth: API key required. Get a key or token from the provider first, then add it as a header in your client config. How remote auth works
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "vaquill-ai-canlii-mcp": { "url": "https://canlii-mcp.vaquill.ai/mcp" } }}
Environment variables
This server does not declare environment variables.
Tools7Tool docs quality grade C
All capabilitiesget_casetoolGet metadata for a specific case (title, citation, date, keywords)
Get cases cited by a case, cases citing it, or legislation it references
get_legislationtoolGet metadata for a specific piece of legislation
List all courts and tribunals in the CanLII collection
list_casestoolBrowse decisions from a specific court/tribunal database
list_legislationtoolBrowse statutes or regulations from a specific database
List all statute and regulation databases
About
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/mcp
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: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.
Authentication
| 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. |
Tools
| 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 |
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.js
Add 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 http
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:
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
Or 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 deploy
Dashboard deploy (Connect to Git)
- Go to Cloudflare Dashboard → Workers & Pages → Create → Connect to Git
- Select your
tomilashy/canlii-mcprepository - On the Set up your application page:
- Project name:
canlii-mcp - Build command:
npm install && npm run build - Deploy command:
npx wrangler deploy(pre-filled)
- Project name:
- Expand Advanced settings:
- Variable name:
CANLII_API - Variable value: your CanLII API key
- Check Encrypt to store it as a secret
- Variable name:
- Click Deploy
The MCP endpoint will be at https://canlii-mcp.<your-subdomain>.workers.dev/mcp.
Configuration
| Environment Variable | Required | Default | Description |
|---|---|---|---|
CANLII_API | 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. |
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. |
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 mode
Release
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.
License
MIT
Community
Questions, ideas, or want to contribute? Join the Vaquill community on Discord.
Frequently asked questions
What is CanLII MCP Server?
MCP for CanLII: Canadian case law and legislation metadata (federal, provincial, territorial).
How do I install CanLII MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. CanLII MCP Server connects to the remote endpoint https://canlii-mcp.vaquill.ai/mcp, so there is nothing to install locally.
Is CanLII MCP Server free and open source?
Yes. CanLII MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does CanLII MCP Server support remote (HTTP) connections?
Yes. CanLII MCP Server offers a hosted endpoint over Streamable HTTP, so HTTP-capable clients can connect to it without running anything locally.
What tools does CanLII MCP Server provide?
CanLII MCP Server provides 7 tools, including get_case, get_case_citations, get_legislation, and list_case_databases. See the full tool list for descriptions and parameters.
How is CanLII MCP Server's trust score calculated?
CanLII MCP Server scores 64 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.