# mcyba/yargi-mcp architecture

> Architecture diagram of the GitHub repository mcyba/yargi-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/mcyba/yargi-mcp
- Repository: https://github.com/mcyba/yargi-mcp

## Overview

Yargı MCP exposes Turkish legal-source search and document retrieval as MCP tools: an MCP client initiates a request, the central server dispatches it to a source-specific client, and results or Markdown documents return through the MCP interface. The repository has dedicated clients for courts, regulators, and other legal bodies, plus shared Bedesten access and semantic-search code. Source-specific search and document handling often live in the same client. The README documents broad coverage; unsampled integrations are shown at subsystem level, and semantic-search wiring is uncertain.

Main entry points: [`mcp_server_main.py`](https://github.com/mcyba/yargi-mcp/blob/main/mcp_server_main.py) (MCP tool server), [`anayasa_mcp_module`](https://github.com/mcyba/yargi-mcp/tree/main/anayasa_mcp_module) (Constitutional Court), [`yargitay_mcp_module/client.py`](https://github.com/mcyba/yargi-mcp/blob/main/yargitay_mcp_module/client.py) (Court of Cassation), [`danistay_mcp_module/client.py`](https://github.com/mcyba/yargi-mcp/blob/main/danistay_mcp_module/client.py) (Council of State)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_courts["Courts and decisions"]
  node_anayasa["Constitutional Court"]
  node_yargitay["Court of Cassation<br/>[client.py]"]
  node_danistay["Council of State<br/>[client.py]"]
  node_emsal["UYAP precedents<br/>[client.py]"]
  node_uyusmazlik["Jurisdiction disputes<br/>[client.py]"]
  node_sayistay["Court of Accounts<br/>[client.py]"]
end

subgraph group_institutions["Institutional sources"]
  node_kik["Public procurement"]
  node_rekabet["Competition authority<br/>[client.py]"]
  node_kvkk["Personal data authority<br/>[client.py]"]
  node_gib["Tax rulings<br/>[client.py]"]
  node_bddk["Banking authority<br/>[client.py]"]
  node_btk["Telecommunications authority<br/>[client.py]"]
  node_sigorta["Insurance arbitration<br/>[client.py]"]
end

subgraph group_shared["Shared search services"]
  node_bedesten["Bedesten API<br/>[client.py]"]
  node_semantic["Semantic search"]
end

node_user(("MCP client"))
node_source_services(("Legal source services"))
node_brave(("Brave Search"))
node_tavily(("Tavily Search"))

node_user -->|"sends MCP request"| node_server
node_server -->|"dispatches tools"| node_anayasa
node_server -->|"dispatches tools"| node_yargitay
node_server -->|"dispatches tools"| node_danistay
node_server -->|"dispatches tools"| node_emsal
node_server -->|"dispatches tools"| node_uyusmazlik
node_server -->|"dispatches tools"| node_sayistay
node_server -->|"dispatches tools"| node_kik
node_server -->|"dispatches tools"| node_rekabet
node_server -->|"dispatches tools"| node_kvkk
node_server -->|"dispatches tools"| node_gib
node_server -->|"dispatches tools"| node_bddk
node_server -->|"dispatches tools"| node_btk
node_server -->|"dispatches tools"| node_sigorta
node_server -->|"dispatches tools"| node_bedesten
node_server -.->|"may dispatch"| node_semantic
node_anayasa -->|"searches and fetches"| node_source_services
node_yargitay -->|"searches decisions"| node_source_services
node_danistay -->|"searches decisions"| node_source_services
node_emsal -->|"searches decisions"| node_source_services
node_uyusmazlik -->|"searches decisions"| node_source_services
node_sayistay -->|"submits searches"| node_source_services
node_kik -->|"searches decisions"| node_source_services
node_rekabet -->|"fetches decisions"| node_source_services
node_kvkk -->|"searches web"| node_brave
node_gib -->|"searches rulings"| node_source_services
node_bddk -->|"searches documents"| node_tavily
node_btk -->|"accesses decisions"| node_source_services
node_sigorta -->|"searches documents"| node_tavily
node_bedesten -->|"searches documents"| node_source_services

click node_server "https://github.com/mcyba/yargi-mcp/blob/main/mcp_server_main.py"
click node_anayasa "https://github.com/mcyba/yargi-mcp/tree/main/anayasa_mcp_module"
click node_yargitay "https://github.com/mcyba/yargi-mcp/blob/main/yargitay_mcp_module/client.py"
click node_danistay "https://github.com/mcyba/yargi-mcp/blob/main/danistay_mcp_module/client.py"
click node_emsal "https://github.com/mcyba/yargi-mcp/blob/main/emsal_mcp_module/client.py"
click node_uyusmazlik "https://github.com/mcyba/yargi-mcp/blob/main/uyusmazlik_mcp_module/client.py"
click node_sayistay "https://github.com/mcyba/yargi-mcp/blob/main/sayistay_mcp_module/client.py"
click node_kik "https://github.com/mcyba/yargi-mcp/tree/main/kik_mcp_module"
click node_rekabet "https://github.com/mcyba/yargi-mcp/blob/main/rekabet_mcp_module/client.py"
click node_kvkk "https://github.com/mcyba/yargi-mcp/blob/main/kvkk_mcp_module/client.py"
click node_gib "https://github.com/mcyba/yargi-mcp/blob/main/gib_mcp_module/client.py"
click node_bddk "https://github.com/mcyba/yargi-mcp/blob/main/bddk_mcp_module/client.py"
click node_btk "https://github.com/mcyba/yargi-mcp/blob/main/btk_mcp_module/client.py"
click node_sigorta "https://github.com/mcyba/yargi-mcp/blob/main/sigorta_tahkim_mcp_module/client.py"
click node_bedesten "https://github.com/mcyba/yargi-mcp/blob/main/bedesten_mcp_module/client.py"
click node_semantic "https://github.com/mcyba/yargi-mcp/tree/main/semantic_search"

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_user toneBlue
class node_anayasa,node_yargitay,node_danistay,node_emsal,node_uyusmazlik,node_sayistay toneAmber
class node_kik,node_rekabet,node_kvkk,node_gib,node_bddk,node_btk,node_sigorta toneMint
class node_bedesten,node_semantic toneRose
class node_source_services,node_brave,node_tavily toneIndigo
```

## Components

### MCP interface

- [MCP tool server](https://github.com/mcyba/yargi-mcp/blob/main/mcp_server_main.py): `mcp_server_main.py`

### Courts and decisions

- [Constitutional Court](https://github.com/mcyba/yargi-mcp/tree/main/anayasa_mcp_module): `anayasa_mcp_module`
- [Court of Cassation](https://github.com/mcyba/yargi-mcp/blob/main/yargitay_mcp_module/client.py): `yargitay_mcp_module/client.py`
- [Council of State](https://github.com/mcyba/yargi-mcp/blob/main/danistay_mcp_module/client.py): `danistay_mcp_module/client.py`
- [UYAP precedents](https://github.com/mcyba/yargi-mcp/blob/main/emsal_mcp_module/client.py): `emsal_mcp_module/client.py`
- [Jurisdiction disputes](https://github.com/mcyba/yargi-mcp/blob/main/uyusmazlik_mcp_module/client.py): `uyusmazlik_mcp_module/client.py`
- [Court of Accounts](https://github.com/mcyba/yargi-mcp/blob/main/sayistay_mcp_module/client.py): `sayistay_mcp_module/client.py`

### Institutional sources

- [Public procurement](https://github.com/mcyba/yargi-mcp/tree/main/kik_mcp_module): `kik_mcp_module`
- [Competition authority](https://github.com/mcyba/yargi-mcp/blob/main/rekabet_mcp_module/client.py): `rekabet_mcp_module/client.py`
- [Personal data authority](https://github.com/mcyba/yargi-mcp/blob/main/kvkk_mcp_module/client.py): `kvkk_mcp_module/client.py`
- [Tax rulings](https://github.com/mcyba/yargi-mcp/blob/main/gib_mcp_module/client.py): `gib_mcp_module/client.py`
- [Banking authority](https://github.com/mcyba/yargi-mcp/blob/main/bddk_mcp_module/client.py): `bddk_mcp_module/client.py`
- [Telecommunications authority](https://github.com/mcyba/yargi-mcp/blob/main/btk_mcp_module/client.py): `btk_mcp_module/client.py`
- [Insurance arbitration](https://github.com/mcyba/yargi-mcp/blob/main/sigorta_tahkim_mcp_module/client.py): `sigorta_tahkim_mcp_module/client.py`

### Shared search services

- [Bedesten API](https://github.com/mcyba/yargi-mcp/blob/main/bedesten_mcp_module/client.py): `bedesten_mcp_module/client.py`
- [Semantic search](https://github.com/mcyba/yargi-mcp/tree/main/semantic_search): `semantic_search`

### Other components

- **MCP client**
- **Legal source services**
- **Brave Search**
- **Tavily Search**

## Connections

- MCP client → MCP tool server: sends MCP request
- MCP tool server → Constitutional Court: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Court of Cassation: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Council of State: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → UYAP precedents: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Jurisdiction disputes: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Court of Accounts: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Public procurement: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Competition authority: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Personal data authority: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Tax rulings: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Banking authority: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Telecommunications authority: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Insurance arbitration: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Bedesten API: dispatches tools (evidence: `mcp_server_main.py`)
- MCP tool server → Semantic search: may dispatch (evidence: `mcp_server_main.py`)
- Constitutional Court → Legal source services: searches and fetches (evidence: `anayasa_mcp_module/api_client.py`)
- Court of Cassation → Legal source services: searches decisions (evidence: `yargitay_mcp_module/client.py`)
- Council of State → Legal source services: searches decisions
- UYAP precedents → Legal source services: searches decisions (evidence: `emsal_mcp_module/client.py`)
- Jurisdiction disputes → Legal source services: searches decisions
- Court of Accounts → Legal source services: submits searches (evidence: `sayistay_mcp_module/client.py`)
- Public procurement → Legal source services: searches decisions
- Competition authority → Legal source services: fetches decisions (evidence: `rekabet_mcp_module/client.py`)
- Personal data authority → Brave Search: searches web (evidence: `kvkk_mcp_module/client.py`)
- Tax rulings → Legal source services: searches rulings (evidence: `gib_mcp_module/client.py`)
- Banking authority → Tavily Search: searches documents (evidence: `bddk_mcp_module/client.py`)
- Telecommunications authority → Legal source services: accesses decisions
- Insurance arbitration → Tavily Search: searches documents (evidence: `sigorta_tahkim_mcp_module/client.py`)
- Bedesten API → Legal source services: searches documents (evidence: `bedesten_mcp_module/client.py`)
