npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

payfast-mcp

v1.0.1

Published

Model Context Protocol (MCP) server for PayFast — enables AI assistants to interact with South Africa's leading payment gateway

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

| Tool | Description | Risk | |------|-------------|------| | ping | Test API connectivity | Low | | transaction_fetch | Get transaction by ID | Low | | transaction_history | Query transaction history | Low | | transaction_charge | Charge a stored token | Medium | | subscription_fetch | Get subscription details | Low | | subscription_pause | Pause a subscription | High | | subscription_unpause | Resume a subscription | Medium | | subscription_cancel | Cancel a subscription | High | | subscription_update | Update subscription terms | High | | subscription_adhoc | Ad-hoc subscription charge | High | | refund_create | Process a refund | High | | refund_fetch | Get refund details | Low | | creditcard_fetch | Query card transaction | Low |

High-risk operations require human approval before execution.

Quick Start

Prerequisites

Installation

npm install -g payfast-mcp

Or run directly with npx:

npx payfast-mcp

Configuration

Set the following environment variables:

| Variable | Required | Description | |----------|----------|-------------| | PAYFAST_MERCHANT_ID | Yes | Your PayFast Merchant ID | | PAYFAST_MERCHANT_KEY | Yes | Your PayFast Merchant Key | | PAYFAST_PASSPHRASE | Yes | Your PayFast API Passphrase | | PAYFAST_ENVIRONMENT | No | sandbox (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):

{
  "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:

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):

{
  "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:

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:

[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

# Clone the repo
git clone https://github.com/jpbester/payfast-mcp.git
cd payfast-mcp

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Run with MCP Inspector
npm run inspect

License

MIT