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.

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 ze Smart App Control

Smart App Control blokuje niepodpisane pliki wykonywalne, a uvx.exe, pip.exe i generowany przy instalacji legalize-mcp.exe podpisane nie sa. python.exe z python.org jest podpisany przez Python Software Foundation, wiec uruchomienie przez modul omija blokade:

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

Nie wylaczaj Smart App Control, zeby to obejsc - wylaczenia nie da sie cofnac bez ponownej instalacji systemu.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

legalize_mcp-0.1.2.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

legalize_mcp-0.1.2-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file legalize_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: legalize_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for legalize_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0c5f19114a67f9c167deeed0cc1b254276cef2e89ecc5d2765fbe9b23f0a5345
MD5 531937870898dc44c14a733e7bb7898d
BLAKE2b-256 cbe40c6bdb53a03451b47eb74710ed8740a963b770d0a0734b6b0e7a4e83d8ff

See more details on using hashes here.

File details

Details for the file legalize_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: legalize_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for legalize_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8d0d9e9b8e236afeabd2d0788d144a7d315d91f2869d36fb5152f4de58fd787a
MD5 793530c87ae1574682343028b539a790
BLAKE2b-256 36d53c471f7c40bcfa74f647354a3e75f44f720c3bc8303e6d142f09733973ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page