Connects Claude to the CanLII API for Canadian legal research. Exposes nine tools including full-text search across cases and legislation, case citators to check if precedents are still good law, and metadata retrieval for building citation chains. Built with automatic rate limiting (2 req/sec, 5000/day) and input validation. Search returns case titles and citations but not full text, so you'll need to follow CanLII URLs to read actual decisions. Citator shows what cases cite a decision but doesn't indicate treatment like "followed" or "distinguished". Useful when you need to verify Ontario or federal case law, check citation relationships, or browse legislation databases without leaving Claude.
A Model Context Protocol (MCP) server for searching Canadian legal information via the CanLII API. Search cases, browse legislation, and check citations — all from Claude Desktop or Claude Code.
npx canlii-mcp
api.canlii.orgPrerequisites: Node.js 18+ and a CanLII API key (free for research use).
Claude Desktop — add to your config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"canlii": {
"command": "npx",
"args": ["-y", "canlii-mcp"],
"env": {
"CANLII_API_KEY": "your_api_key_here"
}
}
}
}
Restart Claude Desktop after saving.
Claude Code:
claude mcp add canlii -e CANLII_API_KEY=your_key -- npx -y canlii-mcp
From source (for development):
git clone https://github.com/mohammadfarooqi/canlii-mcp.git
cd canlii-mcp
npm install && npm run build
Full-text keyword search across all of CanLII — cases, legislation, and commentary. This is the primary entry point for legal research.
search({ query: "material change in circumstances Ontario", resultCount: 10 })
List all available court and tribunal databases. Returns database IDs needed by other tools.
Key Ontario databases: onsc (Superior Court), onca (Court of Appeal), oncj (Court of Justice), csc-scc (Supreme Court of Canada).
Browse case law decisions from a specific court database, ordered by most recently added. Supports date filters.
get_case_law_decisions({ databaseId: "onsc", resultCount: 20 })
Get full details for a specific case — citation, decision date, docket number, keywords, and CanLII URL for reading the full decision.
get_case_metadata({ databaseId: "onsc", caseId: "2021onsc8582" })
Look up citation relationships for a case. Use citingCases to check if a case is still good law.
get_case_citator({ databaseId: "csc-scc", caseId: "1996canlii190", metadataType: "citingCases" })
Quick citation preview returning max 5 results. Faster than the full citator for a quick check.
get_case_citator_tease({ databaseId: "csc-scc", caseId: "1996canlii190", metadataType: "citingCases" })
List all legislation databases. Ontario: ons (Statutes), onr (Regulations). Federal: cas (Statutes), car (Regulations).
List legislation items within a specific database.
browse_legislation({ databaseId: "ons" })
Get metadata for a specific statute or regulation, including its CanLII URL.
search({ query: "gatekeeping parenting time" }) to find relevant casesget_case_metadata(...) to get the full citation and CanLII URLget_case_citator(..., metadataType: "citingCases") to verify the case is still good lawPer CanLII's API terms:
The server enforces these limits automatically with a built-in rate limiter.
npm run build # Compile TypeScript
npm run start # Run the server (needs CANLII_API_KEY env var)
src/
index.ts # MCP server — tools, rate limiter, stdio transport
schema.ts # Zod schemas for CanLII API responses
Contributions are welcome! This project aims to make Canadian legal research more accessible through AI tooling.
Ways to contribute:
To submit a PR:
git checkout -b feature/my-improvement)npm run build && CANLII_API_KEY=your_key npm run start)If you find issues with the CanLII API responses, schema mismatches, or have ideas for new tools that would help legal researchers, please open an issue — even if you're not sure how to fix it. We'll investigate together.
This server is designed to be transparent and minimal:
api.canlii.org — no other network calls, no telemetry, no analyticschild_process, exec, or spawn@modelcontextprotocol/sdk (official Anthropic MCP SDK) and zod (schema validation)If you discover a security issue, please see SECURITY.md.
get_case_metadata separately for each case to get keywords, topics, decision date, and the CanLII URL.get_case_citator (full version) for comprehensive citation analysis.MIT — see LICENSE.
CANLII_API_KEY*secretYour CanLII API key (request free at canlii.org/en/feedback/feedback.html)
com.mcparmory/google-search
io.github.pipeworx-io/brave-search
marcopesani/mcp-server-serper
brave/brave-search-mcp-server
com.mcparmory/google-search-console
acamolese/google-search-console-mcp