Payfast

io.github.jpbesterPublished by GitHub account jpbesterv1.0.1Updated Oct 24, 2026

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

VerifiedSTDIODesktop onlyFinanceBusiness & Commerce

Overview

AI-generated overview

Local MCP server that lets an AI assistant query and manage a PayFast merchant account: transactions, subscriptions, refunds and card lookups.

What you can do
  • Fetch transactions by ID and query transaction history, plus a connectivity ping
  • Charge a stored payment token and look up credit card transaction details
  • Fetch, pause, unpause, cancel and update subscriptions, and run ad-hoc subscription charges
  • Create full or partial refunds and query refund status
When to use it
Useful when you work with a PayFast merchant account and want an assistant to look up transactions, inspect subscriptions or prepare refunds and charges without leaving the chat. Start in sandbox mode to test before pointing it at production.
Requirements
Runs locally as an npm package (payfast-mcp) via npx, requiring Node.js 18 or newer. Needs a PayFast merchant account and the environment variables PAYFAST_MERCHANT_ID, PAYFAST_MERCHANT_KEY and PAYFAST_PASSPHRASE; PAYFAST_ENVIRONMENT selects sandbox (default) or production. Credentials can also come from a .env file. Desktop clients only.
Before you install
The server holds live merchant credentials (PAYFAST_MERCHANT_KEY, PAYFAST_PASSPHRASE) that can move real money. Several tools are marked high risk: pausing, cancelling or updating subscriptions, ad-hoc charges and refunds; the README says these require human approval, so verify that your client enforces it. Charging tokens and refunds spend or return funds, so keep PAYFAST_ENVIRONMENT on sandbox until you are confident.

Installation

In SourceWeft

  1. Open Payfast in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

payfast-mcp

A Model Context Protocol (MCP) server for PayFast, South Africa's leading payment gateway. Enables AI assistants like Claude to securely interact with your PayFast merchant account.

Features

  • 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

Available Tools

ToolDescriptionRisk
pingTest API connectivityLow
transaction_fetchGet transaction by IDLow
transaction_historyQuery transaction historyLow
transaction_chargeCharge a stored tokenMedium
subscription_fetchGet subscription detailsLow
subscription_pausePause a subscriptionHigh
subscription_unpauseResume a subscriptionMedium
subscription_cancelCancel a subscriptionHigh
subscription_updateUpdate subscription termsHigh
subscription_adhocAd-hoc subscription chargeHigh
refund_createProcess a refundHigh
refund_fetchGet refund detailsLow
creditcard_fetchQuery card transactionLow

High-risk operations require human approval before execution.

Quick Start

Prerequisites

Installation

bash
npm install -g payfast-mcp

Or run directly with npx:

bash
npx payfast-mcp

Configuration

Set the following environment variables:

VariableRequiredDescription
PAYFAST_MERCHANT_IDYesYour PayFast Merchant ID
PAYFAST_MERCHANT_KEYYesYour PayFast Merchant Key
PAYFAST_PASSPHRASEYesYour PayFast API Passphrase
PAYFAST_ENVIRONMENTNosandbox (default) or production

You can also create a .env file in your working directory.

Claude Desktop

Add to your Claude Desktop config (claude_desktop_config.json):

json
{  "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"      }    }  }}

Claude Code

Add to your Claude Code settings:

bash
claude mcp add payfast \  -e PAYFAST_MERCHANT_ID=your-merchant-id \  -e PAYFAST_MERCHANT_KEY=your-merchant-key \  -e PAYFAST_PASSPHRASE=your-passphrase \  -e PAYFAST_ENVIRONMENT=sandbox \  -- npx -y payfast-mcp

Cursor

Add to your Cursor MCP config (.cursor/mcp.json for project-level, or ~/.cursor/mcp.json for global):

json
{  "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"      }    }  }}

Codex

Add via the Codex CLI:

bash
codex mcp add payfast \  --env PAYFAST_MERCHANT_ID=your-merchant-id \  --env PAYFAST_MERCHANT_KEY=your-merchant-key \  --env PAYFAST_PASSPHRASE=your-passphrase \  --env PAYFAST_ENVIRONMENT=sandbox \  -- npx -y payfast-mcp

Or add directly to ~/.codex/config.toml:

toml
[mcp_servers.payfast]command = "npx"args = ["-y", "payfast-mcp"]
[mcp_servers.payfast.env]PAYFAST_MERCHANT_ID = "your-merchant-id"PAYFAST_MERCHANT_KEY = "your-merchant-key"PAYFAST_PASSPHRASE = "your-passphrase"PAYFAST_ENVIRONMENT = "sandbox"

Development

bash
# Clone the repogit clone https://github.com/jpbester/payfast-mcp.gitcd payfast-mcp
# Install dependenciesnpm install
# Buildnpm run build
# Run testsnpm test
# Run with MCP Inspectornpm run inspect

License

MIT

Source: README.md at commit df07739

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.0.1LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts