Inspiration

Healthcare AI demos often stop at summarization. They can explain a discharge note, but they rarely close the operational gap between “this patient has risk” and “this is the exact action the care team must take next.”

Handoff Sentinel MCP was inspired by that last-mile problem in discharge workflows. During transitions of care, critical details can fall through the cracks: follow-up visits may not be scheduled, chronic monitoring may be overdue, medication instructions may conflict with active medication records, and allergy risks may not be reconciled before the next handoff.

The goal was to build something more useful than a healthcare chatbot: a reusable MCP superpower that a Prompt Opinion agent can invoke to convert synthetic FHIR-style patient context into clinician-ready handoff actions.

What it does

Handoff Sentinel MCP is a discharge handoff safety superpower built on the MCP path of the Agents Assemble challenge.

The system reviews synthetic patient context and returns a structured handoff safety review containing risk level, risk score, handoff status, care gaps, medication reconciliation flags, priority actions, assigned owner, deadline, patient-facing reminder message, agent handoff note, and synthetic data safety notice.

The primary tool is run_handoff_safety_review(patient_id).

The demo uses three synthetic patients:

PAT-001 is a high-risk discharge handoff case with missing post-discharge follow-up, overdue HbA1c monitoring, missing hypertension follow-up, and a Metformin discrepancy between discharge instructions and the active MedicationRequest.

PAT-002 is a medication safety case. There are no general care gaps, but active sulfamethoxazole-trimethoprim may conflict with a documented sulfa allergy.

PAT-003 is a clean control case with documented follow-up, no actionable medication conflict, and LOW risk / READY status.

This allows the system to show not only escalation, but also restraint. It does not flag everything. It distinguishes unsafe handoffs from clean transitions, which is important for reducing alert fatigue.

How it works

Handoff Sentinel MCP exposes healthcare workflow tools through a Streamable HTTP MCP server. The MCP server is registered inside Prompt Opinion and attached to a BYO agent called Handoff Sentinel Review Agent.

The agent invokes the MCP tool when given a patient ID such as PAT-001, PAT-002, or PAT-003.

The system flow is:

Prompt Opinion Agent → Handoff Sentinel MCP Server → Synthetic FHIR-style patient bundle → Care gap detection and medication reconciliation checks → Structured handoff safety review → Clinician-ready action output.

The output is intentionally operational. Instead of simply saying that a patient is high risk, the tool returns the next action, owner, deadline, severity, and handoff status.

Example output fields include risk_level, risk_score, handoff_status, owner, deadline, action, patient_message, and agent_handoff_note.

How we built it

The project was built as an MCP server in Python. The server exposes multiple tools: get_patient_snapshot, detect_followup_gaps, reconcile_medications, analyze_discharge_handoff, generate_patient_discharge_message, and run_handoff_safety_review.

The main demo uses run_handoff_safety_review, which combines patient snapshotting, follow-up gap detection, medication reconciliation, risk scoring, priority action generation, and patient-facing messaging.

The synthetic patient data is stored as FHIR-style JSON bundles using resources such as Patient, Condition, MedicationRequest, AllergyIntolerance, Observation, Encounter, Appointment, and DocumentReference.

The MCP server was tested locally through MCP Inspector, then exposed through a public endpoint and registered inside Prompt Opinion. A BYO agent was configured in Prompt Opinion with Handoff Sentinel MCP attached as an additional MCP server.

The final demo shows the agent functioning inside Prompt Opinion, invoking the MCP tool and returning structured handoff safety reviews.

Challenges we faced

One major challenge was making the project fit the actual hackathon path. It would have been easy to build a generic healthcare chatbot, but the challenge required an interoperable healthcare agent/tool at the intersection of MCP, A2A, and FHIR. We chose the MCP Superpower route and focused on making the tool reusable by other agents.

Another challenge was designing the clinical output so it felt actionable rather than verbose. The system needed to produce a real handoff object: not only a risk summary, but owner, deadline, action, patient message, and handoff note.

We also had to handle platform integration. The MCP server worked locally first, then through MCP Inspector, and finally inside Prompt Opinion through a BYO agent. Connecting the public MCP endpoint and getting the Prompt Opinion agent to invoke the tool was a key part of the build.

What we learned

We learned that the strongest healthcare AI workflows are not necessarily the most complex. The value comes from converting fragmented context into safe, structured action.

This project also showed why MCP matters. By exposing Handoff Sentinel as a tool server rather than a one-off chatbot, the same capability can be reused by different agents and workflows. An agent does not need to know how to parse every patient bundle itself; it can call a specialized handoff safety tool.

We also learned that healthcare AI needs to handle both escalation and non-escalation. PAT-003 was important because it proved the system can return LOW risk and READY status when no immediate safety issue is detected.

Accomplishments

We successfully built and demonstrated a working MCP server, Prompt Opinion integration, a BYO agent using the MCP server, synthetic FHIR-style patient context, discharge handoff risk scoring, care gap detection, medication reconciliation flagging, patient-facing reminder generation, clinician-ready action output, and three distinct demo cases.

The most important accomplishment is that Handoff Sentinel does not just produce prose. It produces an operational handoff review that a care team could act on.

What’s next

The next version would connect to a real sandbox FHIR server and implement Prompt Opinion’s FHIR/SHARP context extension more deeply, so patient ID, FHIR server URL, and token context can propagate through the workflow automatically.

Future improvements include SMART/FHIR sandbox integration, richer medication reconciliation logic, configurable clinical rules by organization, task creation for care coordinators, scheduling workflow integration, audit trails for handoff decisions, support for multiple receiving-team roles, and agent-to-agent handoff between discharge, pharmacy, and follow-up agents.

The long-term vision is for Handoff Sentinel to become a reusable transition-of-care safety layer that agents can invoke whenever a patient moves between care settings.

Built With

  • allergyintolerance-resources
  • appointment-resources
  • cloudflare-tunnel
  • condition-resources
  • documentreference-resources
  • encounter-resources
  • fhir-style-patient-resources
  • google-gemini-via-prompt-opinion
  • json
  • mcp-inspector
  • mcp-python-sdk
  • medicationrequest-resources
  • model-context-protocol-(mcp)
  • observation-resources
  • prompt-opinion
  • prompt-opinion-byo-agents
  • python
  • streamable-http-mcp-server
  • synthetic-fhir-style-json
Share this project:

Updates