canlii-mcp
canlii-mcp
Сервер MCP (Model Context Protocol) для API канадской правовой информации CanLII. Предоставляет ИИ-ассистентам доступ к метаданным канадского прецедентного права и законодательства по всем федеральным, провинциальным и территориальным юрисдикциям.
Примечание: API CanLII предоставляет только метаданные — названия, цитирования, даты, ключевые слова и связи между цитированиями. Полный текст документов через API недоступен.
Инструменты
Инструмент | Описание |
| Список всех судов и трибуналов в коллекции CanLII |
| Просмотр решений из конкретной базы данных суда/трибунала |
| Получение метаданных конкретного дела (название, цитирование, дата, ключевые слова) |
| Получение дел, на которые ссылается дело, дел, ссылающихся на него, или законодательства, на которое оно ссылается |
| Список всех баз данных статутов и нормативных актов |
| Просмотр статутов или нормативных актов из конкретной базы данных |
| Получение метаданных конкретного законодательного акта |
Related MCP server: courtlistener-mcp
Требования
Node.js 22+
API-ключ CanLII — подать заявку можно здесь
Использование
stdio через npx (самый быстрый способ)
{
"mcpServers": {
"canlii": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@tomilashy/canlii-mcp"],
"env": {
"CANLII_API": "your_api_key"
}
}
}
}stdio (из исходного кода)
npm install
npm run build
node dist/index.jsДобавьте в конфигурацию MCP:
{
"mcpServers": {
"canlii": {
"command": "node",
"args": ["/path/to/canlii-mcp/dist/index.js"],
"env": {
"CANLII_API": "your_api_key"
}
}
}
}HTTP-сервер
PORT=3000 CANLII_API=your_api_key node dist/index.js --transport httpЭндпоинт MCP доступен по адресу http://localhost:3000/mcp. Сервер работает в режиме без сохранения состояния — каждый запрос является автономным, сессионный ID или рукопожатие инициализации не требуются. Клиенты могут вызывать инструменты напрямую:
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Или с помощью 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
Сервер включает точку входа, совместимую с Workers (src/worker.ts).
Развертывание через CLI
npx wrangler secret put CANLII_API
npx wrangler secret put MCP_AUTH_TOKEN # optional
npx wrangler deployРазвертывание через панель управления (подключение к Git)
Перейдите в панель управления Cloudflare → Workers & Pages → Create → Connect to Git
Выберите ваш репозиторий
tomilashy/canlii-mcpНа странице Set up your application:
Project name:
canlii-mcpBuild command:
npm install && npm run buildDeploy command:
npx wrangler deploy(заполнено по умолчанию)
Разверните Advanced settings:
Variable name:
CANLII_APIVariable value: ваш API-ключ CanLII
Установите флажок Encrypt, чтобы сохранить его как секрет
Нажмите Deploy
Эндпоинт MCP будет доступен по адресу https://canlii-mcp.<your-subdomain>.workers.dev/mcp.
Конфигурация
Переменная окружения | Обязательно | По умолчанию | Описание |
| Да | — | Ваш API-ключ CanLII |
| Нет |
| Порт HTTP-сервера (только в режиме HTTP) |
| Нет | — | Bearer-токен для HTTP-аутентификации. Если задан, все HTTP-запросы должны включать |
Ограничения частоты запросов (Rate Limits)
Сервер автоматически соблюдает лимиты API CanLII:
1 запрос за раз
2 запроса в секунду
5 000 запросов в день
Запросы, превышающие дневной лимит, возвращают ошибку, не обращаясь к API.
Разработка
npm install
npm run build # compile TypeScript
npm run watch # watch modeРелиз
Этот проект использует семантическое версионирование через semantic-release. Сообщения коммитов следуют спецификации Conventional Commits:
Префикс коммита | Тип релиза |
| Патч ( |
| Минорный ( |
| Мажорный ( |
Пуш в ветку main запускает рабочий процесс релиза. Если релиз создан, Docker-образ автоматически собирается и публикуется в ghcr.io.
Лицензия
MIT
Available Tools
7 toolsget_caseGet CaseARead-onlyInspect
Get metadata for a specific case including title, citation, decision date, keywords, and URL.
Inputs: caseId (required), databaseId (required), language.
get_case_citationsGet Case CitationsARead-onlyInspect
Get citation information for a case: what it cites, what cites it, or what legislation it references. Note: the CanLII API currently only supports English for this endpoint; French requests will fall back to English.
Inputs: caseId (required), citationType (required), databaseId (required), language.
get_legislationGet LegislationARead-onlyInspect
Get metadata for a specific piece of legislation including title, citation, dates, and repeal status.
Inputs: databaseId (required), legislationId (required), language.
list_case_databasesList Case DatabasesARead-onlyInspect
List all courts and tribunals in the CanLII collection with their database IDs.
Inputs: language.
list_casesList CasesBRead-onlyInspect
List decisions from a specific caselaw database. Returns case titles, citations, and IDs.
Inputs: databaseId (required), decisionDateAfter, decisionDateBefore, language, +4 more.
list_legislationList LegislationARead-onlyInspect
List statutes or regulations from a specific legislation database.
Inputs: databaseId (required), language.
list_legislation_databasesList Legislation DatabasesARead-onlyInspect
List all legislation and regulation databases in the CanLII collection.
Inputs: language.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct operation: retrieving specific case metadata, case citations, legislation, or listing various databases and documents. No functional overlap exists.
All tool names follow a consistent verb_noun pattern using snake_case, e.g., get_case, list_cases, get_legislation, making the API predictable.
7 tools is well-scoped for a legal database API, covering core retrieval and listing operations. Slightly on the smaller side but still appropriate.
The set covers basic CRUD-like read operations for cases and legislation, but lacks search/full-text query capabilities, which are common in legal research APIs.
Maintenance
Related MCP Connectors
Connect AI to millions of laws and court cases with the Lawstronaut MCP.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
AI governance MCP server for EU AI Act compliance and jurisdiction verification
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP Server providing AI agents access to over 3 million US court decisions via CourtListener and EU legislation via EUR-Lex, with tools for searching cases, citations, judges, and court information.621 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server providing AI agents access to CourtListener's comprehensive legal database, featuring semantic search, hybrid search, citation verification, and research tools.7MIT
- AlicenseAqualityBmaintenanceMCP server giving AI agents structured access to Canadian federal, provincial, and municipal government data.4553 PyPI62MIT
- AlicenseAqualityCmaintenanceLegalMCP is a comprehensive US legal MCP server that enables AI assistants to search over 4 million US court opinions, manage Clio practice data, and access PACER federal filings through natural language.1869MIT