usafiri-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.
@@ -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: usafiri-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for Kenya transport — matatu routes, NTSA services, boda-boda licensing, freight logistics, and passenger rights. 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
+ # usafiri-mcp
14
+ MCP server for Kenya transport — matatu routes, NTSA services, boda-boda licensing, freight logistics, and passenger rights. 5 tools.
@@ -0,0 +1,2 @@
1
+ # usafiri-mcp
2
+ MCP server for Kenya transport — matatu routes, NTSA services, boda-boda licensing, freight logistics, and passenger rights. 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 = "usafiri-mcp"
7
+ version = "0.1.0"
8
+ description = "MCP server for Kenya transport — matatu routes, NTSA services, boda-boda licensing, freight logistics, and passenger rights. 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
+ usafiri-mcp = "usafiri_mcp.server:mcp.run"
16
+
17
+ [tool.setuptools.packages.find]
18
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,2 @@
1
+ """MCP server for usafiri-mcp."""
2
+ __version__ = "0.1.0"
@@ -0,0 +1,76 @@
1
+ """UsafiriMCP — Kenya Transport Navigation (5 tools). All data DEMO."""
2
+ from __future__ import annotations
3
+ from typing import Optional
4
+ from fastmcp import FastMCP
5
+ mcp = FastMCP(name="usafiri-mcp", description="Kenya transport and logistics tools. DEMO data only.")
6
+
7
+ @mcp.tool(name="matatu_route_finder", description="Find matatu routes between Kenyan towns. DEMO.")
8
+ def matatu_route_finder(origin: str, destination: str) -> dict:
9
+ fare_est = {"nairobi_mombasa": 1200, "nairobi_kisumu": 900, "nairobi_nakuru": 350,
10
+ "nairobi_eldoret": 700, "nairobi_thika": 100, "default": 500}
11
+ key = f"{origin.lower().replace(' ','_')}_{destination.lower().replace(' ','_')}"
12
+ fare = fare_est.get(key, fare_est["default"])
13
+ return {"source": "DEMO — fares and routes change frequently", "origin": origin, "destination": destination,
14
+ "estimated_fare_kes": fare, "booking_options": ["Bus terminals (Machakos, Muthurwa, Westlands)",
15
+ "Online: buupass.com, flixbus", "Apps: Little, Quickbus"],
16
+ "note": "Confirm current fares at departure terminal. NTSA sets maximum fares for some routes."}
17
+
18
+ @mcp.tool(name="ntsa_services_guide", description="NTSA services guide: driving licence, vehicle inspection, permits. DEMO.")
19
+ def ntsa_services_guide(service: str) -> dict:
20
+ SERVICES = {
21
+ "driving_licence": {"process": "Apply at tims.ntsa.go.ke. Theory test + practical exam. Fee: KES 3,050",
22
+ "documents": ["ID/Passport", "KES 3,050", "Medical certificate", "Passport photo"],
23
+ "duration": "4–8 weeks"},
24
+ "vehicle_inspection": {"process": "Mandatory annually. Inspection at NTSA-accredited garage.",
25
+ "cost": "KES 2,000–5,000 depending on vehicle class",
26
+ "consequence": "Non-compliance: fine up to KES 20,000 or impound"},
27
+ "psv_licence": {"process": "Public Service Vehicle licence for matatu/taxi operators. tims.ntsa.go.ke",
28
+ "documents": ["Valid driving licence (3yr+ PSV category)", "Good conduct certificate", "Medical"],
29
+ "note": "SACCOs required for matatu operators"},
30
+ "transfer_ownership": {"process": "Logbook transfer at NTSA. Fee: KES 1,125",
31
+ "documents": ["Logbook", "Both parties' IDs", "KRA compliance certificate"],
32
+ "duration": "3–7 working days"},
33
+ }
34
+ s = service.lower().replace(" ","_")
35
+ matched = next((v for k, v in SERVICES.items() if k in s or s in k), list(SERVICES.values())[0])
36
+ return {"source": "DEMO — tims.ntsa.go.ke for official process", "service": service, **matched,
37
+ "ntsa": "tims.ntsa.go.ke | 0800723474"}
38
+
39
+ @mcp.tool(name="boda_licensing_guide", description="Boda boda (motorcycle taxi) licensing requirements in Kenya. DEMO.")
40
+ def boda_licensing_guide(county: Optional[str] = None) -> dict:
41
+ return {"source": "DEMO — NTSA/county requirements", "county": county,
42
+ "requirements": ["Class G driving licence (motorcycle)", "PSV licence",
43
+ "Insurance: Third party minimum KES 3,000/year",
44
+ "County government permit (KES 1,000–3,000/year)",
45
+ "Reflective jacket with SACCO number", "Helmet (rider and pillion)",
46
+ "SACCO membership (most counties mandatory)"],
47
+ "ntsa_fee": "PSV licence: KES 2,050/year", "insurance": "Jubilee, GA, or APA offer boda policies",
48
+ "sacco_benefit": "SACCO membership provides accident insurance, savings, and loan access."}
49
+
50
+ @mcp.tool(name="freight_logistics_guide", description="Freight logistics options for Kenya SMEs. DEMO.")
51
+ def freight_logistics_guide(origin: str, destination: str, cargo_type: Optional[str] = "general") -> dict:
52
+ return {"source": "DEMO — prices indicative", "origin": origin, "destination": destination, "cargo": cargo_type,
53
+ "options": [
54
+ {"mode": "Truck (full load)", "price_range": "KES 15,000–80,000 depending on distance",
55
+ "providers": ["SIGINON", "Mitchell Cotts", "local transporters via TruckAfrica"]},
56
+ {"mode": "Bus parcel", "price_range": "KES 300–2,000 for small packages",
57
+ "providers": ["EasyCoach", "Guardian", "Modern Coast"]},
58
+ {"mode": "Motorbike courier (Nairobi/Mombasa)", "price_range": "KES 200–800 same-day",
59
+ "providers": ["Sendy", "Glovo", "Jumia Fulfilment"]},
60
+ {"mode": "SGR cargo (Nairobi–Mombasa)", "price_range": "KES 0.18–0.25 per kg/km",
61
+ "providers": ["Kenya Railways SGR cargo: www.krsgr.co.ke"]},
62
+ ]}
63
+
64
+ @mcp.tool(name="transport_rights_query", description="Passenger rights for Kenya public transport. DEMO.")
65
+ def transport_rights_query(topic: str) -> dict:
66
+ RIGHTS = {
67
+ "overcharging": "NTSA sets maximum fares. Report overcharging: NTSA 0800723474 or police.",
68
+ "safety": "PSV must have valid inspection sticker. Seatbelts mandatory. Report unsafe vehicle: NTSA.",
69
+ "accident": "Report to police within 24 hours. PSV operator liable for passenger injuries under Traffic Act.",
70
+ "goods": "Carrier liable for loss/damage of goods. Get receipt. Small Claims Court for disputes under KES 1M.",
71
+ "disability": "SGR and formal buses must provide disabled access. NTSA enforcing wheelchair standards.",
72
+ }
73
+ t = topic.lower()
74
+ matched = {k: v for k, v in RIGHTS.items() if k in t or any(w in t for w in k.split("_"))}
75
+ return {"source": "DEMO — Traffic Act, Consumer Protection Act", "topic": topic,
76
+ "rights": matched or RIGHTS, "ntsa": "0800723474", "disclaimer": "Not legal advice."}
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: usafiri-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for Kenya transport — matatu routes, NTSA services, boda-boda licensing, freight logistics, and passenger rights. 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
+ # usafiri-mcp
14
+ MCP server for Kenya transport — matatu routes, NTSA services, boda-boda licensing, freight logistics, and passenger rights. 5 tools.
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/usafiri_mcp/__init__.py
5
+ src/usafiri_mcp/server.py
6
+ src/usafiri_mcp.egg-info/PKG-INFO
7
+ src/usafiri_mcp.egg-info/SOURCES.txt
8
+ src/usafiri_mcp.egg-info/dependency_links.txt
9
+ src/usafiri_mcp.egg-info/entry_points.txt
10
+ src/usafiri_mcp.egg-info/requires.txt
11
+ src/usafiri_mcp.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ usafiri-mcp = usafiri_mcp.server:mcp.run
@@ -0,0 +1,2 @@
1
+ fastmcp>=0.9
2
+ pydantic>=2.0
@@ -0,0 +1 @@
1
+ usafiri_mcp