Inspiration

Hospital discharge is one of the most failure-prone moments in healthcare.

Nearly 1 in 5 patients are readmitted within 30 days after discharge, often because symptoms worsen unnoticed, medications are misunderstood, follow-ups are missed, or clinical information becomes fragmented across systems.

CareFlow AI was built to address this gap using interoperable AI orchestration instead of isolated healthcare chatbots.

The goal was to create a SHARP-compliant MCP clinical intelligence platform capable of reasoning over structured FHIR patient context in real time.


What it does

CareFlow AI is an MCP-native healthcare orchestration platform that exposes AI-powered clinical workflows through interoperable tools.

The system combines:

  • Gemini-powered clinical reasoning
  • FHIR R4 interoperability
  • MCP tool orchestration
  • SHARP-aligned healthcare context propagation
  • Structured JSON clinical outputs

CareFlow AI currently exposes 5 interoperable clinical intelligence tools:

1. analyze_symptoms

AI-powered symptom triage using symptom combinations, patient context, and vital signs to identify dangerous clinical deterioration patterns.

Unlike static rules engines, the system reasons across symptom relationships and contextual patient burden.


2. detect_care_gaps

Analyzes FHIR patient history to identify overdue screenings, monitoring gaps, follow-up failures, and unresolved care coordination issues.


3. compute_readmission_risk

Predicts 30-day readmission risk using:

  • active conditions
  • medications
  • prior admissions
  • transportation access
  • social determinants of health
  • home support availability

The system generates prioritized intervention recommendations instead of only numeric scores.


4. generate_handoff_note

Automatically generates structured SBAR clinical handoff documentation from patient context and workflow state.

This reduces manual documentation overhead during discharge transitions.


5. medication_reconciliation

Detects medication conflicts, duplication risks, adherence concerns, and transition-of-care medication issues during discharge planning.


How I built it

Backend Infrastructure

  • Python
  • FastAPI
  • FastMCP
  • Uvicorn ASGI server

AI Layer

  • Google Gemini API
  • Structured clinical JSON generation
  • Prompt-based reasoning orchestration

Healthcare Interoperability

  • FHIR R4
  • HAPI FHIR sandbox
  • SHARP-on-MCP context propagation
  • MCP Streamable HTTP transport

Deployment

  • Railway cloud deployment
  • Production ASGI runtime
  • JSON-RPC based MCP communication

The platform was architected as a modular MCP server where every clinical workflow operates as an independent interoperable tool.


Challenges I ran into

One of the hardest parts was implementing MCP streamable transport correctly while maintaining SHARP-compatible healthcare context propagation.

Additional challenges included:

  • handling FHIR interoperability cleanly
  • generating consistent structured clinical JSON
  • integrating Gemini reasoning reliably
  • debugging Railway deployment/runtime issues
  • designing healthcare-safe tool execution patterns
  • exposing MCP capabilities correctly during initialization

Accomplishments that I'm proud of

  • Built and deployed a fully working MCP healthcare server
  • Implemented 5 interoperable clinical intelligence tools
  • Added SHARP-aligned FHIR context propagation
  • Successfully deployed production infrastructure on Railway
  • Integrated Gemini-powered clinical reasoning
  • Added medication reconciliation and social determinant-aware readmission analysis
  • Implemented structured AI orchestration instead of chatbot-only interaction

What I learned

This project demonstrated how future healthcare AI systems will likely evolve beyond standalone chatbots into interoperable clinical orchestration platforms.

I learned:

  • MCP architecture patterns
  • healthcare interoperability principles
  • SHARP-aligned context propagation
  • FHIR workflow orchestration
  • structured AI tool execution
  • production deployment of healthcare AI infrastructure

What's next for CareFlow AI

Next steps include:

  • SMART-on-FHIR authentication
  • Epic sandbox integration
  • clinician-facing dashboards
  • longitudinal patient memory
  • wearable device integration
  • multi-agent care coordination
  • predictive deterioration monitoring
  • real-time clinical alerting

Built With

  • fastapi
  • fastmcp
  • fhir-r4
  • gemini
  • google-ai
  • hapi-fhir
  • healthcare-ai
  • json-rpc
  • model-context-protocol
  • python
  • railway
  • sharp-on-mcp
  • uvicorn
Share this project:

Updates