AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Clinical Doc Intelligence

mcp-erickyegon-clinical-doc-intelligence · by erickyegon

AI-powered FDA drug label intelligence platform — production RAG with 5-stage retrieval, multi-agent orchestration, clinical guardrails, and 54 automated tests

— No reviews yet
0 installs
30 views
0.0% view→install

Install

$ agentstack add mcp-erickyegon-clinical-doc-intelligence

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ● Network access Used
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ● Environment & secrets Used
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-erickyegon-clinical-doc-intelligence)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
○ 6mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Clinical Doc Intelligence? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Clinical Document Intelligence Platform

[](https://github.com/erickyegon/clinical-doc-intelligence/actions/workflows/ci.yml) [](LICENSE) [](https://www.python.org/downloads/)

AI-powered FDA drug label intelligence system for regulatory analysis, formulary decision support, and competitive intelligence.

> Built by Erick K. Yegon, PhD — Director-level Data Scientist & Epidemiologist with 17+ years in global health analytics.


The Problem

Pharmaceutical HEOR teams, formulary committees, and regulatory analysts spend 40+ hours per drug manually reviewing FDA labels, comparing safety profiles across drug classes, and tracking label changes. This work is repetitive, error-prone, and doesn't scale.

The Solution

A production-grade RAG (Retrieval-Augmented Generation) system that:

  • Ingests 70,000+ FDA drug labels from the openFDA API and clinical trial data from ClinicalTrials.gov
  • Indexes content with section-aware chunking that never splits safety-critical sections (Black Box Warnings, Contraindications)
  • Retrieves relevant information using hybrid search: dense vector retrieval → metadata filtering → section priority boosting → MMR diversification → cross-encoder re-ranking
  • Generates citation-grounded answers with source traceability back to specific label sections
  • Compares drug labels across products for competitive intelligence and formulary decisions
  • Guards against PHI exposure, prompt injection, unsupported clinical claims, and hallucination

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                        FastAPI REST API                              │
│              /query    /compare    /drugs    /health                 │
├────────────┬────────────────────────────────────┬───────────────────┤
│  INPUT     │        RAG PIPELINE                │    OUTPUT         │
│ GUARDRAILS │                                    │   GUARDRAILS      │
│            │  ┌──────────────────────────────┐  │                   │
│ • PHI      │  │  Query Rewrite (Module 6)    │  │ • Confidence      │
│   Detection│  │  ↓                           │  │   threshold       │
│ • Injection│  │  Hybrid Retrieval (Module 7) │  │ • Citation        │
│   Defense  │  │  • Dense vector search       │  │   validation      │
│ • Schema   │  │  • Metadata filtering        │  │ • Unsupported     │
│   Validate │  │  • Section priority boost    │  │   claim detection │
│            │  │  • MMR diversification       │  │ • Clinical        │
│            │  │  • Cross-encoder re-rank     │  │   disclaimer      │
│            │  │  ↓                           │  │                   │
│            │  │  Context Assembly (Module 8)  │  │                   │
│            │  │  ↓                           │  │                   │
│            │  │  LLM Generation (Module 3)   │  │                   │
│            │  │  • Provider switching         │  │                   │
│            │  │  • Cost tracking             │  │                   │
│            │  │  • Automatic fallback        │  │                   │
│            │  │  ↓                           │  │                   │
│            │  │  Citation Extraction         │  │                   │
│            │  └──────────────────────────────┘  │                   │
├────────────┴────────────────────────────────────┴───────────────────┤
│                     DATA LAYER                                       │
│  ┌──────────────┐  ┌──────────────┐  ┌────────────────────────────┐ │
│  │ openFDA API  │  │ ClinicalTrial│  │ ChromaDB Vector Store      │ │
│  │ 70K+ labels  │  │ .gov API V2  │  │ Section-aware chunks       │ │
│  │              │  │ 400K+ trials │  │ Metadata: drug, section,   │ │
│  │              │  │              │  │ therapeutic area, safety    │ │
│  └──────────────┘  └──────────────┘  └────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────────┤
│                    EVALUATION (Module 10)                             │
│  Faithfulness | Relevance | Citation Accuracy | Safety Completeness  │
│  Latency | Token Cost | Error Rate                                   │
└─────────────────────────────────────────────────────────────────────┘

Key Features

1. Clinical Q&A with Citations

Ask questions about any FDA-approved drug and receive answers grounded in official label data with section-level citations.

Query: "What are the contraindications for empagliflozin?"

Answer: Empagliflozin (JARDIANCE) is contraindicated in patients with severe 
renal impairment (eGFR  0.85 |
| Faithfulness | Answer grounded in retrieved context | > 0.90 |
| Citation Accuracy | All citations valid and traceable | > 0.95 |
| Safety Completeness | Safety info included when relevant | > 0.95 |
| Latency (p95) | End-to-end response time | < 5s |
| Cost per Query | Average LLM cost | < $0.03 |

---

## Project Structure

clinical-doc-intel/ ├── app.py # Streamlit interactive frontend ├── .streamlit/config.toml # Streamlit theme & config ├── .github/workflows/ci.yml # GitHub Actions CI/CD pipeline ├── Makefile # One-command operations ├── config/ │ ├── settings.py # Central configuration │ └── prompts.yaml # Jinja2 prompt templates ├── src/ │ ├── ingestion/ │ │ ├── fdalabels.py # openFDA API client │ │ ├── clinicaltrials.py # ClinicalTrials.gov V2 client │ │ └── pipeline.py # Ingestion orchestration │ ├── processing/ │ │ ├── chunker.py # Section-aware chunking │ │ └── metadata.py # Metadata enrichment │ ├── retrieval/ │ │ ├── vectorstore.py # ChromaDB management │ │ └── hybridsearch.py # Multi-stage retrieval + re-ranking │ ├── generation/ │ │ └── ragchain.py # RAG pipeline with citations │ ├── orchestration/ │ │ └── modelrouter.py # Multi-provider LLM routing │ ├── guardrails/ │ │ └── validators.py # Input/output safety validation │ ├── evaluation/ │ │ └── evaluator.py # RAG evaluation framework │ └── api/ │ └── main.py # FastAPI application ├── scripts/ │ ├── seeddata.py # Download FDA label data │ └── ingest.py # Index data into vector store ├── tests/ │ └── testplatform.py # Comprehensive test suite ├── docs/adr/ │ ├── 001-vector-store-selection.md │ └── 002-llm-provider-strategy.md ├── deployment/ │ └── (AWS ECS task definitions, CI/CD configs) ├── Dockerfile # Multi-stage production build ├── docker-compose.yml # Local dev + production profiles ├── requirements.txt ├── .env.example └── README.md


---

## Course Module Coverage

This project implements concepts from across the Full Stack Generative AI BootCamp:

| Module | Topic | Implementation |
|--------|-------|---------------|
| 1 | Foundations of GenAI | Embeddings, vector space, similarity |
| 3 | API for Accessing LLMs | Multi-provider router (OpenAI/Groq/Bedrock) |
| 5 | LLM Hosting & API | FastAPI endpoint exposure |
| 6 | Prompt Engineering | YAML prompt library, Jinja2 templates, CoT |
| 7 | RAG Systems | Full pipeline: ingest → chunk → embed → retrieve → generate |
| 8 | Advanced RAG | Query rewriting, re-ranking, caching, multimodal |
| 10 | Evaluation | Faithfulness, relevance, safety metrics, cost tracking |
| 11 | Guardrails | PHI detection, injection defense, output validation |
| 12 | MCP | Standardized tool interfaces (extensible) |
| 16 | E2E Deployment | Docker, FastAPI, cloud-native architecture |

---

## Related Projects

- **[Medicare RAF Pipeline](https://github.com/erickyegon/medicare-raf-prototypes)** — Risk adjustment factor prediction for Medicare Advantage (ATT −$391/member)
- **RWE Evidence Synthesis Agent** — Multi-agent system for systematic literature review automation (coming soon)
- **HEDIS/STARS Quality Agent** — Automated care gap identification for managed care (coming soon)

---

## License

MIT

---

## Contact

**Erick K. Yegon, PhD**  
Director-Level Data Science & Epidemiology  
📧 keyegonaws@gmail.com  
🔗 [LinkedIn](https://linkedin.com/in/erickyegon) | [GitHub](https://github.com/erickyegon) | [ORCID](https://orcid.org/0000-0002-7055-4848)

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [erickyegon](https://github.com/erickyegon)
- **Source:** [erickyegon/clinical-doc-intelligence](https://github.com/erickyegon/clinical-doc-intelligence)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.