canlii-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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 /health route, and a hosted endpoint at canlii-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)
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:
- **URL parameter (simplest; works in header-less clients like the Claude Desktop connector UI and claude.ai web):** append ?token= to the URL:
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
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: | Hosted / shared deployments |
| BYOK URL param | ?token= (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 | 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)
stdio (from source)
Add to your MCP config:
HTTP server
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:
Docker
Or with Docker Compose:
Cloudflare Workers
The server includes a Workers-compatible entry point (src/worker.ts).
CLI deploy
Dashboard deploy (Connect to Git)
1. Go to Cloudflare Dashboard → **Workers & Pages** → **Create** → **Connect to Git**
2. Select your tomilashy/canlii-mcp repository