{
  "markdown": "# payfast-mcp\n\nA [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server for [PayFast](https://www.payfast.co.za/), South Africa's leading payment gateway. Enables AI assistants like Claude to securely interact with your PayFast merchant account.\n\n## Features\n\n- **Transaction management** — fetch transaction details, query history, process tokenized charges\n- **Subscription management** — fetch, pause, unpause, cancel, update, and ad-hoc charge subscriptions\n- **Refund processing** — create refunds (full or partial) and query refund status\n- **Credit card queries** — look up credit card transaction details\n- **Sandbox support** — defaults to sandbox mode for safe testing\n- **Secure by design** — credentials via environment variables only, sensitive data never logged\n\n## Available Tools\n\n| Tool | Description | Risk |\n|------|-------------|------|\n| `ping` | Test API connectivity | Low |\n| `transaction_fetch` | Get transaction by ID | Low |\n| `transaction_history` | Query transaction history | Low |\n| `transaction_charge` | Charge a stored token | Medium |\n| `subscription_fetch` | Get subscription details | Low |\n| `subscription_pause` | Pause a subscription | High |\n| `subscription_unpause` | Resume a subscription | Medium |\n| `subscription_cancel` | Cancel a subscription | High |\n| `subscription_update` | Update subscription terms | High |\n| `subscription_adhoc` | Ad-hoc subscription charge | High |\n| `refund_create` | Process a refund | High |\n| `refund_fetch` | Get refund details | Low |\n| `creditcard_fetch` | Query card transaction | Low |\n\nHigh-risk operations require human approval before execution.\n\n## Quick Start\n\n### Prerequisites\n\n- Node.js 18+\n- A [PayFast merchant account](https://www.payfast.co.za/) (sandbox or production)\n\n### Installation\n\n```bash\nnpm install -g payfast-mcp\n```\n\nOr run directly with npx:\n\n```bash\nnpx payfast-mcp\n```\n\n### Configuration\n\nSet the following environment variables:\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `PAYFAST_MERCHANT_ID` | Yes | Your PayFast Merchant ID |\n| `PAYFAST_MERCHANT_KEY` | Yes | Your PayFast Merchant Key |\n| `PAYFAST_PASSPHRASE` | Yes | Your PayFast API Passphrase |\n| `PAYFAST_ENVIRONMENT` | No | `sandbox` (default) or `production` |\n\nYou can also create a `.env` file in your working directory.\n\n### Claude Desktop\n\nAdd to your Claude Desktop config (`claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"payfast\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"payfast-mcp\"],\n      \"env\": {\n        \"PAYFAST_MERCHANT_ID\": \"your-merchant-id\",\n        \"PAYFAST_MERCHANT_KEY\": \"your-merchant-key\",\n        \"PAYFAST_PASSPHRASE\": \"your-passphrase\",\n        \"PAYFAST_ENVIRONMENT\": \"sandbox\"\n      }\n    }\n  }\n}\n```\n\n### Claude Code\n\nAdd to your Claude Code settings:\n\n```bash\nclaude mcp add payfast \\\n  -e PAYFAST_MERCHANT_ID=your-merchant-id \\\n  -e PAYFAST_MERCHANT_KEY=your-merchant-key \\\n  -e PAYFAST_PASSPHRASE=your-passphrase \\\n  -e PAYFAST_ENVIRONMENT=sandbox \\\n  -- npx -y payfast-mcp\n```\n\n### Cursor\n\nAdd to your Cursor MCP config (`.cursor/mcp.json` for project-level, or `~/.cursor/mcp.json` for global):\n\n```json\n{\n  \"mcpServers\": {\n    \"payfast\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"payfast-mcp\"],\n      \"env\": {\n        \"PAYFAST_MERCHANT_ID\": \"your-merchant-id\",\n        \"PAYFAST_MERCHANT_KEY\": \"your-merchant-key\",\n        \"PAYFAST_PASSPHRASE\": \"your-passphrase\",\n        \"PAYFAST_ENVIRONMENT\": \"sandbox\"\n      }\n    }\n  }\n}\n```\n\n### Codex\n\nAdd via the Codex CLI:\n\n```bash\ncodex mcp add payfast \\\n  --env PAYFAST_MERCHANT_ID=your-merchant-id \\\n  --env PAYFAST_MERCHANT_KEY=your-merchant-key \\\n  --env PAYFAST_PASSPHRASE=your-passphrase \\\n  --env PAYFAST_ENVIRONMENT=sandbox \\\n  -- npx -y payfast-mcp\n```\n\nOr add directly to `~/.codex/config.toml`:\n\n```toml\n[mcp_servers.payfast]\ncommand = \"npx\"\nargs = [\"-y\", \"payfast-mcp\"]\n\n[mcp_servers.payfast.env]\nPAYFAST_MERCHANT_ID = \"your-merchant-id\"\nPAYFAST_MERCHANT_KEY = \"your-merchant-key\"\nPAYFAST_PASSPHRASE = \"your-passphrase\"\nPAYFAST_ENVIRONMENT = \"sandbox\"\n```\n\n## Development\n\n```bash\n# Clone the repo\ngit clone https://github.com/jpbester/payfast-mcp.git\ncd payfast-mcp\n\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Run tests\nnpm test\n\n# Run with MCP Inspector\nnpm run inspect\n```\n\n## License\n\nMIT\n",
  "bytes": 4348,
  "sha": "95e0a77f7968058dbf459af336d37f87ca3b4826234362669718a64dc9ecc508",
  "repo_slug": "jpbester/payfast-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_jpbester_payfast_351cd22e/readme"
}