Inspiration

Medication errors harm at least 1.5 million patients every year and most at care transitions like hospital discharge, where pharmacists spend up to 20 minutes manually reconciling medication lists. I wanted to solve this with AI. MedReconcile was born from one question: what if an agent could do this in under 30 seconds using real patient data?

What it does

MedReconcile is a SHARP-compliant A2A agent that performs medication reconciliation at care transitions. A clinician asks the agent about a patient and it automatically fetches the patient's active medications from any FHIR R4 server in real time, screens the full list for dangerous drug-drug interactions with MAJOR or MODERATE severity ratings, and generates a structured clinical report with recommended actions for the care team. What used to take 20 minutes now takes under 30 seconds.

How I built it

Built on the po-community-mcp framework, I created three custom Python tools (get_patient_medications, check_drug_interactions, and generate_reconciliation_report). The server connects to the SMART Health IT FHIR R4 sandbox for live synthetic patient data and is exposed to Prompt Opinion via a secure ngrok HTTPS tunnel. The A2A agent was configured on Prompt Opinion with a clinical system prompt, connected to the MCP server, and published to the Marketplace. Stack: Python, FastMCP, FHIR R4, ngrok, Prompt Opinion, SHARP Extension.

Challenges I ran into

The FastMCP SDK rejected documented parameters requiring line-by-line debugging to fix. The free ngrok plan regenerates URLs on every restart which repeatedly broke the Prompt Opinion connection. Implementing the SHARP extension required understanding FastMCP internals. Most significantly, I had no prior experience with Python environments, MCP protocols, or FHIR APIs and built everything from scratch under a tight hackathon deadline.

Accomplishments that we're proud of

We built and deployed a fully working MCP server with three clinical tools from scratch, connected live FHIR R4 patient data to an A2A agent on Prompt Opinion, had all three tools automatically discovered by the platform, published the agent to the Prompt Opinion Marketplace, and reduced a 20-minute clinical workflow to under 30 seconds.

What I learned

I learned how FHIR R4 works as a REST API for real patient data, the difference between an MCP server and an A2A agent and how they work together, and how Prompt Opinion's SHARP extension passes patient context securely between platforms. The most important lesson was non-technical, the most dangerous moment in healthcare is not surgery, it is the handoff between caregivers.

What's next for My MedReconcile AI Agent

Full SHARP extension compliance for automatic patient context passing, allergy cross-referencing against known patient allergies in real time, Epic and Cerner integration via SMART on FHIR OAuth, an expanded drug interaction database using established clinical APIs, and multi-language clinical reports for global healthcare deployment.

Built With

Share this project:

Updates