Skip to main content
Glama
README.md
# eu-recht-mcp

An unofficial [MCP](https://modelcontextprotocol.io) server for EU law in force, in German: regulations, directives and decisions, including implementing and delegated acts. The texts come from Cellar, the repository of the EU Publications Office behind [EUR-Lex](https://eur-lex.europa.eu). The server downloads every act, keeps dated snapshots, and lets an agent search and read every article, recital and annex with a citation.

Only the Official Journal of the European Union is authentic. This project is not affiliated with the Publications Office or any EU institution.

## Use

```bash
pip install eu-recht-mcp
```

```bash
eu-recht-mcp --data-dir ~/eu-recht-mcp-data update
```

```bash
eu-recht-mcp --data-dir ~/eu-recht-mcp-data serve
```

`update` queries the catalog of acts in force, downloads one German text per act, parses everything and switches to the new data only if all of it succeeded. The first run makes about 34,000 requests, one per second, and takes about 12 hours. Later runs ask Cellar whether each file changed and download only those that did.

To add it to Claude Code:

```bash
claude mcp add eu-recht -- eu-recht-mcp --data-dir ~/eu-recht-mcp-data serve
```

## What is served for each act

- **Consolidated version, where one exists:** the newest one dated on or before the download day, with all amendments merged in. Its recitals come from the original, because consolidated texts leave them out.
- **Otherwise the original text** from the Official Journal.
- Acts without a German HTML text in Cellar, about 10%, are left out and counted in `source_status`.

`law_id` is the CELEX number, such as `32016R0679` for the GDPR. Norm keys look like `art6`, `erwgr47` (recital 47), `anhangi` (Annex I) and `praeambel`.

## Tools

| Tool | Purpose |
| --- | --- |
| `search_law(query, law_id?, limit?, as_of?)` | Full-text search over all articles, recitals and annexes |
| `get_law(law_id, offset?, limit?, as_of?)` | An act's details, amendments and table of contents |
| `get_norm(law_id, key, offset?, max_chars?, as_of?)` | One norm's text, in parts if long |
| `list_versions(law_id)` | Snapshot dates on which an act's text changed |
| `source_status()` | Snapshots, counts and download problems |

Resources: `eu-recht://readme` (the source and its known problems), `eu-recht://laws` (catalog) and `law://eu-recht/{law_id}/{key}` (one norm).

## Data folder

```
raw/<date>/catalog/      SPARQL results: acts in force and consolidated versions
raw/<date>/texts/        one German HTML file per act
raw/<date>/originals/    originals of consolidated acts, for their recitals
processed/<date>/        index.sqlite and laws/<celex>.md
CURRENT                  the build in use
```

`processed/<date>/laws/` holds every act as Markdown, so an agent can also work with the folder directly, without MCP.

## Development

```bash
eu-recht-mcp --data-dir /tmp/eu ingest --max-files 100
```

```bash
eu-recht-mcp --data-dir /tmp/eu process
```

```bash
pytest
```

The catalog always takes 32 queries, which count towards `--max-files`. The repository has no dependencies beyond PyPI packages; the shared base (downloads, snapshots, `as_of` builds, citations) is in `src/eu_recht_mcp/_core/`.