legalize-mcp
A read-only MCP server for browsing, searching, citing, and retrieving national legislation from the legalize-dev law-as-git corpus across 32 jurisdictions.
List available jurisdictions (
legalize_list_countries), optionally restricted to EU member states.Keyword-search laws inside a country to find
law_id, snippet, and GitHub URL (legalize_search_laws; requiresGITHUB_TOKEN).Fetch full metadata plus Markdown text of a law by ID (
legalize_get_law), optionally at a historical commit SHA.Fetch cheap frontmatter-only metadata for citation checks (
legalize_get_meta).List the reform/commit timeline of a law (
legalize_list_reforms) and use SHAs to retrieve historical versions.Get citation-ready output: official
source_url, verifiablegithub_url, andhuman_readable_citation.All tools are read-only and idempotent; the server is self-hostable with optional JSONL audit logging.
Reads national legislation stored as law-as-git on GitHub, providing tools to list countries, search laws, get metadata, full text, and reform history from the legalize-dev corpus.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@legalize-mcp Find laws about environmental protection in Estonia"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: lawyer-mcp
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 |
| ✅ | List jurisdictions (code, name, EU flag, repo). |
| needs | Keyword search inside a country's laws → |
| ✅ | Frontmatter only (cheap citation check). |
| ✅ | Full metadata + text by |
| ✅ | Reform timeline (commits) for a law; SHAs feed |
| 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-mcpClaude 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_mcppip.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 |
| — | Enables code search; lifts rate limits. |
|
| JSONL 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
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 testsAttribution
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.
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.16 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.530 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