Skip to main content
Glama

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

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.

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 tools
legalize_get_lawA
Read-onlyIdempotent

Fetch a law's metadata and full text by id (optionally at a historical commit).

ParametersJSON Schema
NameRequiredDescriptionDefault
shaNooptional commit SHA for a historical version (from ``legalize_list_reforms``).
law_idYesthe filename stem (e.g. ``"BOE-A-1978-31229"``).
countryYesISO-3166 alpha-2 code (e.g. ``"es"``).

Output Schema

ParametersJSON Schema
NameRequiredDescription
shaNoGit commit SHA if a historical version was requested.
rankNoCountry-specific legal text type.
extraNoCountry-specific frontmatter fields.
titleNo
law_idYesOfficial identifier (the .md filename stem).
statusNoin_force | repealed | ...
contentYesFull law text (Markdown, frontmatter stripped).
countryYes
byte_sizeNo
github_urlYesRaw provenance URL on github.com/legalize-dev.
source_urlNoOfficial source URL (frontmatter `source`).
last_updatedNo
publication_dateNo
human_readable_citationNo

TDQS

A4.3/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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_metaA
Read-onlyIdempotent

Fetch only a law's frontmatter metadata (no body) - cheap for citation checks.

ParametersJSON Schema
NameRequiredDescriptionDefault
law_idYesthe filename stem.
countryYesISO-3166 alpha-2 code.

Output Schema

ParametersJSON Schema
NameRequiredDescription
rankNoCountry-specific legal text type.
extraNoCountry-specific frontmatter fields.
titleNo
law_idYesOfficial identifier (the .md filename stem).
statusNoin_force | repealed | ...
countryYes
github_urlYesRaw provenance URL on github.com/legalize-dev.
source_urlNoOfficial source URL (frontmatter `source`).
last_updatedNo
publication_dateNo
human_readable_citationNo

TDQS

A4.3/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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_countriesB
Read-onlyIdempotent

List the jurisdictions available in the legalize-dev corpus.

ParametersJSON Schema
NameRequiredDescriptionDefault
eu_onlyNoif true, restrict to EU member states.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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_reformsA
Read-onlyIdempotent

List the reform history (commits) of a law - the legislative timeline.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNomax reforms, newest first (1-100, default 20).
law_idYesthe filename stem.
countryYesISO-3166 alpha-2 code.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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_lawsA
Read-onlyIdempotent

Search a jurisdiction's laws by keyword (GitHub code search; requires a token).

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNomax hits (1-100, default 10).
queryYeskeyword(s) to find inside the law texts.
countryYesISO-3166 alpha-2 code (e.g. ``"ee"``, ``"es"``).

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

A4.2/5.0
Disambiguation5/5

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.

Naming Consistency5/5

All tools follow the consistent pattern of 'legalize_' prefix followed by verb_noun (e.g., get_law, list_countries, search_laws). Perfectly uniform.

Tool Count5/5

With 5 tools, the server covers core operations for a legal document retrieval system without being sparse or bloated. Well-scoped.

Completeness5/5

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

ActivityMaintained
ResponsivenessSyncing

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

Related MCP Servers

Latest Blog Posts

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