Skip to main content

An MCP server giving AI agents access to Indian fintech utilities โ€” IFSC, PAN, GSTIN, pincodes, mutual fund NAV, UPI VPAs, and INR formatting.

Project description

๐Ÿ‡ฎ๐Ÿ‡ณ BharatPay MCP

An MCP server that gives any AI agent โ€” Claude Desktop, Cursor, Windsurf โ€” instant access to Indian fintech utilities. IFSC bank lookups, PAN/GSTIN validation with checksums, mutual fund NAVs, UPI VPA identification, pincode lookups, and Indian-style INR formatting. Seven tools. Zero auth. Zero cost. Designed to complement Razorpay's official MCP server โ€” they handle execution, BharatPay handles validation and lookups.

๐ŸŽฅ Demo coming soon ยท ๐Ÿ“ฆ Install: pip install -e . from source (PyPI publish in progress)


Why this exists

Razorpay shipped an official MCP server in early 2025 for executing payment operations โ€” creating orders, capturing payments, refunding. It's excellent.

But every Indian fintech project also needs a layer below that: validation and enrichment. Is this PAN's format correct? Does this GSTIN's mod-36 checksum verify? What bank does this IFSC code belong to? What's the PSP behind user@oksbi? What's today's NAV for Parag Parikh Flexi Cap?

Currently, an AI agent has to either hallucinate these answers or call seven different APIs with seven different auth schemes. BharatPay collapses all of it into a single MCP server an agent can install in 30 seconds.

Position-wise: BharatPay sits next to Razorpay's MCP, not in competition with it. They handle transactions; we handle validation. Use both together for a complete Indian-fintech AI stack.


Demo

Claude Desktop autonomously calling lookup_ifsc for an Indian bank lookup:

Tests Python License MCP

Claude calling bharatpay's lookup_ifsc tool


What's in the box

Tool Input What it returns
lookup_ifsc KKBK0000261 Bank, branch, address, MICR/SWIFT, supported rails (NEFT/RTGS/IMPS/UPI). Source: Razorpay's open IFSC API.
validate_pan AABCT3518Q Format check, entity type (Individual/Company/HUF/Trust/...) decoded from the 4th character.
validate_gstin 29AABCT1332L1ZS Format + mod-36 checksum verification, embedded state and PAN extraction.
lookup_pincode 302001 District, state, all post offices. Source: India Post API.
get_mutual_fund_nav parag parikh flexi cap or 122639 Latest NAV from AMFI's daily file. Fuzzy name search or exact code lookup. Cached for 6h.
validate_upi_vpa angelina@oksbi PSP identification (Google Pay/PhonePe/Paytm/...) and underlying bank from the handle suffix.
format_inr 100000 or 29500 (paise mode) โ‚น1,00,000 (Indian comma style) + word form (1 Lakh, 1.5 Crore, etc.).

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   AI Agent          โ”‚   MCP / stdio      โ”‚   BharatPay MCP      โ”‚
โ”‚   (Claude / Cursor) โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€> โ”‚   (this server)      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                      โ”‚
                          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                          โ”‚                           โ”‚                           โ”‚
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚  Pure-logic โ”‚         โ”‚   Live HTTP APIs   โ”‚        โ”‚   Cached file   โ”‚
                   โ”‚  validators โ”‚         โ”‚ (no auth, no cost) โ”‚        โ”‚   (refreshed 6h)โ”‚
                   โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค         โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค        โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
                   โ”‚ PAN         โ”‚         โ”‚ ifsc.razorpay.com  โ”‚        โ”‚ AMFI NAVAll.txt โ”‚
                   โ”‚ GSTIN+mod36 โ”‚         โ”‚ postalpincode.in   โ”‚        โ”‚ (~6 MB, ~30K    โ”‚
                   โ”‚ UPI VPA     โ”‚         โ”‚                    โ”‚        โ”‚  schemes)       โ”‚
                   โ”‚ INR format  โ”‚         โ”‚                    โ”‚        โ”‚                 โ”‚
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Design notes worth calling out:

  1. Validators are pure functions. PAN, GSTIN, UPI, and INR run entirely offline โ€” zero network, zero failures from API outages. The mod-36 GSTIN checksum is implemented from the GSTN spec (verified self-consistent: see tests/test_validators.py::test_gstin_checksum_self_consistent).
  2. Network tools are async. IFSC and pincode lookups use httpx.AsyncClient so the MCP server can handle parallel tool calls without blocking.
  3. AMFI data is cached, not re-fetched per call. A single 6 MB file covers all ~30,000 Indian mutual fund schemes; refreshing it on every NAV query would be wasteful and slow. Cache TTL: 6 hours.
  4. Tool descriptions are LLM-tuned. Each tool's docstring is written for the model to read โ€” explicit input formats, examples, and what it returns. This is what determines whether an agent successfully picks the right tool.
  5. No data leaves your machine for offline tools. PAN/GSTIN/UPI/INR validation never touches the network. Useful for compliance-sensitive contexts.

Install

Option 1: pip (recommended)

pip install bharatpay-mcp

Then add to ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or the Windows equivalent:

{
  "mcpServers": {
    "bharatpay": {
      "command": "python",
      "args": ["-m", "bharatpay_mcp"]
    }
  }
}

Restart Claude Desktop. Look for the ๐Ÿ”Œ icon โ€” bharatpay should be listed.

Option 2: From source

git clone https://github.com/angelina10504/bharatpay-mcp
cd bharatpay-mcp
pip install -e .

For Cursor

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "bharatpay": {
      "command": "python",
      "args": ["-m", "bharatpay_mcp"]
    }
  }
}

Try it

Once connected, try these prompts in Claude Desktop:

"Look up IFSC code KKBK0000261 and tell me what payment rails it supports."

"Is 29AAGCB7407Q1ZN a valid GSTIN? If so, what state is the entity registered in?"

"What's today's NAV for Parag Parikh Flexi Cap regular growth?"

"My friend's UPI ID is priya@oksbi โ€” which app does she use?"

"Format โ‚น12,00,000 in Indian style and tell me what it would be in paise."

The agent will autonomously pick the right tool. You'll see the tool call and its structured JSON response inline.

Tests

pip install -e ".[dev]"
pytest tests/ -v

17 unit tests cover all offline validators including a self-consistency test for the GSTIN mod-36 checksum.

What's next (V2)

  • validate_aadhaar(number) โ€” Verhoeff checksum (offline, no UIDAI API needed)
  • get_holiday_calendar() โ€” RBI bank holidays (settlement-day awareness)
  • stock_quote(symbol) โ€” NSE/BSE live quotes for RELIANCE.NS-style tickers
  • tax_slab_calculator(income, regime) โ€” Old vs new regime estimation
  • Bundle as npx @bharatpay/mcp for zero-install distribution

Open an issue on GitHub if you want any of these prioritized.

A note on "AI-first India"

When Razorpay launched their MCP server, they framed it as "designed for an AI-first world." That framing is right โ€” but transactions are only half the picture. Half the engineering effort in any Indian fintech goes into validation, enrichment, and lookups that an AI agent can't reliably hallucinate. That's the gap BharatPay fills.

If you're building AI tools for Indian fintech and you find a utility missing, open an issue or send a PR.

License

MIT โ€” see LICENSE. All upstream APIs (Razorpay IFSC, India Post, AMFI) are themselves free and publicly available under their respective terms.


Built by Angelina Gupta ยท April 2026 ยท For the Razorpay AI Engineer application

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bharatpay_mcp-0.1.0.tar.gz (354.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bharatpay_mcp-0.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file bharatpay_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: bharatpay_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 354.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for bharatpay_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e7caa4283314d8466366d088d1f90c3a586f0ebad2e65b19865f50fdba9a59f2
MD5 1a5f1dfbbde1f5d381457ca2bcaf0c45
BLAKE2b-256 7e73e4002a1e21c90ee9151bd2d55a52f8a7ab8b91bd86826c841f1afbbb3d65

See more details on using hashes here.

File details

Details for the file bharatpay_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bharatpay_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for bharatpay_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5c9b4725c2ebe292564e1e45585dec5db03c2ddad928d319e5c46073df7a62f
MD5 e95e3c169acd2f1350995830f3d9f72b
BLAKE2b-256 01eaf48af637bb1b28381a759b786b37418f5d7bf213b73d4ff33432f2119d55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page