CL Razorpay MCP Server
Integrates with Razorpay's payment infrastructure via REST API, providing tools for order management, payment operations (fetching, capturing, updating), refund processing (full and partial), and settlement queries.
Click on "Install 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., "@CL Razorpay MCP Servercreate an order for ₹5000 with receipt ID ORD-123"
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.
CL Razorpay MCP Server
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.
Overview
The CL Razorpay MCP Server provides stateless, multi-tenant access to the Razorpay API:
Order management — create, fetch, update, and list orders
Payment operations — fetch, capture, and update payments
Refund handling — issue full or partial refunds, query refund status
Settlement queries — list and inspect settlement records
Perfect for:
Automating payment operations from AI agents or internal tools
Querying transaction history and settlement data programmatically
Building Claude-powered finance dashboards or customer support bots
Authentication
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:
Log in to your Razorpay Dashboard.
Navigate to Settings → API Keys.
Click Generate Test Key (for sandbox) or Generate Live Key.
Copy the Key ID and Key Secret — the secret is shown only once.
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.
Tools
Lightweight ping that confirms the MCP server is live. No auth required.
Inputs: none
Output:
{ "status": "ok", "server": "CL Razorpay MCP Server" }Orders
Creates 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"
}Retrieves 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.
Retrieves 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 this
Retrieves 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"
Updates 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 set
Payments
Retrieves details of a specific payment.
Inputs:
key_id(string, required)key_secret(string, required)payment_id(string, required) — e.g."pay_XXXXXXXXXX"
Retrieves a paginated list of payments with optional timestamp filters.
Inputs:
key_id(string, required)key_secret(string, required)count(integer, optional) — default10, max100skip(integer, optional) — default0from_timestamp(integer, optional)to_timestamp(integer, optional)
Changes 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"
Updates 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)
Refunds
Creates 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 refund
Output:
{
"id": "rfnd_XXXXXXXXXX",
"entity": "refund",
"amount": 50000,
"payment_id": "pay_XXXXXXXXXX",
"speed_processed": "normal",
"status": "processed"
}Inputs:
key_id(string, required)key_secret(string, required)refund_id(string, required) — e.g."rfnd_XXXXXXXXXX"
Inputs:
key_id(string, required)key_secret(string, required)count(integer, optional) — default10, max100skip(integer, optional) — default0from_timestamp(integer, optional)to_timestamp(integer, optional)
Inputs:
key_id(string, required)key_secret(string, required)payment_id(string, required) — e.g."pay_XXXXXXXXXX"count(integer, optional) — default10skip(integer, optional) — default0
Inputs:
key_id(string, required)key_secret(string, required)refund_id(string, required)notes(object, required)
Settlements
Inputs:
key_id(string, required)key_secret(string, required)count(integer, optional) — default10, max100skip(integer, optional) — default0from_timestamp(integer, optional)to_timestamp(integer, optional)
Inputs:
key_id(string, required)key_secret(string, required)settlement_id(string, required) — e.g."setl_XXXXXXXXXX"
Common Parameters
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 oncreated_atto_timestamp— Unix epoch integer; upper bound oncreated_at
Resource ID Formats
Order:
order_{alphanumeric}
Example: order_OE1jIbY9HrFaXwPayment:
pay_{alphanumeric}
Example: pay_OE1jIbY9HrFaXwRefund:
rfnd_{alphanumeric}
Example: rfnd_OE1jIbY9HrFaXwSettlement:
setl_{alphanumeric}
Example: setl_OE1jIbY9HrFaXwAll tools require Razorpay API credentials. Here's how to obtain them:
Step 1: Sign Up / Log In
Go to Razorpay Dashboard
Sign up or log into your account
Step 2: Generate API Keys
Navigate to Settings → API Keys
Click Generate Test Key for sandbox or Regenerate Live Key for production
Download or copy both Key ID and Key Secret immediately
Step 3: Use Credentials Per Request
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.
Step 4: Required Permissions
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 details
Refer to the Razorpay Authentication Guide for details.
Missing or Invalid API Key
Cause:
key_idorkey_secretis missing, incorrect, or belongs to a different mode (test vs live)Solution:
Re-copy credentials from the Razorpay Dashboard
Ensure you are using test keys for sandbox and live keys for production
Regenerate keys if they have been rotated
Insufficient Credits / Rate Limiting
Cause: API calls have exceeded your account's rate limits
Solution:
Reduce request frequency
Check Razorpay API Best Practices for rate limit guidance
Malformed Request Payload
Cause: Required fields missing or wrong types
Solution:
Ensure
amountis an integer in smallest currency unit (paise, not rupees)Ensure all required tool parameters are provided
Verify
currencyis a valid ISO 4217 code
Payment Cannot Be Captured
Cause: Payment is not in
authorizedstate, or amount mismatchSolution:
Check payment status with
fetch_paymentbefore capturingEnsure
amountincapture_paymentexactly matches the authorized amount
Refund Cannot Be Created
Cause: Payment is not in
capturedstate, or has already been fully refundedSolution:
Verify payment status with
fetch_paymentCheck existing refunds with
fetch_refunds_for_payment
Razorpay API Documentation — Official API reference
Razorpay Authentication Guide — Auth setup guide
Razorpay Orders API — Orders endpoint reference
Razorpay Payments API — Payments endpoint reference
Razorpay Refunds API — Refunds endpoint reference
Razorpay Settlements API — Settlements endpoint reference
FastMCP Docs — FastMCP specification
Setup
pip install -r requirements.txtRunning the Server
# 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 8001Example Tool Call
{
"tool": "create_order",
"arguments": {
"key_id": "rzp_test_XXXXXXXX",
"key_secret": "XXXXXXXXXXXXXXXX",
"amount": 50000,
"currency": "INR",
"receipt": "receipt_001"
}
}Project Structure
cl-mcp-razorpay/
|-- server.py
|-- requirements.txt
|-- README.md
|-- .gitignore
`-- razorpay_mcp/
|-- __init__.py
|-- cli.py
|-- config.py
|-- schemas.py
|-- service.py
`-- tools.pyThis server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Curious-Layer/cl-mcp-razorpay'
If you have feedback or need assistance with the MCP directory API, please join our Discord server