legalize-mcp
legalize-mcp
非官方。 与 legalize-dev 项目无关联,也未获得其认可。 官方 legalize-dev MCP 服务器正在针对 legalize.dev API 开发中; 本服务器改为读取公开的 git 语料库。
一个 MCP 服务器,覆盖 32 个司法管辖区(21 个欧盟)。 一个基于 legalize-dev 语料库的只读 Model Context Protocol 服务器——国家立法以 law-as-git 形式存储:每部法律一个 Markdown 文件,每次改革一次 Git 提交,每个文件都带有 8 字段的 ELI 风格 frontmatter(Legalize Format Spec v0.2)。本连接器采用 Apache-2.0 许可。
由 Matematic Solutions 构建,属于 eu-legal-mcp 系列。与单一国家的 *-eli-mcp 连接器不同,本连接器通过单个服务器为多个司法管辖区提供服务,因为底层语料库已经规范化为一种格式。
为什么存在
每个响应都携带该系列其余部分所使用的引用契约:
source_url—— 来自法律自身 frontmatter 的官方政府来源 (例如boe.es、riigiteataja.ee、legifrance.gouv.fr)。绝不虚构。github_url—— 实际读取的可验证 legalize-dev 副本。human_readable_citation——"<title> (<identifier>)"。
它符合 RODO/GDPR 要求且可自托管:除了对 GitHub 的只读 GET 请求外,没有任何数据离开用户机器。
Related MCP server: lawyer-mcp
司法管辖区
欧盟:at be cz de ee es eu fi fr gr ie it lt lu lv nl pl pt ro se sk
· 其他:ad ar ch cl co kr li no uk us uy
调用 legalize_list_countries 获取实时列表(添加 eu_only=true 进行过滤)。
工具
工具 | 无需密钥? | 用途 |
| ✅ | 列出司法管辖区(代码、名称、欧盟标志、仓库)。 |
| 需要 | 在国家法律内进行关键词搜索 → |
| ✅ | 仅 frontmatter(轻量级引用检查)。 |
| ✅ | 按 |
| ✅ | 法律改革时间线(提交);SHA 可传入 |
| 声明此连接器覆盖的内容、每个法律族系被采集的时间,以及——明确地——它不覆盖的内容。每个缺口都有相应的回退方案。 |
law_id 是 Markdown 文件名主干(例如西班牙宪法的 BOE-A-1978-31229,爱沙尼亚则为数字 id)。可通过 legalize_search_laws 或官方引用获取——不支持模糊标题查找。
安装
uvx legalize-mcp # run directly
# or
pip install legalize-mcpClaude Code (.mcp.json):
{
"mcpServers": {
"legalize": { "command": "uvx", "args": ["legalize-mcp"] }
}
}Windows 11 与 Smart App Control
Smart App Control 会阻止未签名的可执行文件,这包括 uvx.exe、pip.exe 以及 pip 在安装时写入的 legalize-mcp.exe 启动器。来自 python.org 安装程序的 python.exe 和 py.exe 由 Python Software Foundation 签名,因此通过解释器运行模块即可正常工作:
python -m pip install legalize-mcp
python -m legalize_mcppip.exe 因相同原因被阻止,因此请使用 python -m pip 安装,而不是 pip install。如果 python 不在 PATH 中,请使用 Windows 启动器:py -3 -m legalize_mcp。
{ "mcpServers": { "legalize-mcp": { "command": "python", "args": ["-m", "legalize_mcp"] } } }不要为了绕过此问题而关闭 Smart App Control——如果不重新安装 Windows,它将无法重新启用。
GITHUB_TOKEN(或 GH_TOKEN)是可选的——仅 legalize_search_laws 需要,并且它可以解除 legalize_list_reforms 上的 GitHub 速率限制。
配置
环境变量 | 默认值 | 用途 |
| — | 启用代码搜索;解除速率限制。 |
|
| JSONL 审计日志位置(AI 法案第 12 条)。 |
治理
每次工具调用都会向 ~/.matematic/audit/legalize-mcp.jsonl 追加一行(输入哈希、持续时间、状态——不包含负载)。所有工具均为只读且幂等。参见 CONSTITUTION.md。
开发
python -m venv .venv && .venv/Scripts/python -m pip install -e ".[dev]"
.venv/Scripts/python -m pytest -q # offline unit tests
.venv/Scripts/python -m ruff check src tests署名
立法数据 © 各国家主管机构(参见每部法律的 source)。语料库规范化由 legalize-dev 项目完成。
语料库的许可因国家而异,而非 MIT。 MIT 许可仅涵盖 legalize-dev 的流水线和工具。每个国家仓库都带有继承自其官方来源的条款——legalize-es 遵循 BOE 再利用条件,该条件要求必须注明来源;legalize-at 采用 CC BY 4.0;其他仓库各有不同。在依赖、引用或再分发文本之前,请检查国家仓库。 将语料库视为 MIT 许可会让你跳过实际应承担的署名义务。
更正由 Enrique Lop(legalize-dev)在 issue #18(2026-08-24)中提供。 本连接器不重新分发语料库;它按需读取。
Available Tools
5 toolslegalize_get_lawARead-onlyIdempotent
Fetch a law's metadata and full text by id (optionally at a historical commit).
Inputs: law_id (required), country (required), sha. Returns: A law's metadata plus its full Markdown body.
legalize_get_metaARead-onlyIdempotent
Fetch only a law's frontmatter metadata (no body) - cheap for citation checks.
Inputs: law_id (required), country (required). Returns: Frontmatter metadata for a single law (Legalize Format Spec v0.2 + extensions).
legalize_list_countriesBRead-onlyIdempotent
List the jurisdictions available in the legalize-dev corpus.
Inputs: eu_only. Returns: result
legalize_list_reformsARead-onlyIdempotent
List the reform history (commits) of a law - the legislative timeline.
Inputs: law_id (required), country (required), limit. Returns: result
legalize_search_lawsARead-onlyIdempotent
Search a jurisdiction's laws by keyword (GitHub code search; requires a token).
Inputs: query (required), country (required), limit. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: retrieving full law text, retrieving metadata only, listing available countries, listing reform history, and searching laws. No ambiguity.
All tools follow the consistent pattern of 'legalize_' prefix followed by verb_noun (e.g., get_law, list_countries, search_laws). Perfectly uniform.
With 5 tools, the server covers core operations for a legal document retrieval system without being sparse or bloated. Well-scoped.
The server provides full retrieval (by ID), metadata-only retrieval, jurisdiction listing, reform timeline, and keyword search. For a read-only legal database, this is complete.
Maintenance
Related MCP Connectors
Official MCP connector for Legalize: read and search its whole open corpus, at any point in time.
대한민국 법령·조문·별표·연혁·판례·해석례를 법제처 국가법령정보 OPEN API 로 찾아보는 읽기 전용 MCP 서버. 코어 12 + 보조 12 도구.
An MCP server that provides congressional transcripts
Judged, citation-checked policy corpus over MCP. Keyless public reads; API key for AI tools.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that provides comprehensive US legislation.34 npm38MIT
- FlicenseAqualityDmaintenanceMCP server for Legalize.dev, enabling AI to query and understand legal frameworks across countries via a structured legislation API.131-
- AlicenseAqualityBmaintenanceAn MCP server for accessing Turkish legislation (laws, regulations, decrees) via the Adalet Bakanligi API, providing search, full-text retrieval, and structured citations.562 PyPI2Apache 2.0
- AlicenseNot gradedqualityCmaintenanceA read-only MCP connector for searching, fetching, and citing provenance-tracked legal corpora with verifiable content hashes.Apache 2.0