Legalize Mcp

io.github.matematicsolutions由 GitHub 账号 matematicsolutions 发布v0.2.4更新于 Oct 24, 2026

Legislation for 32 jurisdictions (21 EU) as law-as-git, keyless, with ELI-style citations.

发布方自己的服务:Legalize

概览

AI 生成的概览

只读 MCP 服务器,让助手通过读取公开的 legalize-dev git 语料库,查询 32 个司法管辖区的国家立法并附带引注。

可以做什么
列出司法管辖区,可仅筛选欧盟,含代码、名称与仓库,并说明本连接器覆盖与不覆盖的范围及缺口回退方案。按关键词检索某国法律,返回法律标识与片段。获取法律的前置元数据用于快速核对引注,或按法律标识获取完整元数据与正文,并可用提交 SHA 取历史版本。读取某部法律的修订时间线(提交记录),其 SHA 可回传给获取工具以取旧版本。每次响应都附带法律自身前置元数据中的官方来源网址、实际读取的 GitHub 副本以及人类可读引注。
适用场景
适合需要用一个服务器检索或引用多个欧洲及其他司法管辖区立法的场景,例如确认某次修订时生效的法律版本,或依据官方来源元数据核对引注。适用于对来源与版本准确性有要求的研究与起草工作。
运行要求
以 Python 包形式在本地运行(uvx 或 pip),需要 Python。需要访问 GitHub 的网络连接,仅做只读 GET 请求。GITHUB_TOKEN 或 GH_TOKEN 为可选项:关键词检索必须使用,并可提高修订时间线的 GitHub 速率限制。LEGALIZE_AUDIT_DIR 可指定审计日志位置。在启用 Smart App Control 的 Windows 11 上,应通过已签名的 Python 解释器运行,而非被阻止的启动器。
安装前请注意
非官方连接器,与 legalize-dev 项目无隶属或背书关系;它读取公开 git 语料库而非官方 API。每次工具调用默认会向本地 JSONL 审计日志追加一行。语料库许可按国家而异,并非 MIT:部分来源在引用或再分发时要求署名,依赖文本前请查看对应国家仓库。检索需要 GitHub 令牌,该令牌会发送给 GitHub。所有工具均为只读。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Legalize Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

legalize-mcp

Unofficial. Not affiliated with, or endorsed by, the legalize-dev project. An official legalize-dev MCP server is in development against the legalize.dev API; this one reads the public git corpus instead.

One MCP server, 32 jurisdictions (21 EU). A read-only Model Context Protocol server over the legalize-dev corpus — national legislation stored as law-as-git: one law per Markdown file, every reform a Git commit, each with an 8-field ELI-style frontmatter (Legalize Format Spec v0.2). This connector is Apache-2.0.

Built by Matematic Solutions as part of the eu-legal-mcp line. Unlike the single-country *-eli-mcp connectors, this one serves many jurisdictions from a single server, because the underlying corpus is already normalised to one format.

Why this exists

Every response carries the citation contract the rest of the line uses:

  • source_url — the official government source from the law's own frontmatter (e.g. boe.es, riigiteataja.ee, legifrance.gouv.fr). Never invented.
  • github_url — the verifiable legalize-dev copy actually read.
  • human_readable_citation — "<title> (<identifier>)".

It is self-hostable, with a narrow data path: nothing leaves the user's machine except read-only GETs to GitHub.

Jurisdictions

EU: at be cz de ee es eu fi fr gr ie it lt lu lv nl pl pt ro se sk · Other: ad ar ch cl co kr li no uk us uy

Call legalize_list_countries for the live list (add eu_only=true to filter).

Tools

ToolKeyless?Purpose
legalize_list_countries✅List jurisdictions (code, name, EU flag, repo).
legalize_search_lawsneeds GITHUB_TOKENKeyword search inside a country's laws → law_id + snippet.
legalize_get_meta✅Frontmatter only (cheap citation check).
legalize_get_law✅Full metadata + text by law_id; pass sha= for a historical version.
legalize_list_reforms✅Reform timeline (commits) for a law; SHAs feed legalize_get_law.
legalize_coverageDeclare what this connector covers, when each family was captured, and - explicitly - what it does NOT cover. Every gap carries a fallback.

law_id is the Markdown filename stem (e.g. BOE-A-1978-31229 for the Spanish Constitution, a numeric id for Estonia). Get it from legalize_search_laws or an official citation — there is no fuzzy title lookup.

Install

bash
uvx legalize-mcp           # run directly# orpip install legalize-mcp

Claude Code (.mcp.json):

json
{  "mcpServers": {    "legalize": { "command": "uvx", "args": ["legalize-mcp"] }  }}

Windows 11 with Smart App Control

Smart App Control blocks unsigned executables, which covers uvx.exe, pip.exe and the legalize-mcp.exe launcher that pip writes at install time. The python.exe and py.exe from the python.org installer are signed by the Python Software Foundation, so running the module through the interpreter works:

bash
python -m pip install legalize-mcppython -m legalize_mcp

pip.exe is blocked for the same reason, so install with python -m pip, not pip install. If python is not on PATH, use the Windows launcher: py -3 -m legalize_mcp.

json
{ "mcpServers": { "legalize-mcp": { "command": "python", "args": ["-m", "legalize_mcp"] } } }

Do not turn Smart App Control off to work around this - it cannot be re-enabled without reinstalling Windows.

GITHUB_TOKEN (or GH_TOKEN) is optional — required only for legalize_search_laws, and it lifts the GitHub rate limit on legalize_list_reforms.

Configuration

Env varDefaultPurpose
GITHUB_TOKEN / GH_TOKEN—Enables code search; lifts rate limits.
LEGALIZE_AUDIT_DIR~/.matematic/auditJSONL audit log location (record-keeping).

Governance

Every tool call appends one line to ~/.matematic/audit/legalize-mcp.jsonl (input hash, duration, status — no payloads). All tools are read-only and idempotent. See CONSTITUTION.md.

Development

bash
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

Attribution

Legislative data © the respective national authorities (see each law's source). Corpus normalisation by the legalize-dev project.

Licence of the corpus is per country, not MIT. The MIT licence covers legalize-dev's pipeline and tooling. Each country repository carries terms inherited from its own official source - legalize-es follows the BOE reuse conditions, which make citing the source mandatory; legalize-at is CC BY 4.0; others differ. Check the country repository before you rely on, quote or redistribute a text. Treating the corpus as MIT would skip an attribution obligation you actually have.

Correction supplied by Enrique Lop (legalize-dev) in issue #18, 2026-08-24. This connector does not redistribute the corpus; it reads it on demand.

来源:README.md,提交 944721f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.4最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Legalize 集成