unified-pay-cli
💳 unified-pay-cli
Stripe, Razorpay 및 LemonSqueezy를 위한 범용 결제 게이트웨이 CLI 및 Model Context Protocol (MCP) 서버.
🚀 주요 기능
⚡ 설치 불필요:
npx unified-pay-cli로 필요할 때 즉시 실행.🎯 멀티 프로바이더 엔진: Stripe, Razorpay, LemonSqueezy 간 표준화된 인터페이스.
🛠️ 스마트 결제 링크 생성: 대화형 터미널 UI 프롬프트 또는 직접 스크립트 CLI 플래그.
🔄 전체 거래 및 환불 수명주기: 실시간 상태 확인, 최근 거래 목록, 부분/전체 환불, 전용 환불 진행 상황 추적.
📡 웹훅 스테이션 및 전달 프록시: 내장 HTTP 리스너(
pay listen)가 웹훅 이벤트를 가로채고 색상으로 구분하여 로컬 백엔드로 직접 전달합니다 (--forward http://localhost:3000/api/webhooks).🔒 암호화 서명 검증: 내장 HMAC-SHA256 검증(
--secret)으로 위조되거나 변조된 웹훅 페이로드로부터 로컬 개발 환경을 보호합니다.🤖 네이티브 Model Context Protocol (MCP): 결제 스택을 GitHub Copilot, Cursor 또는 Claude Desktop에 연결하여 AI가 자연어 프롬프트로 링크 생성, 서명 검증, 인보이스 추적을 수행할 수 있습니다.
Related MCP server: MCP Billing Gateway SDK
⚡ 빠른 시작
1. 설치
전역 설치 또는 npx로 필요할 때 실행:
# Global install (recommended for daily CLI use)
npm install -g unified-pay-cli
# Or run instantly with npx
npx unified-pay-cli --help2. 자격 증명 구성
# 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 명령어 참조
1. 결제 링크 생성 (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. 거래 조회 (pay txn)
# List recent transactions
pay txn list --provider razorpay --limit 5
# Check specific payment details
pay txn status pay_Oq7Jk8LmNx9 --provider razorpay3. 환불 발행 및 추적 (pay refund)
pay는 결제와 환불 엔터티의 별도 수명주기를 처리합니다:
# 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. 웹훅 스테이션, 검증 및 프록시 (pay listen)
복잡한 터널링 설정 없이 로컬 개발 중 실시간 웹훅 이벤트를 수신하세요:
# 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) 통합
AI 어시스턴트를 자율적인 청구 및 결제 운영자로 전환하세요.
1. Claude Desktop (claude_desktop_config.json) / Cursor (mcp.json)용
{
"mcpServers": {
"unified-pay": {
"command": "npx",
"args": ["-y", "unified-pay-cli"]
}
}
}2. VS Code Copilot (.vscode/mcp.json)용
{
"servers": {
"unified-pay": {
"type": "stdio",
"command": "npx",
"args": ["-y", "unified-pay-cli"]
}
}
}3. 사용 가능한 AI 도구
도구 이름 | 설명 |
create_payment_link | 사용자 지정 금액, 통화 및 메모로 체크아웃 URL을 생성합니다. |
list_transactions | 최근 결제 및 검증 상태를 가져옵니다. |
get_payment_status | 특정 결제 ID(pay_xxx, ch_xxx)의 수명주기 상태를 검사합니다. |
create_refund | 전체 또는 부분 환불을 실행합니다. |
get_refund_status | 환불 ID(rfnd_xxx, re_xxx)의 실시간 상태를 추적합니다. |
list_refunds | 과거 환불 기록을 나열합니다. |
verify_webhook_signature | 수신된 Stripe/Razorpay 페이로드의 HMAC-SHA256 진위 여부를 검증합니다. |
4. AI 프롬프트 예시
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.🧪 테스트 및 검증
# Run unit tests
npm test
# Run tests in watch mode
npm run test:watch🛠️ 개발
# 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📄 라이선스
MIT 라이선스에 따라 배포됩니다. 자세한 내용은 LICENSE를 참조하세요.
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.MIT
- 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.122 PyPI2MIT
- AlicenseBqualityDmaintenanceAn MCP (Model Context Protocol) server that connects AI assistants like Claude directly to your Razorpay account.1427 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