Inspiration

Every day, doctors across India scribble shorthand notes mid-consultation, shout handover updates to exhausted colleagues at shift change, and mentally juggle a dozen medications for a single patient — all while trying to actually care for people.

The breaking point that inspired ClinIQ was a real scenario: a patient on warfarin was prescribed ibuprofen by an ER doctor who simply didn't know the full medication history. That combination can cause fatal internal bleeding. The doctor wasn't careless — he was overwhelmed.

What if every doctor had an AI safety net that caught what tired human minds miss?

When this hackathon challenged us to build interoperable healthcare agents using MCP, A2A, and FHIR, we saw the perfect opportunity to stop keeping ClinIQ locked inside a single app — and open its capabilities to the entire healthcare AI ecosystem.


What it does

ClinIQ is a Model Context Protocol (MCP) server that exposes five clinical AI tools any agent in the Prompt Opinion ecosystem can discover and invoke:

Tool Clinical Problem Solved
generate_soap_note Raw notes → structured SOAP note + automatic red flag detection
check_drug_interactions Treatment plan → dangerous medication combination report
differential_diagnosis Symptoms + vitals → ranked DDx with confidence scores and critical exclusions
parse_shift_handover Chaotic handover text → patient cards sorted by urgency
rapid_soap_multilingual Hindi/Tamil/Telugu shorthand → full English SOAP + patient summary in original language

Every tool accepts an optional patient_id parameter aligned with the SHARP extension spec, making it FHIR-ready the moment a token is passed in context.


How we built it

Stack: FastMCP (Python), Groq API with LLaMA 3 70B, FastAPI, SQLite, ngrok

[ Prompt Opinion Platform ]
         │  MCP (SSE)
         ▼
[ ClinIQ MCP Server ]  ←── FastMCP (Python)
         │
         ▼
[ Groq API ]  ←── LLaMA 3 70B (high-speed inference)

FastMCP wraps each Python function as a standards-compliant MCP tool with a single decorator — no boilerplate, no custom protocol code. Groq's LPU inference brings response times under 2 seconds on every tool, which matters when a doctor is mid-consultation. The server runs on SSE transport and is published to the Prompt Opinion Marketplace. Every tool accepts a patient_id parameter aligned with the SHARP extension spec for FHIR-grounded workflows.

The differential diagnosis tool assigns each diagnosis a confidence score (0–100):

Rank Diagnosis Confidence Next Step
1 STEMI 87% ECG + troponin immediately
2 Unstable Angina 72% Serial troponins
3 Aortic Dissection 45% CT angiography to rule out

Critical Exclusions are flagged separately — life-threatening conditions that must be ruled out regardless of their score. A low confidence for STEMI doesn't mean you skip the ECG.

The multilingual SOAP tool handles regional Indian languages by understanding input in the source language (e.g. Tamil), generating a structured English SOAP for the clinical record, then generating a patient-friendly summary back in the original language.


Challenges we ran into

Reliable JSON in a clinical context — doctors can't get a parse error mid-shift. We enforced strict prompt discipline across all five tools: pure JSON only, no preamble, no markdown fences. We also built a fallback parser that recovers gracefully when the model drifts.

Speed vs. depth — a DDx that takes 30 seconds is useless mid-consultation. We tuned max_tokens carefully per tool to keep latency under 2 seconds without losing diagnostic depth.

Exposing a local server to Prompt Opinion — the platform needs to reach your MCP server over the internet. Getting ngrok stable and pointing at the correct SSE endpoint took real iteration.

Designing genuinely reusable tools — it's tempting to build one giant "clinical assistant." MCP rewards the opposite: fine-grained tools with clear inputs and outputs that any agent can compose independently. Splitting ClinIQ into five focused tools took discipline but makes each one far more useful to the ecosystem.


Accomplishments that we're proud of

  • Zero custom glue code — FastMCP and Prompt Opinion handled all the interoperability plumbing, letting us focus purely on clinical logic
  • Sub-2-second inference on all five tools, fast enough for real mid-shift clinical use
  • Multilingual SOAP generation covering Hindi, Tamil, Telugu, Bengali, and Marathi — a first for ClinIQ
  • Five composable MCP tools, not a monolith — each independently usable by any agent in the ecosystem
  • SHARP-ready from day onepatient_id on every tool signature, one FHIR token away from real patient-grounded workflows

What we learned

MCP changes how AI tools are shared. Before this hackathon, ClinIQ's capabilities were trapped inside one app. As an MCP server, any agent in the ecosystem — a care coordination agent, a pre-auth agent, a chronic disease monitor — can now call check_drug_interactions without us writing a single bespoke integration.

The hardest part of healthcare AI isn't the AI — it's the plumbing. Prompt Opinion absorbs authentication, context propagation, and FHIR token handling at the platform layer. That freed us to focus entirely on the clinical logic that actually helps doctors.

SHARP taught us to treat patient context as a first-class parameter. Adding patient_id to every tool signature is a small change that makes every tool FHIR-composable by design — not a retrofit.


What's next for ClinIQ — AI-Powered Clinical Workflow MCP Server

  • Connect to a live FHIR R4 server so patient_id automatically pulls real medication lists and problem lists, grounding every tool in verified patient data
  • Add a news2_score tool exposing the National Early Warning Score calculator
  • Build a companion A2A agent that orchestrates all five tools into a full automated pre-shift briefing workflow
  • HIPAA-compliant cloud hosting so ClinIQ can run inside real hospital networks

Built With

Share this project:

Updates