faida-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.
- faida_mcp-0.1.0/PKG-INFO +11 -0
- faida_mcp-0.1.0/README.md +2 -0
- faida_mcp-0.1.0/pyproject.toml +18 -0
- faida_mcp-0.1.0/setup.cfg +4 -0
- faida_mcp-0.1.0/src/faida_mcp/__init__.py +2 -0
- faida_mcp-0.1.0/src/faida_mcp/server.py +116 -0
- faida_mcp-0.1.0/src/faida_mcp.egg-info/PKG-INFO +11 -0
- faida_mcp-0.1.0/src/faida_mcp.egg-info/SOURCES.txt +10 -0
- faida_mcp-0.1.0/src/faida_mcp.egg-info/dependency_links.txt +1 -0
- faida_mcp-0.1.0/src/faida_mcp.egg-info/entry_points.txt +2 -0
- faida_mcp-0.1.0/src/faida_mcp.egg-info/requires.txt +1 -0
- faida_mcp-0.1.0/src/faida_mcp.egg-info/top_level.txt +1 -0
faida_mcp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: faida-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Kenya investment and capital markets — Treasury bonds, NSE equiti
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: fastmcp>=0.9
|
|
9
|
+
|
|
10
|
+
# faida-mcp
|
|
11
|
+
MCP server for Kenya investment and capital markets — Treasury bonds, NSE equities, unit trusts, diaspora investment guide, IPO participation, financial literacy. 6 tools.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "faida-mcp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "MCP server for Kenya investment and capital markets — Treasury bonds, NSE equiti"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
dependencies = ["fastmcp>=0.9"]
|
|
13
|
+
|
|
14
|
+
[project.scripts]
|
|
15
|
+
faida-mcp = "faida_mcp.server:mcp.run"
|
|
16
|
+
|
|
17
|
+
[tool.setuptools.packages.find]
|
|
18
|
+
where = ["src"]
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"""FaidaMCP — Kenya Investment and Capital Markets Tools (6 tools). All data DEMO."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from fastmcp import FastMCP
|
|
5
|
+
mcp = FastMCP(name="faida-mcp", description="Kenya investment and capital markets guidance. DEMO data only.")
|
|
6
|
+
|
|
7
|
+
@mcp.tool(name="treasury_bond_calculator", description="Kenya Treasury bond yield and return calculator. DEMO.")
|
|
8
|
+
def treasury_bond_calculator(principal_kes: float, tenor_years: int = 10,
|
|
9
|
+
coupon_rate_pct: Optional[float] = None) -> dict:
|
|
10
|
+
DEFAULT_RATES = {2: 13.5, 5: 14.2, 10: 14.8, 15: 15.1, 20: 15.5}
|
|
11
|
+
rate = coupon_rate_pct or DEFAULT_RATES.get(tenor_years, 14.5)
|
|
12
|
+
annual_coupon = principal_kes * rate / 100
|
|
13
|
+
total_coupons = annual_coupon * tenor_years
|
|
14
|
+
total_return = total_coupons + principal_kes
|
|
15
|
+
real_rate = rate - 6.5 # rough inflation adjustment (DEMO)
|
|
16
|
+
return {"source": "DEMO — CBK rates indicative Q2 2026", "principal_kes": principal_kes,
|
|
17
|
+
"tenor_years": tenor_years, "coupon_rate_pct": rate,
|
|
18
|
+
"annual_interest_kes": round(annual_coupon, 2),
|
|
19
|
+
"total_interest_kes": round(total_coupons, 2),
|
|
20
|
+
"total_return_kes": round(total_return, 2),
|
|
21
|
+
"real_return_est_pct": round(real_rate, 1),
|
|
22
|
+
"buy_via": "CBK DhowCSD portal: dhowordcsd.cbk.go.ke OR commercial bank",
|
|
23
|
+
"minimum": "KES 50,000", "tax": "WHT 15% on interest for residents",
|
|
24
|
+
"disclaimer": "DEMO — verify current yields at cbk.go.ke"}
|
|
25
|
+
|
|
26
|
+
@mcp.tool(name="nse_equities_guide", description="Nairobi Securities Exchange guide for first-time investors. DEMO.")
|
|
27
|
+
def nse_equities_guide(query: Optional[str] = None) -> dict:
|
|
28
|
+
GUIDE = {
|
|
29
|
+
"account_setup": "Open CDS account at NSE-licensed stockbroker. ID + KES 1,000 minimum.",
|
|
30
|
+
"buy_process": "Instruct broker (phone/app). Settlement T+3 days. Brokerage: 1.8–2.5% per trade.",
|
|
31
|
+
"key_indices": "NSE 20 Share Index (top 20), NSE All Share Index (NASI), NSE 25 (broader)",
|
|
32
|
+
"segments": "Main Investment Market (MIM), Alternative Investment Market (AIM), Growth Enterprise Market (GEMS)",
|
|
33
|
+
"top_sectors": "Banking (KCB, Equity, Co-op), Telecoms (Safaricom), Energy (KenGen, KPLC), Agri (Kakuzi)",
|
|
34
|
+
"costs": "Brokerage 1.8%, CDS levy 0.12%, NSE levy 0.12%, withholding tax 5% on dividends",
|
|
35
|
+
"diaspora": "Diaspora investors welcome. CDSC foreign investor account. Remit via licensed dealer.",
|
|
36
|
+
"platforms": "Mobile: EazyTrader (Equity), I-Trade (Faida Securities), NSE app (coming)",
|
|
37
|
+
}
|
|
38
|
+
if query:
|
|
39
|
+
q = query.lower()
|
|
40
|
+
matched = {k: v for k, v in GUIDE.items() if k in q or any(w in q for w in k.split("_"))}
|
|
41
|
+
return {"source": "DEMO — nse.co.ke", "query": query, "information": matched or GUIDE}
|
|
42
|
+
return {"source": "DEMO — nse.co.ke", "guide": GUIDE, "portal": "nse.co.ke"}
|
|
43
|
+
|
|
44
|
+
@mcp.tool(name="unit_trust_comparison", description="Compare Kenya unit trust fund types and typical returns. DEMO.")
|
|
45
|
+
def unit_trust_comparison(risk_profile: Optional[str] = "moderate") -> dict:
|
|
46
|
+
FUNDS = {
|
|
47
|
+
"money_market": {"risk": "low", "typical_return_pct": 13.5, "liquidity": "T+1 (next day)",
|
|
48
|
+
"min_kes": 1000, "examples": ["CIC MMF", "Sanlam MMF", "ICEA Lion MMF"]},
|
|
49
|
+
"bond_fund": {"risk": "low-moderate", "typical_return_pct": 14.5, "liquidity": "T+3",
|
|
50
|
+
"min_kes": 5000, "examples": ["Old Mutual Bond Fund", "Britam Bond Plus"]},
|
|
51
|
+
"equity_fund": {"risk": "high", "typical_return_pct": "8–20% (variable)", "liquidity": "T+5",
|
|
52
|
+
"min_kes": 5000, "examples": ["GenAfrica Equity Fund", "CIC Equity Fund"]},
|
|
53
|
+
"balanced": {"risk": "moderate", "typical_return_pct": "11–16% (variable)", "liquidity": "T+3",
|
|
54
|
+
"min_kes": 5000, "examples": ["ICEA Lion Balanced Fund", "Sanlam Balanced Fund"]},
|
|
55
|
+
"real_estate": {"risk": "moderate", "typical_return_pct": "9–14%", "liquidity": "Limited",
|
|
56
|
+
"min_kes": 5000, "examples": ["ILAM Fahari I-REIT (NSE listed)"]},
|
|
57
|
+
}
|
|
58
|
+
if risk_profile:
|
|
59
|
+
risk_map = {"low": ["money_market","bond_fund"], "moderate": ["bond_fund","balanced"],
|
|
60
|
+
"high": ["equity_fund","balanced"]}
|
|
61
|
+
relevant = {k: FUNDS[k] for k in risk_map.get(risk_profile.lower(), list(FUNDS.keys()))}
|
|
62
|
+
return {"source": "DEMO — RBA Kenya", "risk_profile": risk_profile, "funds": relevant,
|
|
63
|
+
"regulator": "Retirement Benefits Authority (RBA) regulates unit trusts",
|
|
64
|
+
"tax": "Dividends and capital gains generally exempt in regulated schemes"}
|
|
65
|
+
return {"source": "DEMO — RBA Kenya", "all_fund_types": FUNDS}
|
|
66
|
+
|
|
67
|
+
@mcp.tool(name="diaspora_investment_guide", description="Investment options for Kenya diaspora. DEMO.")
|
|
68
|
+
def diaspora_investment_guide(location: Optional[str] = None) -> dict:
|
|
69
|
+
return {"source": "DEMO — CBK, NSE, Treasury", "diaspora_location": location,
|
|
70
|
+
"options": [
|
|
71
|
+
{"name": "M-Akiba Retail Bond", "description": "CBK mobile-first Treasury bond via M-PESA",
|
|
72
|
+
"min_investment": "KES 3,000", "yield": "~13-14%", "platform": "M-PESA"},
|
|
73
|
+
{"name": "NSE Equities", "description": "Buy Kenya stocks via licensed broker",
|
|
74
|
+
"min_investment": "KES 1,000+", "platform": "NSE-licensed broker"},
|
|
75
|
+
{"name": "Unit Trusts", "description": "Pooled investment in MMF/bonds/equities",
|
|
76
|
+
"min_investment": "KES 1,000", "remittance": "Via licensed FX dealer"},
|
|
77
|
+
{"name": "REITs", "description": "Real estate via ILAM Fahari I-REIT on NSE",
|
|
78
|
+
"min_investment": "One share (~KES 5)", "liquidity": "NSE listed"},
|
|
79
|
+
{"name": "Infrastructure Bonds", "description": "Tax-free govt bonds for infrastructure",
|
|
80
|
+
"yield": "~14-15%", "tax": "Interest tax-exempt for bonds issued before 2027"},
|
|
81
|
+
{"name": "Direct Property", "description": "Land/property (see ardhi-mcp + nyumba-mcp)",
|
|
82
|
+
"note": "Non-citizen: leasehold only (max 99 years)"},
|
|
83
|
+
],
|
|
84
|
+
"remittance_tip": "Use licensed money transfer operators. Report above USD 10,000 to CBK.",
|
|
85
|
+
"cds_account": "Open CDS at cdsc.co.ke for equity purchases"}
|
|
86
|
+
|
|
87
|
+
@mcp.tool(name="nse_ipo_guide", description="Kenya Initial Public Offering (IPO) participation guide. DEMO.")
|
|
88
|
+
def nse_ipo_guide() -> dict:
|
|
89
|
+
return {"source": "DEMO — NSE", "how_to_participate": [
|
|
90
|
+
"1. Monitor NSE announcements at nse.co.ke",
|
|
91
|
+
"2. Get a CDS account if you don't have one",
|
|
92
|
+
"3. Obtain prospectus from lead transaction advisor",
|
|
93
|
+
"4. Complete application form via stockbroker or mobile platform",
|
|
94
|
+
"5. Payment via M-PESA/RTGS by closing date",
|
|
95
|
+
"6. Allocation letter + shares credited to CDS within 10 working days",
|
|
96
|
+
],
|
|
97
|
+
"recent_history": "Kenya's IPO market has been quiet (2020-2025). Keep watching NSE.",
|
|
98
|
+
"min_allocation": "Usually KES 2,500–5,000 (varies per IPO)",
|
|
99
|
+
"tip": "Safaricom IPO (2008) remains Kenya's largest. Future candidates: NTSA, KPLC privatisation."}
|
|
100
|
+
|
|
101
|
+
@mcp.tool(name="financial_literacy_kenya", description="Kenya personal finance fundamentals and glossary. DEMO.")
|
|
102
|
+
def financial_literacy_kenya(topic: Optional[str] = None) -> dict:
|
|
103
|
+
TOPICS = {
|
|
104
|
+
"emergency_fund": "3-6 months expenses in money market fund (liquid, earning ~13%). Before any investing.",
|
|
105
|
+
"debt_first": "Pay high-interest debt (credit cards 36%+, Fuliza 9% pm) before investing.",
|
|
106
|
+
"compound_interest":"At 14% return: KES 10K monthly → KES 2.5M in 10 years. Start early.",
|
|
107
|
+
"diversification": "Spread across: money market (liquid), bonds (stable), equities (growth). 70/20/10 for beginners.",
|
|
108
|
+
"m_pesa_savings": "M-Shwari (CBA) and KCB M-PESA earn 7-8%. Good for emergency fund tier.",
|
|
109
|
+
"sacco_vs_bank": "SACCO loans: 12-14% pa. Bank loans: 14-18% pa. SACCO savings: 8-12%. Better rates.",
|
|
110
|
+
"budget_rule": "50/30/20: 50% needs, 30% wants, 20% savings/investments. Adjust for Kenya realities.",
|
|
111
|
+
}
|
|
112
|
+
if topic:
|
|
113
|
+
t = topic.lower()
|
|
114
|
+
matched = {k: v for k, v in TOPICS.items() if k in t or any(w in t for w in k.split("_"))}
|
|
115
|
+
return {"source": "DEMO", "topic": topic, "guidance": matched or TOPICS}
|
|
116
|
+
return {"source": "DEMO", "financial_literacy_topics": TOPICS}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: faida-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Kenya investment and capital markets — Treasury bonds, NSE equiti
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: fastmcp>=0.9
|
|
9
|
+
|
|
10
|
+
# faida-mcp
|
|
11
|
+
MCP server for Kenya investment and capital markets — Treasury bonds, NSE equities, unit trusts, diaspora investment guide, IPO participation, financial literacy. 6 tools.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/faida_mcp/__init__.py
|
|
4
|
+
src/faida_mcp/server.py
|
|
5
|
+
src/faida_mcp.egg-info/PKG-INFO
|
|
6
|
+
src/faida_mcp.egg-info/SOURCES.txt
|
|
7
|
+
src/faida_mcp.egg-info/dependency_links.txt
|
|
8
|
+
src/faida_mcp.egg-info/entry_points.txt
|
|
9
|
+
src/faida_mcp.egg-info/requires.txt
|
|
10
|
+
src/faida_mcp.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fastmcp>=0.9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
faida_mcp
|