Payfast MCP Server

MCP server for PayFast — AI assistants interact with South Africa's payment gateway

Local serverstdio

What is the Payfast MCP server?

If you already use Payfast, the payfast mcp server is the piece that lets your assistant work with it directly. MCP server for PayFast — AI assistants interact with South Africa's payment gateway.

What the server does

High-risk operations require human approval before execution.

  • Transaction management — — fetch transaction details, query history, process tokenized charges
  • Subscription management — — fetch, pause, unpause, cancel, update, and ad-hoc charge subscriptions
  • Refund processing — — create refunds (full or partial) and query refund status
  • Credit card queries — — look up credit card transaction details
  • Sandbox support — — defaults to sandbox mode for safe testing
  • Secure by design — — credentials via environment variables only, sensitive data never logged

Installation

payfast-mcp on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • ping — Test API connectivity
  • transaction_fetch — Get transaction by ID
  • transaction_history — Query transaction history
  • transaction_charge — Charge a stored token
  • subscription_fetch — Get subscription details
  • subscription_pause — Pause a subscription
  • subscription_unpause — Resume a subscription
  • subscription_cancel — Cancel a subscription
  • subscription_update — Update subscription terms
  • subscription_adhoc — Ad-hoc subscription charge
  • refund_create — Process a refund
  • refund_fetch — Get refund details

Credentials and setup notes

Configuration is passed through the environment: PAYFAST_MERCHANT_ID, PAYFAST_MERCHANT_KEY, PAYFAST_PASSPHRASE, PAYFAST_ENVIRONMENT. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Payfast.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Where it fits

Plenty of payments and commerce servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Payfast's toolset — ping, transaction_fetch, transaction_history and 11 more — is a fair guide to whether it matches your workflow. It is maintained by jpbester; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
pingTest API connectivity
transaction_fetchGet transaction by ID
transaction_historyQuery transaction history
transaction_chargeCharge a stored token
subscription_fetchGet subscription details
subscription_pausePause a subscription
subscription_unpauseResume a subscription
subscription_cancelCancel a subscription
subscription_updateUpdate subscription terms
subscription_adhocAd-hoc subscription charge
refund_createProcess a refund
refund_fetchGet refund details
creditcard_fetchQuery card transaction
PrerequisitesThe Prerequisites tool exposed by this server.

How to install the Payfast MCP server

{
  "mcpServers": {
    "payfast": {
      "command": "npx",
      "args": ["-y", "payfast-mcp"],
      "env": {
        "PAYFAST_MERCHANT_ID": "your-merchant-id",
        "PAYFAST_MERCHANT_KEY": "your-merchant-key",
        "PAYFAST_PASSPHRASE": "your-passphrase",
        "PAYFAST_ENVIRONMENT": "sandbox"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
PAYFAST_MERCHANT_IDConfiguration value read at startup.Optional
PAYFAST_MERCHANT_KEYCredential the server authenticates with.Yes
PAYFAST_PASSPHRASEConfiguration value read at startup.Optional
PAYFAST_ENVIRONMENTConfiguration value read at startup.Optional

Example prompts to try

  • Use Payfast to ping.
  • Use Payfast to transaction fetch.
  • Use Payfast to transaction history.

Frequently asked questions

It connects Payfast to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (ping, transaction_fetch, transaction_history, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Payfast directly.