legalize-mcp
legalize-mcp
No oficial. No está afiliado al proyecto legalize-dev ni cuenta con su respaldo. Se está desarrollando un servidor MCP oficial de legalize-dev contra la API de legalize.dev; este, en cambio, lee el corpus git público.
Un servidor MCP, 32 jurisdicciones (21 de la UE). Un servidor de solo lectura del Model Context Protocol sobre el corpus de legalize-dev: legislación nacional almacenada como law-as-git: una ley por archivo Markdown, cada reforma es un commit de Git, cada una con un frontmatter de 8 campos estilo ELI (Legalize Format Spec v0.2). Este conector es Apache-2.0.
Creado por Matematic Solutions como parte de la línea eu-legal-mcp. A diferencia de los
conectores *-eli-mcp de un solo país, este sirve muchas jurisdicciones desde un único servidor,
porque el corpus subyacente ya está normalizado a un solo formato.
Por qué existe
Cada respuesta incluye el contrato de citación que usa el resto de la línea:
source_url— la fuente gubernamental oficial del frontmatter de la propia ley (p. ej.boe.es,riigiteataja.ee,legifrance.gouv.fr). Nunca inventada.github_url— la copia verificable de legalize-dev que realmente se lee.human_readable_citation—"<title> (<identifier>)".
Es seguro para RODO/GDPR y autoalojable: nada sale de la máquina del usuario excepto GET de solo lectura a GitHub.
Related MCP server: lawyer-mcp
Jurisdicciones
UE: at be cz de ee es eu fi fr gr ie it lt lu lv nl pl pt ro se sk
· Otras: ad ar ch cl co kr li no uk us uy
Llama a legalize_list_countries para obtener la lista en vivo (añade eu_only=true para filtrar).
Herramientas
Herramienta | ¿Sin clave? | Propósito |
| ✅ | Lista las jurisdicciones (código, nombre, bandera de la UE, repo). |
| requiere | Búsqueda por palabras clave en las leyes de un país → |
| ✅ | Solo frontmatter (verificación de citación económica). |
| ✅ | Metadatos completos + texto por |
| ✅ | Cronología de reformas (commits) de una ley; los SHA alimentan |
| Declara qué cubre este conector, cuándo se capturó cada familia y, explícitamente, qué NO cubre. Cada vacío tiene una alternativa. |
law_id es la raíz del nombre de archivo de Markdown (p. ej. BOE-A-1978-31229 para la Constitución española, un
ID numérico para Estonia). Obtenlo de legalize_search_laws o de una citación oficial — no hay
búsqueda difusa por título.
Instalación
uvx legalize-mcp # run directly
# or
pip install legalize-mcpClaude Code (.mcp.json):
{
"mcpServers": {
"legalize": { "command": "uvx", "args": ["legalize-mcp"] }
}
}Windows 11 con Smart App Control
Smart App Control bloquea los ejecutables sin firmar, lo que incluye uvx.exe, pip.exe
y el lanzador legalize-mcp.exe que pip escribe en el momento de la instalación. Los python.exe y
py.exe del instalador de python.org están firmados por la Python Software
Foundation, por lo que ejecutar el módulo a través del intérprete funciona:
python -m pip install legalize-mcp
python -m legalize_mcppip.exe está bloqueado por la misma razón, así que instala con python -m pip, no con
pip install. Si python no está en PATH, usa el lanzador de Windows: py -3 -m legalize_mcp.
{ "mcpServers": { "legalize-mcp": { "command": "python", "args": ["-m", "legalize_mcp"] } } }No desactives Smart App Control para solucionar esto - no se puede volver a activar sin reinstalar Windows.
GITHUB_TOKEN (o GH_TOKEN) es opcional — solo se requiere para legalize_search_laws, y
elimina el límite de tasa de GitHub en legalize_list_reforms.
Configuración
Variable de entorno | Valor por defecto | Propósito |
| — | Habilita la búsqueda de código; elimina los límites de tasa. |
|
| Ubicación del registro de auditoría JSONL (art. 12 de la AI Act). |
Gobernanza
Cada llamada a una herramienta añade una línea a ~/.matematic/audit/legalize-mcp.jsonl (hash de entrada, duración,
estado — sin cargas útiles). Todas las herramientas son de solo lectura e idempotentes. Consulta CONSTITUTION.md.
Desarrollo
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 testsAtribución
Datos legislativos © las respectivas autoridades nacionales (consulta el source de cada ley). Normalización
del corpus por el proyecto legalize-dev.
La licencia del corpus es por país, no MIT. La licencia MIT cubre el pipeline y las herramientas de legalize-dev.
Cada repositorio de país incluye términos heredados de su propia fuente
oficial - legalize-es sigue las condiciones de reutilización del BOE, que hacen obligatoria la cita de la
fuente; legalize-at es CC BY 4.0; otros difieren. Consulta el repositorio del país antes
de confiar en un texto, citarlo o redistribuirlo. Tratar el corpus como MIT omitiría una
obligación de atribución que realmente tienes.
Corrección aportada por Enrique Lop (legalize-dev) en el issue #18, 2026-08-24. Este conector no redistribuye el corpus; lo lee bajo demanda.
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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.1- First observed
legalize_get_law - First observed
legalize_get_meta - First observed
legalize_list_countries - First observed
legalize_list_reforms - First observed
legalize_search_laws
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.
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 gradedqualityBmaintenanceAn MCP server that provides comprehensive US legislation.13 npm38MIT
- FlicenseAqualityDmaintenanceMCP server for Legalize.dev, enabling AI to query and understand legal frameworks across countries via a structured legislation API.131-
- AlicenseAqualityAmaintenanceAn MCP server for accessing Turkish legislation (laws, regulations, decrees) via the Adalet Bakanligi API, providing search, full-text retrieval, and structured citations.544 PyPI2Apache 2.0
- AlicenseNot gradedqualityBmaintenanceA read-only MCP connector for searching, fetching, and citing provenance-tracked legal corpora with verifiable content hashes.Apache 2.0