# berkantacun/mcp-turkiye architecture

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

## Overview

mcp-turkiye exposes Turkish public data and offline validation as MCP tools. An assistant asks a question; the MCP server registers source-specific tools, which retrieve or process data and return a common envelope containing provenance and fetch time. Major branches cover finance, hazards and weather, local services, open data, official publications and reference information. Shared networking and response modules support the tools. The README documents local and Streamable HTTP use; unsampled source implementations are represented by their listed paths, without assuming their internal call details.

Main entry points: [`src/sources/index.ts`](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/index.ts) (Source registry), [`src/sources/mevzuat/index.ts`](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/mevzuat/index.ts) (Legislation), [`src/sources/evds/index.ts`](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/evds/index.ts) (EVDS statistics), [`src/sources/acikveri/index.ts`](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/acikveri/index.ts) (Open data portals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["MCP runtime"]
  node_server["Tool server<br/>[server.ts]"]
  node_httptransport["HTTP transport<br/>[http-sunucu.ts]"]
  node_registry["Source registry<br/>[index.ts]"]
  node_prompts["Usage prompts<br/>[prompts.ts]"]
end

subgraph group_shared["Shared core"]
  node_network["HTTP access<br/>[http.ts]"]
  node_envelope["Answer envelope<br/>[source.ts]"]
  node_format["Tool responses<br/>[cevap.ts]"]
  node_text["Text handling<br/>[metin.ts]"]
  node_certs["TLS certificates<br/>[sertifikalar.ts]"]
end

subgraph group_finance["Finance"]
  node_tcmb["TCMB rates<br/>[index.ts]"]
  node_evds["EVDS statistics<br/>[index.ts]"]
  node_markets["Market prices<br/>[index.ts]"]
  node_crypto["Crypto prices<br/>[index.ts]"]
end

subgraph group_public["Public information"]
  node_earthquakes["Earthquake data<br/>[index.ts]"]
  node_kandilli["Kandilli quakes<br/>[index.ts]"]
  node_weather["Weather alerts<br/>[index.ts]"]
  node_fuel["Fuel prices<br/>[index.ts]"]
  node_news["News headlines<br/>[index.ts]"]
  node_gazette["Official Gazette<br/>[index.ts]"]
  node_legislation["Legislation<br/>[index.ts]"]
end

subgraph group_local["Local services"]
  node_ibb["Istanbul services"]
  node_izmir["Izmir services<br/>[index.ts]"]
  node_open["Open data portals<br/>[index.ts]"]
end

subgraph group_reference["Reference data"]
  node_exams["Exam calendar<br/>[index.ts]"]
  node_holidays["Public holidays<br/>[index.ts]"]
  node_parameters["Official figures<br/>[index.ts]"]
  node_provinces[("Province profiles<br/>[veri.ts]")]
  node_validation["ID validation<br/>[index.ts]"]
end

node_assistant(("MCP client"))
node_publicdata{{"Public data services"}}

node_assistant -->|"calls tools"| node_server
node_assistant -.->|"connects via HTTP"| node_httptransport
node_server -->|"loads sources"| node_registry
node_server -->|"registers prompts"| node_prompts
node_registry -->|"registers"| node_tcmb
node_registry -->|"registers"| node_evds
node_registry -->|"registers"| node_markets
node_registry -->|"registers"| node_crypto
node_registry -->|"registers"| node_earthquakes
node_registry -->|"registers"| node_kandilli
node_registry -->|"registers"| node_weather
node_registry -->|"registers"| node_fuel
node_registry -->|"registers"| node_news
node_registry -->|"registers"| node_ibb
node_registry -->|"registers"| node_izmir
node_registry -->|"registers"| node_open
node_registry -->|"registers"| node_gazette
node_registry -->|"registers"| node_legislation
node_registry -->|"registers"| node_exams
node_registry -->|"registers"| node_holidays
node_registry -->|"registers"| node_parameters
node_registry -->|"registers"| node_provinces
node_registry -->|"registers"| node_validation
node_tcmb -->|"fetches data"| node_network
node_evds -->|"fetches data"| node_network
node_open -->|"fetches data"| node_network
node_izmir -->|"fetches data"| node_network
node_legislation -->|"fetches data"| node_network
node_legislation -->|"parses text"| node_text
node_open -->|"uses certificates"| node_certs
node_legislation -->|"uses certificates"| node_certs
node_evds -->|"wraps results"| node_envelope
node_evds -->|"formats responses"| node_format
node_izmir -->|"wraps results"| node_envelope
node_izmir -->|"formats responses"| node_format
node_open -->|"wraps results"| node_envelope
node_open -->|"formats responses"| node_format
node_legislation -->|"wraps results"| node_envelope
node_legislation -->|"formats responses"| node_format
node_tcmb -.->|"retrieves data"| node_publicdata
node_evds -.->|"retrieves data"| node_publicdata
node_markets -.->|"retrieves data"| node_publicdata
node_crypto -.->|"retrieves data"| node_publicdata
node_earthquakes -.->|"retrieves data"| node_publicdata
node_kandilli -.->|"retrieves data"| node_publicdata
node_weather -.->|"retrieves data"| node_publicdata
node_fuel -.->|"retrieves data"| node_publicdata
node_news -.->|"retrieves data"| node_publicdata

click node_server "https://github.com/berkantacun/mcp-turkiye/blob/master/src/server.ts"
click node_httptransport "https://github.com/berkantacun/mcp-turkiye/blob/master/src/http-sunucu.ts"
click node_registry "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/index.ts"
click node_network "https://github.com/berkantacun/mcp-turkiye/blob/master/src/core/http.ts"
click node_envelope "https://github.com/berkantacun/mcp-turkiye/blob/master/src/core/source.ts"
click node_format "https://github.com/berkantacun/mcp-turkiye/blob/master/src/core/cevap.ts"
click node_text "https://github.com/berkantacun/mcp-turkiye/blob/master/src/core/metin.ts"
click node_certs "https://github.com/berkantacun/mcp-turkiye/blob/master/src/core/sertifikalar.ts"
click node_tcmb "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/tcmb/index.ts"
click node_evds "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/evds/index.ts"
click node_markets "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/bist/index.ts"
click node_crypto "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/btcturk/index.ts"
click node_earthquakes "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/afad/index.ts"
click node_kandilli "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/kandilli/index.ts"
click node_weather "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/mgm/index.ts"
click node_fuel "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/opet/index.ts"
click node_news "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/haber/index.ts"
click node_ibb "https://github.com/berkantacun/mcp-turkiye/tree/master/src/sources/ibb"
click node_izmir "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/izmir/index.ts"
click node_open "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/acikveri/index.ts"
click node_gazette "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/resmigazete/index.ts"
click node_legislation "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/mevzuat/index.ts"
click node_exams "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/osym/index.ts"
click node_holidays "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/tatil/index.ts"
click node_parameters "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/parametreler/index.ts"
click node_provinces "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/iller/veri.ts"
click node_validation "https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/dogrulama/index.ts"
click node_prompts "https://github.com/berkantacun/mcp-turkiye/blob/master/src/prompts.ts"

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_httptransport,node_registry,node_prompts,node_assistant toneBlue
class node_network,node_envelope,node_format,node_text,node_certs toneAmber
class node_tcmb,node_evds,node_markets,node_crypto toneMint
class node_earthquakes,node_kandilli,node_weather,node_fuel,node_news,node_gazette,node_legislation toneRose
class node_ibb,node_izmir,node_open,node_publicdata toneIndigo
class node_exams,node_holidays,node_parameters,node_provinces,node_validation toneTeal
```

## Components

### MCP runtime

- [Tool server](https://github.com/berkantacun/mcp-turkiye/blob/master/src/server.ts): `src/server.ts`
- [HTTP transport](https://github.com/berkantacun/mcp-turkiye/blob/master/src/http-sunucu.ts): `src/http-sunucu.ts`
- [Source registry](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/index.ts): `src/sources/index.ts`
- [Usage prompts](https://github.com/berkantacun/mcp-turkiye/blob/master/src/prompts.ts): `src/prompts.ts`

### Shared core

- [HTTP access](https://github.com/berkantacun/mcp-turkiye/blob/master/src/core/http.ts): `src/core/http.ts`
- [Answer envelope](https://github.com/berkantacun/mcp-turkiye/blob/master/src/core/source.ts): `src/core/source.ts`
- [Tool responses](https://github.com/berkantacun/mcp-turkiye/blob/master/src/core/cevap.ts): `src/core/cevap.ts`
- [Text handling](https://github.com/berkantacun/mcp-turkiye/blob/master/src/core/metin.ts): `src/core/metin.ts`
- [TLS certificates](https://github.com/berkantacun/mcp-turkiye/blob/master/src/core/sertifikalar.ts): `src/core/sertifikalar.ts`

### Finance

- [TCMB rates](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/tcmb/index.ts): `src/sources/tcmb/index.ts`
- [EVDS statistics](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/evds/index.ts): `src/sources/evds/index.ts`
- [Market prices](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/bist/index.ts): `src/sources/bist/index.ts`
- [Crypto prices](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/btcturk/index.ts): `src/sources/btcturk/index.ts`

### Public information

- [Earthquake data](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/afad/index.ts): `src/sources/afad/index.ts`
- [Kandilli quakes](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/kandilli/index.ts): `src/sources/kandilli/index.ts`
- [Weather alerts](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/mgm/index.ts): `src/sources/mgm/index.ts`
- [Fuel prices](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/opet/index.ts): `src/sources/opet/index.ts`
- [News headlines](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/haber/index.ts): `src/sources/haber/index.ts`
- [Official Gazette](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/resmigazete/index.ts): `src/sources/resmigazete/index.ts`
- [Legislation](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/mevzuat/index.ts): `src/sources/mevzuat/index.ts`

### Local services

- [Istanbul services](https://github.com/berkantacun/mcp-turkiye/tree/master/src/sources/ibb): `src/sources/ibb`
- [Izmir services](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/izmir/index.ts): `src/sources/izmir/index.ts`
- [Open data portals](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/acikveri/index.ts): `src/sources/acikveri/index.ts`

### Reference data

- [Exam calendar](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/osym/index.ts): `src/sources/osym/index.ts`
- [Public holidays](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/tatil/index.ts): `src/sources/tatil/index.ts`
- [Official figures](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/parametreler/index.ts): `src/sources/parametreler/index.ts`
- [Province profiles](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/iller/veri.ts): `src/sources/iller/veri.ts`
- [ID validation](https://github.com/berkantacun/mcp-turkiye/blob/master/src/sources/dogrulama/index.ts): `src/sources/dogrulama/index.ts`

### Other components

- **MCP client**
- **Public data services**

## Connections

- MCP client → Tool server: calls tools
- MCP client → HTTP transport: connects via HTTP
- Tool server → Source registry: loads sources (evidence: `src/server.ts`)
- Tool server → Usage prompts: registers prompts (evidence: `src/server.ts`)
- Source registry → TCMB rates: registers (evidence: `src/sources/index.ts`)
- Source registry → EVDS statistics: registers (evidence: `src/sources/index.ts`)
- Source registry → Market prices: registers (evidence: `src/sources/index.ts`)
- Source registry → Crypto prices: registers (evidence: `src/sources/index.ts`)
- Source registry → Earthquake data: registers (evidence: `src/sources/index.ts`)
- Source registry → Kandilli quakes: registers (evidence: `src/sources/index.ts`)
- Source registry → Weather alerts: registers (evidence: `src/sources/index.ts`)
- Source registry → Fuel prices: registers (evidence: `src/sources/index.ts`)
- Source registry → News headlines: registers (evidence: `src/sources/index.ts`)
- Source registry → Istanbul services: registers (evidence: `src/sources/index.ts`)
- Source registry → Izmir services: registers (evidence: `src/sources/index.ts`)
- Source registry → Open data portals: registers (evidence: `src/sources/index.ts`)
- Source registry → Official Gazette: registers (evidence: `src/sources/index.ts`)
- Source registry → Legislation: registers (evidence: `src/sources/index.ts`)
- Source registry → Exam calendar: registers (evidence: `src/sources/index.ts`)
- Source registry → Public holidays: registers (evidence: `src/sources/index.ts`)
- Source registry → Official figures: registers (evidence: `src/sources/index.ts`)
- Source registry → Province profiles: registers (evidence: `src/sources/index.ts`)
- Source registry → ID validation: registers (evidence: `src/sources/index.ts`)
- TCMB rates → HTTP access: fetches data (evidence: `src/sources/tcmb/index.ts`)
- EVDS statistics → HTTP access: fetches data (evidence: `src/sources/evds/index.ts`)
- Open data portals → HTTP access: fetches data (evidence: `src/sources/acikveri/index.ts`)
- Izmir services → HTTP access: fetches data (evidence: `src/sources/izmir/index.ts`)
- Legislation → HTTP access: fetches data (evidence: `src/sources/mevzuat/index.ts`)
- Legislation → Text handling: parses text
- Open data portals → TLS certificates: uses certificates (evidence: `src/sources/acikveri/index.ts`)
- Legislation → TLS certificates: uses certificates (evidence: `src/sources/mevzuat/index.ts`)
- EVDS statistics → Answer envelope: wraps results (evidence: `src/sources/evds/index.ts`)
- EVDS statistics → Tool responses: formats responses (evidence: `src/sources/evds/index.ts`)
- Izmir services → Answer envelope: wraps results (evidence: `src/sources/izmir/index.ts`)
- Izmir services → Tool responses: formats responses (evidence: `src/sources/izmir/index.ts`)
- Open data portals → Answer envelope: wraps results (evidence: `src/sources/acikveri/index.ts`)
- Open data portals → Tool responses: formats responses (evidence: `src/sources/acikveri/index.ts`)
- Legislation → Answer envelope: wraps results (evidence: `src/sources/mevzuat/index.ts`)
- Legislation → Tool responses: formats responses (evidence: `src/sources/mevzuat/index.ts`)
- TCMB rates → Public data services: retrieves data
- EVDS statistics → Public data services: retrieves data
- Market prices → Public data services: retrieves data
- Crypto prices → Public data services: retrieves data
- Earthquake data → Public data services: retrieves data
- Kandilli quakes → Public data services: retrieves data
- Weather alerts → Public data services: retrieves data
- Fuel prices → Public data services: retrieves data
- News headlines → Public data services: retrieves data
