mcp-server-razorpay
Provides tools for interacting with Razorpay's API, enabling AI agents to create and manage orders, payments, refunds, customers, subscriptions, and payment links.
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., "@mcp-server-razorpay Create an order for โน999 and send a payment link to john@example.com"
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.
mcp-server-razorpay
A Model Context Protocol (MCP) server that exposes Razorpay APIs to AI agents.
Enable AI assistants to create orders, process payments, handle refunds, manage subscriptions, and generate payment links โ autonomously.
๐ค What Can an AI Agent Do With This?
Once connected, your AI assistant can handle real payment operations via natural language:
"Create an order for โน999 and send a payment link to john@example.com"
"Refund payment pay_abc123 with optimum speed"
"List all payments from the last 7 days"
"Cancel subscription sub_xyz at the end of the current billing cycle"
"Create a customer for Riya Sharma with contact +919876543210"
Related MCP server: Razorpay MCP Server
๐ ๏ธ Tools
๐ฆ Orders
Tool | Description |
| Create a new order (amount in paise, e.g. 50000 = โน500) |
| Fetch order details by order ID |
| List orders with filters (count, date range, status) |
๐ณ Payments
Tool | Description |
| Fetch payment details by payment ID |
| Capture an authorized payment |
| List payments with date and count filters |
๐ Refunds
Tool | Description |
| Full or partial refund with normal/optimum speed |
| Fetch a specific refund by refund ID |
| List all refunds on a payment |
๐ค Customers
Tool | Description |
| Create a new Razorpay customer |
| Fetch customer details by customer ID |
๐ Subscriptions
Tool | Description |
| Create a recurring subscription for a plan |
| Fetch subscription status and details |
| Cancel immediately or at end of billing cycle |
๐ Payment Links
Tool | Description |
| Generate a shareable payment link with optional SMS/email delivery |
| Fetch payment link details and status |
| Expire a payment link immediately |
โก Quickstart
1. Get Razorpay API Keys
Sign up at dashboard.razorpay.com โ Settings โ API Keys. Use Test Mode keys during development.
2. Clone & Install
git clone https://github.com/YOUR_USERNAME/mcp-server-razorpay.git
cd mcp-server-razorpay
npm install3. Configure Environment
cp .env.example .envEdit .env:
RAZORPAY_KEY_ID=rzp_test_xxxxxxxxxxxxxx
RAZORPAY_KEY_SECRET=xxxxxxxxxxxxxxxxxxxxxxxx4. Build
npm run build๐ Connect to Claude Desktop
Edit your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"razorpay": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-razorpay/dist/index.js"],
"env": {
"RAZORPAY_KEY_ID": "rzp_test_xxxxxxxxxxxxxx",
"RAZORPAY_KEY_SECRET": "xxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}Restart Claude Desktop โ you'll see the ๐จ tools icon appear.
๐ Connect to Cursor
Go to Settings โ Tools & Integrations โ New MCP Server and add:
{
"razorpay": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-razorpay/dist/index.js"],
"env": {
"RAZORPAY_KEY_ID": "rzp_test_xxxxxxxxxxxxxx",
"RAZORPAY_KEY_SECRET": "xxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}๐งช Debug with MCP Inspector
npm run inspectorOpens a browser UI where you can test every tool interactively before connecting to a client.
๐ Project Structure
mcp-server-razorpay/
โโโ src/
โ โโโ index.ts # Entry point & server init
โ โโโ client.ts # Razorpay axios instance + Basic Auth
โ โโโ tools/
โ โโโ orders.ts # Order management tools
โ โโโ payments.ts # Payment tools
โ โโโ refunds.ts # Refund tools
โ โโโ customers.ts # Customer tools
โ โโโ subscriptions.ts # Subscription tools
โ โโโ paymentLinks.ts # Payment link tools
โโโ .env.example
โโโ package.json
โโโ tsconfig.json๐ Security Notes
Never commit your
.envfile โ it's in.gitignoreUse Test Mode keys during development; switch to Live keys only in production
The server runs locally โ your API keys never leave your machine
๐ค Contributing
PRs welcome! If you'd like to add tools (e.g. Payouts, Settlements, Webhooks), open an issue first to discuss.
๐ License
MIT โ free for personal and commercial use.
Available Tools
17 toolscancel_subscriptionCancel SubscriptionB
Cancel a Razorpay subscription immediately or at end of billing cycle.
Inputs: subscription_id (required), cancel_at_cycle_end.
capture_paymentCapture PaymentA
Capture an authorized Razorpay payment. Amount must match the original order amount in paise.
Inputs: amount (required), payment_id (required), currency.
create_customerCreate CustomerC
Create a new customer in Razorpay.
Inputs: name (required), email, notes, contact, +1 more.
create_orderCreate OrderB
Create a new Razorpay order. Amount must be in paise (e.g. 50000 = โน500).
Inputs: amount (required), notes, receipt, currency.
create_payment_linkCreate Payment LinkC
Create a shareable Razorpay payment link for a customer. Amount in paise.
Inputs: amount (required), notes, currency, customer, +4 more.
create_refundCreate RefundB
Create a full or partial refund for a Razorpay payment. Omit amount for full refund.
Inputs: payment_id (required), notes, speed, amount, +1 more.
create_subscriptionCreate SubscriptionC
Create a recurring subscription for a customer in Razorpay.
Inputs: plan_id (required), total_count (required), notes, quantity, +2 more.
deactivate_payment_linkDeactivate Payment LinkA
Deactivate (expire) a Razorpay payment link so it can no longer be used.
Inputs: payment_link_id (required).
fetch_customerFetch CustomerB
Fetch a Razorpay customer by their customer ID.
Inputs: customer_id (required).
fetch_orderFetch OrderB
Fetch details of a specific Razorpay order by order ID.
Inputs: order_id (required).
fetch_paymentFetch PaymentB
Fetch details of a specific Razorpay payment by payment ID.
Inputs: payment_id (required).
fetch_payment_linkFetch Payment LinkC
Fetch details of a Razorpay payment link by its ID.
Inputs: payment_link_id (required).
fetch_refundFetch RefundC
Fetch a specific refund by refund ID and payment ID.
Inputs: refund_id (required), payment_id (required).
fetch_subscriptionFetch SubscriptionB
Fetch a Razorpay subscription by subscription ID.
Inputs: subscription_id (required).
list_ordersList OrdersC
List Razorpay orders with optional filters.
Inputs: to, from, skip, count, +2 more.
list_paymentsList PaymentsC
List Razorpay payments with optional filters.
Inputs: to, from, skip, count.
list_refunds_for_paymentList Refunds for PaymentB
List all refunds created for a specific Razorpay payment.
Inputs: payment_id (required), skip, count.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 17 tools
Each tool pairs a distinct verb with a distinct Razorpay resource (order, payment, refund, customer, subscription, payment link), so no two tools overlap in purpose. Edge cases like fetch_refund versus list_refunds_for_payment are clearly separated by identifier requirements and singular/plural semantics in the descriptions.
All 17 tools follow a strict snake_case verb_noun pattern (fetch_order, create_refund, cancel_subscription, deactivate_payment_link). The one outlier, list_refunds_for_payment, still conforms to the same verb_noun convention with a clarifying resource qualifier.
17 tools spanning six resources is reasonable for a payments API, with roughly three operations per resource. It is slightly on the heavy side of the ideal band, but no tool appears redundant or filler.
Core flows (create/fetch/list orders, capture payments, refund, subscriptions, payment links) are covered, but read coverage is uneven: customers, subscriptions, and payment links have no list or update operations, and there is no fetch/list of all refunds or any customer deletion. Agents can work around these via IDs they already hold, but discovery-style workflows will hit dead ends.
Maintenance
Related MCP Connectors
India payments for AI agents โ UPI, cards, wallets via Razorpay Payment Links. Never holds funds.
Stripe payments for AI agents. Create links, verify, manage customers.
Create payment orders, checkout, subscriptions & UPI via PineLabs Plural PG gateway
Let AI agents add Yolfi crypto checkout, paylinks, webhooks, and status checks.
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceEnables AI agents to interact with Juspay's payment processing APIs and merchant dashboard for managing orders, transactions, refunds, customers, gateways, and reporting through natural language.22Apache 2.0- AlicenseNot gradedqualityDmaintenanceEnables interaction with Razorpay payment gateway through natural language, allowing users to fetch payments, manage orders, issue refunds, and list settlements.MIT
- FlicenseNot gradedqualityDmaintenanceEnables Razorpay merchants to become AI-transactable by letting MCP-compatible agents search catalogs, create real Razorpay orders, and complete purchases with enforced wallet limits and audit trails.-
- FlicenseNot gradedqualityCmaintenanceEnables conversational AI agents to manage Razorpay payments directly, including payment lookups, order creation, refunds, UPI QR generation, and real-time webhook triage via the Model Context Protocol.-