Skip to main content

tr-eli-mcp

An MCP server for Turkish legislation (Kanun/laws, KHK/decree-laws, Tuzuk/statutes, Yonetmelik/regulations, Cumhurbaskanligi Kararnamesi/presidential decrees, Teblig/communiques and more), served as a keyless JSON API by the Adalet Bakanligi (Ministry of Justice) at bedesten.adalet.gov.tr/mevzuat. It gives an AI agent legislation text and metadata with a verifiable citation: a resolvable identifier, a human-readable citation, and a link to the official source.

Part of the eu-legal-mcp line by MateMatic — one connector per country, the same citation contract everywhere. Turkey is included under this line's broader "Europe" framing (Council of Europe member, EU accession candidate), alongside connectors that map strictly to EU-27 membership.

On ELI. Turkey does not publish native ELI (/eli/) URIs. To keep the line's contract honest, eli_uri carries the canonical, resolvable mevzuat.gov.tr URL instead — e.g. https://www.mevzuat.gov.tr/mevzuat?MevzuatNo=5237&MevzuatTur=1&MevzuatTertip=5 — which every Bedesten search record already supplies. The connector never fabricates an /eli/ URI and says so in its tool instructions. See DISCOVERY.md.

On case law. This connector covers legislation only. Yargitay (Court of Cassation) decision search was unreachable (TCP timeout) from the build network, and Anayasa Mahkemesi (Constitutional Court) exposes only a client-rendered SPA with no discovered server API. Neither is wired up here — see DISCOVERY.md for what was actually checked.

Tools

Tool What it does
tr_search_legislation(query, mevzuat_turu=None, mevzuat_no=None, baslikta_ara=True) Search Turkish legislation by title and/or full text, optionally filtered by type and number.
tr_get_legislation_content(mevzuat_id) The full text of one document (HTML converted to plain text).
tr_get_legislation_toc(mevzuat_id) The article tree (madde agaci / table of contents) of one document.
tr_list_legislation_types() Enumerate all legislation types with live document counts (KANUN, KHK, YONETMELIK, ...).

Every response carries the citation contract:

  • eli_uri — the canonical, resolvable mevzuat.gov.tr identifier (see the ELI note above).
  • human_readable_citation — the Turkish citation convention: law number + name + Official Gazette (Resmi Gazete) date/number, e.g. 5237 sayili Turk Ceza Kanunu (Resmi Gazete: 12/10/2004, Sayi: 25611).
  • source_url — the same canonical mevzuat.gov.tr page.

Install

pip install -e ".[dev]"

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

{
  "mcpServers": {
    "tr-eli-mcp": {
      "command": "tr-eli-mcp",
      "env": {
        "TR_ELI_BASE_URL": "https://bedesten.adalet.gov.tr/mevzuat",
        "TR_ELI_CACHE_DIR": "~/.matematic/cache/tr-eli",
        "TR_ELI_AUDIT_DIR": "~/.matematic/audit"
      }
    }
  }
}

Windows 11 ze Smart App Control

Smart App Control blokuje niepodpisane pliki wykonywalne, a uvx.exe, pip.exe i generowany przy instalacji tr-eli-mcp.exe podpisane nie sa. python.exe z python.org jest podpisany przez Python Software Foundation, wiec uruchomienie przez modul omija blokade:

python -m pip install tr-eli-mcp
python -m tr_eli_mcp
{ "mcpServers": { "tr-eli-mcp": { "command": "python", "args": ["-m", "tr_eli_mcp"] } } }

Nie wylaczaj Smart App Control, zeby to obejsc - wylaczenia nie da sie cofnac bez ponownej instalacji systemu.

Design

  • Public data only. Read-only against the keyless Adalet Bakanligi Bedesten API; nothing is sent beyond the query / document id.
  • Audit log. Every call appends one JSON line to ~/.matematic/audit/tr-eli-mcp.jsonl (AI Act art. 12 record-keeping).
  • Vendor-neutral. No LLM provider, no telemetry; own backoff + on-disk cache.
  • No fabrication. Identifiers and titles are parsed from the source record. If Bedesten's schema 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, and what was ruled out).

Tests

pytest tests/test_instructions_drift.py   # offline
pytest tests/test_smoke.py                # live Bedesten API

Licence

Apache-2.0. The Turkish legislation served is official public data of the Republic of Turkey; 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

tr_eli_mcp-0.2.1.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

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

tr_eli_mcp-0.2.1-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file tr_eli_mcp-0.2.1.tar.gz.

File metadata

  • Download URL: tr_eli_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tr_eli_mcp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 142882017e971d195b7904507c1d48b3fe25f5016e27edae34ca3870ed4dda38
MD5 86b23f7a0a6731b0155bbce6df58cf60
BLAKE2b-256 b07eb673b80211e2d9b7df61c131c64f770b6357d9e45d74a34477e27628e784

See more details on using hashes here.

File details

Details for the file tr_eli_mcp-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: tr_eli_mcp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tr_eli_mcp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 80b8205aac666fca86c735b1e842dc0747ac6c9ab00ec331f94c1858bcc2e931
MD5 0aa9ebeb75b9c8e27dd5cb6098694dc6
BLAKE2b-256 134ede139d4f650f8a207c5c51d60c88c5615e1e0ca4e45b6abbbf80211c8b15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page