Interact with Razorpay's payment infrastructure — orders, payments, refunds, and settlements — via API.
A Model Context Protocol (MCP) server that exposes Razorpay's REST API for managing orders, capturing payments, processing refunds, and querying settlements.
The CL Razorpay MCP Server provides stateless, multi-tenant access to the Razorpay API:
Perfect for:
This server is stateless and multi-tenant. Every tenant-facing tool accepts key_id and key_secret on each call. Credentials are never stored server-side.
Obtain your API keys from the Razorpay Dashboard:
Use the test-mode keys against https://api.razorpay.com/v1 — Razorpay's sandbox is live mode with test credentials, no separate base URL needed.
pip install -r requirements.txt# stdio (default — for local Claude Desktop / MCP clients)
python server.py
# SSE transport
python server.py --transport sse --host 127.0.0.1 --port 8001
# Streamable HTTP transport
python server.py --transport streamable-http --host 127.0.0.1 --port 8001{
"tool": "create_order",
"arguments": {
"key_id": "rzp_test_XXXXXXXX",
"key_secret": "XXXXXXXXXXXXXXXX",
"amount": 50000,
"currency": "INR",
"receipt": "receipt_001"
}
}cl-mcp-razorpay/
|-- server.py
|-- requirements.txt
|-- README.md
|-- .gitignore
`-- razorpay_mcp/
|-- __init__.py
|-- cli.py
|-- config.py
|-- schemas.py
|-- service.py
`-- tools.py{
"id": "order_XXXXXXXXXX",
"entity": "order",
"amount": 50000,
"currency": "INR",
"status": "created",
"receipt": "receipt_001",
"created_at": 1690000000
}Usage Example:
POST /mcp/razorpay/create_order
{
"key_id": "rzp_test_XXXXXXXX",
"key_secret": "XXXXXXXXXXXXXXXX",
"amount": 50000,
"currency": "INR",
"receipt": "receipt_001"
}{
"id": "rfnd_XXXXXXXXXX",
"entity": "refund",
"amount": 50000,
"payment_id": "pay_XXXXXXXXXX",
"speed_processed": "normal",
"status": "processed"
}pay_{alphanumeric}
Example: pay_OE1jIbY9HrFaXwRefund:
rfnd_{alphanumeric}
Example: rfnd_OE1jIbY9HrFaXwSettlement:
setl_{alphanumeric}
Example: setl_OE1jIbY9HrFaXworders:read — Read order detailsorders:write — Create and update ordersrefunds:read — Read refund detailsrefunds:write — Create and update refundssettlements:read — Read settlement detailsRefer to the Razorpay Authentication Guide for details.
authorized state, or amount mismatchfetch_payment before capturingamount in capture_payment exactly matches the authorized amountcaptured state, or has already been fully refundedfetch_paymentfetch_refunds_for_payment