MCP server for Italian law: federal legislation via Normattiva (Akoma Ntoso / URN:NIR / ELI, point-in-time text) and Constitutional Court (Corte Costituzionale) case law from the Court's official open data, ECLI-native.
Project description
it-eli-mcp
An MCP server for Italian law, in two layers:
- Legislation via Normattiva, the official portal of the Ministero della Giustizia. It fetches acts as Akoma Ntoso with verifiable URN:NIR and ELI identifiers, and returns the text as it stood on any past date (multivigenza). Live and keyless.
- Constitutional case law (Corte Costituzionale): a local, keyless full-text index of every decision since 1956, each with its native ECLI, built from the Court's official open data.
Italy has the EU's largest legal profession by headcount - roughly 240,000 lawyers per CCBE figures, ahead of Germany and Spain. No live, keyless MCP connector covered its statute book. This one does, and it also covers the constitutional case law.
Part of the MateMatic eu-legal-mcp production line: the Italian sibling of de-eli-mcp (Germany)
and sejm-eli-mcp (Poland), built on the same architecture and citation contract against the
Italian source.
No JSON API. Normattiva does not publish a REST API. This connector drives the same session-based flow a browser uses - resolve a URN, read the act page, fetch its Akoma Ntoso export - so every act comes back as structured XML with its ELI intact. See
DISCOVERY.md.Licence. Italian official legal texts are outside copyright (art. 5, l. 633/1941), and Normattiva declares CC-BY-4.0 for its data from 2026-01-01. This connector relays individual acts on request, with attribution and a
source_url; it does not bulk-harvest the database (Normattiva's terms restrict that). Every response carries adataset_note. (A practitioner's read, not formal legal advice.)
Legislation tools (Normattiva, live)
| Tool | What it does |
|---|---|
it_list_codes |
The major Italian codes and consolidated acts (Codice civile, penale, di procedura, privacy/GDPR, CAD, D.Lgs. 231/2001, Costituzione, L. 241/1990) with their canonical URN. |
it_resolve |
Turns act coordinates (act_type, year, number) into a canonical, resolvable URN:NIR. Offline. |
it_get_act |
Fetches act metadata (title, date, ELI, article count) for a code name, URN, ELI path, or normattiva.it URL. |
it_get_text |
Fetches the text of a whole act or a single article - with at_date for the point-in-time version. |
Constitutional case-law tools (Corte Costituzionale, local index)
| Tool | What it does |
|---|---|
it_case_search |
Full-text search over the decisions (heading, reasoning, operative part). Filters by year and type (sentenza/ordinanza). Accent-insensitive. |
it_case_get_decision |
The full text of one decision, by ECLI (ECLI:IT:COST:2024:1) or by year + number. |
it_case_recent |
The most recent decisions (newest first). |
it_case_stats |
Index coverage: total decisions, year range, counts by type, last build time. |
The case-law tools read a local SQLite index. Build it once (downloads the Court's open data - all decisions since 1956):
italy-eli-mcp-caselaw-ingest
Re-run it to refresh when the Court publishes new decisions. The legislation tools need no such step; they fetch live. Scope is the Constitutional Court only - not the Corte di Cassazione (subscription-gated) or the administrative courts.
Every legislation response carries the citation contract: eli_uri (e.g.
eli/id/1990/08/18/090G0294/CONSOLIDATED), urn (e.g. urn:nir:stato:legge:1990-08-07;241),
human_readable_citation (e.g. Legge 7 agosto 1990, n. 241), and source_url.
How it identifies an act
- URN:NIR -
urn:nir:{authority}:{type}:{date};{number}. A partial URN with the year alone (urn:nir:stato:legge:1990;241) also resolves, so you can cite an act you only know as "L. 241/1990". - ELI -
eli/id/{year}/{month}/{day}/{code}/CONSOLIDATED, read from the act itself. Never invented.
Examples
it_list_codes()
→ [{key: "codice civile", urn: "urn:nir:stato:regio.decreto:1942-03-16;262", ...}, ...]
it_resolve(act_type="d.lgs", year=2001, number=231)
→ {urn: "urn:nir:stato:decreto.legislativo:2001;231",
human_readable_citation: "Decreto legislativo n. 231/2001", source_url: "..."}
it_get_text(reference="codice civile", article="2043")
→ art. 2043 c.c. (Risarcimento per fatto illecito), with eli_uri + source_url
it_get_text(reference="codice privacy", article="1", at_date="2010-01-01")
→ the privacy code's art. 1 as it stood on 1 January 2010
Install
cd it-eli-mcp
pip install -e .
Configure (Claude Code / any MCP client)
Copy .mcp.json.example:
{
"mcpServers": {
"it-eli-mcp": { "command": "italy-eli-mcp" }
}
}
Environment:
IT_ELI_BASE_URL- defaulthttps://www.normattiva.itIT_ELI_CACHE_DIR- default~/.matematic/cache/it-eliIT_ELI_AUDIT_DIR- default~/.matematic/auditIT_ELI_CASELAW_DB- constitutional case-law index path (default~/.matematic/data/it-eli-caselaw/cost.sqlite)
Tests
pip install -e ".[dev]"
pytest -m "not smoke" # offline (URN, Akoma Ntoso parser, case-law index, drift)
pytest -m smoke # live: Normattiva + the Corte Costituzionale open data
Audit trail
Every tool call appends one JSON line to ~/.matematic/audit/it-eli-mcp.jsonl (timestamp, tool,
input hash, output size, duration, status) for AI Act art. 12 record-keeping. No raw query text is
stored.
Licence
Apache-2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file italy_eli_mcp-0.2.2.tar.gz.
File metadata
- Download URL: italy_eli_mcp-0.2.2.tar.gz
- Upload date:
- Size: 42.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27cd333e59ae999c6c0a770b7e8594bcea8650ea16853f9cea49a4bebb37275c
|
|
| MD5 |
fedcf1f34bf7969f4f0b5f27da551005
|
|
| BLAKE2b-256 |
120a2e31ec92f3970f3a46a84980d03d4c443647398f6e09927eac6d7d01edd0
|
File details
Details for the file italy_eli_mcp-0.2.2-py3-none-any.whl.
File metadata
- Download URL: italy_eli_mcp-0.2.2-py3-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7aafad383688992ac8d53f6e70edcfc53e73b7eb43fb2c9b595e3f185624d2e3
|
|
| MD5 |
44493be5853f74103a738e5a400124b0
|
|
| BLAKE2b-256 |
c24d59beb5195070c7971c6fc72bb8c273f93f44c5549cbef2fcc5adfccb791f
|