# emircanok/resmi-gazete-mcp architecture

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

## Overview

This MCP server exposes four Official Gazette tools to LLM clients over stdio: retrieve an issue index, read an article, search index titles across dates, and extract PDF text. Each request is validated and dispatched by the server; tool modules fetch and parse Gazette content, with HTTP caching backed by local disk. Source excerpts show the tool dispatch and fetch/parsing paths. The README documents all four capabilities; no separate external-service implementation is included.

Main entry points: [`src/http.ts`](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/http.ts) (HTTP fetch), [`src/server.ts`](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/server.ts) (MCP server), [`src/tools/getFihrist.ts`](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/tools/getFihrist.ts) (Get fihrist), [`src/tools/readArticle.ts`](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/tools/readArticle.ts) (Read article)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["MCP entry"]
  node_stdio["Stdio transport<br/>[index.ts]"]
  node_mcp["MCP server<br/>[server.ts]"]
end

subgraph group_tools["Gazette tools"]
  node_fihrist_tool["Get fihrist<br/>[getFihrist.ts]"]
  node_article_tool["Read article<br/>[readArticle.ts]"]
  node_search_tool["Search Gazette<br/>[searchGazette.ts]"]
  node_pdf_tool["Extract PDF<br/>[extractPdf.ts]"]
end

subgraph group_content["Content processing"]
  node_fihrist_parser["Fihrist parser<br/>[fihrist.ts]"]
  node_article_parser["Article parser<br/>[article.ts]"]
  node_result_types["Result models<br/>[types.ts]"]
end

subgraph group_infra["Fetch and cache"]
  node_http_fetch["HTTP fetch<br/>[http.ts]"]
  node_disk_cache[("Disk cache<br/>[cache.ts]")]
end

node_client(("LLM client"))
node_gazette(("Official Gazette"))

node_client -->|"uses tools"| node_stdio
node_stdio -->|"connects"| node_mcp
node_mcp -->|"dispatches"| node_fihrist_tool
node_mcp -->|"dispatches"| node_article_tool
node_mcp -->|"dispatches"| node_search_tool
node_mcp -->|"dispatches"| node_pdf_tool
node_search_tool -->|"gets indexes"| node_fihrist_tool
node_fihrist_tool -->|"fetches index"| node_http_fetch
node_fihrist_tool -->|"parses HTML"| node_fihrist_parser
node_article_tool -->|"fetches article"| node_http_fetch
node_article_tool -->|"parses HTML"| node_article_parser
node_pdf_tool -->|"downloads PDF"| node_http_fetch
node_fihrist_parser -->|"returns index model"| node_result_types
node_article_parser -->|"returns article model"| node_result_types
node_http_fetch -->|"reads and writes"| node_disk_cache
node_http_fetch -->|"requests content"| node_gazette
node_gazette -->|"returns responses"| node_http_fetch

click node_stdio "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/index.ts"
click node_mcp "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/server.ts"
click node_fihrist_tool "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/tools/getFihrist.ts"
click node_article_tool "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/tools/readArticle.ts"
click node_search_tool "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/tools/searchGazette.ts"
click node_pdf_tool "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/tools/extractPdf.ts"
click node_fihrist_parser "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/parse/fihrist.ts"
click node_article_parser "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/parse/article.ts"
click node_result_types "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/types.ts"
click node_http_fetch "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/http.ts"
click node_disk_cache "https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/cache.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_stdio,node_mcp,node_client toneBlue
class node_fihrist_tool,node_article_tool,node_search_tool,node_pdf_tool toneAmber
class node_fihrist_parser,node_article_parser,node_result_types toneMint
class node_http_fetch,node_disk_cache toneRose
class node_gazette toneIndigo
```

## Components

### MCP entry

- [Stdio transport](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/index.ts): `src/index.ts`
- [MCP server](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/server.ts): `src/server.ts`

### Gazette tools

- [Get fihrist](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/tools/getFihrist.ts): `src/tools/getFihrist.ts`
- [Read article](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/tools/readArticle.ts): `src/tools/readArticle.ts`
- [Search Gazette](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/tools/searchGazette.ts): `src/tools/searchGazette.ts`
- [Extract PDF](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/tools/extractPdf.ts): `src/tools/extractPdf.ts`

### Content processing

- [Fihrist parser](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/parse/fihrist.ts): `src/parse/fihrist.ts`
- [Article parser](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/parse/article.ts): `src/parse/article.ts`
- [Result models](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/types.ts): `src/types.ts`

### Fetch and cache

- [HTTP fetch](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/http.ts): `src/http.ts`
- [Disk cache](https://github.com/emircanok/resmi-gazete-mcp/blob/main/src/cache.ts): `src/cache.ts`

### Other components

- **LLM client**
- **Official Gazette**

## Connections

- LLM client → Stdio transport: uses tools (evidence: `README.md`)
- Stdio transport → MCP server: connects (evidence: `src/index.ts`)
- MCP server → Get fihrist: dispatches (evidence: `src/server.ts`)
- MCP server → Read article: dispatches (evidence: `src/server.ts`)
- MCP server → Search Gazette: dispatches (evidence: `src/server.ts`)
- MCP server → Extract PDF: dispatches (evidence: `src/server.ts`)
- Search Gazette → Get fihrist: gets indexes (evidence: `src/tools/searchGazette.ts`)
- Get fihrist → HTTP fetch: fetches index (evidence: `src/tools/getFihrist.ts`)
- Get fihrist → Fihrist parser: parses HTML (evidence: `src/tools/getFihrist.ts`)
- Read article → HTTP fetch: fetches article (evidence: `src/tools/readArticle.ts`)
- Read article → Article parser: parses HTML (evidence: `src/tools/readArticle.ts`)
- Extract PDF → HTTP fetch: downloads PDF (evidence: `src/tools/extractPdf.ts`)
- Fihrist parser → Result models: returns index model (evidence: `src/parse/fihrist.ts`)
- Article parser → Result models: returns article model (evidence: `src/parse/article.ts`)
- HTTP fetch → Disk cache: reads and writes (evidence: `src/http.ts`)
- HTTP fetch → Official Gazette: requests content (evidence: `src/http.ts`)
- Official Gazette → HTTP fetch: returns responses (evidence: `src/http.ts`)
