Purpose
turk-hukuku-mevzuat-mcp is an MCP (Model Context Protocol) server that exposes current official Turkish legal texts (sourced from mevzuat.gov.tr, the Presidency's Legal Information System) to artificial intelligence tools. Its design purpose can be summarized in one sentence: when a model cites a legal provision, do not rely on the model's memory, but instead retrieve the text from the official source and relay it in a verifiable way. For example, when a user mentions "TBK m.49", the server returns the currently in-force text of that provision along with a verification link.
The project is compatible with Claude Code, Codex, and Gemini CLI. It explicitly states that this is not legal advice: the tool is intended only to facilitate access to official texts and does not include interpretation, assessment of case law, or application to specific cases; the final text should always be verified through mevzuat.gov.tr.
Main capabilities
- Retrieve the current provision text by law and article number: when a provision of a law is requested, the server returns the currently in-force text of that provision and a verification link.
- Flexible law parameter kanun: supports abbreviations (e.g., TBK), numbers (e.g., 6098), or full identifiers (e.g., 1.5.6098). Even if a law is not registered, it can be accessed by number or identifier.
- Search function mevzuat_ara: its nerede parameter accepts three values: Baslik (search in the "law name", used to find laws), Icerik (search in the "full text", used to scan which laws a concept appears in), Tumu (all). The returned mevzuat_id can be passed directly to madde_getir, so its provisions can be accessed even without knowing the law number.
How it works
mevzuat.gov.tr provides a consolidated (current) text PDF for each law in the following pattern: all large laws use the 1.5.<number> pattern (Tür=1 law, Tertip=5), for example TBK corresponds to 1.5.6098. The server retrieves that PDF, converts it to text (using pypdf), extracts the required provision with a regular expression, and keeps it in cache throughout the process. The entire process is performed locally and no data is collected.
Search accesses the site's anasayfa/MevzuatDatatable endpoint (the search term is encoded in UTF-8 Base64). Each result carries tur.tertip.no, so the PDF identifier of the matching law (and thus the full text and provisions) can be obtained directly.
How to use
The project has been published on PyPI and can be run via uv without a separate installation. Installation instructions are at turk-hukuku.com/mcp; if the user does not use a terminal, the desktop application (Mac and Windows) installs and runs the server by itself.
Configuration example (according to the official instructions):
In ~/.codex/config.toml:
(原始资料未提供此处的完整配置代码内容)
Under mcpServers in ~/.gemini/settings.json:
{
"mcpServers": {
// 原始资料未提供此处的完整配置代码内容
}
}
Alternative: pip
# 原始资料未提供具体 pip 安装命令内容
Use Cases
- When AI coding or dialogue tools need to cite Turkish legal provisions, obtain verifiable current texts from official sources instead of relying on model memory.
- When there is a need to quickly locate a specific law by name, number, or identifier and extract specific provisions.
- When there is a need to search across full texts for which laws a certain concept appears in.
Known Limitations
- Laws only: Both search (MevzuatTur=1) and text access are limited to "laws"; other types of legal norms such as regulations and communiqués, as well as case law, are out of scope.
- No guaranteed search ranking: The first result of mevzuat_ara is not necessarily the most relevant; please select the correct law based on name or number.
- Depends on PDF text: Occasional line breaks or merges may occur; if in doubt, open the source to verify.
- For repealed or amended provisions, if the tool cannot return the text, it will give a warning rather than fabricate the provision.
Other Information
- License: MIT.
- The data source belongs to mevzuat.gov.tr; this project is only an independent client for convenient access to public official texts.
- Privacy: No data collection, no telemetry; the only external connection is mevzuat.gov.tr.
- The project is open source on GitHub at https://github.com/aydincan/turk-hukuku-mevzuat-mcp。