Inspiration

Medication errors are the #1 cause of preventable harm in hospitalized children. Every pediatric dose must be weight-adjusted, and a misplaced decimal point can be fatal - a 10x dosing error happens more often than any parent should know.

The statistics are alarming:

  • 1 in 8 pediatric medication orders contain an error
  • 30% of those errors can cause serious harm
  • Only 0.6% of FDA-authorized AI/ML devices were built for pediatric patients

Children are being left behind by healthcare AI. We built PEDS GUARD because the most vulnerable patients deserve the strongest safeguards - and the healthcare ecosystem needs composable, interoperable tools that any agent can pick up and use.

What it does

PEDS GUARD is a pediatric medication safety system built as both an MCP Server (Superpower) and an A2A Agent. It exposes 7 reusable MCP tools that any agent on the Prompt Opinion platform can invoke:

Tool What it does
get_patient_demographics Fetches age, weight, height, calculates BSA from FHIR
get_active_medications Retrieves all active medication orders from FHIR
check_pediatric_dose Validates doses against weight-based ranges for 25+ drugs
screen_drug_interactions Screens against active meds via RxNorm API
get_relevant_labs Pulls renal/hepatic function labs for dose adjustment
get_allergy_alerts Detects allergies AND cross-sensitivities across 13 drug classes
suggest_alternative Claude AI recommends safer alternatives based on full clinical context

Demo Scenarios

Scenario 1 — Penicillin Allergy Detection: Emma Rodriguez, 6 years old, 20kg. Documented penicillin allergy with anaphylaxis history. When Amoxicillin 500mg is ordered, PEDS GUARD immediately flags it as DANGER - Amoxicillin is a penicillin-type antibiotic. It recommends Azithromycin as a safe alternative.

Scenario 2 — 10x Dosing Overdose: Liam Chen, 2 years old, 12kg. Gentamicin 100mg IV is ordered. PEDS GUARD flags DANGER - the proposed dose of 8.33 mg/kg far exceeds the maximum of 2.5 mg/kg/dose. This is exactly the kind of decimal point error that harms children in real hospitals.

Scenario 3 — Drug Interaction + Allergy: Aisha Patel, 12 years old, on Methotrexate. TMP-SMX is ordered - PEDS GUARD catches both the sulfa drug allergy AND the dangerous methotrexate interaction.

How we built it

MCP Server (TypeScript/Express)

Built on @modelcontextprotocol/sdk following the SHARP-on-MCP specification from Darena Health's reference implementation. The server creates a per-request McpServer instance with StreamableHTTPServerTransport, registers all 7 tools via an initializer pattern, and extracts FHIR context from SHARP headers (x-fhir-server-url, x-fhir-access-token, x-patient-id).

Key technical details:

  • Patient ID extraction from JWT claims with header fallback
  • Built-in pediatric dosing reference database covering 25 common medications
  • Drug interaction screening via RxNorm API with fallback to embedded interaction pairs
  • Cross-sensitivity detection across 13 drug class families
  • fhir_context_required: true capability flag per SHARP spec

FHIR Integration

Connected to HAPI FHIR R4 server with 3 test pediatric patients. Queries 7 FHIR resource types: Patient, Observation, MedicationRequest, MedicationStatement, AllergyIntolerance, Condition, and DiagnosticReport. Uses proper LOINC codes for lab queries (creatinine: 2160-0, ALT: 1742-6, body weight: 29463-7).

Dashboard (Next.js 16)

Clinical dark theme with color-coded severity (green/amber/red). Features a safety check page with patient context panel, drug interaction matrix visualization, and audit trail. Built with Tailwind CSS, shadcn/ui, and Framer Motion animations.

AI Layer

Claude API powers the suggest_alternative tool, providing evidence-based medication recommendations considering the patient's age, weight, current medications, labs, and allergies.

Challenges we faced

  1. MCP Streaming Transport on Serverless: The Streamable HTTP transport requires specific Accept headers and per-request server instantiation - took debugging to deploy correctly on Vercel serverless functions.

  2. Pediatric Dosing Data Curation: Building accurate weight-based dosing ranges for 25+ medications required cross-referencing pharmacology sources (Lexicomp, Harriet Lane, DailyMed). Pediatric dosing is not standardized in a single database.

  3. Cross-Sensitivity Detection: Mapping drug class families for allergy cross-reactivity (e.g., penicillin → cephalosporin ~2% cross-reactivity) required clinical pharmacology knowledge beyond what's in standard drug databases.

  4. FHIR Data Handling: Gracefully handling missing data in FHIR bundles - not every patient has all observations, and search results can be empty.

Accomplishments we're proud of

  • Catches a 10x gentamicin overdose in a 12kg toddler (8.33 mg/kg vs. max 2.5 mg/kg)
  • Detects penicillin → amoxicillin cross-sensitivity with anaphylaxis history
  • 7 composable MCP tools published to the Prompt Opinion Marketplace — any agent can use them
  • All 5Ts covered: Talk, Template, Table, Transaction, Task outputs
  • Both MCP Server AND A2A Agent published and discoverable on the platform

What we learned

  • SHARP extension specs are elegantly simple - just 3 HTTP headers propagating clinical context through multi-agent chains
  • MCP's per-request server pattern enables stateless deployment on serverless platforms
  • Pediatric medication safety is a massively underserved gap where AI can have huge impact
  • The composability thesis of MCP really shines when you build tools other agents can reuse

What's next for PEDS GUARD

  • Integration with real EHR systems via SMART on FHIR launch
  • Expanded drug database covering the full pediatric formulary
  • Neonatal dosing support (gestational age-adjusted)
  • Real-time monitoring of medication order streams
  • Multi-language support for global deployment

Built With

  • anthropic-sdk
  • claude-ai
  • express.js
  • framer-motion
  • hapi-fhir-server
  • hl7-fhir-r4
  • model-context-protocol-(mcp)
  • next.js
  • openai-tts
  • rxnorm-api
  • shadcn/ui
  • sharp-on-mcp
  • tailwind-css
  • typescript
  • vercel
  • zod
Share this project:

Updates