kra-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.
kra_mcp-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: kra-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for Kenya Revenue Authority tax compliance — PAYE calculator, PIN reg
5
+ License: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: fastmcp>=0.9
9
+
10
+ # kra-mcp
11
+ MCP server for Kenya Revenue Authority tax compliance — PAYE calculator, PIN registration, VAT guide, filing calendar, withholding tax rates, investment incentives. 6 tools.
@@ -0,0 +1,2 @@
1
+ # kra-mcp
2
+ MCP server for Kenya Revenue Authority tax compliance — PAYE calculator, PIN registration, VAT guide, filing calendar, withholding tax rates, investment incentives. 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 = "kra-mcp"
7
+ version = "0.1.0"
8
+ description = "MCP server for Kenya Revenue Authority tax compliance — PAYE calculator, PIN reg"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ requires-python = ">=3.10"
12
+ dependencies = ["fastmcp>=0.9"]
13
+
14
+ [project.scripts]
15
+ kra-mcp = "kra_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 kra-mcp."""
2
+ __version__ = "0.1.0"
@@ -0,0 +1,133 @@
1
+ """KraMCP — Kenya Revenue Authority Tax Compliance 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="kra-mcp", description="Kenya Revenue Authority tax compliance tools. DEMO data only.")
6
+
7
+ TAX_BRACKETS_2025 = [
8
+ (24000, 0.10), (8333, 0.25), (467667, 0.30), (300000, 0.325), (float("inf"), 0.35)
9
+ ]
10
+
11
+ def compute_paye(annual_income: float) -> dict:
12
+ """Compute PAYE tax for Kenya 2025 (simplified)."""
13
+ tax = 0.0
14
+ remaining = annual_income
15
+ breakdown = []
16
+ cumulative = 0
17
+ for band, rate in TAX_BRACKETS_2025:
18
+ monthly_band = band
19
+ annual_band = monthly_band * 12
20
+ taxable = min(remaining, annual_band)
21
+ band_tax = taxable * rate
22
+ if taxable > 0:
23
+ breakdown.append({"band_kes": round(taxable, 0), "rate_pct": rate*100, "tax_kes": round(band_tax, 0)})
24
+ tax += band_tax
25
+ remaining -= taxable
26
+ cumulative += annual_band
27
+ if remaining <= 0:
28
+ break
29
+ personal_relief = 28800
30
+ net_tax = max(0, tax - personal_relief)
31
+ return {"gross_annual": annual_income, "gross_tax": round(tax, 2),
32
+ "personal_relief": personal_relief, "net_paye_annual": round(net_tax, 2),
33
+ "net_paye_monthly": round(net_tax/12, 2), "breakdown": breakdown,
34
+ "effective_rate_pct": round(net_tax/annual_income*100, 2) if annual_income > 0 else 0}
35
+
36
+ @mcp.tool(name="paye_calculator", description="Compute Kenya PAYE income tax for 2025 tax year. DEMO.")
37
+ def paye_calculator(annual_gross_income_kes: float, include_nhif: Optional[bool] = True,
38
+ include_nssf: Optional[bool] = True) -> dict:
39
+ result = compute_paye(annual_gross_income_kes)
40
+ if include_nhif:
41
+ nhif = min(1700 * 12, annual_gross_income_kes * 0.015 * 12)
42
+ result["nhif_annual"] = round(nhif, 2)
43
+ if include_nssf:
44
+ result["nssf_annual"] = round(min(720 * 12, annual_gross_income_kes * 0.06), 2)
45
+ result["source"] = "DEMO — verify at itax.kra.go.ke"
46
+ result["note"] = "Personal relief: KES 28,800/year. AHL levy, insurance relief may apply."
47
+ return result
48
+
49
+ @mcp.tool(name="pin_registration_guide", description="Guide to registering for Kenya Revenue Authority PIN. DEMO.")
50
+ def pin_registration_guide(applicant_type: str = "individual") -> dict:
51
+ GUIDES = {
52
+ "individual": {"steps": ["1. Go to iTax: itax.kra.go.ke", "2. New user registration",
53
+ "3. Enter ID/Passport number", "4. Provide: name, DOB, contacts",
54
+ "5. Upload ID scan", "6. PIN generated instantly"],
55
+ "documents": ["National ID or Passport", "Phone number", "Email address"],
56
+ "cost": "Free", "processing": "Instant"},
57
+ "company": {"steps": ["1. iTax portal", "2. Non-individual PIN", "3. Certificate of Incorporation",
58
+ "4. CR12 (directors)", "5. Registrar confirms after 2-3 days"],
59
+ "documents": ["Certificate of Incorporation", "CR12", "Director IDs"],
60
+ "cost": "Free", "processing": "2-3 working days"},
61
+ }
62
+ guide = GUIDES.get(applicant_type.lower(), GUIDES["individual"])
63
+ return {"source": "DEMO — itax.kra.go.ke", "applicant_type": applicant_type, **guide,
64
+ "kra_portal": "itax.kra.go.ke", "kra_contact": "0800723470 (toll-free)"}
65
+
66
+ @mcp.tool(name="vat_guide", description="Kenya VAT registration, rates, and filing guidance. DEMO.")
67
+ def vat_guide(query: str) -> dict:
68
+ INFO = {
69
+ "registration": "Register if annual taxable turnover > KES 5M. iTax portal. Certificate in 7 days.",
70
+ "rate": "Standard rate: 16%. Zero-rated: exports, basic foods, medical. Exempt: financial, educational.",
71
+ "filing": "Monthly by 20th of following month. iTax form VAT-3. Electronic filing mandatory.",
72
+ "refund": "File VAT-3 showing excess input tax. KRA may audit before refund. Takes 30-90 days.",
73
+ "withholding_vat":"Government ministries withhold 6% VAT on supplier invoices. Supplier claims credit.",
74
+ }
75
+ q = query.lower()
76
+ matched = {k: v for k, v in INFO.items() if k in q or any(w in q for w in k.split("_"))}
77
+ return {"source": "DEMO — verify at kra.go.ke/vat", "query": query,
78
+ "information": matched or INFO, "threshold": "KES 5M annual turnover = mandatory registration"}
79
+
80
+ @mcp.tool(name="tax_filing_calendar", description="Kenya tax filing deadlines and calendar. DEMO.")
81
+ def tax_filing_calendar() -> dict:
82
+ return {"source": "DEMO — kra.go.ke", "year": 2025,
83
+ "key_deadlines": [
84
+ {"deadline": "Jan 20", "obligation": "VAT return — December transactions"},
85
+ {"deadline": "Feb 9", "obligation": "PAYE return — January payroll"},
86
+ {"deadline": "Apr 30", "obligation": "Individual tax return (simple income)"},
87
+ {"deadline": "Jun 30", "obligation": "Corporate tax return (non-December year-end)"},
88
+ {"deadline": "Dec 31", "obligation": "Withholding tax certificate issuance"},
89
+ ],
90
+ "monthly": "PAYE and VAT due by 9th and 20th respectively each month",
91
+ "penalties": "5% of tax due for late filing. 1% interest per month on late payment."}
92
+
93
+ @mcp.tool(name="withholding_tax_rates", description="Kenya withholding tax rates by payment type. DEMO.")
94
+ def withholding_tax_rates(payment_type: Optional[str] = None) -> dict:
95
+ RATES = {
96
+ "dividends_resident": "5% (final tax)",
97
+ "dividends_non_resident": "10% (final tax)",
98
+ "interest_bank": "15% (final tax for resident individuals)",
99
+ "professional_fees": "5% (resident), 20% (non-resident)",
100
+ "rent_commercial": "30% (if payer is registered withholding agent)",
101
+ "royalties_resident": "5%",
102
+ "royalties_non_resident": "20% (may be reduced by tax treaty)",
103
+ "management_fees": "5% (resident), 20% (non-resident)",
104
+ "contractor_payments": "3% (public sector, construction)",
105
+ }
106
+ if payment_type:
107
+ pt = payment_type.lower().replace(" ", "_")
108
+ matched = {k: v for k, v in RATES.items() if pt in k}
109
+ return {"source": "DEMO — kra.go.ke", "payment_type": payment_type,
110
+ "rate": matched or {"general": "Verify specific rate at kra.go.ke/withholding-tax"}}
111
+ return {"source": "DEMO — kra.go.ke", "withholding_tax_rates": RATES,
112
+ "note": "Rates may be reduced by Double Tax Agreements (DTAs). Verify at kra.go.ke"}
113
+
114
+ @mcp.tool(name="tax_incentives_guide", description="Kenya investment tax incentives and reliefs. DEMO.")
115
+ def tax_incentives_guide(sector: Optional[str] = None) -> dict:
116
+ INCENTIVES = {
117
+ "manufacturing": ["100% investment deduction on plant/machinery in EPZ",
118
+ "10-year tax holiday in EPZ", "Reduced corporate tax 15% for SEZ"],
119
+ "agriculture": ["100% capital allowance on farm works", "Tax-free cooperatives",
120
+ "Zero VAT on agricultural inputs"],
121
+ "technology": ["100% investment deduction for ICT infrastructure",
122
+ "Preferential 10% corporate tax for registered ICT companies"],
123
+ "exports": ["10% corporate tax for qualifying manufacturers",
124
+ "Zero-rated VAT on all exports"],
125
+ "pension": ["Employer contributions tax-deductible up to KES 240,000/year",
126
+ "Employee contributions deductible up to KES 240,000/year"],
127
+ "startup": ["Available in Nairobi Innovation Hub — no corporate tax for 10 years",
128
+ "No import duty on software/ICT equipment for registered tech startups"],
129
+ }
130
+ s = sector.lower() if sector else None
131
+ data = {k: v for k, v in INCENTIVES.items() if not s or k in s} or INCENTIVES
132
+ return {"source": "DEMO — KRA and Kenya Investment Authority", "sector": sector,
133
+ "incentives": data, "keninvest": "keninvest.go.ke for investment facilitation"}
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: kra-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for Kenya Revenue Authority tax compliance — PAYE calculator, PIN reg
5
+ License: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: fastmcp>=0.9
9
+
10
+ # kra-mcp
11
+ MCP server for Kenya Revenue Authority tax compliance — PAYE calculator, PIN registration, VAT guide, filing calendar, withholding tax rates, investment incentives. 6 tools.
@@ -0,0 +1,10 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/kra_mcp/__init__.py
4
+ src/kra_mcp/server.py
5
+ src/kra_mcp.egg-info/PKG-INFO
6
+ src/kra_mcp.egg-info/SOURCES.txt
7
+ src/kra_mcp.egg-info/dependency_links.txt
8
+ src/kra_mcp.egg-info/entry_points.txt
9
+ src/kra_mcp.egg-info/requires.txt
10
+ src/kra_mcp.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ kra-mcp = kra_mcp.server:mcp.run
@@ -0,0 +1 @@
1
+ fastmcp>=0.9
@@ -0,0 +1 @@
1
+ kra_mcp