Skip to main content
Glama

upi-mcp

MCP server for UPI handle (VPA) verification. It exposes a single tool, upi_handle_verify, that checks whether a UPI ID is valid in format — validated entirely offline, no API key required.

What it does

A UPI ID (also called a VPA — Virtual Payment Address) has the shape:

localpart@server

for example name@paytm, user@yupi, me@oksbi. The grammar (UPI SDK / NPCI) is:

localpart : [a-zA-Z0-9._-]+     (letters, digits, dot, underscore, hyphen)
'@'
server    : [a-zA-Z]+           (letters only)

upi_handle_verify returns:

{ "valid": true, "validFormat": true, "upiId": "name@paytm" }

or, for a bad input:

{ "valid": false, "validFormat": false, "error": "Invalid UPI format. ..." }

Data source note — format validation only

There is no reliable, free, no-key way to check whether a UPI handle is actually active (i.e. linked to a real, verified bank account). Confirming liveness requires bank / RTP integration through a payment aggregator (penny-drop or VPA-resolution APIs — e.g. Razorpay, Cashfree, Digi KYC, API Express — all paid and business-KYC gated).

So this package validates format only. The active field is always undefined; if you need live-activation checks, wire in a paid aggregator and call it from lib/upi.js.

Related MCP server: gst-validator-mcp

Quick start

Requires Node.js 18+.

cd upi-mcp
npm install
npm start        # runs: node server.js
npm test         # runs: node scripts/test.mjs

MCP client configuration (stdio)

Add this to your MCP client config (e.g. claude_desktop_config.json or any MCP-compatible client):

{
  "mcpServers": {
    "upi": {
      "command": "node",
      "args": ["/absolute/path/to/india-mcp/upi-mcp/server.js"],
      "transportType": "stdio"
    }
  }
}

(On Windows, point args at the full path to server.js.)

Tool

upi_handle_verify

Verifies the format of a UPI ID.

Arguments

name

type

required

description

upi_id

string

yes

UPI ID / VPA to verify, e.g. name@paytm

Example

{
  "name": "upi_handle_verify",
  "arguments": { "upi_id": "name@paytm" }
}

Response

{ "valid": true, "validFormat": true, "upiId": "name@paytm" }

How validation works

verifyHandle() in lib/upi.js:

  1. Trims the input.

  2. Rejects empty / non-string input.

  3. Matches against /^[a-zA-Z0-9._-]+@[a-zA-Z]+$/.

  4. Confirms both the localpart and the server are non-empty.

It does not make any network call, so it is fast, free, and deterministic.

Project layout

upi-mcp/
├── lib/
│   └── upi.js        # verifyHandle() — offline format validation
├── scripts/
│   └── test.mjs      # test suite
├── server.js         # MCP server (ListTools + CallTool, stdio)
├── package.json
├── README.md
├── LICENSE
└── .gitignore

License

MIT. See LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      An offline-first MCP server for Indian financial, tax, and government APIs, providing tools for identity validation (PAN, Aadhaar, GSTIN), tax calculations (Income Tax, TDS, GST), and master data lookups (IFSC, Pincode, HSN/SAC) with zero authentication required.
      76
      88
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Validates Indian GSTIN numbers with structural checks, embedded PAN extraction, state-code lookup, and mod-36 check character validation, all via local compute.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to validate IBAN, BIC, EU VAT, GTIN/EAN/UPC, and ISBN codes offline through format and check-digit checks, and retrieve related metadata.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to validate Indian identifiers (GSTIN, PAN, Aadhaar format, IFSC) and look up pincodes, state/GST codes, Central Government holidays, and compliance due dates entirely offline. Every result is deterministic and carries its data source and freshness, while making clear that a well-formed number is not proof of registration.
      8
      34 npm
      MIT