chilean-legal-mcp
chilean-legal-mcp
Servidor MCP de investigación legal chilena — 93 herramientas, fuentes oficiales verificables, sin registro ni créditos. Local, ilimitado, con cuerpo FTS, semántica híbrida, corpus CGR/TC/LeyChile, export Word/PDF y corpus JPL opcional.
Qué hace (93 tools: base + JPL + corpus CGR/TC + conectores FNE/TA/SMA)
Herramienta | Fuente | Qué devuelve |
| BCN SPARQL 748k + FTS local + body | Leyes con filtros |
| BCN | Cita texto y JSON |
|
| Texto completo 14k |
| local | Word |
| Híbrido FTS + embeddings MiniLM + sinónimos |
|
| CGR Domino + BCN + FTS | Dictámenes con URL |
| BCN + CGR + PJUD público | Jurisprudencia + links |
| BCN Articulo 30k + fallback | Artículos |
| BCN | Vigencia y relaciones |
| SciELO, DT, Diario Oficial | Doctrina y normativa sectorial |
| Paralelo real | Multi-fuente en 1 llamada |
| Corpus JPL local (53 leyes + ordenanzas 344 comunas) | Leyes JPL, artículos exactos, búsqueda global |
| Ordenanzas municipales JPL | Ordenanzas por comuna/materia |
| Corpus JPL + plantillas tribunal | Sentencias, resoluciones, oficios, comparendos |
| local | Estado del corpus JPL |
| Carpeta local PDF/DOCX/TXT (FTS5) | Expediente propio: fragmentos citados, línea de tiempo, partes |
| Expediente ↔ base nacional local | Derecho invocado con artículo/inciso + verificación [VERIFICADA]/[POR VERIFICAR] |
| Expediente ↔ LeyChile | VIGENCIA de cada norma citada (derogada/refundida) + nota intertemporal |
| Expediente + cómputo procesal | Plazos detectados en documentos con vencimiento y estado frente a hoy |
| LeyChile XML + caché | Artículo (e inciso) exacto; corte forense con ordinal º/° (art. 2 ≠ art. 20) |
| Reglas CPC/COT offline | Vencimiento con fundamentos (arts. 38/40 CPC, 66 COT, ley 2.977) |
| — | Links oficiales |
Todas las respuestas incluyen cita y enlace a la fuente oficial. Fechas chilenas DD-MM-AAAA en entrada y salida. JPL auto-activo si data/jpl/corpus.db.zlib está instalado (ver SETUP.md + scripts/install_jpl.py).
Related MCP server: LeyChile MCP
Instalación
git clone <repo>
cd chilean-legal-mcp
pip install -e . # base: httpx, mcp, python-docx, reportlab
pip install -e ".[semantic]" # opcional: sentence-transformers para embeddings reales
pip install -e ".[pdf]" # opcional: weasyprint (requiere libgobject)
python -m chilean_legal_mcp.ingest # 545 normas iniciales
python -m chilean_legal_mcp.ingest --bulk # 360k completo (~2h, 150MB)Uso — cualquier cliente MCP (stdio)
python -m chilean_legal_mcp.server # stdio (default)
python -m chilean_legal_mcp.server --http # HTTP streamable :8000Claude Code: claude mcp add chilean-legal -- python -m chilean_legal_mcp.server
Claude Desktop / OpenCode / Cursor / VS Code / Antigravity: mcpServers: {"chilean-legal": {"command":"python","args":["-m","chilean_legal_mcp.server"]}}
Estructura
src/chilean_legal_mcp/
sparql_client.py # BCN SPARQL + filtros fecha/tipo
db.py # SQLite FTS5 (normas, textos, dictamenes)
jpl/db.py # Corpus JPL (53 leyes + 5939 ordenanzas 344 comunas) — auto-activo
jpl/generator.py # Generador de documentos JPL
texto.py # LeyChile obtxml XML
contraloria.py # CGR Domino POST
fuentes_externas.py # SciELO, DT, Diario Oficial
exportar.py # docx/pdf
ingest.py # incremental + bulk OFFSET
server.py # FastMCP 93 tools (base + JPL + corpus CGR/TC + conectores FNE/TA/SMA)
expediente.py # Expedientes locales (indexar/preguntar/timeline/partes/citas/vigencia/plazos)
citas.py # Extracción de citas normativas (art/inciso) + corte forense de articulado
plazos.py # Cómputo procesal chileno (feriados, feriado judicial, arts. 38/40 CPC)
workflow.py # Prompt multi-etapa
semantico.py # Embeddings locales
scripts/
install_jpl.py # Instalador JPL (descarga corpus privado a data/jpl/)
data/
normas.db # 29k normas (se genera / se descarga)
jpl/
corpus.db.zlib # 15 MB comprimido JPL (no va a git, se instala)
corpus.db # 58 MB descomprimido + FTS (se genera al primer jpl_*)Fuentes (100% públicas, sin registro)
BCN
datos.bcn.cl/sparql(Virtuoso)LeyChile
leychile.cl/Consulta/obtxml?opt=7&idNorma=...CGR
contraloria.cl/appinf/...+ BCN OficioPJUD
pjud.cl/portal-unificado-sentencias(Playwright verificado, sin api.pjud.cl)SciELO, DT, Diario Oficial — buscadores públicos
Licencia
MIT
Related MCP Connectors
Brazilian legal search and jurimetria: 115M+ court decisions from 90+ courts across 14 MCP tools.
Taiwan legal research MCP: 判決書、全國法規、釋字/憲判與立法歷程查詢,12 個工具,回應均附官方出處 URL。
LawOracle — 20 legal AI tools: case law search, contracts, EU regulations, citation graph.
Taiwan legal research MCP by Dr.Legal (法律偵探): 22.7M court judgments, current statutes, administrative rulings and Constitutional Court decisions. Retrieval-only, per-item citations, appeal-chain history, bundle-level citation audit. Free, no API key; OAuth 2.0 dynamic registration completes automatically. 台灣法律 MCP:2,272 萬筆裁判書、法規、函釋、憲法法庭裁判,逐筆附出處並提供引用查核。免費、免金鑰。Docs: https://dr-legal.com.tw/mcp
Related MCP Servers
- AlicenseCqualityBmaintenanceEnables searching, comparing, and analyzing Korean laws and public institution regulations through natural language, integrating 110 MCP tools covering statutes, precedents, and internal rules.10033 npm24MIT
- AlicenseAqualityDmaintenanceMCP server that connects AI to the Chilean legislation system (Ley Chile) for retrieving legal norms, citations, and intertemporal analysis.283MIT
- AlicenseBqualityFmaintenanceConnects AI assistants to Chilean legal sources, enabling citation of official legal texts, search of doctrine, jurisprudence, and rulings.18MIT
- AlicenseNot gradedqualityFmaintenanceEnables querying Spanish legislation (BOE) and EU law integration through MCP, providing full-text search, citation validation, and cross-referencing capabilities.37 npm2Apache 2.0