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 分