Model Context Protocol server

zen-mcp

Lets an AI assistant work with the ZEN.com Payment Gateway: create hosted payment links, look up transactions, issue refunds, send payouts and pull reconciliation reports.

MIT licensed Node 18+ stdio transport 14 tools

Unofficial project

Not affiliated with, endorsed by, or maintained by ZEN.com. The name refers to the API it talks to, nothing more.

It was built from public documentation without access to a live merchant account. Verify endpoint versions, field shapes and signing behaviour against ZEN's current OpenAPI or Postman collection before you point it at real money.

Install

Claude Code

claude mcp add zen \
  --env ZEN_API_KEY=your_terminal_api_key \
  -- npx -y @krystiangw/zen-mcp

Claude Desktop

{
  "mcpServers": {
    "zen": {
      "command": "npx",
      "args": ["-y", "@krystiangw/zen-mcp"],
      "env": {
        "ZEN_API_KEY": "your_terminal_api_key",
        "ZEN_PAYWALL_SECRET": "your_paywall_secret",
        "ZEN_IPN_SECRET": "your_ipn_secret",
        "ZEN_ENV": "sandbox"
      }
    }
  }
}

Try it without an account

Mock mode answers every API-backed tool with deterministic canned data and never touches the network, so you can walk the whole surface before signing up for anything.

ZEN_MOCK=1 ZEN_IPN_SECRET=demo npx -y @krystiangw/zen-mcp

The dummy IPN secret is there because verify_webhook_signature does real cryptography rather than calling the API, so it needs a secret even in mock mode. Any value works for a demo.

Where the key comes from

In the ZEN merchant panel: my.zen.com → Shop settings → Terminal.

Start on sandbox. The default host is api.zen-test.com, though sandbox availability and onboarding requirements are worth confirming with ZEN directly.

No merchant account yet? You can open a ZEN business account. That is a referral link: it credits the author of this project if you sign up through it, and costs you nothing. Every other link here is a plain one.

Tools

NameKindWhat it does
list_payment_methodsreadPayment methods available to the terminal
get_transactionreadOne transaction, by ZEN id or your own merchant id
list_payment_linksreadHosted payment links
get_payment_linkreadA single hosted payment link
get_payoutreadOne payout, by ZEN id
download_reportreadTransaction and settlement reports for reconciliation
list_supported_currenciesreadDocumented supported currencies
verify_webhook_signaturereadChecks an IPN signature locally, no network call
create_payment_linkwriteHosted checkout link and QR code, no card data involved
create_customerwriteCustomer record, groundwork for recurring payments
capture_transactiondestructiveCaptures an authorised transaction
cancel_transactiondestructiveCancels a transaction
refund_transactiondestructiveFull or partial refund
create_payoutdestructiveSends money out. The most sensitive tool here.

How it handles money

Anything that moves or reverses money carries the destructive hint, so MCP clients can hold it behind a confirmation instead of letting a model fire it off mid-sentence. Read tools are marked read-only and stay that way.

Payment acceptance goes through ZEN-hosted links, which means card numbers never pass through this server and there is no PCI surface to inherit. Raw card charges are deliberately left out of the MVP rather than bolted on.

Secrets are read from environment variables only. They are never tool arguments, so they cannot end up in a transcript, a log line, or a model's context by accident.

The request signing algorithm follows public documentation, but nested-object and array flattening are not fully specified there. That part is isolated in one module, covered by tests, and flagged for verification against the live API.

Configuration

  • ZEN_API_KEY
    Terminal API key. Required outside mock mode.
  • ZEN_PAYWALL_SECRET
    Signs request bodies. Required for writes.
  • ZEN_IPN_SECRET
    Webhook verification only.
  • ZEN_ENV
    sandbox (default) or production.
  • ZEN_BASE_URL
    Overrides the host. Wins over ZEN_ENV.
  • ZEN_MOCK
    1 for offline canned responses.
  • ZEN_HASH_ALG
    sha224, sha256 (default), sha384, sha512.

Scope

ZEN publishes an official API for the Payment Gateway only. The consumer side, meaning cashback, Reward Zone, personal cards and accounts, has no public API, so it is out of scope here rather than approximated by scraping something fragile.

Still on the list: raw card charges once there is a deliberate PCI design behind them, recurring and one-click payments after the tokenisation flow has been verified against a live account, and a remote Streamable HTTP transport with OAuth after the stdio version has proven itself.

Source

TypeScript, validated with Zod, tested with Vitest against an in-memory MCP transport.

Read the code on GitHub