tr-eli-mcp
This server lets an AI agent search, retrieve, and inspect Turkish legislation from the official Adalet Bakanligi Bedesten API, always returning verifiable citations to mevzuat.gov.tr.
Search legislation (
tr_search_legislation): query by title and/or full text, with optional filters for legislation type and law number.Get full text (
tr_get_legislation_content): fetch the complete plain-text content of a document using itsmevzuat_id.Get table of contents (
tr_get_legislation_toc): retrieve the article/madde tree of a document.List legislation types (
tr_list_legislation_types): enumerate all Turkish legislation types with live document counts (KANUN, KHK, YONETMELIK, etc.).Check coverage (
tr_coverage): see exactly what is covered, coverage dates, and known gaps with fallbacks (e.g., case law is not included).Citation contract: every result includes
eli_uri(the canonical mevzuat.gov.tr URL),human_readable_citation, andsource_urlfor verifiability.Safe and transparent: read-only, no API key, no fabrication, audit logging, on-disk cache, and fails loudly if source schema changes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tr-eli-mcp search for Turkish Penal Code"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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_uricarries the canonical, resolvablemevzuat.gov.trURL 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. SeeDISCOVERY.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.mdfor what was actually checked.
Tools
Tool | What it does |
| Search Turkish legislation by title and/or full text, optionally filtered by type and number. |
| The full text of one document (HTML converted to plain text). |
| The article tree (madde agaci / table of contents) of one document. |
| Enumerate all legislation types with live document counts (KANUN, KHK, YONETMELIK, ...). |
| 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 canonical, resolvablemevzuat.gov.tridentifier (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 canonicalmevzuat.gov.trpage.
Related MCP server: BDDK MCP Server
Install
As a Claude plugin (Claude Code or the desktop app, needs uv); see plugin/README.md for what it sends and stores:
/plugin marketplace add matematicsolutions/tr-eli-mcp
/plugin install tr-eli-mcp@tr-eli-mcppip 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 with Smart App Control
Smart App Control blocks unsigned executables, which covers uvx.exe, pip.exe
and the tr-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 tr-eli-mcp
python -m tr_eli_mcppip.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 tr_eli_mcp.
{ "mcpServers": { "tr-eli-mcp": { "command": "python", "args": ["-m", "tr_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 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(record-keeping).Network - the server talks to the official source(s) named above and the local filesystem. Once, on first use, it also fetches a small configuration file (
tr-runtime.json.gz, updated source addresses) from this repository's GitHub Releases. That request carries no query content; GitHub's download counter for the file is the only usage signal we see.TR_ELI_RUNTIME_URL=""turns it off; the Claude plugin ships with it off. No LLM provider, no other 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 APILicence
Apache-2.0. The Turkish legislation served is official public data of the Republic of Turkey; this connector adds no rights over it.
Available Tools
5 toolstr_coverageARead-onlyIdempotent
Declare what this connector covers, how it is sourced, and what it does NOT cover.
Call this before telling a user that the law "does not contain" something, and whenever a search comes back empty: the absence may be a gap in this connector rather than in the law. Every gap carries a fallback saying where to look instead.
Returns:
Coverage with families, an as-of note, and a non-empty list of known gaps.
Inputs: no named parameters. Returns: What this connector covers, how it is sourced, and what it does not cover.
tr_get_legislation_contentARead-onlyIdempotent
Fetch the full text of a Turkish legislative document by its mevzuat_id.
Inputs: mevzuat_id (required). Returns: Result of ``tr_get_legislation_content``.
tr_get_legislation_tocARead-onlyIdempotent
Fetch the article tree (madde agaci / table of contents) of a document.
Inputs: mevzuat_id (required). Returns: Result of ``tr_get_legislation_toc``.
tr_list_legislation_typesARead-onlyIdempotent
Enumerate all Turkish legislation types with live document counts.
Returns:
LegislationTypeList with items like KANUN (laws), KHK (decree-laws),
YONETMELIK (regulations), CB_KARARNAME (presidential decrees), etc.
Inputs: no named parameters. Returns: Result of ``tr_list_legislation_types``.
tr_search_legislationARead-onlyIdempotent
Search Turkish legislation by title and/or full text.
Inputs: query (required), mevzuat_no, baslikta_ara, mevzuat_turu. Returns: Result of ``tr_search_legislation``.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct aspect of Turkish legislation: searching, listing types, fetching full text, fetching table of contents, and declaring coverage gaps. There is no meaningful overlap; even get_legislation_content and get_legislation_toc are clearly separated by the type of content returned.
Most tools follow a consistent tr_<verb>_<object> pattern (tr_search_legislation, tr_list_legislation_types, tr_get_legislation_content, tr_get_legislation_toc). The lone exception is tr_coverage, which uses a noun instead of a verb, creating a minor but noticeable deviation.
Five tools is well-scoped for a legal research connector: two for discovery, two for retrieval, and one for coverage metadata. Each tool serves a clear purpose and none feel redundant or extraneous.
The surface covers the core workflow of searching, enumerating types, fetching full text, and navigating structure via TOC, plus a dedicated gap-awareness tool. For a read-only legislation domain, this is complete; there are no obvious missing operations that would block typical agent workflows.
Maintenance
Related MCP Connectors
An MCP server that provides congressional transcripts
대한민국 법령·조문·별표·연혁·판례·해석례를 법제처 국가법령정보 OPEN API 로 찾아보는 읽기 전용 MCP 서버. 핵심 도구 12개.
MCP server for Brazilian Federal Senate open data (legislative, administrative, e-Cidadania).
MCP server for Chinese law lookup: statutes, regulations and articles by keyword or law name.
Related MCP Servers
- AlicenseAqualityBmaintenanceA FastMCP server providing access to the Turkish Ministry of Justice's Legislative Information System, allowing LLM applications to search legislation, retrieve article lists, and get article contents in Markdown format.26246 PyPI234MIT
- AlicenseNot gradedqualityBmaintenanceAn offline-first MCP server for searching, retrieving, and analyzing Turkish banking regulation data from BDDK and mevzuat.gov.tr.1MIT
- AlicenseAqualityBmaintenanceMCP server for querying French legislation and case law via the Legifrance API, enabling search and retrieval of laws, codes, and court decisions with verifiable citations.854 PyPI2Apache 2.0
- AlicenseNot gradedqualityBmaintenanceMCP server for Azerbaijan's official legal-acts database (e-qanun.az), enabling search, metadata retrieval, and full-text access to legislative and judicial documents.MIT