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 henry@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