I grew up in Ghana. I have watched family members go to Korle Bu Teaching Hospital and sit for hours while nurses manually flip through paper folders trying to find what medications a patient was on last visit. I have seen a doctor ask a patient "are you allergic to anything?" and get a shrug back because nobody wrote it down anywhere accessible.
This is not a Ghana-specific problem. It happens in hospitals everywhere. But I noticed it here first. The data exists somewhere, just scattered, inaccessible, and not connected to the person trying to make a clinical decision in the next 60 seconds.
When I learned about FHIR, the international standard modern hospitals use to store and share patient data, and MCP, the protocol that lets AI agents use external tools, I realized connecting these two things could meaningfully change what a doctor can know in the moment they need to know it. I am not a doctor. I am an engineer. But I know how to build the bridge.
What It Does
Healthcare Assistant MCP is a server that exposes four clinical tools to any AI agent on the Prompt Opinion platform.
get_patient_info : pulls a patient's demographics, blood type, and known allergies. When a real FHIR patient ID is provided it fetches live data from the hospital's FHIR server, and falls back to structured mock data when needed.
get_medications: retrieves the patient's current active medications with doses, frequency, and what condition each drug is treating.
get_lab_results : pulls recent lab observations with values, reference ranges, and flags anything HIGH or LOW.
check_drug_interaction : checks whether two drugs have a known dangerous interaction before they both end up in the same patient. A combination like Warfarin and Aspirin raises a HIGH severity bleeding risk warning.
The thing that matters most to me about this: when a doctor has a patient file open in their EHR system, they should not have to type the patient ID again to ask the AI a question about that patient. SHARP context passes it automatically through every tool call. The doctor just asks. The tools already know who they are talking about.
How I Built It
I started by figuring out what information a clinician actually needs in the first 2 minutes with a patient, demographics, active medications, recent labs, interaction checks. Those became the four tools.
The server is built in Python using FastMCP, which handles the MCP protocol, tool registration, and SSE transport so any compliant AI agent can discover and call the tools without custom integration. Each tool has a detailed docstring, not just for documentation, but because the AI reads those descriptions to decide when to call each tool. That is what makes autonomous chaining possible.
For FHIR I built a dedicated client module that makes real calls to FHIR R4 servers, fetching Patient resources, MedicationRequest resources, and Observation resources. I tested against the public HAPI FHIR server and created proper test patients there to demonstrate a realistic clinical scenario. For SHARP context I implemented header extraction so patient ID and FHIR credentials flow into every tool call automatically from the EHR session.
The whole thing runs in a Docker container on Render and is registered on the Prompt Opinion marketplace so any agent on the platform can invoke it.
Challenges I Ran Into
The public FHIR test server has a lot of garbage data. Developers testing their code leave behind entries like "yty" and "asd" as medication names. I solved this by using the FHIR REST API to create properly structured test patients with realistic clinical data so the demo actually shows what a clinical interaction looks like.
The stdio vs SSE transport issue took me a while. When the AI agent spawns the MCP server as a subprocess it communicates over stdin/stdout using pure JSON-RPC. Any print statement in the server, even a startup message, goes to stdout and corrupts the pipe. I had to create a separate silent stdio version of the server for agent testing and keep the HTTP/SSE version for Prompt Opinion. Simple fix once I understood what was happening, but it took time to diagnose.
Accomplishments I'm Proud Of
The first time I typed "Patient P002 is being considered for aspirin, are there any dangerous interactions?" into the Prompt Opinion Launchpad and watched the agent call get_medications by itself, then call check_drug_interaction for each medication without me telling it to, that was a real moment for me. I did not programme that sequence. It read the tool descriptions and reasoned through it on its own.
Also the fact that this works with real data. Patient 131421738 on the HAPI FHIR server, Kofi Mensah, has real FHIR-structured medications and lab results created using the proper FHIR API. When the platform fetches his medications that is a genuine HTTP call to a genuine FHIR R4 endpoint returning a genuine MedicationRequest bundle. It is not a mock.
What I Learned
Before this project every AI tool I built lived inside the agent that used it. My Discord bot had weather tools that only the Discord bot could call. This project taught me that separating tools from agents, making them independently discoverable and callable via a standard protocol, is a fundamentally better architecture. You build the tools once and every agent everywhere that speaks MCP can use them.
I also learned that FHIR is not complicated once you stop being afraid of the spec. It is just structured JSON with a consistent pattern. Once you understand how to read a Patient resource and a MedicationRequest bundle the rest follows naturally.
What's Next
I want to add an AllergyIntolerance tool that fetches real allergy records from FHIR, right now allergies come from the Patient resource extension which is not always populated. I also want to add a clinical notes summarizer that reads FHIR DocumentReference resources and gives a clinician a quick summary of the last visit. And eventually I want to connect this to a real Ghanaian hospital system. Korle Bu and 37 Military Hospital both have digital records now. That is the actual endgame for me.
Log in or sign up for Devpost to join the conversation.