Automates US healthcare prior authorization using a 3-tool MCP pipeline.
A clinician types one sentence — the agent returns a complete PA submission in under 30 seconds.
MCP servers: FastMCP (Streamable HTTP, MCP 2025-03-26 spec)
LLM: Google Gemini API (gemini-2.5-flash, free tier)
FHIR: SMART Health IT R4 sandbox with mock fallback
Platform: Prompt Opinion A2A orchestrator
Frontend: Next.js + Tailwind CSS dashboard
Layer
Component
Port
MCP Tool 1
fhir-patient-fetcher
8001
MCP Tool 2
coverage-checker
8002
MCP Tool 3
justification-writer
8003
Orchestrator
FastAPI chain (Tool 1 → 2 → 3)
8000
Platform
Prompt Opinion A2A Orchestrator
—
Frontend
Next.js dashboard
3000
cd backend/prior-auth-agent
cp .env.example .env
# Add your GEMINI_API_KEY to .env
docker compose up --build
Verify the servers are running
curl http://localhost:8000/health # orchestrator
curl http://localhost:8001/health # fhir-fetcher
curl http://localhost:8002/health # coverage-checker
curl http://localhost:8003/health # justification-writer
ID
Patient
Scenario
Denial risk
mock-123
Sarah Johnson
RA — Humira (adalimumab)
Low
mock-456
Marcus Williams
Psoriasis — Skyrizi (risankizumab)
Medium
mock-789
Linda Okafor
T2D — Ozempic (semaglutide)
High
SHARP Context Headers
When called via Prompt Opinion, the orchestrator injects:
X-Sharp-Patient-Id — patient identifier
X-Sharp-Fhir-Token — FHIR OAuth2 bearer token
X-Sharp-Fhir-Base-Url — FHIR server base URL
backend/prior-auth-agent/
services/
fhir_fetcher/ MCP Tool 1 (port 8001)
coverage_checker/ MCP Tool 2 (port 8002)
justification_writer/ MCP Tool 3 (port 8003)
shared/
models.py Pydantic v2 data contracts
sharp_context.py SHARP header utilities
docker-compose.yml
.env.example
frontend/ Next.js dashboard
Name
Role
Vipin Bhatt
Backend MCP servers, FHIR client, coverage checker
Yashas Yadav
Frontend, orchestrator, platform integration