Metadata-Version: 2.5
Name: cl-eli-mcp
Version: 0.3.1
Summary: MCP server for Chilean legislation (BCN Linked Open Data SPARQL endpoint) with verifiable citations.
Project-URL: Repository, https://github.com/matematicsolutions/cl-eli-mcp
Project-URL: Issues, https://github.com/matematicsolutions/cl-eli-mcp/issues
Project-URL: Homepage, https://matematic.co
Author-email: Matematic Solutions <kontakt@matematic.co>, Wieslaw Mazur <mazur.wieslaw2022@gmail.com>
License: Apache-2.0
License-File: LICENSE
Keywords: bcn,chile,law,legaltech,mcp,sparql
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Legal Industry
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business
Requires-Python: >=3.11
Requires-Dist: anyio>=4.3
Requires-Dist: diskcache>=5.6
Requires-Dist: fastmcp<4,>=3.4
Requires-Dist: httpx<1,>=0.27
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# cl-eli-mcp

<!-- mcp-name: io.github.matematicsolutions/cl-eli-mcp -->

MCP server for Chilean legislation via the BCN (Biblioteca del Congreso
Nacional de Chile) Linked Open Data SPARQL endpoint. Searches and fetches
laws, decrees, and resolutions by their persistent resource URI.

## What this is not

BCN's resource URIs are not formally called ELI, but they carry the same
idea: jurisdiction, type, issuing body, date, number, all in one
dereferenceable URI. This connector returns metadata (title, number, dates,
issuing body) - not the operative text of the law. Following `source_url`
(the same URI, content-negotiated) takes you to the human-readable page.

## Tools

| Tool | Purpose |
|---|---|
| `cl_search_norms` | Full-text search over norm titles |
| `cl_get_norm` | Full detail for one norm by its BCN resource URI |
| `cl_coverage` | Declare what this connector covers, when each family was captured, and - explicitly - what it does NOT cover. Every gap carries a fallback. |

Every response carries `lex_uri` and `source_url` (both the BCN resource
URI) and `human_readable_citation` (e.g. `"Ley 18290, de 1984-01-23"`).

## Install

```bash
pip install cl-eli-mcp
```


### Windows 11 with Smart App Control

Smart App Control blocks unsigned executables, which covers `uvx.exe`, `pip.exe`
and the `cl-eli-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:

```bash
python -m pip install cl-eli-mcp
python -m cl_eli_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 cl_eli_mcp`.

```json
{ "mcpServers": { "cl-eli-mcp": { "command": "python", "args": ["-m", "cl_eli_mcp"] } } }
```

Do not turn Smart App Control off to work around this - it cannot be re-enabled
without reinstalling Windows.

## Configuration

| Env var | Default |
|---|---|
| `CL_ELI_CACHE_DIR` | `~/.matematic/cache/cl-eli` |
| `CL_ELI_AUDIT_DIR` | `~/.matematic/audit` |
| `CL_ELI_BASE_URL` | `https://datos.bcn.cl/sparql` |

## License

Apache-2.0 (code). BCN Linked Open Data is a public government dataset (see
[SOURCES.md](SOURCES.md)).
