# armit26/dietcode-claimback-mcp architecture

> Architecture diagram of the GitHub repository armit26/dietcode-claimback-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/armit26/dietcode-claimback-mcp
- Repository: https://github.com/armit26/dietcode-claimback-mcp

## Overview

ClaimBack MCP is a claims-auditing prototype with a web/API entry point and an MCP tool server. The main workflow loads a case and policy history, checks claim timelines and IRDAI rules, detects duplicate bill charges, presents findings, and—only after human approval—prepares an appeal draft and SLA reminders. The sampled implementation centers on local case data and returned draft/reminder payloads; README-described cloud, OCR, voice, and privacy capabilities are not evidenced as implemented here.

Main entry points: [`api.py`](https://github.com/armit26/dietcode-claimback-mcp/blob/main/api.py) (FastAPI Application), [`mcp_server/server.py`](https://github.com/armit26/dietcode-claimback-mcp/blob/main/mcp_server/server.py) (MCP Tool Server), [`mcp_server/auditor.py`](https://github.com/armit26/dietcode-claimback-mcp/blob/main/mcp_server/auditor.py) (Rule and Bill Auditor), [`frontend/index.html`](https://github.com/armit26/dietcode-claimback-mcp/blob/main/frontend/index.html) (Web Interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Entry"]
  node_webui["Web Interface<br/>[index.html]"]
  node_api["FastAPI Application<br/>[api.py]"]
  node_mcp["MCP Tool Server<br/>[server.py]"]
end

subgraph group_audit["Claims Audit"]
  node_auditor["Rule and Bill Auditor<br/>[auditor.py]"]
  node_auditview["Audit Findings<br/>[api.py]"]
end

subgraph group_action["Approved Actions"]
  node_approval["Human Approval Gate<br/>[api.py]"]
  node_draft["GRO Draft Builder<br/>[auditor.py]"]
  node_sla["SLA Reminder Builder<br/>[auditor.py]"]
end

subgraph group_casefiles["Case and Rules"]
  node_case["Case Record<br/>[case_cb_204.json]"]
  node_rules["IRDAI Rule Set"]
end

node_policyholder(("Policyholder"))
node_drive["Google Drive"]
node_gmail["Gmail"]
node_calendar["Google Calendar"]

node_policyholder -->|"uses"| node_webui
node_webui -.->|"accesses"| node_api
node_api -->|"serves"| node_webui
node_api -->|"calls"| node_auditor
node_mcp -->|"calls"| node_auditor
node_auditor -->|"loads"| node_case
node_auditor -->|"reads"| node_rules
node_api -->|"returns findings"| node_auditview
node_policyholder -->|"approves"| node_approval
node_api -->|"enforces"| node_approval
node_approval -->|"requests draft"| node_draft
node_approval -->|"requests reminders"| node_sla
node_mcp -->|"dispatches"| node_draft
node_mcp -->|"dispatches"| node_sla
node_draft -.->|"saves draft"| node_gmail
node_sla -.->|"schedules"| node_calendar
node_mcp -.->|"fetches history"| node_drive

click node_webui "https://github.com/armit26/dietcode-claimback-mcp/blob/main/frontend/index.html"
click node_api "https://github.com/armit26/dietcode-claimback-mcp/blob/main/api.py"
click node_mcp "https://github.com/armit26/dietcode-claimback-mcp/blob/main/mcp_server/server.py"
click node_case "https://github.com/armit26/dietcode-claimback-mcp/blob/main/sample_data/case_cb_204.json"
click node_rules "https://github.com/armit26/dietcode-claimback-mcp/blob/main/rules/irdai_2024_rules.json"
click node_auditor "https://github.com/armit26/dietcode-claimback-mcp/blob/main/mcp_server/auditor.py"
click node_auditview "https://github.com/armit26/dietcode-claimback-mcp/blob/main/api.py"
click node_approval "https://github.com/armit26/dietcode-claimback-mcp/blob/main/api.py"
click node_draft "https://github.com/armit26/dietcode-claimback-mcp/blob/main/mcp_server/auditor.py"
click node_sla "https://github.com/armit26/dietcode-claimback-mcp/blob/main/mcp_server/auditor.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_webui,node_api,node_mcp toneBlue
class node_auditor,node_auditview toneAmber
class node_approval,node_draft,node_sla toneMint
class node_case,node_rules toneRose
class node_policyholder,node_drive,node_gmail,node_calendar toneIndigo
```

## Components

### User Entry

- [Web Interface](https://github.com/armit26/dietcode-claimback-mcp/blob/main/frontend/index.html): `frontend/index.html`
- [FastAPI Application](https://github.com/armit26/dietcode-claimback-mcp/blob/main/api.py): `api.py`
- [MCP Tool Server](https://github.com/armit26/dietcode-claimback-mcp/blob/main/mcp_server/server.py): `mcp_server/server.py`

### Claims Audit

- [Rule and Bill Auditor](https://github.com/armit26/dietcode-claimback-mcp/blob/main/mcp_server/auditor.py): `mcp_server/auditor.py`
- [Audit Findings](https://github.com/armit26/dietcode-claimback-mcp/blob/main/api.py): `api.py`

### Approved Actions

- [Human Approval Gate](https://github.com/armit26/dietcode-claimback-mcp/blob/main/api.py): `api.py`
- [GRO Draft Builder](https://github.com/armit26/dietcode-claimback-mcp/blob/main/mcp_server/auditor.py): `mcp_server/auditor.py`
- [SLA Reminder Builder](https://github.com/armit26/dietcode-claimback-mcp/blob/main/mcp_server/auditor.py): `mcp_server/auditor.py`

### Case and Rules

- [Case Record](https://github.com/armit26/dietcode-claimback-mcp/blob/main/sample_data/case_cb_204.json): `sample_data/case_cb_204.json`
- [IRDAI Rule Set](https://github.com/armit26/dietcode-claimback-mcp/blob/main/rules/irdai_2024_rules.json): `rules/irdai_2024_rules.json`

### Other components

- **Policyholder**
- **Google Drive**
- **Gmail**
- **Google Calendar**

## Connections

- Policyholder → Web Interface: uses (evidence: `README.md`)
- Web Interface → FastAPI Application: accesses
- FastAPI Application → Web Interface: serves (evidence: `api.py`)
- FastAPI Application → Rule and Bill Auditor: calls (evidence: `api.py`)
- MCP Tool Server → Rule and Bill Auditor: calls (evidence: `mcp_server/server.py`)
- Rule and Bill Auditor → Case Record: loads (evidence: `mcp_server/auditor.py`)
- Rule and Bill Auditor → IRDAI Rule Set: reads (evidence: `mcp_server/auditor.py`)
- FastAPI Application → Audit Findings: returns findings (evidence: `api.py`)
- Policyholder → Human Approval Gate: approves (evidence: `README.md`)
- FastAPI Application → Human Approval Gate: enforces (evidence: `api.py`)
- Human Approval Gate → GRO Draft Builder: requests draft (evidence: `api.py`)
- Human Approval Gate → SLA Reminder Builder: requests reminders (evidence: `api.py`)
- MCP Tool Server → GRO Draft Builder: dispatches (evidence: `mcp_server/server.py`)
- MCP Tool Server → SLA Reminder Builder: dispatches (evidence: `mcp_server/server.py`)
- GRO Draft Builder → Gmail: saves draft (evidence: `README.md`)
- SLA Reminder Builder → Google Calendar: schedules (evidence: `README.md`)
- MCP Tool Server → Google Drive: fetches history (evidence: `README.md`)
