MedCAPA GxP Compliance MCP
README.md
# MedCAPA Context
> **Build with context. Pass inspections with confidence.** — An Atlassian Forge **FDA 21 CFR 820 / ISO 13485 / ISO 14971** CAPA & Clinical Quality Compliance Engine, Rovo Regulatory Auditor Agent, and Atlassian Forge MCP Server for **Healthcare, Medical Devices & Life Sciences**.
Built for **Atlassian Codegeist 2026** (`Apps for Specialized Industries` + `Best Agents — Rovo/Assignable Agents` + `Best App with Atlassian MCP`).
- **Forge Runtime:** `nodejs24.x` / `arm64` (`Runs on Atlassian` eligible — zero external data egress / zero external PHI exposure)
- **Automated Tests:** `4/4` passing (`npm test`)
---
## Why MedCAPA Context?
Quality Assurance (QA) and Regulatory Affairs (RA) teams in MedTech, Biopharma, and Clinical Operations track CAPAs, deviations, and GxP change controls in Jira while controlled SOPs, FMEA risk matrices, and IQ/OQ/PQ validation protocols reside in Confluence. Missing cross-references or incomplete dual attestations trigger costly **FDA Form 483 observations** and batch release delays.
**MedCAPA Context** runs **100% serverless on Atlassian Forge** and continuously audits Jira + Confluence regulatory traceability:
1. **Jira Issue Panel (`jira:issuePanel` — MedCAPA GxP Audit):**
- Automatically parses **Lot/Batch ID**, **SOP Reference**, **Device Class**, **Patient Safety Severity** (`Critical` / `Major` / `Minor`), and **Record Type** (`CAPA` / `Clinical Deviation` / `GxP Change Control`).
- Evaluates **5 Regulatory Inspection Pillars (`0–100`)** -> **`AUDIT-READY`** / **`CAPA-GAP`** / **`QUARANTINE`** verdict mapped to exact **21 CFR 820.100**, **ISO 14971**, **21 CFR 820.75**, **ISO 13485 §8.3**, and **21 CFR Part 11** clauses.
- Auto-discovers controlled **Confluence SOPs, FMEA risk tables, and IQ/OQ/PQ validation protocols** via CQL.
- Interactive **21 CFR Part 11 QA/RA Dual Electronic Attestations** persisted in `@forge/kvs`, **1-click File GxP Dossier to Jira**, and **1-click Generate Confluence Inspection Brief**.
2. **Jira Project Page (`jira:projectPage` — MedCAPA Inspection Console):**
- Site-wide **Inspection Readiness %**, **Quarantined Record count**, **Critical Patient Safety triage**, filterable audit queue, and live split-screen Regulatory Inspector.
3. **Rovo Regulatory Agent (`rovo:agent` — `MedCAPA Regulatory Auditor`):**
- Embedded in Atlassian Rovo with 4 live actions (`inspect-capa-record`, `audit-quality-queue`, `locate-sop-validation`, `file-gxp-audit-memo`).
4. **Atlassian Forge MCP Server (`rovo:mcp` — `MedCAPA GxP Compliance MCP`):**
- Exposes all 4 GxP regulatory audit tools over the Model Context Protocol.
---
## 5 Regulatory Inspection Pillars (`0–100`)
| Pillar | Regulatory Clause | Weight | Quarantine Stop? | Signal Evaluated |
|---|---|---:|:---:|---|
| **Root Cause & Lot Containment** | 21 CFR 820.100 | 25 | Yes (Critical) | Documented 5-Why / Ishikawa RCA & lot containment |
| **FMEA Risk & Patient Safety** | ISO 14971 | 20 | Yes (Critical) | Risk matrix / hazard mitigation in Jira or Confluence FMEA |
| **SOP & IQ/OQ/PQ Traceability** | 21 CFR 820.75 | 20 | No | Controlled Confluence SOPs & validation evidence via CQL |
| **Blocking Deviations & Holds** | ISO 13485 §8.3 | 15 | Yes | Unresolved `is blocked by` clinical deviations or quality holds |
| **QA/RA Dual Sign-Off & Effectiveness** | 21 CFR Part 11 | 20 | Yes (Critical QA) | Persisted QA + RA attestations & 30-day effectiveness check |
---
## Local Development & Verification
```bash
npm install
npm test # 4/4 FDA 21 CFR 820 / ISO 13485 unit tests
npm run build:ui # Bundles Custom UI surfaces (static/panel/dist & static/console/dist)
forge lint
forge deploy -e production
```
## License
MIT License — see [LICENSE](./LICENSE). Privacy & GxP data handling in [PRIVACY.md](./PRIVACY.md).