MCP-India-Stack
MCP server for Indian APIs โ GSTIN, IFSC, PAN, UPI, pincode, HSN/SAC. Zero auth. Offline-first. For AI agents.
Documentation
๐ฎ๐ณ 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.
๐ Table of Contents
- Problem Statement
- Tech Stack
- Architecture Diagram
- Demo & Links
- Key Features
- Authenticity System
- Quick Start
- Tool Catalog
- Agent Workflows & Resources
- Data Architecture & Freshness
- Limitations
- Legal & Attribution
- Launch Notes
๐ Problem Statement
- Fragmented Access: Indian fintech, identity, and tax APIs are heavily siloed, requiring multiple disjointed integrations.
- High Barriers to Entry: Existing solutions are plagued by paid subscriptions, strict rate limits, and complex API key management.
- No Native AI Integration: There is no MCP-native standard designed specifically for autonomous AI agents to validate GSTIN, PAN, IFSC, or compute tax data.
- Latency & Reliability Issues: Depending on remote third-party APIs for static/slow-moving datasets introduces unnecessary network delays and potential points of failure for AI workflows.
๐ ๏ธ Tech Stack
| Layer | Technology |
|---|---|
| Protocol | MCP (FastMCP) |
| Runtime | Python |
| Distribution | PyPI / Smithery |
| Hosting | Render |
| Datasets | Offline-bundled (jsDelivr CDN sync) |
๐๏ธ Architecture Diagram
+-----------------------------------------------------------+
| MCP Clients |
| (Claude Desktop, Cursor, Custom Agent Frameworks) |
+-----------------------------+-----------------------------+
|
STDIO / SSE Protocol
|
+-----------------------------v-----------------------------+
| MCP India Stack |
| (FastMCP Server) |
+-----------------------------+-----------------------------+
|
+-----------------------+-----------------------+
| | |
+-----v-------------+ +------v------------+ +-------v-----+
| Pure Offline (71) | | Offline + CDN | | Market |
| Format Validators | | Refresh (5) | | Data (2) |
| Tax Calculators | | IFSC, HSN, Pin | | yfinance |
| Legal Reference | | Bundled Datasets | | Delayed |
+-------------------+ +-------------------+ +-------------+
MCP Client โ FastMCP Server โ 78 modular tool endpoints
๐ Links
- Deployment: docs/deployment.md
- PPT: https://gamma.app/docs/Problem-India-lacks-native-fintech-primitives-for-AI-agents-d1izzfemlvfvkf0?mode=doc
- GitHub: https://github.com/rehan1020/MCP-India-Stack
- PyPI: https://pypi.org/project/mcp-india-stack/
โจ 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: 80 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.
๐ก๏ธ Authenticity System
Every verifying tool states how strongly an identifier is attested through standard levels (A0 to A4) instead of a simplistic binary flag:
A0(Format & Checksum): Structural syntax and checksum algorithms pass offline (e.g. Luhn mod-36 for GSTIN, Verhoeff for Aadhaar).A1(Cross-Field Consistency): Cross-field rules pass offline (e.g. embedded PAN in GSTIN, ROC jurisdiction in CIN, RTO code in DL).A2(Authoritative Dataset Match): Record matched in a bundled authoritative dataset (e.g. RBI IFSC directory, India Post pincode list, NSDL ISIN list).A3(Cryptographic Artifact Verification): Digital signature on a supplied artifact verified offline (e.g. NIC e-invoice QR code, UIDAI offline XML).A4(Live Registry Attestation): Confirmed via an opt-in live registry provider.
Every response includes an additive authenticity object with verified checks, authority source, evaluation date, and explicit limitations (e.g. "active registration status not verified"). See docs/authenticity.md and docs/writing_a_provider.md for complete details.
๐ Quick Start
Installation
pip install mcp-india-stack
Claude Desktop Configuration
Add the following to your claude_desktop_config.json file to enable the India Stack in Claude Desktop:
Windows (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"mcp-india-stack": {
"command": "python",
"args": ["-m", "mcp_india_stack"]
}
}
}
macOS/Linux (~/Library/Application Support/Claude/claude_desktop_config.json or ~/.config/Claude/claude_desktop_config.json):
{
"mcpServers": {
"mcp-india-stack": {
"command": "python3",
"args": ["-m", "mcp_india_stack"]
}
}
}
๐ ๏ธ Tool Catalog
๐ Lookup Tools
lookup_ifscโ Bank branch details from IFSC codelookup_pincodeโ India pincode details and post officeslookup_hsn_codeโ HSN/SAC code lookup by code or keyworddecode_state_codeโ GST state code metadatalookup_bbps_billerโ BBPS biller directory lookuplookup_bankโ Basic bank master lookup by name or code
โ Validation Tools
validate_gstinโ GSTIN structure and checksumvalidate_panโ PAN format and entity type decodevalidate_upi_vpaโ UPI VPA structure and provider decodevalidate_aadhaarโ Aadhaar number with Verhoeff checksum (masked output)validate_voter_idโ Voter ID (EPIC) format with legacy detectionvalidate_driving_licenseโ DL format with state/RTO/year decodevalidate_passportโ Indian passport number formatvalidate_cinโ Company Identification Number with full field decodevalidate_dinโ Director Identification Number formatvalidate_fssaiโ FSSAI license number validation and decodevalidate_epf_codeโ EPF establishment code validatorvalidate_esic_codeโ ESIC employer code validatorvalidate_tanโ TAN validatorvalidate_pranโ PRAN validator for NPSvalidate_llpinโ LLPIN validatordecode_isinโ ISIN decoder with Luhn validationdecode_digilocker_uriโ DigiLocker URI decoder and validator mapperdecode_pan_typeโ Decode PAN entity type from the 4th characterverify_einvoice_qrโ Cryptographically verify NIC B2B e-invoice signed QR codes (A3 Authenticity)verify_aadhaar_offline_artifactโ Cryptographically verify UIDAI Paperless Offline e-KYC XML/ZIP (A3 Authenticity)
๐ฑ Identity & Contact
validate_mobile_numberโ Mobile number with operator/circle detection
โก Bulk Operations
bulk_validate_gstinโ Parallel GSTIN batch validationbulk_validate_panโ Parallel PAN batch validationbulk_validate_ifscโ Parallel IFSC batch validationbulk_validate_aadhaarโ Parallel Aadhaar batch validation
๐งฎ Tax & Financial Calculators (FY2025-26)
calculate_income_taxโ Old vs new regime comparison with surcharge, rebate, cesscalculate_tdsโ TDS rate lookup and computation for 15+ sectionscalculate_gstโ GST breakdown (CGST/SGST/IGST/cess) with HSN lookupcalculate_surchargeโ Surcharge and marginal relief calculatorcalculate_hra_exemptionโ HRA exemption calculator for salary planningcalculate_capital_gainsโ Capital gains with Section 54/54F exemptioncalculate_advance_taxโ Advance tax estimatorcalculate_gst_late_feeโ GST late filing penaltycalculate_income_tax_interestโ Sections 234A/B/C interestcalculate_presumptive_taxโ 44AD/44ADA presumptive taxget_regulatory_deadlinesโ Tax & regulatory compliance calendar
๐ฐ Savings & Investment Calculators
calculate_epf_esicโ EPF/ESIC contribution calculatorcalculate_emiโ Loan EMI with amortization schedulecalculate_gratuityโ Gratuity under Payment of Gratuity Actcalculate_ppf_maturityโ PPF maturity projectionscalculate_fd_maturityโ Fixed Deposit maturitycalculate_rd_maturityโ Recurring Deposit maturitycalculate_sip_returnsโ SIP returns with inflation adjustmentcalculate_step_up_sipโ Step-up SIP comparisoncalculate_nps_projectionโ NPS corpus and pensioncalculate_sukanya_samriddhiโ SSY and SCSS calculator
๐ Real Estate
calculate_home_vs_rentโ Buy vs rent financial comparisoncalculate_leave_encashment_taxโ Section 10(10AA) leave encashment
๐ผ HR & Payroll
calculate_professional_taxโ State-wise professional taxcalculate_salary_restructuringโ Tax-optimized salary restructuring
๐ฆ Banking & Payments
calculate_neft_rtgs_imps_chargesโ Transaction charges
๐ Stock Market
get_stock_quoteโ Fetch live/delayed Indian stock quotes and summaries (NSE/BSE) using yfinance.get_stock_historyโ Fetch historical end-of-day data for Indian stocks using yfinance.
โ๏ธ Legal Reference
decode_cnr_numberโ CNR (Case Number Record) decoder and validatorlookup_court_establishment_codeโ Court establishment code directory lookuplookup_ipc_sectionโ IPC section lookup with BNS crosswalklookup_bns_sectionโ BNS section lookup with IPC crosswalklookup_crpc_sectionโ CrPC section lookup with BNSS crosswalklookup_bnss_sectionโ BNSS section lookup with CrPC crosswalklookup_evidence_act_sectionโ Indian Evidence Act section lookuplookup_bsa_sectionโ BSA section lookup with IEA crosswalkdecode_ipc_bns_crosswalkโ Bidirectional IPCโBNS section crosswalkcalculate_limitation_deadlineโ Limitation Act 1963 deadline calculatorcalculate_court_feeโ State-wise court fee calculatorcalculate_stamp_dutyโ State-wise stamp duty and registration fee calculator
๐ RTI Toolkit
calculate_rti_feeโ RTI application fee calculator (central + state)calculate_rti_deadlineโ RTI response and appeal deadline calculatorcalculate_rti_penalty_estimateโ RTI penalty estimator (Section 20)draft_rti_applicationโ RTI application drafter (Section 6)draft_first_appealโ First appeal template generator (Section 19)draft_second_appealโ Second appeal template generator (Section 19)
๐ Account Aggregator (Offline)
build_aa_consent_requestโ AA consent request buildervalidate_aa_consent_artifactโ AA consent validatordecode_aa_fi_typeโ AA FI type decoder
๐ 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 flagsindia://changelogโ Structured changelog resourceindia://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.
All datasets are bundled directly within the package and checksum-verified at build time:
- Offline First: Zero runtime network calls for dataset queries. No external CDN dependency or cache shadowing.
- Deterministic: Data freshness is tied to package releases. To receive updated datasets, upgrade
mcp-india-stack. - Integrity: Bundled dataset integrity is verified against a build-time SHA-256 manifest.
โ ๏ธ Limitations
- Stateless Validation: GSTIN, Aadhaar, Voter ID, DL, Passport, CIN, and DIN validators check structural formatting and checksums only. They do not verify active registration status with government issuing authorities.
- Algorithmic Constraints: PAN validation is structural; the PAN check character logic is not publicly verifiable.
- Tax Estimates: All tax calculations are algorithmic estimates based on FY2025-26 rules. Actual liability may differ. Always consult a Chartered Accountant.
- Static Rates: HSN/SAC rates are static references and may vary based on specific conditions or new government notifications.
โ๏ธ Legal & Attribution
See NOTICES for detailed dataset attribution, licensing details, and third-party acknowledgments.
See LEGAL_NOTICE.md for important legal disclaimers including:
- No Government Affiliation โ This project is not affiliated with NIC, eCourts, MeitY, or any government body.
- Not Legal Advice โ All outputs (bare-act lookups, limitation calculations, court fee estimates, stamp duty estimates, RTI deadline/penalty calculations) are algorithmic estimates, not legal advice.
- Data Accuracy โ State-subject data (court fees, stamp duty) carries
as_of/last_verifiedfields and is not live-verified against issuing authorities. - Personal Data โ Identity validation (Aadhaar, PAN, etc.) is structural/checksum only. Users are responsible for DPDP Act compliance.
๐ Launch Notes
This repository is release-ready for GitHub launch with:
0.8.0package 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.
What's New in v0.8.0 โ Authenticity System (A0-A4), Signed Datasets & Cryptographic Verification
- Multi-Tier Authenticity System (8a): Every verifying tool outputs an additive
authenticityenvelope (A0toA4) enforcing rules R1โR6. - Signed Dataset Manifests (8b): Detached Ed25519 dataset verification, key ring with rotation/revocation, monotonic anti-rollback checks, and
--verify-dataCLI command. - Cryptographic Artifact Verification (8c): Signed NIC B2B e-invoice QR code verification and UIDAI secure offline XML/ZIP e-KYC attestation with XXE/bomb defense.
- Opt-In Registry Provider Interface (8d): Pluggable
BaseRegistryProvider(ABC)with entry points discovery,FixtureProvider, circuit breaker, rate limiting, and SSRF defense.
Previous Releases
- v0.6.0: Legal Reference (CNR decoder, court establishment lookup, bare-act section lookups for IPC/BNS/CrPC/BNSS/IEA/BSA, IPCโBNS crosswalk, limitation period calculator, court fee, stamp duty) and RTI Toolkit (fee calculator, deadline tracker, penalty estimator, templates). Added yfinance-based market data tools.
- v0.4.x: Deep statutory audit across capital gains thresholds, EPF wage ceilings, metro HRA rules, 7-slab presumptive tax, and GST late fee caps. See CHANGELOG.md for detailed history.
Offline-First Guarantee
The package classifies every tool under an authoritative network access attribute (none, optional, or required), surfaced programmatically in the india://status MCP resource (tools_network):
| Network Tier | Policy | Tool Count | Tools Included |
|---|---|---|---|
none (Network: None) | Pure offline execution. Zero network calls, zero external endpoints, no sockets opened. Computations, format checks, checksum algorithms, and tax rules execute entirely in-process using local logic. | 73 | validate_gstin, bulk_validate_gstin, validate_pan, bulk_validate_pan, decode_pan_type, validate_upi_vpa, decode_state_code, validate_aadhaar, bulk_validate_aadhaar, validate_voter_id, validate_driving_license, validate_passport, validate_cin, validate_din, validate_fssai, validate_tan, validate_mobile_number, validate_pran, validate_llpin, decode_isin, lookup_bank, lookup_bbps_biller, validate_epf_code, validate_esic_code, decode_digilocker_uri, verify_einvoice_qr, verify_aadhaar_offline_artifact, build_aa_consent_request, validate_aa_consent_artifact, decode_aa_fi_type, calculate_income_tax, calculate_tds, calculate_surcharge, calculate_hra_exemption, calculate_capital_gains, calculate_advance_tax, calculate_epf_esic, calculate_emi, calculate_gratuity, calculate_ppf_maturity, calculate_fd_maturity, calculate_rd_maturity, calculate_sip_returns, calculate_step_up_sip, calculate_nps_projection, calculate_sukanya_samriddhi, calculate_home_vs_rent, calculate_gst_late_fee, calculate_income_tax_interest, calculate_presumptive_tax, calculate_professional_tax, calculate_leave_encashment_tax, calculate_salary_restructuring, calculate_neft_rtgs_imps_charges, get_regulatory_deadlines, decode_cnr_number, lookup_court_establishment_code, lookup_ipc_section, lookup_bns_section, lookup_crpc_section, lookup_bnss_section, lookup_evidence_act_section, lookup_bsa_section, decode_ipc_bns_crosswalk, calculate_limitation_deadline, calculate_court_fee, calculate_stamp_duty, calculate_rti_fee, calculate_rti_deadline, calculate_rti_penalty_estimate, draft_rti_application, draft_first_appeal, draft_second_appeal |
optional (Network: Optional) | Datasets are bundled locally offline (IFSC master, postal pincodes, HSN/SAC master). When enabled, background non-blocking CDN refresh or optional live lookup enriches local data. If network is unavailable or blocked, falls back seamlessly to bundled local datasets without blocking or error. | 5 | lookup_ifsc, bulk_validate_ifsc, lookup_pincode, lookup_hsn_code, calculate_gst |
required (Network: Required) | Live financial market data feeds. Must reach market upstream endpoints (e.g. Yahoo Finance) to retrieve current quotes or historical prices. If network is blocked or unavailable, returns structured error envelopes without unhandled exceptions. | 2 | get_stock_quote, get_stock_history |
