Skip to main content
Glama
TehreemArbab

mcp-jazzcash

by TehreemArbab

mcp-jazzcash

npm version License: MIT Node MCP Status

An open-source Model Context Protocol server for JazzCash — Pakistan's largest mobile-money platform. Plug it into Claude Desktop, Cursor, Cline, or any MCP-aware agent and let it create checkouts, charge mobile wallets, look up transactions, and issue refunds against the JazzCash REST API.

Sandbox-by-default. Bring your own merchant credentials. No secrets bundled.


Table of contents


Related MCP server: Juspay MCP Tools

Why this exists

The Pakistani payments stack is fragmented and English-language documentation for AI agents is thin. This MCP gives any agent a stable, typed interface to JazzCash so you don't have to teach it the signature scheme, field names, and gotchas every time. Prompt your agent in plain English; let the server do the cryptography and HTTP.

Tools

Tool

Purpose

jazzcash_create_hosted_checkout

Builds a signed Hosted Checkout (Page Redirection) form. Returns the action URL, hidden fields, and a ready-to-use HTML snippet your app can serve.

jazzcash_charge_mobile_wallet

Server-to-server MWALLET charge. Customer authorizes via MPIN on their phone.

jazzcash_inquire_transaction

Status lookup by pp_TxnRefNo.

jazzcash_refund_transaction

Full or partial refund (requires merchant role).

jazzcash_environment_info

Reports active environment, endpoint URLs, and which credentials are present. Never returns secrets.

All amounts are passed as PKR paisa (rupees × 100) to avoid float rounding.

Quick start

git clone https://github.com/TehreemArbab/JazzCashMCP.git
cd JazzCashMCP
npm install
cp .env.example .env       # then edit .env with your sandbox credentials
npm run build
npm start

The server speaks MCP over stdio, so npm start is most useful when launched by an MCP client (see below). To verify the build alone:

npm run typecheck

Configuration

Copy .env.example to .env and fill in credentials from your JazzCash merchant portal:

JAZZCASH_MERCHANT_ID=MC...
JAZZCASH_PASSWORD=...
JAZZCASH_INTEGRITY_SALT=...
JAZZCASH_ENV=sandbox
JAZZCASH_RETURN_URL=https://yourapp.example.com/jazzcash/callback

Sandbox credentials are issued at https://sandbox.jazzcash.com.pk. To go live, switch JAZZCASH_ENV=production and swap in your live merchant credentials — no code changes required.

Variable

Required

Notes

JAZZCASH_MERCHANT_ID

yes

From the merchant portal.

JAZZCASH_PASSWORD

yes

API password, not your portal login.

JAZZCASH_INTEGRITY_SALT

yes

HMAC key for pp_SecureHash.

JAZZCASH_ENV

yes

sandbox or production.

JAZZCASH_RETURN_URL

only for hosted checkout

Where JazzCash redirects the customer post-payment.

JAZZCASH_LANGUAGE

no

Default EN.

JAZZCASH_CURRENCY

no

Default PKR.

JAZZCASH_VERSION

no

Default 1.1.

JAZZCASH_*_URL

no

Per-endpoint URL override; see Endpoint overrides.

Wire it into Claude Desktop

Add this to claude_desktop_config.json:

{
  "mcpServers": {
    "jazzcash": {
      "command": "node",
      "args": ["C:/path/to/mcp-jazzcash/dist/index.js"],
      "env": {
        "JAZZCASH_MERCHANT_ID": "MC...",
        "JAZZCASH_PASSWORD": "...",
        "JAZZCASH_INTEGRITY_SALT": "...",
        "JAZZCASH_ENV": "sandbox",
        "JAZZCASH_RETURN_URL": "https://yourapp.example.com/jazzcash/callback"
      }
    }
  }
}

Restart Claude Desktop, then try:

"Using the JazzCash MCP, create a hosted checkout for PKR 1500 with description 'Order #1023' and bill reference 'INV1023'."

Claude will call jazzcash_create_hosted_checkout and hand back the form HTML.

Use it from any MCP client

The server uses stdio transport, so it works with anything that speaks MCP — Cursor, Cline, Continue, Zed, and custom agents built on the MCP TypeScript SDK. Point the client at node /path/to/dist/index.js and pass the same env vars shown above.

How the signature works

JazzCash uses HMAC-SHA256 over alphabetically sorted, non-empty pp_* fields, joined with &, with the merchant's Integrity Salt as both the HMAC key and a prepended salt:

message = integritySalt + "&" + sortedField1Value + "&" + sortedField2Value + ...
hash    = hex(HMAC_SHA256(key=integritySalt, message))

pp_SecureHash itself is excluded from the message. Empty values are skipped. The implementation lives in src/signature.ts — small enough to audit in 30 seconds.

Endpoint overrides

Default endpoint URLs ship for both sandbox and production. If JazzCash rotates a path, override the relevant variable without changing code:

JAZZCASH_HOSTED_CHECKOUT_URL=https://sandbox.jazzcash.com.pk/.../HostedCheckout
JAZZCASH_MOBILE_WALLET_URL=https://sandbox.jazzcash.com.pk/.../DoMWalletTransaction
JAZZCASH_INQUIRY_URL=https://sandbox.jazzcash.com.pk/.../StatusInquiry
JAZZCASH_REFUND_URL=https://sandbox.jazzcash.com.pk/.../DoRefundTransaction

Security model

  • No bundled secrets. Credentials are read from environment variables only.

  • No secrets in tool output. jazzcash_environment_info returns only booleans for which credentials are configured.

  • Sandbox is the default. Production requires explicitly setting JAZZCASH_ENV=production.

  • Stdio transport. The server has no network listener; it talks only to the parent MCP client process.

  • Audit-friendly. Signature logic is isolated in one short file. No vendored crypto.

If you find a security issue, please open a private advisory on GitHub rather than a public issue.

Roadmap

  • Card / Tokenization tools (Authorize, Capture, Retrieve/Delete Token)

  • IPN webhook signature-verification helper

  • Voucher / OTC payment flow

  • CLI (mcp-jazzcash inspect) for hash debugging

  • Published npm package + automated releases

Contributing

Issues and PRs welcome. A few ground rules:

  • Don't paste real merchant credentials into bug reports — use the placeholder JAZZCASH_* names.

  • Keep new tools framework-agnostic; the server should remain usable from any MCP client.

  • Run npm run typecheck before opening a PR.

License

MIT. Not affiliated with or endorsed by JazzCash, Mobilink Microfinance Bank, or VEON.

Available Tools

5 tools
jazzcash_charge_mobile_walletCharge JazzCash Mobile Wallet (MWALLET)C

Server-to-server charge against a JazzCash mobile wallet. Customer authorizes via MPIN on their phone. Amount is in PKR paisa.

ParametersJSON Schema
NameRequiredDescriptionDefault
amount_paisaYes
descriptionYes
bill_referenceYes
mobile_numberYes
cnicYes
txn_ref_noNo
ppmpf_1No
ppmpf_2No
ppmpf_3No
ppmpf_4No
ppmpf_5No

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description must convey behavioral traits. It mentions MPIN authorization but omits side effects, idempotency, error behaviors, or asynchronous nature. Minimal disclosure for a financial transaction tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short, direct sentences with no redundant information. However, conciseness sacrifices completeness, as key details are omitted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 11 parameters, no output schema, and no annotations, the description is insufficient. It covers only the amount unit and authorization mechanism, ignoring the purpose of other required fields, response structure, and potential error cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must explain parameters. Only 'amount_paisa' is clarified (PKR paisa). The other 10 parameters (including required fields like cnic and bill_reference) are left unexplained beyond schema patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it's a server-to-server charge against a JazzCash mobile wallet, with authorization via MPIN. It differentiates from siblings (e.g., create hosted checkout, refund) by name and core action, though no explicit differentiation is provided.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives. No prerequisites, exclusions, or context are provided, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

jazzcash_create_hosted_checkoutCreate JazzCash Hosted CheckoutA

Build a signed Hosted Checkout (Page Redirection) form that redirects the customer to JazzCash to pay. Returns the action URL, hidden fields, and a ready-to-use HTML form snippet. Amount is in PKR paisa (rupees * 100).

ParametersJSON Schema
NameRequiredDescriptionDefault
amount_paisaYesAmount in PKR paisa (rupees * 100).
descriptionYes
bill_referenceYes
txn_ref_noNoDefaults to T + yyyymmddhhmmss.
return_urlNo
ppmpf_1No
ppmpf_2No
ppmpf_3No
ppmpf_4No
ppmpf_5No

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool returns a form and that amount is in paisa, but it does not describe side effects, idempotency, or authentication requirements. Some behavioral context is given but insufficient for a 4.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core action, and contains no redundant phrases. Every sentence contributes to understanding the tool's purpose and key detail (paisa conversion).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 10 parameters and no output schema, the description is incomplete. It does not describe the return structure beyond mentioning action URL and hidden fields, nor does it cover potential errors, required configuration, or consequences of invoking the tool. The tool's complexity demands more context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 20%, with only two parameters having descriptions. The description adds that amount is in PKR paisa (already in schema) and that txn_ref_no defaults to T+timestamp (beyond schema), but does not explain the ppmpf_1-5 fields or return_url. The description adds minimal value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool builds a signed Hosted Checkout form that redirects the customer to JazzCash to pay, and returns action URL and HTML snippet. This verb+resource combination uniquely identifies the tool among siblings like charge mobile wallet or inquire transaction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for checkout scenarios but does not explicitly state when to use it versus alternatives, nor does it mention when not to use it. No comparison to sibling tools or prerequisites are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

jazzcash_environment_infoShow current JazzCash environmentA

Returns the active environment (sandbox/production), endpoint URLs in use, and whether credentials are configured. Does not return secrets.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description explicitly states it does not return secrets, addressing a key safety concern. Although no annotations exist, the read-only nature is implicit; additional detail on idempotency would push to 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise, front-loaded sentences covering all essential aspects without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters and no output schema, the description fully covers what the tool returns and its behavior. No gaps or missing information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters, the baseline is 4 per rules. The description adds no parameter details, which is acceptable since schema coverage is 100%.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description specifies a clear verb ('Returns') and resource ('active environment, endpoint URLs, credentials status'). It distinctly sets the tool apart from siblings which involve transactions, payments, and refunds.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The tool's purpose as a status checker is unambiguous; no alternative tools provide environment info. Context signals confirm zero parameters, so usage is straightforward.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

jazzcash_inquire_transactionInquire JazzCash transaction statusB

Look up the current status of a JazzCash transaction by its pp_TxnRefNo.

ParametersJSON Schema
NameRequiredDescriptionDefault
txn_ref_noYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. The description lacks details on side effects, error behavior (e.g., if transaction not found), latency, or whether it is read-only. Minimal transparency beyond the core action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with the action and key parameter. No superfluous words. However, it could be slightly expanded to include return value information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple lookup with one parameter, the description covers the basic purpose. However, it lacks description of the return value (expected status) and error handling, especially given no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description mentions 'pp_TxnRefNo' but does not explain its format, constraints, or relationship to the JazzCash system. The parameter's purpose is only inferred from the tool's name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('look up'), the resource ('status of a JazzCash transaction'), and the key identifier ('by its pp_TxnRefNo'). It distinguishes this tool from siblings like jazzcash_refund_transaction or jazzcash_charge_mobile_wallet.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives, no prerequisites, and no conditions mentioned. The description only states the basic lookup action without context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

jazzcash_refund_transactionRefund a JazzCash transactionB

Issue a full or partial refund against a previously settled JazzCash transaction. Requires the merchant account to have refund permissions enabled.

ParametersJSON Schema
NameRequiredDescriptionDefault
txn_ref_noYes
amount_paisaYes
descriptionYes

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility. It identifies a write operation (refund) and a permission requirement, but does not disclose failure modes, idempotency, rate limits, or return behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core action, and free of fluff. However, it could be slightly more structured by listing the parameters or conditions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Without an output schema or annotations, the description must cover prerequisites, behavior, and results. It mentions permissions but omits error handling, success response, and fails to describe the three required parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and no parameter descriptions in the text, the agent receives no explanation for txn_ref_no, amount_paisa, or description. The description's mention of 'full or partial refund' loosely connects to amount but does not clarify units or identifiers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool issues a refund, specifies it can be full or partial, and targets previously settled JazzCash transactions. This distinguishes it from sibling tools like charge, checkout, or inquiry.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides context (settled transaction) and a prerequisite (refund permissions enabled), but lacks explicit guidance on when not to use or alternatives. The agent can infer usage, but no exclusions are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 5 tool updatesv0.1.0
    • First observedjazzcash_charge_mobile_wallet
    • First observedjazzcash_create_hosted_checkout
    • First observedjazzcash_environment_info
    • First observedjazzcash_inquire_transaction
    • First observedjazzcash_refund_transaction

TDQS

A3.5/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct operation: charging mobile wallet, creating hosted checkout, environment info, inquiring transactions, and refunding. No overlap in functionality.

Naming Consistency4/5

All names use snake_case with a consistent 'jazzcash_' prefix. Most follow a verb_noun pattern (charge_mobile_wallet, create_hosted_checkout, inquire_transaction, refund_transaction), though 'environment_info' is noun_noun, which is a minor deviation.

Tool Count5/5

Five tools cover the core operations for a payment gateway integration: charge, checkout, inquiry, refund, and environment check. This is well-scoped for the stated domain.

Completeness4/5

The tool surface covers essential payment lifecycle operations: creating charges, checkout flows, status inquiry, and refunds. Missing features like void/cancel or webhook verification are minor gaps for a basic integration.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables AI agents to interact with multiple payment providers (Stripe, Paystack) through a unified API. Supports payment initialization, verification, refunds, customer management, and invoicing without requiring knowledge of specific provider implementations.
    2
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to interact with Juspay's payment processing APIs and merchant dashboard for managing orders, transactions, refunds, customers, gateways, and reporting through natural language.
    21
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to access Magpie Payment Platform APIs for processing payments, creating checkout sessions, sending invoices, and managing payment links through natural conversation.
    46
    1
    MIT