npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@theyahia/jazzcash-mcp

v2.0.1

Published

MCP server for JazzCash — mobile wallet, mobile account, OTC vouchers, refunds (Pakistan)

Readme

jazzcash-mcp

MCP server for the JazzCash payment gateway (Pakistan). Exposes Mobile Wallet payments, CNIC-enabled Mobile Account payments, Over-The-Counter (OTC) vouchers, status inquiry, and refunds as MCP tools. Requests are signed with JazzCash's HMAC-SHA256 secure hash, and responses are hash-verified.

Tools (5)

| Tool | Type | Description | |------|------|-------------| | create_payment | write | Mobile Wallet (MWALLET) payment | | create_mobile_account_payment | write | CNIC-enabled Mobile Account payment (MWALLET) | | create_voucher | write | Over-The-Counter (OTC) voucher — returns a voucher number redeemed offline at an outlet | | check_payment_status | read | Transaction status inquiry (PaymentInquiry/Inquire) | | refund_payment | write, destructive | Refund a transaction (authorize/Refund; card transactions per JazzCash) |

Quick Start

{
  "mcpServers": {
    "jazzcash": {
      "command": "npx",
      "args": ["-y", "@theyahia/jazzcash-mcp"],
      "env": {
        "JAZZCASH_MERCHANT_ID": "<YOUR_MERCHANT_ID>",
        "JAZZCASH_PASSWORD": "<YOUR_PASSWORD>",
        "JAZZCASH_INTEGRITY_SALT": "<YOUR_SALT>",
        "JAZZCASH_ENV": "sandbox"
      }
    }
  }
}

Environment Variables

| Variable | Required | Default | Description | |----------|----------|---------|-------------| | JAZZCASH_MERCHANT_ID | Yes | — | Merchant ID from the JazzCash portal | | JAZZCASH_PASSWORD | Yes | — | Merchant password | | JAZZCASH_INTEGRITY_SALT | Yes | — | HMAC integrity salt (shared secret) | | JAZZCASH_ENV | No | sandbox | sandbox or production | | JAZZCASH_BASE_URL | No | — | Full base URL override (e.g. for staging); takes precedence over JAZZCASH_ENV |

The server fails fast at startup if the three required credentials are missing.

Amounts

All amount parameters are in PKR rupees (e.g. 5000 = 5000 PKR). The server converts to paisa (amount × 100, no decimal point) before signing, because JazzCash's pp_Amount is expressed in the lowest denomination. So 5000 is sent to JazzCash as pp_Amount=500000.

Sandbox vs Production

| Environment | Host | |-------------|------| | sandbox (default) | https://sandbox.jazzcash.com.pk/ApplicationAPI/API | | production | https://payments.jazzcash.com.pk/ApplicationAPI/API |

The default is sandbox for safety. Set JAZZCASH_ENV=production (or a full JAZZCASH_BASE_URL) to go live.

Verify endpoints against your merchant portal. JazzCash exposes the same operation under slightly different path/version conventions depending on the merchant-account generation, and the modern token-wallet endpoint differs from the documented Payment API. The endpoint paths in src/config.ts are best-evidence canonical values cross-checked against the official docs and multiple integrations; confirm the exact paths and whether pp_Version is expected against the per-merchant API URLs shown in your JazzCash merchant portal before transacting real money.

Security

  • Request signing — every request carries an HMAC-SHA256 pp_SecureHash (integrity salt as both the prepended prefix and the HMAC key; empty fields excluded; lowercase hex). Verified against the official worked test vector in the test suite.
  • Response verification — responses that include a pp_SecureHash are recomputed and compared (constant-time); a mismatch raises an error rather than returning unverified data.
  • No secret leakagepp_Password/pp_SecureHash are stripped from tool output, and upstream error bodies are never echoed back to the model (only redacted to stderr).

Demo Prompts

  • "Create a JazzCash payment of 5000 PKR to 03001234567"
  • "Check the status of transaction TXN-001"
  • "Refund 3000 PKR for transaction TXN-001"
  • "Create an OTC voucher for 2000 PKR for 03001234567 (CNIC 123456)"

Removed in 2.0 (and why)

2.0.0 removed three tools that targeted JazzCash endpoints which do not exist, verified against the official documentation and multiple independent integrations:

  • get_balance — JazzCash has no balance-inquiry API.
  • redeem_voucher — voucher redemption happens offline at a JazzCash outlet, not via a merchant API.
  • inquire_transaction — duplicated check_payment_status; both now use the canonical PaymentInquiry/Inquire.

Other breaking changes: create_mobile_account_payment now uses the real MWALLET transaction type (there is no MA type), create_voucher now issues an OTC voucher, amounts are in rupees (auto-converted to paisa), and txn_ref is optional (auto-generated when omitted). See CHANGELOG.md.

Development

npm install
npm run build   # tsc → dist/
npm test        # vitest (schema, hash test-vector, response verification, fetch mocking)
npm run dev     # run from source via tsx

License

MIT