nyumba-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.
- nyumba_mcp-0.1.0/LICENSE +21 -0
- nyumba_mcp-0.1.0/PKG-INFO +14 -0
- nyumba_mcp-0.1.0/README.md +2 -0
- nyumba_mcp-0.1.0/pyproject.toml +18 -0
- nyumba_mcp-0.1.0/setup.cfg +4 -0
- nyumba_mcp-0.1.0/src/nyumba_mcp/__init__.py +2 -0
- nyumba_mcp-0.1.0/src/nyumba_mcp/server.py +84 -0
- nyumba_mcp-0.1.0/src/nyumba_mcp.egg-info/PKG-INFO +14 -0
- nyumba_mcp-0.1.0/src/nyumba_mcp.egg-info/SOURCES.txt +11 -0
- nyumba_mcp-0.1.0/src/nyumba_mcp.egg-info/dependency_links.txt +1 -0
- nyumba_mcp-0.1.0/src/nyumba_mcp.egg-info/entry_points.txt +2 -0
- nyumba_mcp-0.1.0/src/nyumba_mcp.egg-info/requires.txt +2 -0
- nyumba_mcp-0.1.0/src/nyumba_mcp.egg-info/top_level.txt +1 -0
nyumba_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.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nyumba-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Kenya housing — rental market, tenant rights, building permits, affordable housing programs, and housing finance. 5 tools.
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: fastmcp>=0.9
|
|
10
|
+
Requires-Dist: pydantic>=2.0
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# nyumba-mcp
|
|
14
|
+
MCP server for Kenya housing — rental market, tenant rights, building permits, affordable housing programs, and housing finance. 5 tools.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "nyumba-mcp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "MCP server for Kenya housing — rental market, tenant rights, building permits, affordable housing programs, and housing finance. 5 tools."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
dependencies = ["fastmcp>=0.9", "pydantic>=2.0"]
|
|
13
|
+
|
|
14
|
+
[project.scripts]
|
|
15
|
+
nyumba-mcp = "nyumba_mcp.server:mcp.run"
|
|
16
|
+
|
|
17
|
+
[tool.setuptools.packages.find]
|
|
18
|
+
where = ["src"]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""NyumbaMCP — Kenya Housing Tools (5 tools). All data DEMO."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from fastmcp import FastMCP
|
|
5
|
+
mcp = FastMCP(name="nyumba-mcp", description="Kenya housing: rental market, permits, affordable housing. DEMO.")
|
|
6
|
+
|
|
7
|
+
@mcp.tool(name="rental_market_guide", description="Kenya rental market guide: prices, tenant rights, and county-specific info. DEMO.")
|
|
8
|
+
def rental_market_guide(county: str, bedrooms: Optional[int] = 1, area_type: Optional[str] = "suburb") -> dict:
|
|
9
|
+
RENTALS = {
|
|
10
|
+
"nairobi": {1: {"suburb": "KES 12,000–25,000", "estate": "KES 6,000–15,000"},
|
|
11
|
+
2: {"suburb": "KES 25,000–60,000", "estate": "KES 15,000–30,000"},
|
|
12
|
+
3: {"suburb": "KES 50,000–150,000", "estate": "KES 25,000–60,000"}},
|
|
13
|
+
"mombasa": {1: {"suburb": "KES 8,000–18,000", "estate": "KES 4,000–12,000"},
|
|
14
|
+
2: {"suburb": "KES 15,000–35,000", "estate": "KES 10,000–20,000"}},
|
|
15
|
+
"kisumu": {1: {"suburb": "KES 6,000–15,000", "estate": "KES 3,000–10,000"},
|
|
16
|
+
2: {"suburb": "KES 12,000–25,000", "estate": "KES 7,000–15,000"}},
|
|
17
|
+
}
|
|
18
|
+
county_key = county.lower()
|
|
19
|
+
data = RENTALS.get(county_key, {"default": {"suburb": "KES 5,000–25,000", "estate": "KES 3,000–15,000"}})
|
|
20
|
+
br_data = data.get(bedrooms, data.get(1, {}))
|
|
21
|
+
price = br_data.get(area_type.lower(), "Not in sample")
|
|
22
|
+
return {"source": "DEMO — prices indicative Q2 2026", "county": county, "bedrooms": bedrooms,
|
|
23
|
+
"area_type": area_type, "estimated_rent_kes": price,
|
|
24
|
+
"platforms": ["BuyRentKenya", "PigiaMe", "HauzaKe", "Landlord Kenya"],
|
|
25
|
+
"tip": "Prices vary significantly by specific neighbourhood and building quality."}
|
|
26
|
+
|
|
27
|
+
@mcp.tool(name="tenant_rights_guide", description="Kenya tenant rights under Rent Restriction Act and Land Act. DEMO.")
|
|
28
|
+
def tenant_rights_guide(topic: str) -> dict:
|
|
29
|
+
RIGHTS = {
|
|
30
|
+
"eviction": "30 days notice required for month-to-month tenancy. Court order needed for forceful eviction. Illegal to remove tenant's belongings without court order.",
|
|
31
|
+
"rent_increase": "Landlord must give 30 days notice. Rent Restriction Tribunal (residential < KES 2,500/month old law) — now mainly market-based.",
|
|
32
|
+
"deposit": "Security deposit (typically 2–3 months rent). Must be refunded within 30 days of vacating, less legitimate deductions.",
|
|
33
|
+
"maintenance": "Landlord responsible for structural repairs. Tenant responsible for interior maintenance per lease terms.",
|
|
34
|
+
"utilities": "Landlord cannot cut utilities to force eviction. Utility disconnection by landlord = illegal.",
|
|
35
|
+
"lease": "Written lease protects both parties. Verbal lease legally valid but harder to enforce.",
|
|
36
|
+
"dispute": "Business Premises: Business Premises Rent Tribunal. Residential: file suit at Magistrate Court.",
|
|
37
|
+
}
|
|
38
|
+
t = topic.lower()
|
|
39
|
+
matched = {k: v for k, v in RIGHTS.items() if k in t or any(w in t for w in k.split("_"))}
|
|
40
|
+
return {"source": "DEMO — Landlord and Tenant Act, Land Act 2012", "topic": topic,
|
|
41
|
+
"rights": matched or RIGHTS, "disclaimer": "Not legal advice. Consult an advocate."}
|
|
42
|
+
|
|
43
|
+
@mcp.tool(name="building_permit_guide", description="Building plan approval and permit process in Kenya counties. DEMO.")
|
|
44
|
+
def building_permit_guide(county: str, project_type: Optional[str] = "residential") -> dict:
|
|
45
|
+
return {"source": "DEMO — NCA and county governments", "county": county, "project_type": project_type,
|
|
46
|
+
"steps": ["1. Engage registered architect (NCA-licensed)",
|
|
47
|
+
"2. Submit drawings to county Physical Planning (for planning approval)",
|
|
48
|
+
"3. Submit to county Buildings Department (for building permit)",
|
|
49
|
+
"4. Pay statutory fees (1–3% of project cost)",
|
|
50
|
+
"5. Construction only after permit issued",
|
|
51
|
+
"6. Inspections during construction",
|
|
52
|
+
"7. Occupation certificate on completion"],
|
|
53
|
+
"fees_estimate": "KES 30,000–500,000+ depending on county and size",
|
|
54
|
+
"nca": "National Construction Authority — nca.go.ke — contractor registration",
|
|
55
|
+
"penalty": "Illegal construction: KES 1M fine or 2 years prison or both."}
|
|
56
|
+
|
|
57
|
+
@mcp.tool(name="affordable_housing_guide", description="Kenya affordable housing programs: Boma Yangu, SHA, county schemes. DEMO.")
|
|
58
|
+
def affordable_housing_guide(county: Optional[str] = None, income_range: Optional[str] = None) -> dict:
|
|
59
|
+
return {"source": "DEMO — bomayanguke.go.ke for official programs", "county": county,
|
|
60
|
+
"programs": [
|
|
61
|
+
{"name": "Boma Yangu (Affordable Housing Program)", "url": "bomayanguke.go.ke",
|
|
62
|
+
"eligibility": "Kenyan citizen, 18+, employed or informal sector with regular income",
|
|
63
|
+
"units": "30,000+ planned nationwide", "prices": "KES 800,000–3M (studio to 3BR)"},
|
|
64
|
+
{"name": "SHA Housing Enhancement Fund", "url": "sha.go.ke",
|
|
65
|
+
"benefit": "Mortgage top-up or construction loans for SHA members"},
|
|
66
|
+
{"name": "National Housing Corporation", "url": "nhc.co.ke",
|
|
67
|
+
"benefit": "Low-cost housing developments, mortgages for civil servants"},
|
|
68
|
+
{"name": "County Social Housing", "url": "Varies by county",
|
|
69
|
+
"benefit": "Subsidised rentals for low-income households — very limited supply"},
|
|
70
|
+
],
|
|
71
|
+
"mortgage": "KMRC (Kenya Mortgage Refinance Company) — liquidity for affordable mortgages. Banks: KCB, Co-op, Equity."}
|
|
72
|
+
|
|
73
|
+
@mcp.tool(name="housing_finance_guide", description="Kenya housing finance: mortgages, SACCOS, tenant purchase schemes. DEMO.")
|
|
74
|
+
def housing_finance_guide(income_kes_monthly: Optional[float] = 50000, property_value_kes: Optional[float] = None) -> dict:
|
|
75
|
+
max_mortgage = round((income_kes_monthly or 50000) * 0.4 * 240, 0)
|
|
76
|
+
return {"source": "DEMO — verify with specific lenders", "monthly_income": income_kes_monthly,
|
|
77
|
+
"mortgage_estimate": {"max_loan_kes": max_mortgage, "term": "20 years",
|
|
78
|
+
"rate": "12–14% p.a. (commercial) or 7% (affordable housing schemes)",
|
|
79
|
+
"note": "40% of income used as repayment guideline"},
|
|
80
|
+
"lenders": [{"type": "Commercial bank", "rate": "12–14%", "min_deposit": "10–20%"},
|
|
81
|
+
{"type": "SACCO mortgage", "rate": "10–12%", "min_deposit": "20%", "note": "Must be SACCO member 2+ years"},
|
|
82
|
+
{"type": "KMRC-linked", "rate": "7%", "note": "Affordable housing scheme, income limits apply"}],
|
|
83
|
+
"nhif_benefit": "SHA members may access mortgage-linked benefits",
|
|
84
|
+
"tip": "SACCO mortgages are often cheaper than commercial bank rates."}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nyumba-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Kenya housing — rental market, tenant rights, building permits, affordable housing programs, and housing finance. 5 tools.
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: fastmcp>=0.9
|
|
10
|
+
Requires-Dist: pydantic>=2.0
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# nyumba-mcp
|
|
14
|
+
MCP server for Kenya housing — rental market, tenant rights, building permits, affordable housing programs, and housing finance. 5 tools.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/nyumba_mcp/__init__.py
|
|
5
|
+
src/nyumba_mcp/server.py
|
|
6
|
+
src/nyumba_mcp.egg-info/PKG-INFO
|
|
7
|
+
src/nyumba_mcp.egg-info/SOURCES.txt
|
|
8
|
+
src/nyumba_mcp.egg-info/dependency_links.txt
|
|
9
|
+
src/nyumba_mcp.egg-info/entry_points.txt
|
|
10
|
+
src/nyumba_mcp.egg-info/requires.txt
|
|
11
|
+
src/nyumba_mcp.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nyumba_mcp
|