home / mcp / payfast mcp server
Provides transaction, subscription, refund, and credit card query capabilities for PayFast via MCP with sandbox support and environment-variable credentials.
Configuration
View docs{
"mcpServers": {
"jpbester-payfast-mcp": {
"command": "npx",
"args": [
"-y",
"payfast-mcp"
],
"env": {
"PAYFAST_PASSPHRASE": "your-passphrase",
"PAYFAST_ENVIRONMENT": "sandbox",
"PAYFAST_MERCHANT_ID": "your-merchant-id",
"PAYFAST_MERCHANT_KEY": "your-merchant-key"
}
}
}
}You can run PayFast MCP to securely interact with your PayFast merchant account through an MCP client. This server provides transaction, subscription, refunds, and card query capabilities in a sandbox-friendly, credentials-only setup, ensuring sensitive data is never logged.
You use an MCP client to talk to the PayFast MCP server. Start the server using your preferred MCP-integrated client (Claude, Codex, Cursor, or similar) and supply the required environment variables. The server exposes functions for fetching transactions, managing subscriptions, processing refunds, and querying card details. High-risk actions require explicit human approval before execution, so plan those steps with your workflow.
# Prerequisites
Node.js 18+
PayFast merchant account (sandbox or production)
# Install the MCP server globally
npm install -g payfast-mcp
# Or run directly with npx
npx payfast-mcpConfiguration and security are central to safe operation. You will provide credentials exclusively via environment variables. Sensitive data is never logged.
Environment variables you need to set include: PAYFAST_MERCHANT_ID, PAYFAST_MERCHANT_KEY, PAYFAST_PASSPHRASE, and PAYFAST_ENVIRONMENT. The default environment is sandbox unless you explicitly set production.
The following sections show practical configuration examples for common MCP clients. Use these exact patterns to connect your client to this MCP server.
- Use environment variables to store credentials and avoid logging sensitive values. - Run in sandbox mode for testing before moving to production. - Review high-risk operations and require human approval where appropriate.
If the MCP server fails to start, verify Node.js 18+ is installed, and ensure you have network access for dependencies. Check that the required environment variables are present and correctly named.
Test API connectivity
Get transaction by ID
Query transaction history
Charge a stored token
Get subscription details
Pause a subscription
Resume a subscription
Cancel a subscription
Update subscription terms
Ad-hoc subscription charge
Process a refund
Get refund details
Query card transaction