Skip to main content

hu-eli-mcp

An MCP server for Hungary's official national legislation database, the Nemzeti Jogszabalytar (NJT, njt.jog.gov.hu), maintained by MKIFK. It gives an AI agent a piece of Hungarian legislation resolved by its native ELI (European Legislation Identifier), with a verifiable citation: the ELI itself, a human-readable citation, and a link to the official source.

Part of the eu-legal-mcp line by MateMatic — one connector per EU member state, the same citation contract everywhere.

On ELI. Unlike the Netherlands and Sweden (earlier connectors in this line, neither of which publishes native ELI), Hungary has a genuine, documented national ELI implementation since 2023 (njt.jog.gov.hu/eli/urisemak). eli_uri is therefore the real /eli/ URI the tool resolved — never a substitute identifier. See DISCOVERY.md.

Tools

Tool What it does
hu_get_act(year, serial) Metadata for a Hungarian Act (torveny) by ELI, e.g. year 2013, serial 5 (the Civil Code). No issuer code needed.
hu_get_legislation(doc_type, year, issuer, serial) Metadata for any other legislation (decrees etc.) by ELI — type, year, issuer (case-sensitive) and serial.
hu_get_text(doc_type, year, serial, issuer=None) The full document HTML content for either an Act or other legislation.
hu_list_doc_types() Valid NJT document-type codes (e.g. TV=Act, R=decree).
hu_list_issuers() Valid NJT issuer codes (e.g. Korm=Government) — note the exact casing matters.
hu_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 the citation contract:

  • eli_uri — the native ELI URI resolved, e.g. https://njt.jog.gov.hu/eli/TV/2013/5.
  • human_readable_citation — built from the parsed title + subtitle, e.g. "2013. évi V. törvény (a Polgári Törvénykönyvről)".
  • source_url — the browsable njt.jog.gov.hu/jogszabaly/... document page.

No free-text search

NJT has no REST/JSON API and its search/browse UI is a JavaScript SPA requiring a session (not usable headlessly). Documents must be addressed by a known ELI — use hu_list_doc_types / hu_list_issuers to discover valid codes, then hu_get_act / hu_get_legislation. An unresolvable ELI (wrong year/serial/issuer, or wrong issuer-code case) surfaces as not_found — NJT itself redirects it to a search-assist page rather than a 404.

Install

pip install -e ".[dev]"

Register it with your MCP client (see .mcp.json.example):

{
  "mcpServers": {
    "hu-eli-mcp": {
      "command": "hu-eli-mcp",
      "env": {
        "HU_ELI_BASE_URL": "https://njt.jog.gov.hu",
        "HU_ELI_CACHE_DIR": "~/.matematic/cache/hu-eli",
        "HU_ELI_AUDIT_DIR": "~/.matematic/audit"
      }
    }
  }
}

Windows 11 with Smart App Control

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

python -m pip install hu-eli-mcp
python -m hu_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 hu_eli_mcp.

{ "mcpServers": { "hu-eli-mcp": { "command": "python", "args": ["-m", "hu_eli_mcp"] } } }

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

Design

  • Public data only. Read-only against the keyless, official njt.jog.gov.hu; nothing is sent beyond the ELI path being resolved. Honors robots.txt (never calls /search/*).
  • Audit log. Every call appends one JSON line to ~/.matematic/audit/hu-eli-mcp.jsonl (AI Act art. 12 record-keeping).
  • Vendor-neutral. No LLM provider, no telemetry; own backoff + on-disk cache.
  • No fabrication. The ELI, title and citation are parsed from the resolved document page. If NJT's markup changes, the connector fails loudly rather than returning stale or invented data.

See CONSTITUTION.md (the 4 principles) and DISCOVERY.md (how the source was mapped, including the njt.hunjt.jog.gov.hu domain discovery and the issuer-code casing gotcha).

Tests

pytest tests/test_instructions_drift.py   # offline
pytest tests/test_smoke.py                 # live NJT

Licence

Apache-2.0. The Hungarian legislation served is official public data of Hungary; this connector adds no rights over it.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hu_eli_mcp-0.3.2.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hu_eli_mcp-0.3.2-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file hu_eli_mcp-0.3.2.tar.gz.

File metadata

  • Download URL: hu_eli_mcp-0.3.2.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hu_eli_mcp-0.3.2.tar.gz
Algorithm Hash digest
SHA256 763b570796779851195979673efbda85c95982c9e52cafae29020c1358d53fbd
MD5 c017f7b2a107936bf86567ee77462a44
BLAKE2b-256 e5d8960ad18873745bd4bf93f0f1f20798353eb23fa4619dc75e1f37c8055233

See more details on using hashes here.

File details

Details for the file hu_eli_mcp-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: hu_eli_mcp-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hu_eli_mcp-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 15a7fe0ca634ecda4f0159f15b01637ab8b35cc26203706a05d942bac0884517
MD5 a6da2f3f106919c68d5175b6a0888242
BLAKE2b-256 3ff4c8b2b13b17c8e12250aa2abe20f6d563bb05e4354b4d4cb6cd7d1e6c67e3

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.3

2 files

This release

0.3.2 This release

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page