legalize-mcp
This server provides read-only access to national legislation from 32 jurisdictions (21 EU member states + 11 others) stored as structured Markdown with Git-tracked reform history. Capabilities include:
List jurisdictions (
legalize_list_countries): Get all supported countries with codes, names, EU membership status, and GitHub repo links. Filterable to EU-only.Search laws (
legalize_search_laws): Full-text keyword search within a country's legislation, returning law IDs and snippets. (Requires aGITHUB_TOKEN.)Get law metadata (
legalize_get_meta): Fetch only the frontmatter (title, status, publication date, source URL, citation) — a cheap citation check without downloading full text.Get full law text (
legalize_get_law): Retrieve complete text and metadata for a specific law by ID. Supports historical versions via a Git commit SHA.List law reforms (
legalize_list_reforms): View the full amendment/reform timeline for a law as Git commits (dates, messages, SHAs), which can be fed back intolegalize_get_lawfor historical versions.
Key features:
Every response includes a citation contract:
source_url(official government source),github_url(verifiable copy), andhuman_readable_citationAll tools are read-only and idempotent; GDPR-safe and self-hostable (only read-only GETs to GitHub)
Audit logging to
~/.matematic/audit/legalize-mcp.jsonl(configurable viaLEGALIZE_AUDIT_DIR)Supported jurisdictions: EU (
at be cz de ee es eu fi fr gr ie it lt lu lv nl pl pt ro se sk) and others (ad ar ch cl co kr li no uk us uy)
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 "Install 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-mcpFind 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 RODO/GDPR-safe and self-hostable: 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 (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 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).
| Name | Required | Description | Default |
|---|---|---|---|
| sha | No | optional commit SHA for a historical version (from ``legalize_list_reforms``). | |
| law_id | Yes | the filename stem (e.g. ``"BOE-A-1978-31229"``). | |
| country | Yes | ISO-3166 alpha-2 code (e.g. ``"es"``). |
Output Schema
| Name | Required | Description |
|---|---|---|
| sha | No | Git commit SHA if a historical version was requested. |
| rank | No | Country-specific legal text type. |
| extra | No | Country-specific frontmatter fields. |
| title | No | |
| law_id | Yes | Official identifier (the .md filename stem). |
| status | No | in_force | repealed | ... |
| content | Yes | Full law text (Markdown, frontmatter stripped). |
| country | Yes | |
| byte_size | No | |
| github_url | Yes | Raw provenance URL on github.com/legalize-dev. |
| source_url | No | Official source URL (frontmatter `source`). |
| last_updated | No | |
| publication_date | No | |
| human_readable_citation | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide safety profile (readOnly, idempotent, non-destructive). The description adds that it returns both metadata and full text, which is beyond what annotations cover. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, no wasted words, front-loaded with action and resource. Every part earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the input schema has full descriptions and an output schema exists, the description is complete for the tool's purpose. It mentions the key optional feature (historical commit) and the fact it returns both metadata and full text.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already describes all parameters. The description reinforces the purpose but does not add new meaning beyond stating 'by id' and the optional historical commit, which is already clear from the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Fetch' and identifies the resource 'a law's metadata and full text' with a clear method 'by id (optionally at a historical commit)'. It distinguishes from siblings like legalize_get_meta by indicating it returns both metadata and full text, and from legalize_list_reforms by noting the optional commit SHA.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use: when you have the law ID and optionally want a historical version using the SHA from legalize_list_reforms. However, it does not explicitly state when not to use or provide alternatives beyond the implied sibling context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
legalize_get_metaARead-onlyIdempotent
Fetch only a law's frontmatter metadata (no body) - cheap for citation checks.
| Name | Required | Description | Default |
|---|---|---|---|
| law_id | Yes | the filename stem. | |
| country | Yes | ISO-3166 alpha-2 code. |
Output Schema
| Name | Required | Description |
|---|---|---|
| rank | No | Country-specific legal text type. |
| extra | No | Country-specific frontmatter fields. |
| title | No | |
| law_id | Yes | Official identifier (the .md filename stem). |
| status | No | in_force | repealed | ... |
| country | Yes | |
| github_url | Yes | Raw provenance URL on github.com/legalize-dev. |
| source_url | No | Official source URL (frontmatter `source`). |
| last_updated | No | |
| publication_date | No | |
| human_readable_citation | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and no destructive hint. The description adds valuable behavioral context by noting the tool is 'cheap', indicating low cost or fast performance, which is beyond what annotations provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence that is front-loaded with key action and resource, no wasted words. Every part earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the existence of an output schema, return values need no explanation. The description fully covers the tool's role: fetching only metadata, cheap, for citation checks, and distinguishes from siblings. No gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so parameters are well-documented. The description does not add further meaning to the parameters beyond the schema, staying at baseline 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb (fetch), resource (law's frontmatter metadata), and distinguishes it from sibling tools like legalize_get_law by explicitly saying 'no body'. The phrase 'cheap for citation checks' further clarifies the purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for citation checks and distinguishes from legalize_get_law (full body). It provides clear context but does not explicitly state when not to use or list alternatives beyond the implied distinction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
legalize_list_countriesBRead-onlyIdempotent
List the jurisdictions available in the legalize-dev corpus.
| Name | Required | Description | Default |
|---|---|---|---|
| eu_only | No | if true, restrict to EU member states. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint. The description merely restates the list action without adding behavioral context. It does not contradict annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no wasted words. However, it could include a brief note about the output format or purpose without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the low complexity (1 optional param, no required fields, annotations present, output schema exists), the description is minimally adequate but lacks additional context that could help an agent, such as mentioning that this tool returns country names or codes.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the single boolean parameter is already documented. The description does not add any extra meaning or usage details beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists jurisdictions in the legalize-dev corpus. It uses a specific verb (list) and resource (jurisdictions), and distinguishes from sibling tools that deal with laws, reforms, and metadata.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No usage guidelines are provided. The description does not indicate when to use this tool versus alternatives like legalize_get_meta, nor does it provide any context on prerequisites or limitations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
legalize_list_reformsARead-onlyIdempotent
List the reform history (commits) of a law - the legislative timeline.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | max reforms, newest first (1-100, default 20). | |
| law_id | Yes | the filename stem. | |
| country | Yes | ISO-3166 alpha-2 code. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint, openWorldHint, idempotentHint, destructiveHint. The description adds context by specifying 'reform history (commits)' and 'legislative timeline,' but does not elaborate on ordering, pagination, or potential nuances beyond the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence that is front-loaded with the core action. No redundant or unnecessary words; every part contributes to clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema (not shown but indicated), the description is fairly complete. It could hint at the return structure (e.g., 'reform history includes dates and changes'), but the output schema likely covers that.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has 100% coverage with each parameter having a description (e.g., 'ISO-3166 alpha-2 code', 'filename stem'). The description adds no additional meaning to parameters beyond what the schema provides, so baseline score of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List the reform history (commits) of a law - the legislative timeline,' which specifies the verb (list) and resource (reform history of a law). It effectively distinguishes from siblings like legalize_get_law (likely gets current law) and legalize_search_laws (search).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for viewing legislative timeline, but does not explicitly state when to use this tool versus alternatives. No exclusion or when-not-to-use guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
legalize_search_lawsARead-onlyIdempotent
Search a jurisdiction's laws by keyword (GitHub code search; requires a token).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | max hits (1-100, default 10). | |
| query | Yes | keyword(s) to find inside the law texts. | |
| country | Yes | ISO-3166 alpha-2 code (e.g. ``"ee"``, ``"es"``). |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly, idempotent, and non-destructive. The description adds value by disclosing the token requirement and the underlying GitHub code search mechanism, which are not present in annotations. However, it does not detail pagination behavior or error handling beyond the limit parameter.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, front-loaded with the action, and includes the critical token note in parentheses. No extraneous words, making it efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has three parameters, full schema coverage, and an output schema (not shown), the description provides sufficient context for the core operation. However, it could briefly mention result scope (e.g., returns matching law snippets) to complete the picture.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, with each parameter having a description. The description does not add new semantic information beyond the schema, so it meets the baseline for full schema coverage without additional parameter insight.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches a jurisdiction's laws by keyword, specifies it uses GitHub code search, and notes the token requirement. This distinguishes it from siblings like legalize_get_law (retrieve a specific law) and legalize_list_countries (list jurisdictions).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies search use but does not explicitly guide when to use this tool over alternatives. The token requirement is mentioned but no when-to-use or when-not-to-use guidance is provided, leaving the agent to infer based on tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Official MCP connector for Legalize: read and search its whole open corpus, at any point in time.
An MCP server that provides congressional transcripts
Judged, citation-checked policy corpus over MCP. Keyless public reads; API key for AI tools.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceAn MCP server that provides comprehensive US legislation.2337MIT
- 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.5Apache 2.0
- AlicenseNot gradedqualityBmaintenanceA read-only MCP connector for searching, fetching, and citing provenance-tracked legal corpora with verifiable content hashes.Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/matematicsolutions/legalize-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server