ahl-mcp-server

anandkiran2007/ahl-mcp-server

3.1

If you are the rightful owner of ahl-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

This project is an open-source Model Context Protocol (MCP) server that connects to mocked AWS HealthLake data sources and provides structured, standardized context bundles for clinical models.

🏥 MCP Server for AWS HealthLake (Mocked)

This project is an open-source Model Context Protocol (MCP) server that connects to (mocked) AWS HealthLake data sources and provides structured, standardized context bundles for clinical models.

✅ Features

  • Mocked AWS HealthLake APIs (FHIR-based)
  • Context bundling per MCP spec (FHIR + NLP)
  • Model registration and tailored context delivery
  • Mocked model invocation endpoint
  • Audit logging
  • Optional USE_AWS flag for future AWS integration

🚀 Quick Start

1. Clone or Download

unzip mcp-server.zip
cd ahl-mcp-server

2. Install Python Dependencies

python3 -m venv venv
source venv/bin/activate        # On Windows: venv\Scripts\activate
pip install -r requirements.txt

3. Run Locally (Mock Mode)

uvicorn app.main:app --reload

Visit: http://localhost:8000/docs


🔁 Endpoints

📦 MCP Endpoints

EndpointMethodDescription
/context/{patient_id}GETGet context bundle
/models/registerPOSTRegister model info
/models/{model_id}/context/{patient_id}GETTailored context
/model/invoke/{model_id}?patient_id=...POSTMock model prediction

🧪 Mock HealthLake Endpoints

EndpointMethodDescription
/ahl/PatientPOSTCreate patient
/ahl/Patient/{id}GETGet patient
/ahl/Condition?patient=...GETGet conditions
/ahl/MedicationRequest?patient=...GETGet meds
/ahl/Observation?patient=...GETGet labs
/ahl/mock/add_*POSTAdd mock data (condition/med/obs)

⚙️ Switching Between Mock and AWS Mode

By default, the app runs in mock mode.

To prepare for future AWS integration:

export USE_AWS=true

Note: AWS mode is not implemented yet but ready for integration.


🧪 Run Tests

pytest tests/

📂 Folder Structure

app/
├── api/                # API endpoints
├── core/               # Config and logging
├── fhir/               # Placeholder for FHIR connector
├── models/             # Pydantic models
├── nlp/                # NLP mock enhancer
├── services/           # Context resolver, policy logic
├── main.py             # FastAPI entry
infra/
tests/                  # Test cases
schemas/                # MCP JSON schema
.env
requirements.txt

📜 License

MIT License


🧠 Coming Soon

  • AWS HealthLake integration (boto3)
  • Amazon Comprehend Medical / Bedrock models
  • Dockerfile + ECS deployment
  • Real-time cohort search
  • SMART-on-FHIR authentication