# aydincan/turk-hukuku-mevzuat-mcp architecture

> Architecture diagram of the GitHub repository aydincan/turk-hukuku-mevzuat-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aydincan/turk-hukuku-mevzuat-mcp
- Repository: https://github.com/aydincan/turk-hukuku-mevzuat-mcp

## Overview

This is an MCP server that lets AI clients search Turkish laws and retrieve current official law text or individual articles from mevzuat.gov.tr. The main workflow is a tool request, optional law identification, official-source retrieval, and a verifiable response; a separate tool lists known laws. The source excerpts show the tool dispatch and processing logic. The external service interactions and capabilities are also documented in the README; finer internal boundaries within mevzuat.py reflect its described stages.

Main entry points: [`turk_hukuku_mevzuat/server.py`](https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/server.py) (MCP tool server), [`turk_hukuku_mevzuat/mevzuat.py`](https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/mevzuat.py) (Full-text retrieval), [`turk_hukuku_mevzuat/registry.py`](https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/registry.py) (Law ID resolver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["MCP interface"]
  node_server["MCP tool server<br/>[server.py]"]
end

subgraph group_law_index["Law identification"]
  node_resolver["Law ID resolver<br/>[registry.py]"]
  node_known_laws["Known-law index<br/>[registry.py]"]
end

subgraph group_official_text["Official text access"]
  node_search["Law search<br/>[mevzuat.py]"]
  node_full_text["Full-text retrieval<br/>[mevzuat.py]"]
  node_pdf_text["PDF text conversion<br/>[mevzuat.py]"]
  node_article["Article extraction<br/>[mevzuat.py]"]
end

node_client(("AI client"))
node_official_site{{"mevzuat.gov.tr"}}

node_client -->|"sends tool request"| node_server
node_server -->|"calls search"| node_search
node_server -->|"calls full text"| node_full_text
node_server -->|"calls article lookup"| node_article
node_server -->|"lists laws"| node_known_laws
node_full_text -->|"resolves law"| node_resolver
node_full_text -->|"fetches PDF"| node_official_site
node_official_site -->|"returns matches"| node_search
node_search -->|"submits search"| node_official_site
node_full_text -->|"converts PDF"| node_pdf_text
node_article -->|"gets full text"| node_full_text
node_server -->|"returns results"| node_client

click node_server "https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/server.py"
click node_search "https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/mevzuat.py"
click node_full_text "https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/mevzuat.py"
click node_pdf_text "https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/mevzuat.py"
click node_article "https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/mevzuat.py"
click node_resolver "https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/registry.py"
click node_known_laws "https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/registry.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_client toneBlue
class node_resolver,node_known_laws toneAmber
class node_search,node_full_text,node_pdf_text,node_article toneMint
class node_official_site toneIndigo
```

## Components

### MCP interface

- [MCP tool server](https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/server.py): `turk_hukuku_mevzuat/server.py`

### Law identification

- [Law ID resolver](https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/registry.py): `turk_hukuku_mevzuat/registry.py`
- [Known-law index](https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/registry.py): `turk_hukuku_mevzuat/registry.py`

### Official text access

- [Law search](https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/mevzuat.py): `turk_hukuku_mevzuat/mevzuat.py`
- [Full-text retrieval](https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/mevzuat.py): `turk_hukuku_mevzuat/mevzuat.py`
- [PDF text conversion](https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/mevzuat.py): `turk_hukuku_mevzuat/mevzuat.py`
- [Article extraction](https://github.com/aydincan/turk-hukuku-mevzuat-mcp/blob/main/turk_hukuku_mevzuat/mevzuat.py): `turk_hukuku_mevzuat/mevzuat.py`

### Other components

- **AI client**
- **mevzuat.gov.tr**

## Connections

- AI client → MCP tool server: sends tool request (evidence: `README.md`)
- MCP tool server → Law search: calls search (evidence: `turk_hukuku_mevzuat/server.py`)
- MCP tool server → Full-text retrieval: calls full text (evidence: `turk_hukuku_mevzuat/server.py`)
- MCP tool server → Article extraction: calls article lookup (evidence: `turk_hukuku_mevzuat/server.py`)
- MCP tool server → Known-law index: lists laws (evidence: `turk_hukuku_mevzuat/server.py`)
- Full-text retrieval → Law ID resolver: resolves law (evidence: `turk_hukuku_mevzuat/mevzuat.py`)
- Full-text retrieval → mevzuat.gov.tr: fetches PDF (evidence: `turk_hukuku_mevzuat/mevzuat.py`)
- mevzuat.gov.tr → Law search: returns matches (evidence: `README.md`)
- Law search → mevzuat.gov.tr: submits search (evidence: `turk_hukuku_mevzuat/mevzuat.py`)
- Full-text retrieval → PDF text conversion: converts PDF (evidence: `turk_hukuku_mevzuat/mevzuat.py`)
- Article extraction → Full-text retrieval: gets full text (evidence: `turk_hukuku_mevzuat/mevzuat.py`)
- MCP tool server → AI client: returns results (evidence: `turk_hukuku_mevzuat/server.py`)
