Labsco
rehan1020 logo

MCP-India-Stack

โ˜… 31

from rehan1020

MCP server for Indian APIs โ€” GSTIN, IFSC, PAN, UPI, pincode, HSN/SAC. Zero auth. Offline-first. For AI agents.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

๐Ÿ‡ฎ๐Ÿ‡ณ MCP India Stack

A high-performance, offline-first Model Context Protocol (MCP) server equipping AI agents with Indian financial, tax, and government APIs. Zero authentication required.

PyPI version License: MIT MCP Compatible CI Verified on MseeP MseeP.ai Security Assessment Badge

๐Ÿ“‘ Table of Contents


๐Ÿ“Œ Problem Statement

  • Fragmented API Landscape: AI agents lack a unified, standard interface to interact with scattered Indian financial, tax, and government systems.
  • Authentication Blockers: Traditional APIs require API keys, secrets, or paid subscriptions, making it impossible for autonomous agents to perform zero-setup operations.
  • Latency & Reliability Constraints: Calling remote third-party APIs for static/slow-moving datasets introduces unnecessary network delays and points of failure.
  • Data Freshness Burden: Manually maintaining local copies of critical validation datasets (like IFSC or HSN codes) is tedious and error-prone.

โœจ Key Features

  • Offline-First Architecture: Bundles compressed datasets for zero-latency lookups (IFSC, Pincodes, HSN/SAC). No API rate limits.
  • Zero Authentication: No API keys, secrets, or subscriptions required. All logic runs locally.
  • Background Auto-Updates: Non-blocking CDN fetching ensures your datasets never go stale without impacting request latency.
  • Comprehensive Coverage: 58 dedicated tools for identity validation (PAN, Aadhaar, GSTIN, TAN, PRAN), tax calculation (Income Tax, TDS, GST), savings calculators (EPF, PPF, SIP), and master data lookups.
  • Enterprise-Ready: Thread-pool accelerated bulk validation tools for processing large batches of vendor or customer data.

๐Ÿ› ๏ธ Tech Stack

LayerTechnology
ProtocolModel Context Protocol (MCP)
RuntimePython
DistributionPyPI / Smithery
HostingRender

๐Ÿ—๏ธ Architecture Diagram

Architecture High-level architecture of the MCP India Stack.


๐Ÿ› ๏ธ Tool Catalog

๐Ÿ” Lookup Tools

โœ… Validation Tools

๐Ÿ“ฑ Identity & Contact

โšก Bulk Operations

๐Ÿงฎ Tax & Financial Calculators (FY2025-26)

๐Ÿ’ฐ Savings & Investment Calculators

๐Ÿ  Real Estate

๐Ÿ’ผ HR & Payroll

๐Ÿฆ Banking & Payments

๐Ÿ” Account Aggregator (Offline)


๐Ÿ”„ Agent Workflows & Resources

Prompt Workflows (Overview)

Built-in prompt templates to guide AI agents through complex multi-step tasks:

  • vendor_kyc โ€” GSTIN, PAN, and IFSC verification sequence.
  • salary_planner โ€” Income, HRA, and optimized take-home salary planning.
  • invoice_audit โ€” Cross-referencing GSTINs, HSN codes, and applicable GST rates.

Server Resources (Overview)

Dynamic JSON resources provided directly to the LLM context:

  • india://status โ€” Version, DB connectivity, and runtime flags
  • india://changelog โ€” Structured changelog resource
  • india://schema/* โ€” JSON schemas for all tool outputs

๐Ÿ“ก Data Architecture & Freshness

This package bundles static datasets for offline-first workflows (approx. 10-11MB compressed footprint), covering IFSCs, Pincodes, HSN/SAC masters, and curated UPI handles.

An optional auto-update mechanism fetches the latest versions from the jsDelivr CDN in the background:

  • Non-blocking: Stale data triggers a background refresh; the current request immediately uses existing cached data to ensure zero latency.
  • Opt out: Set the MCP_INDIA_STACK_NO_AUTO_UPDATE=1 environment variable to disable all update checks.
  • Manual refresh: Run mcp-india-stack --refresh-all to synchronously refresh all datasets from the CDN.
  • Cache location: Platform-specific via platformdirs (e.g., ~/.cache/mcp-india-stack on Linux).

โš–๏ธ Legal & Attribution

See NOTICES for detailed dataset attribution, licensing details, and third-party acknowledgments.


๐Ÿง  Team

NameNAMESPACE UsernameRole
Rehanrehan1020Developer / Architect

๐Ÿ† Hackathon Track

Track: Work, Finance & Digital Economy


๐Ÿ”— Demo & Links


๐Ÿš€ Launch Notes

This repository is release-ready for GitHub launch with:

  • 0.4.2 package metadata and changelog coverage.
  • A complete MCP server-card under docs/.well-known/mcp/server-card.json.
  • Local setup and publishing steps in SETUP.md.
  • Contribution guidance and versioning policy in CONTRIBUTING.md.

Bug fixes in v0.4.2 (Round 2 โ€” Deep Code Audit)

  • Capital Gains: Asset-type-specific LTCG thresholds โ€” real estate 24mo, gold/debentures 36mo, crypto always 30% flat.
  • EPF/ESIC: Employee EPF correctly capped at โ‚น15K wage ceiling. Added voluntary_pf_on_actual for VPF.
  • HRA: Removed Bangalore/Hyderabad/Pune from metro cities. Only Delhi/Mumbai/Chennai/Kolkata get 50%.
  • Presumptive Tax: Full 7-slab new regime coverage with 87A rebate (was truncated at 3 slabs).
  • GST Late Fee: GSTR9 cap enforced (0.25% of turnover). Nil return rate corrected to โ‚น20/day.
  • Income Tax Interest: Section 234C uses cumulative paid vs required (not single-quarter).
  • Advance Tax: Installments show incremental installment_amount (not confusing cumulative).
  • Salary Restructuring: Removed obsolete โ‚น19,200 conveyance exemption. Standard deduction (โ‚น75K) shown.

Bug fixes in v0.4.1

  • Security: Masked Aadhaar number leakage in response fields.
  • Validation: Fixed mobile number over-counting digits issue.
  • Tax Rules: Corrected Presumptive Tax (44AD/44ADA) thresholds to FY25-26 rules.
  • Financial: Fixed Step-up SIP compounding return calculation.
  • Data: Added missing HSN codes (8517, 9401, 2523, 3004, 8708) with correct GST rates.
  • Professional Tax: Fixed annual total calculations based on correct monthly slabs.
  • Income Tax: Fixed 80D deduction cap for senior citizens.
  • ISIN: Fixed Luhn checksum multi-digit expansion logic.
  • EMI Calculator: Improved error responses to not leak fallback fields on invalid inputs.
  • Advance Tax: Added support for overriding internal computations with user-provided tax_liability.

Offline-First Guarantee: All tools in this package work without an internet connection. No API keys required. No data is sent to any external server. All datasets are bundled in the package at install time.