SW RDC
Provides read-only access to Razorpay revenue data through 33 tools for fetching payments, orders, settlements, refunds, and related resources, plus streaming summarization with pagination, time-window filtering, PII masking, and OAuth or API-key authentication.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SW RDC summarize captured Razorpay payments from the last 7 days"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SW RDC — Revenue Data Connector (@schema-weaver/rdc)
SW RDC (Revenue Data Connector) — Read-only, zero-storage revenue data connector and MCP engine for Razorpay, Stripe, Cashfree, and billing APIs.
v1 implements Razorpay as the first provider. The catalog, executor, auth, redaction, and telemetry layers are provider-agnostic so additional revenue sources can be added without changing the MCP/CLI surface.
Repository: https://github.com/Schema-Weaver/sw-rdc
Placement: This is an independent package/repository, like Schema Weaver's
sw-agent,pg-ddl-parser, andmigration-engine. It can be consumed in-process by the backend, run as a hosted MCP server, or published as an npm/CLI package. OAuth token storage, encryption, and Supabase persistence stay in the Schema Weaver SaaS backend; nothing insrc/imports a database,.env, or Express.
Exact repository metadata
Field | Value |
Repository name |
|
Description | Revenue Data Connector (SW RDC) — Read-only, zero-storage revenue data connector and MCP engine for Razorpay, Stripe, Cashfree, and billing APIs. |
Display name | SW RDC |
Subtitle | Revenue Data Connector |
npm package |
|
CLI binary |
|
Related MCP server: xendit-mcp
Install & Requirements
npm install @schema-weaver/rdcNode.js
>= 18(uses built-infetch,AbortController, andURL)ESM (
import), CJS (require), and.d.tstype declarations includedRuntime dependencies:
@modelcontextprotocol/sdk,zod
From a source checkout:
cd sw-rdc
npm install
npm run typecheck
npm test
npm run buildnpm test currently runs 75 tests across 9 files; npm run build emits ESM, CJS, source maps, and declarations into dist/.
Quick Start
1. Programmatic execution
import { executeRazorpayTool } from '@schema-weaver/rdc';
const result = await executeRazorpayTool({
toolName: 'fetch_all_payments',
args: { from: 'last_7_days', count: 25, status: 'captured' },
auth: {
type: 'oauth', // Razorpay Partner OAuth token
accessToken: decryptedAccessToken,
accountId: connectionId,
// Optional: called at most once on HTTP 401
onTokenExpired: async () => refreshAndPersistToken(connectionId),
},
caller: 'resona_ai',
onExecutionEvent: async (span) => auditSink.write(span),
});
console.log(result.items, result.meta);Standalone API-key auth also works:
auth: {
type: 'api_key',
keyId: process.env.RAZORPAY_KEY_ID!,
keySecret: process.env.RAZORPAY_KEY_SECRET!,
}2. Reusable connector
import { createRazorpayConnector } from '@schema-weaver/rdc';
const payments = createRazorpayConnector({ auth, caller: 'dashboard_gen' });
const tools = payments.listTools(); // 33 Razorpay v1 tool metadata objects
const result = await payments.execute('fetch_payment', { payment_id: 'pay_ABC123' });3. MCP server (stdio)
import { runMcpStdioServer } from '@schema-weaver/rdc/mcp';
await runMcpStdioServer({
// Called once per tools/call: ideal for hosted multi-tenant deployments.
auth: async () => loadTenantAuthFromRequestContext(),
});4. CLI
# Print the read-only catalog
sw-rdc list-tools
# Run one tool
RAZORPAY_KEY_ID=rzp_test_xxx RAZORPAY_KEY_SECRET=yyy \
sw-rdc call fetch_all_payments '{"count":5,"status":"captured"}'
# Start a stdio MCP server for an MCP client
sw-rdc serve --access-token "$RAZORPAY_ACCESS_TOKEN"What Is Included
33 read-only Razorpay tools — 32
fetch_*REST lookups plussummarize_razorpay_resource. No capture, refund creation, updates, or any other mutating tool exists.Provider-ready architecture — v1 ships Razorpay; the registry and result envelope are designed for Stripe, Cashfree, and billing APIs.
Dynamic auth per execution — OAuth Bearer with a single 401 refresh retry, or API-key Basic auth for standalone/npm use. Credentials are never logged.
Zero-retention analytics — the summarizer streams pages through a
Mapaccumulator, drops each page immediately, and returns only buckets/totals.maxPagesdefaults to 20 and is hard-capped at 50.Pagination that respects Razorpay —
count/skip, Unix-second windows, relative presets, deep-skip window bisection by timestamp cursor, settlement-recon day iteration, and 429 exponential backoff with jitter honoringRetry-After.PII-safe by default — emails/contacts become
*_maskedcompanions; card tokens, fingerprints, full card numbers, bank accounts, OTPs, and secret-looking fields are stripped.includeUnmaskedPii: trueis a trusted server-only opt-out for email/contact only.Integer minor units — raw amounts stay in minor units (paise for INR);
amount_major/sum:amount_majorcompanions are added for display. Currency-specific exponents (JPY, KWD, BHD, …) are supported.Audit spans in
finally— every success, validation failure, auth failure, and rate limit emits a sanitizedConnectorExecutionSpanviaonExecutionEvent. A broken logger never breaks a query.Strict allow-listed inputs — Zod strict schemas reject unknown keys and raw URLs; paths are fixed in the catalog with an SSRF/traversal guard in the HTTP client.
Result envelope
{
ok: true,
provider: 'razorpay',
tool: 'fetch_all_payments',
count: 5,
hasMore: true,
nextSkip: 5,
currencyDefault: 'INR',
amountUnit: 'minor (paise: divide by 100 for INR)',
items: [ /* sanitized records */ ],
meta: {
apiCalls: 1,
scannedCount: 5,
appliedWindow: { from: 1760774400, to: 1760860799 },
appliedPeriod: null,
warnings: [],
},
}Errors are ConnectorError instances with stable codes such as INVALID_ARGS, AUTH_EXPIRED, PERMISSION, NOT_FOUND, RATE_LIMITED, UPSTREAM_ERROR, NETWORK_ERROR, ABORTED, and UNSUPPORTED; toJSON() is safe to return to a caller.
Streaming Analytics Example
await executeRazorpayTool({
toolName: 'summarize_razorpay_resource',
args: {
resource: 'payments',
from: 'last_30_days',
group_by: ['method', 'status'],
time_bucket: 'day',
metrics: ['count', 'sum:amount', 'avg:amount', 'max:amount', 'sum:fee'],
where: { currency: 'INR' },
maxPages: 20,
},
auth,
});Returns grouped buckets plus meta.totals, meta.scannedCount, meta.matchedCount, meta.truncated, and the applied window. Use resource: 'settlement_recon' with year/month (and optional day) for reconciliation reports.
Documentation
Architecture & Implementation Spec — provider boundary, interfaces, guardrails, acceptance criteria
Razorpay Read-Only Tool Catalog — exact 33-tool specification and query rules
Schema Weaver Integration Contract — backend,
backend-ai, and dashboard integrationImplementation Notes — what was built, file map, design decisions, known limits
Tools & Resources — every tool, API path, and result semantics
MCP Server & CLI — stdio setup, dynamic auth, commands, config examples
Official Server Reference & Learnings — what was mirrored from Razorpay's Go server and what was intentionally changed
Repository Setup — GitHub repo name, description, package identity, and publish checklist
Attribution
Tool naming and query semantics follow Razorpay's MIT-licensed razorpay-mcp-server. This package is an independent TypeScript implementation for Schema Weaver and is not affiliated with or endorsed by Razorpay. See LICENSE.
Available Tools
33 toolsfetch_all_customersFetch all customersARead-onlyIdempotent
List Razorpay customers. Email and contact are masked by default as email_masked/contact_masked. Read-only Razorpay API call.
Inputs: to, from, skip, count, +1 more.
fetch_all_disputesFetch all disputesARead-onlyIdempotent
List Razorpay disputes with time and pagination filters. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, count, +1 more.
fetch_all_instant_settlementsFetch all instant settlementsARead-onlyIdempotent
List Razorpay instant settlements, optionally expanding payout details. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, count, +2 more.
fetch_all_invoicesFetch all invoicesARead-onlyIdempotent
List Razorpay invoices with payment, customer, subscription, and type filters. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, type, +5 more.
fetch_all_ordersFetch all ordersARead-onlyIdempotent
List Razorpay orders with time, pagination, authorization, receipt, and expand filters. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, count, +4 more.
fetch_all_payment_linksFetch all payment linksARead-onlyIdempotent
List Razorpay payment links with time, pagination, reference, payment, and UPI filters. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, count, +4 more.
fetch_all_paymentsFetch all paymentsARead-onlyIdempotent
List Razorpay payments with time, pagination, status, method, and expand filters. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, count, +4 more.
fetch_all_payoutsFetch all payoutsARead-onlyIdempotent
List RazorpayX payouts for a bank account number. If RazorpayX is not enabled on the merchant account, Razorpay returns an upstream error that is surfaced cleanly. Read-only Razorpay API call.
Inputs: account_number (required), to, from, skip, +1 more.
fetch_all_plansFetch all plansARead-onlyIdempotent
List Razorpay subscription plans. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, count, +1 more.
fetch_all_qr_codesFetch all QR codesARead-onlyIdempotent
List Razorpay QR codes with time and pagination filters. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, count, +1 more.
fetch_all_refundsFetch all refundsARead-onlyIdempotent
List Razorpay refunds with time and pagination filters. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, count, +1 more.
fetch_all_settlementsFetch all settlementsARead-onlyIdempotent
List Razorpay settlements with time and pagination filters. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, count, +1 more.
fetch_all_subscriptionsFetch all subscriptionsBRead-onlyIdempotent
List Razorpay subscriptions with optional plan filter. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: to, from, skip, count, +2 more.
fetch_customerFetch customerARead-onlyIdempotent
Retrieve one Razorpay customer. Email and contact are masked by default. Read-only Razorpay API call.
Inputs: customer_id (required).
fetch_disputeFetch disputeARead-onlyIdempotent
Retrieve one Razorpay dispute by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: dispute_id (required), expand.
fetch_instant_settlement_with_idFetch instant settlementARead-onlyIdempotent
Retrieve one Razorpay instant settlement by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: settlement_id (required).
fetch_invoiceFetch invoiceARead-onlyIdempotent
Retrieve one Razorpay invoice by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: invoice_id (required).
fetch_multiple_refunds_for_paymentFetch multiple refunds for a paymentARead-onlyIdempotent
List refunds created for one payment. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: payment_id (required), to, from, skip, +1 more.
fetch_orderFetch orderARead-onlyIdempotent
Retrieve one Razorpay order by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: order_id (required), expand.
fetch_order_paymentsFetch order paymentsARead-onlyIdempotent
List all payments made for one Razorpay order. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: order_id (required).
fetch_paymentFetch paymentARead-onlyIdempotent
Retrieve one Razorpay payment by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: payment_id (required), expand.
fetch_payment_card_detailsFetch payment card detailsARead-onlyIdempotent
Retrieve safe card metadata for a card payment. Card tokens, fingerprints, and full card numbers are always stripped. Read-only Razorpay API call.
Inputs: payment_id (required).
fetch_payment_linkFetch payment linkARead-onlyIdempotent
Retrieve one Razorpay payment link by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: payment_link_id (required).
fetch_payments_for_qr_codeFetch payments for QR codeARead-onlyIdempotent
List payments made on one Razorpay QR code. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: qr_code_id (required), to, from, skip, +1 more.
fetch_payout_by_idFetch payoutARead-onlyIdempotent
Retrieve one RazorpayX payout by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: payout_id (required).
fetch_planFetch planARead-onlyIdempotent
Retrieve one Razorpay subscription plan by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: plan_id (required).
fetch_qr_codeFetch QR codeARead-onlyIdempotent
Retrieve one Razorpay QR code by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: qr_code_id (required).
fetch_refundFetch refundARead-onlyIdempotent
Retrieve one Razorpay refund by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: refund_id (required).
fetch_settlement_recon_detailsFetch settlement reconciliation detailsBRead-onlyIdempotent
Fetch Razorpay combined settlement reconciliation records for a year/month/day. This endpoint supports count up to 1000. Read-only Razorpay API call.
Inputs: year (required), month (required), day, skip, +1 more.
fetch_settlement_with_idFetch settlementARead-onlyIdempotent
Retrieve one Razorpay settlement by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: settlement_id (required).
fetch_specific_refund_for_paymentFetch specific refund for paymentARead-onlyIdempotent
Retrieve one refund belonging to a specific payment. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: refund_id (required), payment_id (required).
fetch_subscriptionFetch subscriptionARead-onlyIdempotent
Retrieve one Razorpay subscription by id. Read-only Razorpay API call. Amounts remain in minor units (paise for INR).
Inputs: subscription_id (required).
summarize_razorpay_resourceSummarize Razorpay resourceARead-onlyIdempotent
Stream Razorpay pages, aggregate them in memory, and return grouped counts/sums/min/max without storing or returning raw transaction rows. Supports payments, orders, refunds, settlements, settlement reconciliation, subscriptions, invoices, disputes, and customers.
Inputs: resource (required), to, day, from, +9 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Most tools target distinct Razorpay resources, but several refund/payment/settlement tools overlap in practice: fetch_refund, fetch_all_refunds, fetch_multiple_refunds_for_payment, and fetch_specific_refund_for_payment are easy to confuse. Descriptions generally clarify the differences, but an agent must carefully choose between general and scoped list/get variants.
All names are snake_case and use a fetch_ prefix, but the patterns vary: fetch_all_X, fetch_X, fetch_Xs_for_Y, fetch_X_with_id, and fetch_X_by_id. The conventions are readable but not fully predictable, especially across list/get and scoped-list tools.
The 33 tools cover many Razorpay resources, so the breadth is somewhat justified, but the surface is heavy and includes numerous paired list/get and scoped-list endpoints. It is broader than a typical well-scoped tool set and could likely be consolidated without losing coverage.
The surface provides broad read-only coverage across payments, orders, refunds, settlements, payouts, subscriptions, invoices, disputes, customers, QR codes, and payment links. Minor read gaps exist, but the main lifecycle for a read-only Razorpay connector is well covered.
Maintenance
Related MCP Connectors
Read-only MCP over your own revenue and net margin across 14 billing rails
Read-only revenue analytics from Stripe, Paddle, Polar, Lemon Squeezy, Creem and Freemius.
MerchantFlow is a hosted, read-only ecommerce analytics MCP server for Shopify and WooCommerce. It gives AI assistants tenant-scoped access to revenue, profit and loss, product and SKU profitability, COGS coverage, fulfillment costs, advertising spend, ROAS, marketing performance, cohorts, LTV, and business valuation across connected commerce and marketing platforms. Connect with OAuth over Streamable HTTP. No local server installation is required.
Invoices, receipts and statements into clean rows you can check and export. REST API and MCP.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceIntegrates with Razorpay's payment infrastructure to manage orders, process payments, handle refunds, and query settlements via the Model Context Protocol. Features stateless, multi-tenant architecture with secure per-request authentication using API keys.-
- AlicenseAqualityDmaintenanceA read-only MCP server for securely accessing Xendit payment platform data. It enables querying balances, invoices, transactions, disbursements, refunds, and virtual account payments while preventing any money-moving operations.13MIT
- AlicenseNot gradedqualityDmaintenanceRead-only Stripe finance, ops, and risk reporting exposed via MCP, HTTP API, and CLI. Enables querying balances, payments, customers, payouts, reconciliation, and risk alerts without mutating Stripe state.MIT
- AlicenseBqualityCmaintenanceA read-only MCP server that collects contract and bank-statement evidence, splits incoming platform payments per merchant, and generates explainable claiming candidates written into a fixed 13-column local template for human review. All operations are strictly read-only (no logins, uploads, imports, or reconciliation writes), and it exposes blockers with provenance evidence instead of guessing.5MIT