Payfast

io.github.jpbester由 GitHub 帳號 jpbester 發布v1.0.1更新於 Oct 24, 2026

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

已驗證STDIO僅桌面金融商業與電商

概覽

AI 產生的概覽

本機 MCP 伺服器,讓 AI 助理查詢與管理 PayFast 商戶帳戶的交易、訂閱、退款與信用卡交易紀錄。

可以做什麼
  • 依 ID 取得交易詳情、查詢交易歷史,並測試 API 連線
  • 對已儲存的付款權杖發起扣款,並查詢信用卡交易詳情
  • 取得、暫停、恢復、取消與更新訂閱,以及進行訂閱臨時扣款
  • 建立全額或部分退款並查詢退款狀態
適用情境
當你使用 PayFast 商戶帳戶,希望助理在對話中直接查詢交易、檢視訂閱或準備退款與扣款時適用。建議先在沙箱模式測試,再切換到正式環境。
執行需求
以 npm 套件 payfast-mcp 透過 npx 在本機執行,需要 Node.js 18 以上版本。需要 PayFast 商戶帳戶,並設定環境變數 PAYFAST_MERCHANT_ID、PAYFAST_MERCHANT_KEY 與 PAYFAST_PASSPHRASE;PAYFAST_ENVIRONMENT 選擇 sandbox(預設)或 production。也可透過 .env 檔案提供憑證。僅支援桌面用戶端。
安裝前請注意
此伺服器持有真實商戶憑證(PAYFAST_MERCHANT_KEY、PAYFAST_PASSPHRASE),可動用真實資金。多個工具被標為高風險:暫停、取消或更新訂閱、臨時扣款與退款;README 稱這些操作需人工核准,請確認你的用戶端確實執行此限制。扣款與退款會實際收付資金,在確認無誤前請保持 PAYFAST_ENVIRONMENT 為 sandbox。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Payfast,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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

來源:README.md,提交 df07739

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分