Metadata-Version: 2.4
Name: de-eli-mcp
Version: 0.1.0
Summary: MCP server for the German NeuRIS API (rechtsinformationen.bund.de) — search and fetch federal legislation with ELI identifiers and verifiable citations.
Project-URL: Repository, https://github.com/matematicsolutions/de-eli-mcp
Project-URL: Issues, https://github.com/matematicsolutions/de-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: eli,gdpr,germany,law,legaltech,mcp,neuris
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>=0.2.0
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.6
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

# de-eli-mcp

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

An MCP server for **NeuRIS** (`rechtsinformationen.bund.de`), Germany's official
federal legal information portal. It searches and retrieves legislation
(Gesetze, Verordnungen) with verifiable ELI identifiers and German citations.

Part of the MateMatic `eu-legal-mcp` production line: the German counterpart of the
Polish `sejm-eli-mcp`, built on the same architecture and citation contract against the
German source.

> **Beta source.** NeuRIS is an official but beta service; its dataset is not yet
> complete. Every response carries a `dataset_note` saying so. For exhaustive
> research, cross-check gesetze-im-internet.de / rechtsprechung-im-internet.de.
>
> **Licence.** German official works - statutes, ordinances, court decisions and
> official headnotes - are outside copyright under § 5 UrhG (gemeinfrei), which is
> the standard basis for reusing German legal data. NeuRIS is operated by the BMJV /
> DigitalService GmbH and publishes no separate API terms or key requirement. This
> connector only relays that public-domain content, with attribution and a
> `source_url`. Caveat: NeuRIS is in test phase; re-check the terms at general
> availability. (This is a practitioner's read, not formal legal advice.)

## The five tools

| Tool | What it does |
|---|---|
| `de_search` | Search legislation by term, ELI and date (`GET /v1/legislation`). |
| `de_get_act` | Fetch act metadata by ELI. |
| `de_get_text` | Fetch the full text (`html` or `xml` / LegalDocML.de). |
| `de_list_publishers` | List the publication organs (BGBl I/II, Bundesanzeiger). |
| `de_recent_changes` | Acts published since a date, newest-first. |

Every response carries the contract: `eli_uri` (e.g. `eli/bund/bgbl-1/2017/s2097/2025-01-01/1/deu`),
`human_readable_citation` (e.g. `BDSG (BGBl I, 2017 2097)`), and `source_url`.

## Install

```bash
cd de-eli-mcp
pip install -e .
```

## Configure (Claude Code / any MCP client)

Copy `.mcp.json.example` and adjust if needed:

```json
{
  "mcpServers": {
    "de-eli-mcp": { "command": "de-eli-mcp" }
  }
}
```

Environment:

- `DE_ELI_BASE_URL` - default `https://testphase.rechtsinformationen.bund.de`
- `DE_ELI_CACHE_DIR` - default `~/.matematic/cache/de-eli`
- `DE_ELI_AUDIT_DIR` - default `~/.matematic/audit`

No API key. NeuRIS is keyless.

## Governance

- **Public data only** - read-only against NeuRIS; no client data leaves the machine beyond search parameters.
- **Audit log** - every tool call appends one JSON line to `~/.matematic/audit/de-eli-mcp.jsonl`.
- **Vendor-neutral** - the server talks only to NeuRIS and the local filesystem; no LLM provider, no telemetry.
- **Verifiable citations** - every response is independently checkable via `source_url`.

See `CONSTITUTION.md` (the binding rules) and `DISCOVERY.md` (the NeuRIS API map).

## Tests

```bash
pip install -e ".[dev]"
pytest tests/test_instructions_drift.py -v   # offline
pytest tests/test_smoke.py -v                # hits live NeuRIS
```

## Licence

Apache-2.0. © Matematic Solutions / Wieslaw Mazur.
