Skip to main content

legalize-mcp

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). MIT-licensed source corpus; 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 RODO/GDPR-safe and self-hostable: 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

Tool Keyless? Purpose
legalize_list_countries ✅ List jurisdictions (code, name, EU flag, repo).
legalize_search_laws needs GITHUB_TOKEN Keyword 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_coverage Declare 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

uvx legalize-mcp           # run directly
# or
pip install legalize-mcp

Claude Code (.mcp.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:

python -m pip install legalize-mcp
python -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.

{ "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 var Default Purpose
GITHUB_TOKEN / GH_TOKEN — Enables code search; lifts rate limits.
LEGALIZE_AUDIT_DIR ~/.matematic/audit JSONL audit log location (AI Act art. 12).

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

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 under the MIT License. This connector does not redistribute the corpus; it reads it on demand.

Metadata

Release files for legalize-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for legalize-mcp 0.2.0
File Size Uploaded
legalize_mcp-0.2.0.tar.gz 22.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for legalize-mcp 0.2.0
File Interpreter ABI Platform
legalize_mcp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.2 kB

Release files / legalize_mcp-0.2.0.tar.gz

Download URL legalize_mcp-0.2.0.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0286a898fb6f5a43cc3ab3d52c594e98bb41374d67771e14e811097a3e26e6b0
BLAKE2b-256 checksum
How to use checksums
f42156aef7b30657a1757ce813ace3b6b0e97ed62bf18722e2078f1d155c628d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / legalize_mcp-0.2.0-py3-none-any.whl

Download URL legalize_mcp-0.2.0-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a732d99d96e15402861ab33119b64c72561c9daf9330c1ec7f75f89191b16cdb
BLAKE2b-256 checksum
How to use checksums
4ca84192d1018bf55f4cd884b86b7415ef51e3ecae394dc425501fba2528993b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page