canlii
canlii mcp for people in law in canada
claude mcp add --transport stdio alhwyn-canlii-mcp npm run dev \ --env CANLII_API="your_canlii_api_key_here"
How to use
This MCP server provides programmatic access to CanLII data through a suite of tools. It exposes endpoints that let you discover available courts/tribunals, list and browse legislation databases, fetch metadata for specific acts or cases, and retrieve citations information. Once running locally, you can connect clients like Claude Desktop or the Cloudflare AI Playground to the server's M CPC interface to perform searches and retrieve structured results. The tools resemble a small API catalog: get_courts_and_tribunals, get_legislation_databases, browse_legislation, get_legislation_regulation_metadata, get_case_law_decisions, get_case_metadata, and get_case_citator. Each tool accepts language (en/fr) and relevant identifiers (databaseId, caseId, legislationId) plus optional date filters. You can combine these tools to perform common legal research workflows such as locating statutes, drilling into case metadata, and tracing case citators.
How to install
Prerequisites:
- Node.js and npm
- A CanLII API key
- Optional: Cloudflare Workers account for deployment
- Clone the repository and install dependencies
git clone <repository-url>
cd canlii-mcp
npm install
- Create and configure environment variables
- Create a .env file or configure your environment with the CanLII API key:
CANLII_API=your_canlii_api_key_here
- If deploying to Cloudflare Workers, you can set the variable via Wrangler:
wrangler secret put CANLII_API
- Running locally for development
npm run dev
This will start the MCP server locally at http://localhost:8787
- Deploy to Cloudflare Workers
npm run deploy
5) Optional verification
- Ensure CANLII_API is set in the environment before starting.
- Visit http://localhost:8787/sse to verify the MCP server stream endpoint (for tools integration).
Additional notes
Tips and notes:
- The server relies on the CANLII_API key, so ensure it is securely stored and not committed to version control.
- When deploying to Cloudflare Workers, configure the CANLII_API environment variable in your worker settings.
- Be mindful of CanLII API rate limits and terms of use; implement appropriate client-side rate limiting if integrating into automation.
- The npm scripts provided include dev (local server), deploy (Cloudflare deployment), format, lint, and type-check to help maintain code quality.
- If you need to adjust connection settings, update the environment variable or modify the deployment config accordingly.
Related MCP Servers
context7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
mcp
MCP server for the Cloudflare API
MiniMax -JS
Official MiniMax Model Context Protocol (MCP) JavaScript implementation that provides seamless integration with MiniMax's powerful AI capabilities including image generation, video generation, text-to-speech, and voice cloning APIs.
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!
google -remote
Collection of Google-native tools (e.g., Gmail, Calendar) for the MCP
akyn-sdk
Turn any data source into an MCP server in 5 minutes. Build AI-agents-ready knowledge bases.