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.

Available Tools

1 tool
upi_handle_verifyA

Verify a UPI handle (VPA - Virtual Payment Address) such as name@paytm. Checks the format (localpart@server). Use when a user asks to validate a UPI ID before sending a payment. NOTE: this confirms format only; there is no reliable free way to confirm a VPA is linked to a live account.

Inputs: upi_id (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 1 tool

    Disambiguation5/5

    There is only one tool, so there is no possibility of misselection or overlap. Its purpose (VPA format validation) is clearly stated and self-contained.

    Naming Consistency4/5

    The single name upi_handle_verify is snake_case and namespaced with a upi_ prefix, which is readable and predictable. With only one tool the pattern cannot be fully verified, and the noun-before-verb ordering is slightly unconventional.

    Tool Count2/5

    A server named upi-mcp exposing only a format validator is far too thin for the apparent payments domain. One narrow tool does not earn the scope implied by the server name.

    Completeness2/5

    The surface covers only syntax validation and explicitly cannot confirm whether a VPA is live or reachable. Core UPI workflows (payment initiation, status checks, account/ifsc-style lookups) are entirely absent, leaving agents at a dead end for anything beyond format checks.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    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
      38 PyPI
      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