afya-mcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- afya_mcp-0.1.0/LICENSE +21 -0
- afya_mcp-0.1.0/PKG-INFO +18 -0
- afya_mcp-0.1.0/README.md +2 -0
- afya_mcp-0.1.0/pyproject.toml +24 -0
- afya_mcp-0.1.0/setup.cfg +4 -0
- afya_mcp-0.1.0/src/afya_mcp/__init__.py +2 -0
- afya_mcp-0.1.0/src/afya_mcp/server.py +101 -0
- afya_mcp-0.1.0/src/afya_mcp.egg-info/PKG-INFO +18 -0
- afya_mcp-0.1.0/src/afya_mcp.egg-info/SOURCES.txt +11 -0
- afya_mcp-0.1.0/src/afya_mcp.egg-info/dependency_links.txt +1 -0
- afya_mcp-0.1.0/src/afya_mcp.egg-info/entry_points.txt +2 -0
- afya_mcp-0.1.0/src/afya_mcp.egg-info/requires.txt +2 -0
- afya_mcp-0.1.0/src/afya_mcp.egg-info/top_level.txt +1 -0
afya_mcp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gabriel Mahia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
afya_mcp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: afya-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Kenya health system navigation — NHIF coverage, facility finder, maternal health, CHW support, and essential medicines. 6 tools.
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: mcp,kenya,africa,east-africa,coordination-infrastructure
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: fastmcp>=0.9
|
|
14
|
+
Requires-Dist: pydantic>=2.0
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# afya-mcp
|
|
18
|
+
MCP server for Kenya health system navigation — NHIF coverage, facility finder, maternal health, CHW support, and essential medicines. 6 tools.
|
afya_mcp-0.1.0/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "afya-mcp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "MCP server for Kenya health system navigation — NHIF coverage, facility finder, maternal health, CHW support, and essential medicines. 6 tools."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
dependencies = ["fastmcp>=0.9", "pydantic>=2.0"]
|
|
13
|
+
keywords = ["mcp","kenya","africa","east-africa","coordination-infrastructure"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.scripts]
|
|
21
|
+
afya-mcp = "afya_mcp.server:mcp.run"
|
|
22
|
+
|
|
23
|
+
[tool.setuptools.packages.find]
|
|
24
|
+
where = ["src"]
|
afya_mcp-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""AfyaMCP — Kenya Health System Navigation (6 tools). All data DEMO."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from fastmcp import FastMCP
|
|
5
|
+
|
|
6
|
+
mcp = FastMCP(name="afya-mcp", description="Kenya health system navigation. DEMO data only.")
|
|
7
|
+
|
|
8
|
+
NHIF_BENEFITS = {
|
|
9
|
+
"outpatient": "NHIF SHA covers outpatient at accredited facilities. Annual limit varies by contribution tier.",
|
|
10
|
+
"inpatient": "Inpatient coverage up to 180 days per year. Shared rooms covered; private rooms may attract a top-up.",
|
|
11
|
+
"maternity": "Normal delivery: KES 10,000. C-section: KES 30,000. Accredited facilities only.",
|
|
12
|
+
"dental": "Basic dental covered biannually at accredited dental clinics.",
|
|
13
|
+
"optical": "Optical covered annually — frames and lenses up to KES 5,000.",
|
|
14
|
+
"chronic": "Chronic disease management covered under SHA Enhancement Fund for specific conditions.",
|
|
15
|
+
"dialysis": "Renal dialysis covered at designated centres under SHA.",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
FACILITY_LEVELS = {
|
|
19
|
+
"dispensary": "Level 2 — basic outpatient, maternal, immunisation",
|
|
20
|
+
"health_centre": "Level 3 — outpatient, inpatient beds, minor surgery",
|
|
21
|
+
"sub_county_hospital": "Level 4 — general surgery, lab, radiology",
|
|
22
|
+
"county_hospital": "Level 5 — specialist services, ICU",
|
|
23
|
+
"national_referral": "Level 6 — Kenya National Hospital, Kenyatta, Moi Teaching",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@mcp.tool(name="nhif_coverage_query", description="Query NHIF/SHA coverage for a procedure or condition. DEMO.")
|
|
27
|
+
def nhif_coverage_query(query: str, member_tier: Optional[str] = "standard") -> dict:
|
|
28
|
+
q = query.lower()
|
|
29
|
+
matched = {k: v for k, v in NHIF_BENEFITS.items() if k in q or any(w in q for w in k.split("_"))}
|
|
30
|
+
if not matched:
|
|
31
|
+
matched = {"general": "NHIF SHA covers most inpatient and outpatient services at accredited facilities."}
|
|
32
|
+
return {"source": "DEMO — verify at nhif.or.ke or sha.go.ke", "query": query,
|
|
33
|
+
"member_tier": member_tier, "coverage": matched,
|
|
34
|
+
"tip": "Always confirm coverage before procedure. Call SHA: 0800720601 (free)."}
|
|
35
|
+
|
|
36
|
+
@mcp.tool(name="health_facility_finder", description="Find accredited health facilities in a Kenya county/sub-county. DEMO.")
|
|
37
|
+
def health_facility_finder(county: str, level: Optional[str] = None, nhif_only: Optional[bool] = True) -> dict:
|
|
38
|
+
sample = [
|
|
39
|
+
{"name": f"{county} County Referral Hospital", "level": "county_hospital", "nhif_accredited": True, "county": county},
|
|
40
|
+
{"name": f"{county} Sub-County Hospital", "level": "sub_county_hospital", "nhif_accredited": True, "county": county},
|
|
41
|
+
{"name": f"Central Health Centre — {county}", "level": "health_centre", "nhif_accredited": nhif_only, "county": county},
|
|
42
|
+
{"name": f"Community Dispensary — {county}", "level": "dispensary", "nhif_accredited": False, "county": county},
|
|
43
|
+
]
|
|
44
|
+
if level:
|
|
45
|
+
sample = [f for f in sample if level.lower() in f["level"]]
|
|
46
|
+
if nhif_only:
|
|
47
|
+
sample = [f for f in sample if f["nhif_accredited"]]
|
|
48
|
+
return {"source": "DEMO — verify at KenyaEMR/DHIS2", "county": county,
|
|
49
|
+
"facilities": sample, "tip": "For real-time facility data: ehealth.go.ke"}
|
|
50
|
+
|
|
51
|
+
@mcp.tool(name="chw_service_lookup", description="Lookup CHW services in a Kenya sub-county. DEMO.")
|
|
52
|
+
def chw_service_lookup(sub_county: str) -> dict:
|
|
53
|
+
return {"source": "DEMO", "sub_county": sub_county,
|
|
54
|
+
"chw_services": ["Health education","Malaria prevention","Maternal-child health","Immunisation referral",
|
|
55
|
+
"TB contact tracing","Nutrition screening","NCDs follow-up"],
|
|
56
|
+
"referral_pathway": "CHW → Health Centre → Sub-County Hospital → County Referral",
|
|
57
|
+
"contact": "Contact your county health department for CHW assignment in your village."}
|
|
58
|
+
|
|
59
|
+
@mcp.tool(name="maternal_health_guide", description="ANC milestones, danger signs, and delivery guidance for Kenya. DEMO.")
|
|
60
|
+
def maternal_health_guide(trimester: str, specific_concern: Optional[str] = None) -> dict:
|
|
61
|
+
GUIDE = {
|
|
62
|
+
"first": {"anc_visits": "At least 1 visit before 12 weeks", "key_tests": ["Blood group","Hemoglobin","HIV test","Syphilis screening"],
|
|
63
|
+
"danger_signs": ["Heavy bleeding","Severe vomiting","Fever above 38°C"]},
|
|
64
|
+
"second": {"anc_visits": "2 visits (20 and 26 weeks)", "key_tests": ["Ultrasound","Glucose screening","Tetanus toxoid"],
|
|
65
|
+
"danger_signs": ["Reduced fetal movement","Severe headache","Visual disturbances"]},
|
|
66
|
+
"third": {"anc_visits": "2 visits (32 and 36 weeks)", "key_tests": ["Presentation check","Birth plan review"],
|
|
67
|
+
"danger_signs": ["Labour before 37 weeks","Absence of fetal movement","Severe swelling"]},
|
|
68
|
+
}
|
|
69
|
+
t = trimester.lower().replace("1st","first").replace("2nd","second").replace("3rd","third")
|
|
70
|
+
data = GUIDE.get(t, GUIDE["first"])
|
|
71
|
+
return {"source": "DEMO — verify with qualified midwife/obstetrician", "trimester": trimester,
|
|
72
|
+
**data, "nhif_maternity": "Deliver at NHIF-accredited facility. Normal delivery: KES 10,000 covered."}
|
|
73
|
+
|
|
74
|
+
@mcp.tool(name="essential_medicines", description="Query Kenya Essential Medicines List. DEMO.")
|
|
75
|
+
def essential_medicines(query: str) -> dict:
|
|
76
|
+
COMMON = {"amoxicillin": "Tier 1 — dispensary level. Generic available. Avg KES 50/course.",
|
|
77
|
+
"metformin": "Tier 2 — health centre. Generic available. Avg KES 30/month.",
|
|
78
|
+
"paracetamol": "Tier 1 — all facilities. OTC available. Avg KES 10/strip.",
|
|
79
|
+
"malaria": "Artemether-lumefantrine (Coartem) — Tier 1, free at public facilities.",
|
|
80
|
+
"tb": "First-line TB drugs — free through NTLD programme at public facilities.",
|
|
81
|
+
"insulin": "Tier 3 — sub-county hospital and above. NHIF covers with chronic disease card."}
|
|
82
|
+
q = query.lower()
|
|
83
|
+
match = next((v for k, v in COMMON.items() if k in q), "Not in sample dataset — check EML at kemsa.go.ke")
|
|
84
|
+
return {"source": "DEMO — Kenya Essential Medicines List 2024", "query": query,
|
|
85
|
+
"information": match, "kemsa": "kemsa.go.ke", "disclaimer": "Consult a pharmacist or prescriber."}
|
|
86
|
+
|
|
87
|
+
@mcp.tool(name="health_rights_query", description="Patient rights under Kenya Health Act 2017. DEMO.")
|
|
88
|
+
def health_rights_query(topic: str) -> dict:
|
|
89
|
+
RIGHTS = {
|
|
90
|
+
"consent": "Informed consent required before any procedure. Patient may refuse treatment.",
|
|
91
|
+
"privacy": "Medical records are confidential. Cannot be shared without consent (HIV Act, Data Protection Act).",
|
|
92
|
+
"emergency": "Any public facility must provide emergency care regardless of ability to pay.",
|
|
93
|
+
"second_opinion": "Patient has the right to seek a second opinion from another provider.",
|
|
94
|
+
"complaint": "File complaints: Kenya Medical Practitioners and Dentists Council (KMPDC), or county health department.",
|
|
95
|
+
"nhif_dispute": "NHIF disputes: SHA Ombudsman — 0800720601. Must be resolved within 30 days.",
|
|
96
|
+
}
|
|
97
|
+
t = topic.lower()
|
|
98
|
+
matched = {k: v for k, v in RIGHTS.items() if k in t or any(w in t for w in k.split("_"))}
|
|
99
|
+
return {"source": "DEMO — Kenya Health Act 2017", "topic": topic,
|
|
100
|
+
"rights": matched or {"general": "Review Kenya Health Act 2017 at kenyalaw.org"},
|
|
101
|
+
"all_topics": list(RIGHTS.keys()), "disclaimer": "Not legal or medical advice."}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: afya-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Kenya health system navigation — NHIF coverage, facility finder, maternal health, CHW support, and essential medicines. 6 tools.
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: mcp,kenya,africa,east-africa,coordination-infrastructure
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: fastmcp>=0.9
|
|
14
|
+
Requires-Dist: pydantic>=2.0
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# afya-mcp
|
|
18
|
+
MCP server for Kenya health system navigation — NHIF coverage, facility finder, maternal health, CHW support, and essential medicines. 6 tools.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/afya_mcp/__init__.py
|
|
5
|
+
src/afya_mcp/server.py
|
|
6
|
+
src/afya_mcp.egg-info/PKG-INFO
|
|
7
|
+
src/afya_mcp.egg-info/SOURCES.txt
|
|
8
|
+
src/afya_mcp.egg-info/dependency_links.txt
|
|
9
|
+
src/afya_mcp.egg-info/entry_points.txt
|
|
10
|
+
src/afya_mcp.egg-info/requires.txt
|
|
11
|
+
src/afya_mcp.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
afya_mcp
|