canlii-mcp
Click on "Install 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-mcpsearch 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/mcpTwo headers are required for the hosted instance:
Authorization: Bearer <MCP_AUTH_TOKEN>— gates access to the MCP server itselfX-CanLII-Token: <your_canlii_api_key>— your CanLII key. Apply at canlii.org/en/api/. The server never stores your key.
Claude Desktop / Claude Code
{
"mcpServers": {
"canlii": {
"url": "https://canlii-mcp.vaquill.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_MCP_TOKEN",
"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 (preferred) |
| Hosted / shared deployments |
Server fallback | (env | Self-hosted single-tenant. Required for stdio. |
MCP gate |
| Optional. Restricts who may use the hosted endpoint. |
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 |
| Yes | — | Your CanLII API key |
| 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:
1 request at a time
2 requests per second
5,000 requests per day
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vaquill-AI/canlii-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server