Skip to content

mghareeb/ClinicalMind

Repository files navigation

ClinicalMind MCP

AI-powered clinical decision support for the Prompt Opinion platform

Built for the Agents Assemble: Healthcare AI Endgame hackathon.


What it does

ClinicalMind exposes 4 specialized healthcare AI tools via the Model Context Protocol (MCP), designed to reduce medical errors and support clinical decision-making:

Tool Description
check_medication_conflicts Detects drug-drug interactions from patient med list (FHIR or manual)
analyze_care_gaps Identifies missing/overdue preventive care vs clinical guidelines
generate_clinical_summary Produces structured SBAR handoff note from FHIR patient data
interpret_lab_trends Flags abnormal lab values and worsening trends with clinical context

All tools integrate with the Prompt Opinion platform via the SHARP FHIR context extension, automatically receiving patient ID, FHIR server URL, and auth token.


Quick start (local)

git clone https://github.com/YOUR_USERNAME/clinicalmind-mcp
cd clinicalmind-mcp
pip install -r requirements.txt
cp .env.example .env
python server.py

Server starts at http://localhost:8000


Run tests

python tests/test_tools.py

Expected output: all 5 test suites pass with synthetic demo patient data.


Deploy to Railway (free tier)

  1. Push to GitHub
  2. Go to railway.app → New Project → Deploy from GitHub
  3. Set environment variables from .env.example
  4. Railway auto-detects the Dockerfile and deploys
  5. Copy the public URL (e.g. https://clinicalmind-mcp.railway.app)

Add to Prompt Opinion

  1. Go to Configuration → MCP Servers in your Prompt Opinion workspace
  2. Click Add MCP Server
  3. Enter your deployed URL: https://YOUR_URL/mcp
  4. Click Continue — the platform sends an initialize request
  5. The FHIR extension is detected automatically
  6. Enable Trust FHIR context — this allows FHIR headers to be forwarded
  7. Save — your tools now appear in the Prompt Opinion marketplace

FHIR context (how it works)

When a clinician opens a patient record in Prompt Opinion and triggers a tool, the platform automatically injects these HTTP headers into every MCP call:

X-FHIR-Server-URL: https://your-ehr.fhir.com/baseR4
X-FHIR-Access-Token: Bearer eyJ...
X-Patient-ID: patient-123

ClinicalMind reads these headers and fetches real-time patient data from the FHIR server — no manual data entry required.

For testing without a connected EHR, use the public HAPI FHIR server: https://hapi.fhir.org/baseR4


Data safety

  • All testing uses synthetic/de-identified data only
  • No real Protected Health Information (PHI) is processed or stored
  • The server does not persist any patient data between requests
  • FHIR tokens are passed through in-memory only and never logged

Tech stack

  • Python 3.11
  • FastMCP — MCP server framework
  • httpx — async FHIR client
  • HAPI FHIR R4 — public test FHIR server
  • Deployed on Railway

Judging criteria alignment

Criterion How ClinicalMind addresses it
AI Factor LLM-level reasoning over FHIR graph data — impossible with rule-based engines alone
Potential Impact Medication errors cause 7,000+ deaths/year in the US; care gaps cost $55B annually
Feasibility FHIR-native, HIPAA-safe synthetic data, production-deployable in under 10 minutes

About

ClinicalMind

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors