# aydincan/turk-hukuku-ictihat-mcp architecture

> Architecture diagram of the GitHub repository aydincan/turk-hukuku-ictihat-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-ictihat-mcp
- Repository: https://github.com/aydincan/turk-hukuku-ictihat-mcp

## Overview

This repository is a local MCP server that exposes official Turkish case-law search and full-text retrieval to AI clients. The main workflow is a client tool call, server-side court selection and dispatch, then a court-specific search or document fetch returning structured citation data or readable decision text. Adli search combines Yargıtay and UYAP Emsal; AYM also supports a separate norm-review branch. The README documents the covered official sources. Edges reflect the shown dispatches, calls, and documented source endpoints; unsampled subsystems are represented only where documented.

Main entry points: [`turk_hukuku_ictihat/server.py`](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/server.py) (MCP server), [`turk_hukuku_ictihat/yargitay.py`](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/yargitay.py) (Yargıtay client), [`turk_hukuku_ictihat/uyap.py`](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/uyap.py) (UYAP client), [`turk_hukuku_ictihat/adli.py`](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/adli.py) (Combined search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["MCP interface"]
  node_server["MCP server<br/>[server.py]"]
  node_adli["Combined search<br/>[adli.py]"]
end

subgraph group_courts["Court clients"]
  node_yargitay["Yargıtay client<br/>[yargitay.py]"]
  node_uyap["UYAP client<br/>[uyap.py]"]
  node_danistay["Danıştay client<br/>[danistay.py]"]
  node_aym["AYM individual<br/>[anayasa.py]"]
  node_norm["AYM norm review<br/>[anayasa.py]"]
end

subgraph group_shared["Shared logic"]
  node_common["Query helpers<br/>[ortak.py]"]
end

node_client(("AI client"))
node_bedesten["Bedesten API"]
node_uyap_api["UYAP Emsal"]
node_danistay_api["Danıştay API"]
node_aym_api["AYM API"]

node_client -->|"calls tools"| node_server
node_server -->|"dispatches search"| node_adli
node_server -->|"dispatches requests"| node_yargitay
node_server -->|"dispatches requests"| node_uyap
node_server -->|"dispatches requests"| node_danistay
node_server -->|"dispatches requests"| node_aym
node_server -->|"dispatches requests"| node_norm
node_adli -->|"searches or fetches"| node_yargitay
node_adli -->|"searches or fetches"| node_uyap
node_yargitay -->|"uses query helpers"| node_common
node_uyap -->|"uses query helpers"| node_common
node_aym -->|"uses query helper"| node_common
node_yargitay -->|"searches and fetches"| node_bedesten
node_uyap -->|"searches and fetches"| node_uyap_api
node_danistay -->|"searches and fetches"| node_danistay_api
node_aym -->|"searches and fetches"| node_aym_api
node_norm -->|"searches and fetches"| node_aym_api

click node_server "https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/server.py"
click node_adli "https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/adli.py"
click node_yargitay "https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/yargitay.py"
click node_uyap "https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/uyap.py"
click node_danistay "https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/danistay.py"
click node_aym "https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/anayasa.py"
click node_norm "https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/anayasa.py"
click node_common "https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/ortak.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_adli,node_client toneBlue
class node_yargitay,node_uyap,node_danistay,node_aym,node_norm toneAmber
class node_common,node_bedesten,node_danistay_api,node_aym_api toneMint
class node_uyap_api toneIndigo
```

## Components

### MCP interface

- [MCP server](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/server.py): `turk_hukuku_ictihat/server.py`
- [Combined search](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/adli.py): `turk_hukuku_ictihat/adli.py`

### Court clients

- [Yargıtay client](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/yargitay.py): `turk_hukuku_ictihat/yargitay.py`
- [UYAP client](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/uyap.py): `turk_hukuku_ictihat/uyap.py`
- [Danıştay client](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/danistay.py): `turk_hukuku_ictihat/danistay.py`
- [AYM individual](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/anayasa.py): `turk_hukuku_ictihat/anayasa.py`
- [AYM norm review](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/anayasa.py): `turk_hukuku_ictihat/anayasa.py`

### Shared logic

- [Query helpers](https://github.com/aydincan/turk-hukuku-ictihat-mcp/blob/main/turk_hukuku_ictihat/ortak.py): `turk_hukuku_ictihat/ortak.py`

### Other components

- **AI client**
- **Bedesten API**
- **UYAP Emsal**
- **Danıştay API**
- **AYM API**

## Connections

- AI client → MCP server: calls tools (evidence: `README.md`)
- MCP server → Combined search: dispatches search (evidence: `turk_hukuku_ictihat/server.py`)
- MCP server → Yargıtay client: dispatches requests (evidence: `turk_hukuku_ictihat/server.py`)
- MCP server → UYAP client: dispatches requests (evidence: `turk_hukuku_ictihat/server.py`)
- MCP server → Danıştay client: dispatches requests (evidence: `turk_hukuku_ictihat/server.py`)
- MCP server → AYM individual: dispatches requests (evidence: `turk_hukuku_ictihat/server.py`)
- MCP server → AYM norm review: dispatches requests (evidence: `turk_hukuku_ictihat/server.py`)
- Combined search → Yargıtay client: searches or fetches (evidence: `turk_hukuku_ictihat/adli.py`)
- Combined search → UYAP client: searches or fetches (evidence: `turk_hukuku_ictihat/adli.py`)
- Yargıtay client → Query helpers: uses query helpers (evidence: `turk_hukuku_ictihat/yargitay.py`)
- UYAP client → Query helpers: uses query helpers (evidence: `turk_hukuku_ictihat/uyap.py`)
- AYM individual → Query helpers: uses query helper (evidence: `turk_hukuku_ictihat/anayasa.py`)
- Yargıtay client → Bedesten API: searches and fetches (evidence: `turk_hukuku_ictihat/yargitay.py`)
- UYAP client → UYAP Emsal: searches and fetches (evidence: `turk_hukuku_ictihat/uyap.py`)
- Danıştay client → Danıştay API: searches and fetches (evidence: `README.md`)
- AYM individual → AYM API: searches and fetches (evidence: `turk_hukuku_ictihat/anayasa.py`)
- AYM norm review → AYM API: searches and fetches (evidence: `turk_hukuku_ictihat/anayasa.py`)
