Inspiration
Physicians see 20+ patients a day. For complex cases they need to cross-reference treatment guidelines, adjust drug doses for kidney function, and screen for dangerous interactions — all in real time. Most look it up manually. We built Clinical Decision Support to make that lookup instant and AI-powered.
What it does
An MCP server exposing four tools:
check_treatment_guidelines— takes an ICD-10 code and returns evidence-based first, second, and third-line treatment options with guideline sourcescalculate_drug_dosing— adjusts dosing for patient weight, age, and renal function (eGFR), flagging dangerous doses automaticallyflag_contraindications— screens a medication list against diagnoses and returns absolute/relative contraindications, drug-drug interactions, and an overall safety scoreget_synthetic_patient_example— returns a ready-to-use synthetic patient for testing (67F, T2DM/HTN/CKD3/CAD, eGFR 38)
How we built it
- MCP Server in Node.js using
@modelcontextprotocol/sdk, exposed over SSE via Express - Gemini 2.0 Flash via raw fetch for all clinical reasoning
- Synthetic FHIR R4 patient data as input standard
- Cloudflare Tunnel for public accessibility
- Published to Prompt Opinion Marketplace — discoverable and invokable by any agent in the ecosystem
Challenges we ran into
Getting Gemini to return consistent, parseable JSON across all four tools required careful prompt engineering and a markdown-strip fallback parser. The per-connection MCP server instance bug (500 error on reconnect) took time to debug — solved by instantiating a fresh server per SSE connection.
Accomplishments that we're proud of
The renal dosing adjustment logic. When we tested Metformin on a patient with eGFR of 38 (CKD Stage 3), the server correctly flagged it as contraindicated and recommended dose reduction — exactly what a pharmacist would catch. That's the kind of safety net that prevents real harm.
What we learned
Clinical decision support is only as good as its input data structure. Anchoring to ICD-10 codes and FHIR standards means this server can slot into any EHR workflow without custom integration — the standard is the interface.
What's next for Clinical Decision Support
- Real FHIR server integration — pulling live patient data with proper auth via SMART on FHIR
- Payer-specific formulary checking — cross-referencing treatment guidelines against what insurance will actually cover
- Integration with Prior Auth Copilot — automatic PA letter generation when a recommended treatment requires authorization
Built With
- 2.0
- cloudflare
- express.js
- fhir
- flash
- gemini
- mcp
- node.js
- opinion
- prompt
- r4
- sdk
- sse
- tunnel
Log in or sign up for Devpost to join the conversation.