loading…
Search for a command to run...
loading…
Integrates with Razorpay's payment infrastructure to manage orders, process payments, handle refunds, and query settlements via the Model Context Protocol. Feat
Integrates 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.
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.
health_check — Verify server is runningLightweight ping that confirms the MCP server is live. No auth required.
Inputs: none
Output:
{ "status": "ok", "server": "CL Razorpay MCP Server" }
create_order — Create a new Razorpay orderCreates an order that is required before initiating a payment on the frontend SDK.
Inputs:
key_id (string, required) — Razorpay API key IDkey_secret (string, required) — Razorpay API key secretamount (integer, required) — Amount in smallest currency unit (e.g. paise for INR; ₹500 = 50000)currency (string, required) — ISO 4217 currency code, e.g. "INR"receipt (string, optional) — Merchant receipt number (max 40 chars)notes (object, optional) — Key-value metadata to attachpartial_payment (boolean, optional) — Whether partial payments are allowed (default: false)Output:
{
"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"
}
fetch_order — Fetch a single order by IDRetrieves full details of a specific order.
Inputs:
key_id (string, required)key_secret (string, required)order_id (string, required) — e.g. "order_XXXXXXXXXX"Output: Full order object as returned by Razorpay API.
fetch_all_orders — List all orders with paginationRetrieves a paginated list of orders, optionally filtered by creation timestamp.
Inputs:
key_id (string, required)key_secret (string, required)count (integer, optional) — Number to return (default: 10, max: 100)skip (integer, optional) — Offset for pagination (default: 0)from_timestamp (integer, optional) — Unix epoch; fetch orders created after thisto_timestamp (integer, optional) — Unix epoch; fetch orders created before thisfetch_payments_for_order — Fetch payments linked to an orderRetrieves all payment attempts made against a specific order ID.
Inputs:
key_id (string, required)key_secret (string, required)order_id (string, required) — e.g. "order_XXXXXXXXXX"update_order — Update notes on an orderUpdates the notes key-value map on an existing order.
Inputs:
key_id (string, required)key_secret (string, required)order_id (string, required)notes (object, required) — Key-value pairs to setfetch_payment — Fetch a single payment by IDRetrieves details of a specific payment.
Inputs:
key_id (string, required)key_secret (string, required)payment_id (string, required) — e.g. "pay_XXXXXXXXXX"fetch_all_payments — List all payments with paginationRetrieves a paginated list of payments with optional timestamp filters.
Inputs:
key_id (string, required)key_secret (string, required)count (integer, optional) — default 10, max 100skip (integer, optional) — default 0from_timestamp (integer, optional)to_timestamp (integer, optional)capture_payment — Capture an authorized paymentChanges a payment from authorized to captured. Amount must exactly match the authorized amount.
Inputs:
key_id (string, required)key_secret (string, required)payment_id (string, required) — e.g. "pay_XXXXXXXXXX"amount (integer, required) — Must match the authorized amount exactlycurrency (string, required) — e.g. "INR"update_payment — Update notes on a paymentUpdates the notes key-value map on an existing payment.
Inputs:
key_id (string, required)key_secret (string, required)payment_id (string, required)notes (object, required)create_refund — Issue a full or partial refundCreates a refund for a captured payment. Omit amount for a full refund.
Inputs:
key_id (string, required)key_secret (string, required)payment_id (string, required) — e.g. "pay_XXXXXXXXXX"amount (integer, optional) — Partial refund amount; omit for full refundspeed (string, optional) — "normal" (default) or "optimum"notes (object, optional) — Key-value metadatareceipt (string, optional) — Merchant receipt for the refundOutput:
{
"id": "rfnd_XXXXXXXXXX",
"entity": "refund",
"amount": 50000,
"payment_id": "pay_XXXXXXXXXX",
"speed_processed": "normal",
"status": "processed"
}
fetch_refund — Fetch a single refund by IDInputs:
key_id (string, required)key_secret (string, required)refund_id (string, required) — e.g. "rfnd_XXXXXXXXXX"fetch_all_refunds — List all refunds with paginationInputs:
key_id (string, required)key_secret (string, required)count (integer, optional) — default 10, max 100skip (integer, optional) — default 0from_timestamp (integer, optional)to_timestamp (integer, optional)fetch_refunds_for_payment — Fetch refunds for a paymentInputs:
key_id (string, required)key_secret (string, required)payment_id (string, required) — e.g. "pay_XXXXXXXXXX"count (integer, optional) — default 10skip (integer, optional) — default 0update_refund — Update notes on a refundInputs:
key_id (string, required)key_secret (string, required)refund_id (string, required)notes (object, required)fetch_all_settlements — List all settlements with paginationInputs:
key_id (string, required)key_secret (string, required)count (integer, optional) — default 10, max 100skip (integer, optional) — default 0from_timestamp (integer, optional)to_timestamp (integer, optional)fetch_settlement — Fetch a single settlement by IDInputs:
key_id (string, required)key_secret (string, required)settlement_id (string, required) — e.g. "setl_XXXXXXXXXX"count — Number of records to return (integer, 1–100, default 10)skip — Number of records to skip for pagination (integer, default 0)from_timestamp — Unix epoch integer; lower bound on created_atto_timestamp — Unix epoch integer; upper bound on created_atOrder:
order_{alphanumeric}
Example: order_OE1jIbY9HrFaXw
Payment:
pay_{alphanumeric}
Example: pay_OE1jIbY9HrFaXw
Refund:
rfnd_{alphanumeric}
Example: rfnd_OE1jIbY9HrFaXw
Settlement:
setl_{alphanumeric}
Example: setl_OE1jIbY9HrFaXw
All tools require Razorpay API credentials. Here's how to obtain them:
Pass key_id and key_secret in every tool call. The server uses HTTP Basic Auth (key_id as username, key_secret as password) on each request.
Ensure your Razorpay account has:
payments:read — Read payment detailspayments:write — Capture and update paymentsorders: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.
key_id or key_secret is missing, incorrect, or belongs to a different mode (test vs live)amount is an integer in smallest currency unit (paise, not rupees)currency is a valid ISO 4217 codeauthorized 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_paymentpip 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
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"cl-razorpay-mcp-server": {
"command": "npx",
"args": []
}
}
}