anandkiran2007/ahl-mcp-server
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
Endpoint | Method | Description |
---|---|---|
/context/{patient_id} | GET | Get context bundle |
/models/register | POST | Register model info |
/models/{model_id}/context/{patient_id} | GET | Tailored context |
/model/invoke/{model_id}?patient_id=... | POST | Mock model prediction |
๐งช Mock HealthLake Endpoints
Endpoint | Method | Description |
---|---|---|
/ahl/Patient | POST | Create patient |
/ahl/Patient/{id} | GET | Get patient |
/ahl/Condition?patient=... | GET | Get conditions |
/ahl/MedicationRequest?patient=... | GET | Get meds |
/ahl/Observation?patient=... | GET | Get labs |
/ahl/mock/add_* | POST | Add 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