# payfast [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/jpbester/payfast-mcp  
**GitHub Stars:** 2  
**npm Downloads (last month):** 209  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/payfast

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

## Tools
Capabilities this server exposes over MCP:

- **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
- **creditcard_fetch** — Query card transaction

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "payfast": {
    "command": "npx",
    "args": ["-y","payfast-mcp"],
    "env": {
      "PAYFAST_MERCHANT_ID": "",
      "PAYFAST_MERCHANT_KEY": "",
      "PAYFAST_PASSPHRASE": "",
      "PAYFAST_ENVIRONMENT": ""
    }
  }
}
```

**Requires environment variables:** `PAYFAST_MERCHANT_ID`, `PAYFAST_MERCHANT_KEY`, `PAYFAST_PASSPHRASE`, `PAYFAST_ENVIRONMENT` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the payfast MCP server does

The payfast MCP server exposes selected PayFast merchant-account operations to AI assistants through the Model Context Protocol. It supports transaction lookups and history searches, charges against stored tokens, subscription administration, refunds, and credit-card transaction queries.

The server is intended for PayFast accounts in South Africa and can target either PayFast's sandbox or production environment. It provides a `ping` operation for checking API connectivity before attempting account actions.

## How it works

The payfast MCP server runs as a Node.js process and communicates with an MCP client over its configured local server command. The client sends tool calls, while the server uses the PayFast merchant credentials supplied through the process environment to access the account.

Operations are grouped by the PayFast resource they affect:

- Transactions can be fetched by ID, searched through history, or charged using a stored token.
- Subscriptions can be retrieved, paused, resumed, cancelled, updated, or charged on an ad-hoc basis.
- Refunds can be created and queried.
- Credit-card transaction details can be looked up.

High-risk actions require human approval before execution. These include pausing, cancelling, or changing subscriptions, making ad-hoc subscription charges, and creating refunds. Token charges and subscription resumption are listed as medium-risk operations.

## Setup and configuration

Install the package globally with npm or run it directly through `npx`:

```bash
npm install -g payfast-mcp
npx payfast-mcp
```

Node.js 18 or newer and a PayFast merchant account are required. Configure the server with `PAYFAST_MERCHANT_ID`, `PAYFAST_MERCHANT_KEY`, and `PAYFAST_PASSPHRASE`. `PAYFAST_ENVIRONMENT` is optional; set it to `sandbox` for testing or `production` for live use. If omitted, the server uses sandbox mode. A `.env` file in the working directory can also hold these values.

The README provides configuration examples for Claude Desktop, Claude Code, Cursor, and Codex. Each starts the package with `npx` and passes the PayFast variables through the client configuration.

## Tools and capabilities

Available tools include:

- `ping` for API connectivity checks.
- `transaction_fetch` and `transaction_history` for transaction retrieval.
- `transaction_charge` for charging a stored payment token.
- `subscription_fetch`, `subscription_pause`, `subscription_unpause`, `subscription_cancel`, and `subscription_update` for subscription administration.
- `subscription_adhoc` for an additional subscription charge.
- `refund_create` and `refund_fetch` for refund processing and status checks.
- `creditcard_fetch` for card transaction queries.

## Limitations and notes

The server requires valid PayFast merchant credentials and a PayFast account. Production use must be selected explicitly through `PAYFAST_ENVIRONMENT`; sandbox is the default. Credentials are supplied through environment variables rather than hard-coded configuration, and the project states that sensitive data is not logged.

Because several tools can alter payment or subscription state, client users should review approval prompts and confirm the target transaction, subscription, or refund before allowing execution. The project is released under the MIT license.

_Full upstream README: https://allmcps.com/mcp/payfast/readme_

