Skip to main content
Glama

khqrpay-mcp

A local MCP server for KHQRPay, the KHQR payment gateway and API for Cambodia. It lets an AI coding tool create and check KHQR test payments, read payments, show your plan's usage and check webhook signatures while it builds your integration. It runs on your own machine, with your own key.

What it can do

Tool

What it does

Key

create_test_payment

Creates a test payment: a KHQR no bank will pay, with a hosted checkout page

Test only

simulate_test_payment

Moves a test payment to scanned, paid, expired or failed; your test webhook endpoints get the events

Test only

get_payment

Reads one payment: status, amounts, expiry, whether it was paid late

Test, or live with opt-in

list_payments

Lists payments, newest first, a page at a time

Test, or live with opt-in

get_usage

Shows your plan's paid transactions used and left

Test, or live with opt-in

check_webhook_signature

Checks an X-KHQRPay-Signature header against a raw body, and says why it fails

Runs locally

Related MCP server: @moncashconnect/mcp

Safe by default

  • Test keys do everything. Use a kp_test_ key: test payments never reach a bank and never count toward your plan.

  • Live keys never create or change anything. With a kp_live_ key, create_test_payment and simulate_test_payment refuse, and the read tools work only if you set KHQRPAY_MCP_LIVE_READS=1.

  • Secrets stay in the environment. Keys are read from environment variables and never printed. The webhook signing secret is never a tool argument, and check_webhook_signature never shows the right signature.

  • No polling. Reads count toward your account's daily read allowance, so the read tools tell the model to read once, not in a loop. Your own app should follow payments with webhooks.

Set up

You need Node.js 18 or newer and a test key from the KHQRPay dashboard (API keys, with the page set to Test).

Claude Code

claude mcp add khqrpay -e KHQRPAY_SECRET_KEY=kp_test_… -- npx -y khqrpay-mcp

Claude Desktop, Cursor and other clients that read an mcpServers file (claude_desktop_config.json, .cursor/mcp.json):

{
  "mcpServers": {
    "khqrpay": {
      "command": "npx",
      "args": ["-y", "khqrpay-mcp"],
      "env": { "KHQRPAY_SECRET_KEY": "kp_test_…" }
    }
  }
}

Add "KHQRPAY_WEBHOOK_SECRET": "whsec_…" to env to use check_webhook_signature with your test endpoint's signing secret.

Environment

Variable

What it's for

KHQRPAY_SECRET_KEY

Your KHQRPay key. kp_test_ for every tool; kp_live_ for the read tools only, with the next variable

KHQRPAY_MCP_LIVE_READS

Set to 1 to let a live key read payments and usage. Nothing ever creates or changes live payments

KHQRPAY_WEBHOOK_SECRET

A webhook endpoint's signing secret, for check_webhook_signature

KHQRPAY_API_BASE

Another KHQRPay address, for testing. Must be https, or http on localhost

Learn more

License

MIT

Available Tools

6 tools
check_webhook_signatureCheck a webhook signatureA
Read-only

Checks an X-KHQRPay-Signature header against a webhook's raw body, with the signing secret from this server's KHQRPAY_WEBHOOK_SECRET (the secret is never an argument and never shown). Says why a check fails: a malformed header, a timestamp more than 5 minutes off, or a mismatch. Runs on this machine; nothing is sent anywhere.

Inputs: raw_body (required), signature_header (required).

create_test_paymentCreate a test paymentA

Creates a KHQRPay test payment: a KHQR that no bank will pay, with a hosted checkout page. Only with a kp_test_ key: this server never creates live payments. Returns the payment, including checkout_url and expires_at. Move it with simulate_test_payment; the store's test webhook endpoints get the events.

Inputs: amount (required), currency, metadata, reference_id.

get_paymentGet a paymentA
Read-only

Reads one payment by its id: status (pending, scanned, paid, expired or failed), amounts, expiry, and whether it was paid late. Each call counts toward the account's daily read allowance, so read when you need the answer and never poll in a loop; application code should follow payments with webhooks.

Inputs: id (required).

get_usageGet plan usageA
Read-only

Shows the account's plan, its paid transactions used and left this period, and when the period ends. Only paid live payments count; test payments never do.

Inputs: no named parameters.

list_paymentsList paymentsA
Read-only

Lists the store's payments in the key's mode, newest first, one page at a time; each leaves out metadata, which get_payment returns. Each call counts toward the account's daily read allowance, so read when you need the answer and never poll in a loop; application code should follow payments with webhooks.

Inputs: limit, cursor, status.

simulate_test_paymentSimulate a test paymentA
Idempotent

Moves a test payment to scanned, paid, expired or failed, as if the customer and the bank had acted, and the store's test webhook endpoints get the matching event. Test payments only. To try a late payment, simulate expired and then paid. A status the payment can't move to changes nothing.

Inputs: id (required), status (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: usage/limits (get_usage), creation (create_test_payment), state transition (simulate_test_payment), single read (get_payment), bulk read (list_payments), and webhook verification (check_webhook_signature). The only near-neighbors, get_payment vs list_payments and create_test_payment vs simulate_test_payment, are explicitly differentiated by 'one payment' vs 'one page' and 'create' vs 'move' language.

    Naming Consistency5/5

    All six tools follow a uniform snake_case verb_noun pattern (get_, create_, simulate_, list_, check_). The shared test_payment suffix groups related tools rather than creating inconsistency.

    Tool Count5/5

    Six tools is well-scoped for a test-only payment API: usage, create, simulate, get, list, and signature check each cover a distinct step with no filler. Nothing feels padded or missing at the count level.

    Completeness4/5

    The test-payment lifecycle is closed: create -> simulate (including expired-then-paid for late payments) -> get/list -> verify webhook signature, plus account usage. Minor gaps remain: no refund/cancel operation, no webhook endpoint registration or event listing, and live payments are excluded by design.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI coding assistants to interact with MonCashConnect payment data read-only, including checking balances, listing transactions, and viewing payment details, without moving money.
      5 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides AI assistants with read and safe-write access to Alternative Payments customers, invoices, payment requests, transactions, payouts, and webhooks without directly moving money.
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to inspect BLMPay balances, payments, payouts, webhooks, and API capabilities through MCP tools, with write/financial tools disabled by default for security.
      MIT