Skip to main content
Glama
chilean-legal-mcp
by zkak0

chilean-legal-mcp

MCP-Server für chilenische Rechtsrecherche — 15 Werkzeuge, verifizierbare offizielle Quellen, ohne Registrierung oder Guthaben. Besser als Trifolia: lokal, unbegrenzt, mit FTS-Volltextsuche, hybrider Semantik und Word/PDF-Export.

Was es macht (15 Tools)

Werkzeug

Quelle

Was es zurückgibt

buscar_normas

BCN SPARQL 748k + FTS lokal + body

Gesetze mit Filtern fecha_desde/hasta DD-MM-AAAA, tipo, materia + Zitat

citar_norma / citar_json

BCN

Zitiert Text und JSON {numero, fecha DD-MM-AAAA, titulo, url}

obtener_texto_norma

leychile.cl/Consulta/obtxml?opt=7 offizielles gecachtes XML

Volltext 14k

exportar_norma

lokal

Word .docx (python-docx) / PDF .pdf (reportlab/weasyprint) in /tmp

buscar_semantico

Hybrid FTS + MiniLM-Embeddings + Synonyme

acoso ≈ maltrato

buscar_dictamenes

CGR Domino + BCN + FTS

Gutachten mit URL

buscar_jurisprudencia

BCN + CGR + öffentliches PJUD

Rechtsprechung + Links

buscar_doctrina

BCN-Artikel 30k + Fallback

Artikel

historial_norma

BCN hasVersion/modifiesTo

Gültigkeit und Beziehungen

buscar_scielo / buscar_dt / buscar_diario_oficial

SciELO, DT, Diario Oficial

Doktrin und sektorale Vorschriften

buscar_todo

Echte Parallelität mit ThreadPoolExecutor(4)

Mehrere Quellen in 1 Aufruf

ayuda_acceso_abogado

—

6 offizielle Links

Alle Antworten enthalten Zitat und Link zur offiziellen Quelle. Chilenische Datumsangaben DD-MM-AAAA bei Eingabe und Ausgabe.

Related MCP server: LeyChile MCP

Installation

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)

Verwendung — jeder MCP-Client (stdio)

python -m chilean_legal_mcp.server          # stdio (default)
python -m chilean_legal_mcp.server --http   # HTTP streamable :8000

Claude 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"]}}

Struktur

src/chilean_legal_mcp/
  sparql_client.py  # BCN SPARQL + filtros fecha/tipo
  db.py             # SQLite FTS5 (normas, textos, dictamenes) + check_same_thread=False
  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 15 tools, paralelo real
data/
  normas.db (545)
  jpl/README.md     # reservado Ley 18.287

Quellen (100 % öffentlich, ohne Registrierung)

  • BCN datos.bcn.cl/sparql (Virtuoso)

  • LeyChile leychile.cl/Consulta/obtxml?opt=7&idNorma=...

  • CGR contraloria.cl/appinf/... + BCN Oficio

  • PJUD pjud.cl/portal-unificado-sentencias (mit Playwright verifiziert, ohne api.pjud.cl)

  • SciELO, DT, Diario Oficial — öffentliche Suchmaschinen

Lizenz

MIT

Related MCP Connectors

Related MCP Servers