io.github.billibu-n/mcp-leyes-chile
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., "@io.github.billibu-n/mcp-leyes-chile busca el artículo 22 del Código del Trabajo y dame su cita"
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.
mcp-leyes-chile
mcp-name: io.github.billibu-n/mcp-leyes-chile
Servidor MCP de leyes chilenas con cita verificable (v0.2.4), fichas notariales curadas y
generación de documentos .odt (editable), .pdf y .docx.
No es asesoría legal. Es una herramienta para que una persona llegue a la notaría con el borrador hecho y para que un abogado no presente una cita que no exista.
Qué hace
Tool | Para qué |
| Busca artículos por texto en el corpus local (SQLite FTS5) |
| Texto literal + cita con |
| Historial de versiones de una norma (83 en el DL 825) |
| Verifica un lote: |
| 27 fichas: trámite, arancel y estado por campo (24 generadas del Decreto 587) |
| Genera |
| Qué cubre, hasta cuándo, y qué no cubre |
Related MCP server: chilean-legal-mcp
Instalación
Desde PyPI:
pip install mcp-leyes-chile
mcp-leyes-chile --ingesta # ~20 s: 9 normas, 6.246 artículos, 556 versiones
mcp-leyes-chile --selftest # lista las 7 toolsO desde el código:
python3 -m venv .venv && . .venv/bin/activate
pip install -e .
python -m mcp_leyes --ingesta
python -m mcp_leyes --notaria-generar # crea fichas desde el arancel (idempotente)
python -m mcp_leyes --smoke # genera .odt + .pdf de prueba
python -m mcp_leyes # sirve por stdioConfiguración en un host MCP (ejemplo):
{"mcpServers": {"leyes-chile": {"command": "python", "args": ["-m", "mcp_leyes"],
"env": {"MCP_LEYES_DB": "/ruta/a/corpus.db"}}}}Formulario HTML
python -m mcp_leyes --formulario 8801
# http://127.0.0.1:8801/ -> pregunta los campos -> .odt + .pdfSkill para agentes
La carpeta skill/ es la misma herramienta empaquetada como skill para
clientes de agentes (Claude, Agensi, etc.): SKILL.md, dos referencias y un script
sin dependencias que lee un corpus local en data/corpus.jsonl.
cd skill
python3 scripts/consulta.py normas
python3 scripts/consulta.py buscar "compraventa" --limite 5
python3 scripts/consulta.py articulo 172986 1793El corpus (skill/data/corpus.jsonl, 6.852 textos, 5,6 MB) no se versiona: se regenera
con python exportar-corpus.py (descarga el XML de LeyChile y conserva la jerarquía de
compendios) o se toma del ZIP publicado en cada release (leyes-chile-skill.zip,
1,1 MB). La skill no usa red, no escribe archivos y no llama al MCP: es autónoma.
Publicación
En el registro oficial: io.github.billibu-n/mcp-leyes-chile 0.2.4
(https://registry.modelcontextprotocol.io), paquete PyPI mcp-leyes-chile.
server.json cumple el esquema del registro: registryType: pypi, transport: stdio.
Publicar requiere mcp-publisher login github y autorización del dueño.
Qué cambió en 0.2.4 y 0.2.3
0.2.4 — compendios, segunda parte. cl_articulo acepta cuerpo="Ley 4.808" y
devuelve el artículo de ese cuerpo dentro del DFL 1; si el cuerpo no existe, el error
lista los disponibles. Sin cuerpo se mantiene el primero y se declara coincidencias.
0.2.3 — atribución. El DFL 1 mezcla el Código Civil con leyes anexas (Registro
Civil, menores, abandono de familia, herencias). El parser perdía la jerarquía y citaba
un "art. 31" de la Ley 4.808 como "Código Civil, art. 31". Ahora cada parte guarda
cuerpo y cuerpo_corto, la cita usa el cuerpo real y la base existente se migra sola.
Qué cambió en 0.2.2
El servidor pasó por una prueba de alto estrés de 41 comprobaciones por el protocolo real (parámetros hostiles, FTS5 roto, concurrencia, documentos en paralelo, lotes de 200). Encontró nueve defectos; esta versión los corrige:
Defecto | Antes | Ahora |
Consulta de 54.000 caracteres | 44 s de bloqueo | 11 ms (recorte a 24 términos) |
Fecha | viajaba a LeyChile: 90 s y el texto de otra versión |
|
Centinela | respuesta con fecha falsa |
|
| rechazo del protocolo | acepta |
Formato de | caía en silencio a PDF |
|
Base legal de la plantilla | siempre art. 2116 (mandato) | 1793 y 1801 para compraventa, 2116 para poder |
Salida | dejaba | sustituye los campos |
Dos documentos a la vez | se pisaban el mismo | carpeta propia por llamada |
40 artículos concurrentes | 7,2 s | 0,15 s (prefiltro en SQL y conexiones cerradas) |
Además, esta versión incorpora las correcciones del ejercicio de evaluación de T-105, que
hasta ahora solo estaban en el repositorio: fuente con i=None, cita de artículo derogado que
decía «vigente», [not_found] sin nombre de norma, documento sin base legal, la Ley 19.496
en el corpus y las claves con sufijo (DEL ART. 2).
Cobertura y límites
9 cuerpos legales: DL 825, Código del Trabajo, Código Civil, Comercio, Penal, Constitución, Ley 19.628, Ley 19.496 y Arancel de notarios.
No cubre jurisprudencia, tribunales, SII más allá de las normas, competencia territorial notarial estructurada, precios actuales ni firma de documentos.
Los montos del arancel son nominales de 1998: el servidor los muestra y advierte, no calcula el precio final.
Datos y licencias
Código: Apache-2.0 (
LICENSE).Fuente: LeyChile / BCN. El paquete no redistribuye el corpus: lo descarga en la máquina del usuario. Los términos de LeyChile no se pudieron verificar (2026-11-06).
Fichas notariales: CC BY 4.0, con fuente y fecha por campo.
Pruebas
python -m pytest -q # 34 tests
python -m eval.estres # 41 comprobaciones de estrés por stdio
python -m eval.correr --banco 60 # 66 tareas: exactitud 1.0, 0 alucinaciones
python -m eval.ejercicio # 10 tareas de razonamiento (22/22)
python -m mcp_leyes --notaria # 27 fichas, 0 fallosAvailable Tools
7 toolscl_articuloC
Texto literal + objeto de cita. Sin fuente no devuelve texto.
cuerpo desambigua compendios (DFL 1): "Código Civil", "Ley 4.808", etc.
Inputs: articulo (required), id_norma (required), cuerpo, vigente_al.
cl_buscarC
Busca articulos por texto. Devuelve idNorma, norma, articulo y fragmento.
Inputs: q (required), limite, solo_vigentes.
cl_citarC
Verifica un lote de referencias. Devuelve ok, faltantes y sin_fuente_verificable.
Inputs: referencias (required).
cl_coberturaA
Que cubre el servidor, hasta cuando, y que NO cubre.
Inputs: no named parameters.
cl_documentoC
Genera .odt (siempre) y deriva .pdf/.docx/.md. Marca de borrador obligatoria.
Inputs: datos (required), plantilla (required), formato.
cl_notariaC
Ficha de tramite notarial con fuente y estado por campo. No calcula precios.
Inputs: q, ficha.
cl_versionesC
Historial de versiones con rango de vigencia y advertencia de centinela.
Inputs: id_norma (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct operation: search (cl_buscar), article retrieval (cl_articulo), version history (cl_versiones), citation verification (cl_citar), notarial procedures (cl_notaria), document generation (cl_documento), and coverage (cl_cobertura). The clearest risk is cl_buscar vs cl_articulo, but descriptions separate search-by-text from fetch-by-id sufficiently. cl_citar vs cl_articulo could momentarily confuse an agent but the verification framing differentiates them.
All names share a consistent cl_ prefix with short, readable Spanish tokens, which is a clear convention. However, it mixes verbs (buscar, citar) with bare nouns (articulo, versiones, notaria, documento, cobertura), so the verb_noun predictability breaks down slightly. Still readable and internally cohesive overall.
Seven tools is well within the ideal 3-15 range for a domain-specific legal research server. Each tool maps to a distinct workflow step (search, retrieve, version-check, cite, notarial, export, coverage), so none feel redundant. The surface is tightly scoped rather than padded.
The lifecycle is well covered: discovery, retrieval, version history, citation validation, notarial support, document export, and an explicit coverage disclaimer. A minor gap is browsing a norm's structure or listing all articles of a given norm, which would help navigation without prior knowledge. Also no explicit update/'recent changes' style tool beyond version history per article.
Maintenance
Related MCP Connectors
Resolve, search and verify legal citations against the official sources, with provenance.
Search laws, gazettes and case law from Argentina, Brazil, Chile and Mexico. Read-only; API key.
French case law (Judilibre) and codes (Légifrance) from official sources, with citation checking.
Temporal search and comparison for official Luxembourg and reviewed EU law, with provenance.
Related MCP Servers
- AlicenseBqualityFmaintenanceConnects AI assistants to Chilean legal sources, enabling citation of official legal texts, search of doctrine, jurisprudence, and rulings.18MIT
- FlicenseNot gradedqualityCmaintenanceEnables Chilean legal research via 15 MCP tools that search and cite official sources, retrieve full legal texts, perform hybrid semantic searches, and export results to Word or PDF.-
- AlicenseCqualityBmaintenanceExposes 55 forensic tools over the Model Context Protocol so agents can query Chilean statutes, jurisprudence, administrative dicta and doctrine from official state sources such as BCN, PJUD, CGR and DT, while running locally for confidential casework. It also supports citation-validated drafting, deadline and docket monitoring, judgment deconstruction, OCR dossier compilation and legal knowledge-graph analysis for civil-law practice, teaching and research.95125 PyPI7Apache 2.0
- AlicenseAqualityBmaintenanceEnables read-only search of Spanish legislation and multi-tier case law from official registries, retrieval of full legal texts as Markdown, and verification of statutory and case-law citations.6MIT