unified-pay-cli
This server is a payment gateway CLI and MCP server that lets you create payment links, manage transactions and refunds, verify webhooks, and analyze payments across Stripe, Razorpay, and LemonSqueezy.
Create payment and checkout links (single or itemized invoices) with custom amounts, currencies, descriptions, customer details, expiry, and tax breakdowns.
Inspect transactions – list recent charges and check payment status for a given ID.
Issue refunds – partial or full refunds for a payment ID across supported providers.
Verify webhook signatures – authenticate HMAC-SHA256 signed Stripe/Razorpay payloads.
Trigger mock webhooks – simulate signed events (e.g., payment.captured, payment.failed) to test local endpoints.
Get payment analytics – retrieve revenue, success rates, and performance across gateways.
Manage provider configuration via CLI credentials (Stripe, Razorpay, LemonSqueezy).
Run as an MCP server – expose tools (create_payment_link, list_transactions, get_payment_status, create_refund, verify_webhook_signature, etc.) to AI assistants like Claude, Cursor, or Copilot.
Provides tools for creating payment links, listing and inspecting transactions, issuing and tracking refunds, and verifying webhook signatures.
Provides tools for creating payment links, listing and inspecting transactions, issuing and tracking refunds, and verifying webhook signatures.
💳 unified-pay-cli
The Universal Payment Gateway CLI & Model Context Protocol (MCP) Server for Stripe, Razorpay & LemonSqueezy.
🚀 Highlights
⚡ Zero Installation Required: Run instantly on demand via
npx unified-pay-cli.🎯 Multi-Provider Engine: Standardized interface across Stripe, Razorpay, and LemonSqueezy.
🛠️ Smart Payment Link Generation: Interactive terminal UI prompts or direct scripted CLI flags.
🔄 Full Transaction & Refund Lifecycle: Live status checks, recent transaction listings, partial/full refunds, and dedicated refund progress tracking.
📡 Webhook Station & Forwarding Proxy: Built-in HTTP listener (
pay listen) that intercepts, color-codes, and forwards webhook events directly to your local backend (--forward http://localhost:3000/api/webhooks).🔒 Cryptographic Signature Verification: Built-in HMAC-SHA256 verification (
--secret) protecting your local development from forged or tampered webhook payloads.🤖 Native Model Context Protocol (MCP): Connect your payment stack to GitHub Copilot, Cursor, or Claude Desktop so AI can create links, verify signatures, and track invoices from natural language prompts.
Related MCP server: MCP Billing Gateway SDK
⚡ Quick Start
1. Installation
Install globally or run on demand via npx:
# Global install (recommended for daily CLI use)
npm install -g unified-pay-cli
# Or run instantly with npx
npx unified-pay-cli --help2. Configure Credentials
# Stripe
pay config --stripe-key sk_test_51...
# Razorpay
pay config --razorpay-id rzp_test_... --razorpay-secret ...
# LemonSqueezy (Optional)
pay config --lemonsqueezy-key lms_... --lemonsqueezy-store 12345💻 CLI Command Reference
1. Create Payment Links (pay link)
# Interactive mode (prompts for provider, amount, description)
pay link
# Scriptable flag mode
pay link --provider razorpay --amount 350000 --currency INR --desc "2-Hour Technical Consultation"
pay link --provider stripe --amount 2500 --currency USD --desc "Pro Tier Subscription"2. Inspect Transactions (pay txn)
# List recent transactions
pay txn list --provider razorpay --limit 5
# Check specific payment details
pay txn status pay_Oq7Jk8LmNx9 --provider razorpay3. Issue & Track Refunds (pay refund)
pay handles the separate lifecycle of charges vs. refund entities:
# Issue a refund (full or partial in minor units)
pay refund create pay_Oq7Jk8LmNx9 --provider razorpay --amount 10000
# Track live refund progression
pay refund status rfnd_TRNTRFvhQ6NDKx --provider razorpay
# List all past refunds
pay refund list --provider razorpay4. Webhook Station, Verification & Proxy (pay listen)
Catch real-time webhook events during local development without complex tunneling setups:
# 1. Basic listener
pay listen --port 4242
# 2. Listener with HMAC-SHA256 signature verification
pay listen --port 4242 --secret my_webhook_signing_secret
# 3. Listener with signature verification + proxy forwarding to local backend
pay listen --port 4242 --secret my_webhook_secret --forward http://localhost:3000/api/webhooks🤖 Model Context Protocol (MCP) Integration
Turn your AI assistant into an autonomous billing and payment operator.
1. For Claude Desktop (claude_desktop_config.json) / Cursor (mcp.json)
{
"mcpServers": {
"unified-pay": {
"command": "npx",
"args": ["-y", "unified-pay-cli"]
}
}
}2. For VS Code Copilot (.vscode/mcp.json)
{
"servers": {
"unified-pay": {
"type": "stdio",
"command": "npx",
"args": ["-y", "unified-pay-cli"]
}
}
}3. Available AI Tools
Tool Name | Description |
create_payment_link | Creates checkout URLs with custom amount, currency, and note. |
list_transactions | Fetches recent charges and verification statuses. |
get_payment_status | Inspects lifecycle state for a specific payment ID (pay_xxx, ch_xxx). |
create_refund | Triggers a full or partial refund. |
get_refund_status | Tracks the live status of a refund ID (rfnd_xxx, re_xxx). |
list_refunds | Lists historical refund records. |
verify_webhook_signature | Verifies HMAC-SHA256 authenticity of incoming Stripe/Razorpay payloads. |
4. Example AI Prompts
Use unified-pay to generate a INR 3,500 Razorpay payment link for "2-Hour Technical Consultation" and draft a WhatsApp message for the client.
Check if payment ID pay_Oq7Jk8LmNx9 on Razorpay was successfully captured.
Issue a full refund for Stripe charge ch_3Mtw1234 using unified-pay.
Verify if this incoming Razorpay webhook payload and signature are authentic using my signing secret.🧪 Testing & Verification
# Run unit tests
npm test
# Run tests in watch mode
npm run test:watch🛠️ Development
# 1. Clone the repository
git clone https://github.com/your-username/unified-pay-cli.git
cd unified-pay-cli
# 2. Install dependencies
npm install
# 3. Build TypeScript
npm run build
# 4. Symlink globally for local testing
npm link📄 License
Distributed under the MIT License. See LICENSE for details.
Available Tools
7 toolscompare_gateway_feesA
Evaluates and compares the transaction processing fees, percentage cuts, fixed interchange fees, and estimated net payouts across Stripe, Razorpay, and LemonSqueezy for a given transaction amount and currency. Returns an itemized fee breakdown for each supported gateway alongside the recommended lowest-cost provider.
Inputs: amount (required), currency (required).
create_itemized_invoiceA
Constructs a multi-item commercial invoice checkout link containing itemized product line descriptions, per-unit pricing, item quantities, total tax calculations, and customer billing details. Returns the generated hosted invoice payment URL and itemized receipt breakdown.
Inputs: items (required), customerEmail (required), currency, provider.
create_payment_linkA
Generates a secure hosted payment checkout URL across Stripe, Razorpay, or LemonSqueezy. Supports custom transaction amounts, automatic currency formatting, customer prefill metadata (name, email, phone), customizable link expiry timeouts, and intelligent multi-gateway routing. Returns a JSON object containing the checkout URL, payment link ID, status, and assigned gateway provider.
Inputs: amount (required), currency (required), description (required), provider, +5 more.
create_refundA
Executes an immediate full or partial monetary refund for a previously settled payment or charge transaction across supported payment gateways. Returns a JSON confirmation object containing the refund ID, status, refunded amount, and currency.
Inputs: provider (required), paymentId (required), amount.
get_payment_analyticsA
Aggregates real-time transaction performance, total gross volume, captured revenue volume, settled payouts, and payment success/conversion rates by querying recent transaction histories across connected payment gateway accounts. Returns statistical aggregates and settlement ratios.
Inputs: provider (required), limit.
trigger_mock_webhookA
Constructs and dispatches a cryptographically authentic HMAC-SHA256 signed synthetic webhook event payload directly to a local or remote backend endpoint. Useful for verifying webhook signature parsing, event processing handlers, and local integration pipelines without executing live card charges. Returns the HTTP status code, response headers, and response body received from the target server.
Inputs: event (required), provider (required), targetUrl (required), amount, +1 more.
verify_webhook_signatureA
Validates the cryptographic HMAC-SHA256 signature and tamper-resistance of an incoming webhook HTTP request payload against a shared webhook signing secret. Returns a JSON boolean indicating whether the signature matches the payload digest.
Inputs: secret (required), provider (required), signature (required), rawPayload (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools are clearly distinct, but create_payment_link and create_itemized_invoice both generate hosted checkout URLs, potentially causing confusion. Other tools (fees, webhooks, refunds, analytics) have clear boundaries.
All tools follow a consistent verb_noun snake_case pattern (create_, compare_, trigger_, verify_, get_). The naming is uniform and predictable across the entire set.
Seven tools is a well-scoped size for a payment CLI, covering common operations without overwhelming the user. Each tool addresses a distinct payment workflow, making the count appropriate.
Core operations like creating payments, refunds, and webhook verification are covered, but there are notable gaps such as no way to retrieve a payment by ID or list past payments. This forces agents to rely on analytics for status, which is a workaround rather than a direct access pattern.
Maintenance
Related MCP Connectors
MCP server for Lemon Squeezy — stores, products, orders, subscriptions, license keys.
Hosted Stripe MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Billing proxy for MCP servers. Adds Stripe and x402 crypto payments without writing billing code.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceCentralizes payment gateway integrations for Pagar.me (customers, recipients, Pix, credit card, splits, charges) and Woovi/OpenPix (Pix charges, refunds, webhook verification) through MCP tools.6 npmMIT
- AlicenseBqualityDmaintenanceUniversal billing gateway for MCP servers. Add Stripe subscription billing to any MCP server with one line of code. Supports tiered plans, usage tracking, and automatic access control.137 PyPI2MIT
- AlicenseBqualityDmaintenanceAn MCP (Model Context Protocol) server that connects AI assistants like Claude directly to your Razorpay account.1441 npm1MIT
- AlicenseNot gradedqualityBmaintenanceA remote MCP server that lets any AI agent accept payments in India via UPI, cards, netbanking, and wallets through Razorpay Payment Links. Bring your own credentials, stateless, no funds touched.MIT