# Razorpay MCP Server > **Razorpay MCP Server** is a hosted, multitenant Model Context Protocol (MCP) server run by **MewCP** (https://mewcp.com), giving AI agents managed access to Razorpay. > > MewCP takes care of all MCP infrastructure for you — credential storage, OAuth flows, > token refresh, and production-grade auto-scaling — so your AI agents can connect to > third-party services and run freely without you managing any MCP server yourself. > > To connect your agent to this server you need a MewCP account and your API key: > - MEWCP_KEY — your personal API key (dashboard → Developer) > > Server page: https://mewcp.com/mcp/razorpay > MewCP docs: https://docs.mewcp.com > Full catalog: https://mewcp.com/llms.txt ## About Handle payments, orders, refunds and subscription workflows through Razorpay. Manage financial transactions and payment operations for businesses and applications. ## How to connect Server Page URL: https://mewcp.com/mcp/razorpay Gateway URL: https://gateway.mewcp.com/personal/mcp Every request to this server requires one header: Authorization: Bearer — your MewCP API key (dashboard → Developer) All connection snippets and ready-to-use code examples are available on the server page and in this document below. --- ## Server documentation **Automate Razorpay payments, refunds, and settlements through AI.** A Model Context Protocol (MCP) server that exposes Razorpay's API for managing orders, payments, refunds, and settlements. ## Overview The Razorpay MCP Server provides full lifecycle payment management through AI: - Create and track orders, capture and update payments - Issue full or partial refunds with speed control - Query settlements and reconcile transaction history Perfect for: - Automating refund workflows and customer support payment queries - Building AI-powered dashboards that pull live payment and settlement data - Triggering order creation and payment capture from conversational interfaces ## Tools
health_check — Check server readiness Returns a status object confirming the server is running and reachable. **Inputs:** _(none)_ **Output:** ```json { "status": "ok", "server": "CL Razorpay MCP Server" } ```
create_order — Create a new Razorpay order Creates a new order object. The returned order ID is passed to the Razorpay checkout SDK on the frontend to initiate payment. **Inputs:** ``` - `amount` (integer, required) — Amount in smallest currency unit (e.g. paise for INR) - `currency` (string, required) — ISO 4217 currency code, e.g. 'INR' - `receipt` (string, optional) — Merchant receipt number (max 40 chars) - `notes` (object, optional) — Key-value notes to attach to the order - `partial_payment` (boolean, optional) — Whether partial payments are allowed (default: false) ``` **Output:** ```json { "id": "order_XXXXXXXXXX", "entity": "order", "amount": 50000, "currency": "INR", "status": "created" } ```
fetch_order — Fetch a specific order Retrieves full details of a single Razorpay order by its order ID. **Inputs:** ``` - `order_id` (string, required) — Razorpay order ID (e.g. 'order_XXXXXXXXXX') ``` **Output:** ```json { "id": "order_XXXXXXXXXX", "entity": "order", "amount": 50000, "amount_paid": 0, "status": "created" } ```
fetch_all_orders — Fetch paginated list of orders Returns a filtered, paginated list of all Razorpay orders. Supports Unix timestamp range filtering. **Inputs:** ``` - `count` (integer, optional) — Number of orders to fetch, max 100 (default: 10) - `skip` (integer, optional) — Number of orders to skip for pagination (default: 0) - `from_timestamp` (integer, optional) — Unix timestamp — fetch orders created after this time - `to_timestamp` (integer, optional) — Unix timestamp — fetch orders created before this time ``` **Output:** ```json { "entity": "collection", "count": 10, "items": [...] } ```
fetch_payments_for_order — Fetch payments for a specific order Returns all payments made against a given order ID. **Inputs:** ``` - `order_id` (string, required) — Razorpay order ID (e.g. 'order_XXXXXXXXXX') ``` **Output:** ```json { "entity": "collection", "count": 1, "items": [...] } ```
update_order — Update notes on an order Patches the notes field on an existing order. Only the notes field can be updated after creation. **Inputs:** ``` - `order_id` (string, required) — Razorpay order ID (e.g. 'order_XXXXXXXXXX') - `notes` (object, required) — Key-value notes to update on the order ``` **Output:** ```json { "id": "order_XXXXXXXXXX", "notes": { "key": "value" } } ```
fetch_payment — Fetch a specific payment Retrieves full details of a single Razorpay payment by its payment ID. **Inputs:** ``` - `payment_id` (string, required) — Razorpay payment ID (e.g. 'pay_XXXXXXXXXX') ``` **Output:** ```json { "id": "pay_XXXXXXXXXX", "entity": "payment", "amount": 50000, "currency": "INR", "status": "captured" } ```
fetch_all_payments — Fetch paginated list of payments Returns a filtered, paginated list of all Razorpay payments. Supports Unix timestamp range filtering. **Inputs:** ``` - `count` (integer, optional) — Number of payments to fetch, max 100 (default: 10) - `skip` (integer, optional) — Number of payments to skip for pagination (default: 0) - `from_timestamp` (integer, optional) — Unix timestamp — fetch payments created after this time - `to_timestamp` (integer, optional) — Unix timestamp — fetch payments created before this time ``` **Output:** ```json { "entity": "collection", "count": 10, "items": [...] } ```
capture_payment — Capture an authorized payment Captures a payment that is in `authorized` state. The amount must exactly match the authorized amount. **Inputs:** ``` - `payment_id` (string, required) — Razorpay payment ID (e.g. 'pay_XXXXXXXXXX') - `amount` (integer, required) — Amount to capture in smallest currency unit (must match authorized amount) - `currency` (string, required) — ISO 4217 currency code, e.g. 'INR' ``` **Output:** ```json { "id": "pay_XXXXXXXXXX", "status": "captured", "amount": 50000 } ```
update_payment — Update notes on a payment Patches the notes field on an existing payment. **Inputs:** ``` - `payment_id` (string, required) — Razorpay payment ID (e.g. 'pay_XXXXXXXXXX') - `notes` (object, required) — Key-value notes to update on the payment ``` **Output:** ```json { "id": "pay_XXXXXXXXXX", "notes": { "key": "value" } } ```
create_refund — Create a refund for a payment Issues a full or partial refund for a captured payment. Omit amount for a full refund. Speed `optimum` uses instant refund where available. **Inputs:** ``` - `payment_id` (string, required) — Razorpay payment ID to refund (e.g. 'pay_XXXXXXXXXX') - `amount` (integer, optional) — Refund amount in smallest currency unit; omit for full refund - `speed` (string, optional) — Refund speed: 'normal' (default) or 'optimum' - `notes` (object, optional) — Key-value notes to attach to the refund - `receipt` (string, optional) — Unique merchant receipt number for the refund ``` **Output:** ```json { "id": "rfnd_XXXXXXXXXX", "entity": "refund", "amount": 50000, "speed_processed": "normal", "status": "processed" } ```
fetch_refund — Fetch a specific refund Retrieves full details of a single Razorpay refund by its refund ID. **Inputs:** ``` - `refund_id` (string, required) — Razorpay refund ID (e.g. 'rfnd_XXXXXXXXXX') ``` **Output:** ```json { "id": "rfnd_XXXXXXXXXX", "entity": "refund", "amount": 50000, "status": "processed" } ```
fetch_all_refunds — Fetch paginated list of refunds Returns a filtered, paginated list of all Razorpay refunds. Supports Unix timestamp range filtering. **Inputs:** ``` - `count` (integer, optional) — Number of refunds to fetch, max 100 (default: 10) - `skip` (integer, optional) — Number of refunds to skip for pagination (default: 0) - `from_timestamp` (integer, optional) — Unix timestamp — fetch refunds created after this time - `to_timestamp` (integer, optional) — Unix timestamp — fetch refunds created before this time ``` **Output:** ```json { "entity": "collection", "count": 10, "items": [...] } ```
fetch_refunds_for_payment — Fetch all refunds for a payment Returns all refunds issued against a specific payment ID, with pagination support. **Inputs:** ``` - `payment_id` (string, required) — Razorpay payment ID (e.g. 'pay_XXXXXXXXXX') - `count` (integer, optional) — Number of refunds to fetch, max 100 (default: 10) - `skip` (integer, optional) — Number of refunds to skip for pagination (default: 0) ``` **Output:** ```json { "entity": "collection", "count": 2, "items": [...] } ```
update_refund — Update notes on a refund Patches the notes field on an existing refund. **Inputs:** ``` - `refund_id` (string, required) — Razorpay refund ID (e.g. 'rfnd_XXXXXXXXXX') - `notes` (object, required) — Key-value notes to update on the refund ``` **Output:** ```json { "id": "rfnd_XXXXXXXXXX", "notes": { "key": "value" } } ```
fetch_all_settlements — Fetch paginated list of settlements Returns a filtered, paginated list of all Razorpay settlements. Supports Unix timestamp range filtering. **Inputs:** ``` - `count` (integer, optional) — Number of settlements to fetch, max 100 (default: 10) - `skip` (integer, optional) — Number of settlements to skip for pagination (default: 0) - `from_timestamp` (integer, optional) — Unix timestamp — fetch settlements created after this time - `to_timestamp` (integer, optional) — Unix timestamp — fetch settlements created before this time ``` **Output:** ```json { "entity": "collection", "count": 10, "items": [...] } ```
fetch_settlement — Fetch a specific settlement Retrieves full details of a single Razorpay settlement by its settlement ID. **Inputs:** ``` - `settlement_id` (string, required) — Razorpay settlement ID (e.g. 'setl_XXXXXXXXXX') ``` **Output:** ```json { "id": "setl_XXXXXXXXXX", "entity": "settlement", "amount": 1000000, "status": "processed" } ```
## API Parameters Reference
Common Parameters - `count` — Number of records to return per request (max 100, default 10) - `skip` — Number of records to skip; use with `count` for pagination - `from_timestamp` — Unix epoch timestamp (seconds); filters records created at or after this time - `to_timestamp` — Unix epoch timestamp (seconds); filters records created at or before this time
Resource ID Formats **Orders:** ``` order_{alphanumeric} Example: order_OGN1lSF2fk1JNW ``` **Payments:** ``` pay_{alphanumeric} Example: pay_OGN1lSF2fk1JNW ``` **Refunds:** ``` rfnd_{alphanumeric} Example: rfnd_OGN1lSF2fk1JNW ``` **Settlements:** ``` setl_{alphanumeric} Example: setl_OGN1lSF2fk1JNW ```
Amount Formatting All amounts are in the **smallest currency unit**: - INR → paise (₹500.00 = `50000`) - USD → cents ($10.00 = `1000`) - EUR → cents (€10.00 = `1000`)
## Getting Your Razorpay API Keys
Steps 1. Go to the [Razorpay Dashboard](https://dashboard.razorpay.com/) 2. Navigate to **Settings** → **API Keys** 3. Click **Generate Test Key** (for test mode) or **Generate Live Key** (for production) 4. Copy the **Key ID** and **Key Secret** — the secret is only shown once; store it securely > Use test mode keys (prefixed `rzp_test_`) during development and live keys (`rzp_live_`) in production.
## Troubleshooting
Missing or Invalid Headers - **Cause:** API key not provided in request headers or incorrect format - **Solution:** 1. Verify `Authorization: Bearer YOUR_API_KEY` and `X-Mewcp-Credential-Id: CREDENTIAL-ID` headers are present 2. Check API key is active in your MewCP account
Insufficient Credits - **Cause:** API calls have exceeded your request limits - **Solution:** 1. Check credit usage in your Curious Layer dashboard 2. Upgrade to a paid plan or add credits for higher limits 3. Contact support for credit adjustments
Credential Not Connected - **Cause:** No Razorpay credential linked to your account - **Solution:** 1. Go to **Credentials** in your MewCP dashboard 2. Add your Razorpay Key ID and Key Secret 3. Retry the request with the correct `X-Mewcp-Credential-Id` header
Malformed Request Payload - **Cause:** JSON payload is invalid or missing required fields - **Solution:** 1. Validate JSON syntax before sending 2. Ensure all required tool parameters are included 3. Check that `amount` is an integer in the smallest currency unit, not a decimal
Server Not Found - **Cause:** Incorrect server name in the API endpoint - **Solution:** 1. Verify endpoint format: `{server-name}/mcp/{tool-name}` 2. Use correct server name from documentation 3. Check available servers in your Curious Layer account
Razorpay API Error - **Cause:** Upstream Razorpay API returned an error - **Solution:** 1. Check Razorpay service status at [Razorpay Status Page](https://status.razorpay.com/) 2. Verify your API keys have the required permissions for the operation 3. Review the error message for specific details (e.g. payment not in `authorized` state for capture)
---
Resources - **[Razorpay API Documentation](https://razorpay.com/docs/api/)** — Official API reference - **[Razorpay Dashboard](https://dashboard.razorpay.com/)** — Manage keys, orders, and settlements - **[FastMCP Docs](https://gofastmcp.com/v2/getting-started/welcome)** — FastMCP specification - **[FastMCP Credentials](https://pypi.org/project/fastmcp-credentials/)** — FastMCP Credentials package for credential handling
--- ## Connection snippets ### Python (fastmcp) ```python import asyncio from fastmcp import Client from fastmcp.client.transports import StreamableHttpTransport SERVER_URL = "https://gateway.mewcp.com/personal/mcp" MEWCP_KEY = "YOUR_MEWCP_KEY" transport = StreamableHttpTransport( url=SERVER_URL, headers={ "Authorization": f"Bearer {MEWCP_KEY}", } ) async def main(): client = Client(transport) async with client: await client.ping() tools = await client.list_tools() resources = await client.list_resources() prompts = await client.list_prompts() # Change the tool name and arguments with actual tool and arguments available in server result = await client.call_tool("example_tool", {"param": "value"}) print(result) asyncio.run(main()) ``` ### TypeScript (MCP SDK) ```typescript import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; const SERVER_URL = "https://gateway.mewcp.com/personal/mcp"; const MEWCP_KEY = "YOUR_MEWCP_KEY"; const transport = new StreamableHTTPClientTransport(new URL(SERVER_URL), { requestInit: { headers: { Authorization: `Bearer ${MEWCP_KEY}`, }, }, }); const client = new Client({ name: "mewcp-client", version: "1.0.0", }); await client.connect(transport); const tools = await client.listTools(); console.log("Available tools:", tools.tools.map(t => t.name)); // Change the tool name and arguments to a tool available on your server const result = await client.callTool({ name: "example_tool", arguments: { param: "value" }, }); console.log("Tool result:", result); ``` ### VS Code (settings.json) ```json { "servers": { "mewcp": { "type": "http", "url": "https://gateway.mewcp.com/personal/mcp", "headers": { "Authorization": "Bearer YOUR_MEWCP_KEY" } } } } ``` ### Cursor (mcp.json) ```json { "mcpServers": { "mewcp": { "url": "https://gateway.mewcp.com/personal/mcp", "headers": { "Authorization": "Bearer YOUR_MEWCP_KEY" } } } } ``` ### Claude Desktop (claude_desktop_config.json) ```json "mcpServers": { "mewcp": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "https://gateway.mewcp.com/personal/mcp", "--transport", "http-only", "--header", "Authorization: Bearer YOUR_MEWCP_KEY" ] } } ```