Razorpay MCP server
Let AI assistants work with Razorpay over MCP: orders, payments, payment links, QR codes, refunds and settlements.
PaymentsGuided#mcp#payments#upi#india#ai-agents#payment-links
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
The Razorpay MCP server is Razorpay's official Model Context Protocol server. It gives an AI assistant tools for the everyday Razorpay jobs: look up payments, orders, refunds, settlements and payouts; create orders, payment links and UPI QR codes; capture authorised payments; and generate Standard Checkout integration code for your stack. Razorpay hosts it as a remote server at https://mcp.razorpay.com/mcp (Streamable HTTP; the old /sse endpoint was deprecated on 13 August 2025), and the Go source is open at github.com/razorpay/razorpay-mcp-server for self-hosting. Availability: India.
Getting credentials
You have two ways to authenticate with the remote server:
A. API key (merchant token, used by this collection).
- Log in to the Razorpay Dashboard, switch to Test mode while you try things out.
- Open Account & Settings > API Keys and generate a key. Copy the Key ID and the Key Secret (the secret is shown once).
- The server expects
Authorization: Basic <base64 of key_id:key_secret>. Razorpay calls the base64 string the merchant token; make it withecho -n 'KEY_ID:KEY_SECRET' | base64(use-nso no newline sneaks into the token). - In this collection just fill
keyIdandkeySecret: the collection's Basic auth builds the header for you.
B. OAuth 2.0. Clients that support MCP OAuth (the official Razorpay connector in Claude, ChatGPT, Replit, Claude Code's /mcp) discover https://mcp.razorpay.com/.well-known/oauth-authorization-server, register with /register (dynamic client registration), send you to /authorize with PKCE S256, and exchange the code at /token for a short-lived Bearer token. The documented scope is read_only, so an OAuth connection is meant for lookups; use API keys for the write tools. Folder 1 shows these discovery calls; to try OAuth in this app, use the MCP editor's OAuth sign-in and switch the request auth to Bearer.
Add it to your AI client
- Claude Code:
claude mcp add --transport http razorpay https://mcp.razorpay.com/mcp --header "Authorization: Basic <merchant token>"(or leave the header out and authenticate with/mcp). - Claude Desktop / claude.ai: Razorpay is an official connector: Settings > Connectors, find Razorpay, Connect, and approve in the Razorpay consent screen.
- Cursor (
mcp.json):{"mcpServers": {"razorpay": {"command": "npx", "args": ["mcp-remote", "https://mcp.razorpay.com/mcp", "--header", "Authorization:${AUTH_HEADER}"], "env": {"AUTH_HEADER": "Basic <merchant token>"}}}}. - VS Code: declare a
promptStringinput with"password": truefor the token and runnpx mcp-remote https://mcp.razorpay.com/mcp --header "Authorization: Basic ${input:merchant_token}"as the server command, as in the README.
Run order and variables
Fill keyId and keySecret (test mode), then run folder 2 (create an order, copy its id into orderId), folder 3 (payments), folder 4 (payment links and QR codes), folder 5 (refunds, settlements, payouts; accountNumber is your RazorpayX account) and folder 6 (checkout code helper). Amounts are in the smallest currency unit: 50000 = INR 500.00.
Remote vs local tools
The remote server leaves out create_refund, close_qr_code, create_instant_settlement and create_registration_link; run the server yourself (Docker or Go, with --read-only and --toolsets options) if you need them. Three tool names in the code differ from the README table: the real names are payment_link_upi_create (README: create_payment_link_upi), payment_link_notify (send_payment_link) and fetch_payout_with_id (fetch_payout_by_id). This collection uses the names from the code.
Safety
Write tools act on real money in live mode: create_order, create_payment_link, payment_link_upi_create, payment_link_notify (sends SMS/email to a customer), capture_payment (settles funds), create_qr_code and the update_* tools. Use test keys while building, keep a human approval step for every write in live mode, give agents a restricted key where possible, and never paste the merchant token into a prompt. Rate limits follow the Razorpay APIs (docs).
Common errors
| Response | Meaning | Fix |
|---|---|---|
| HTTP 401 | Missing or wrong Basic token / expired OAuth token | Rebuild the token from key:secret without a trailing newline |
BAD_REQUEST_ERROR in the tool result | Invalid argument (amount, id prefix) | Check order_, pay_, plink_, qr_, rfnd_ prefixes and paise amounts |
| Tool not found | Local-only tool on the remote server | Self-host the server |
isError: true, capture amount mismatch | Capture amount must equal the authorised amount | Fetch the payment first |
Docs: MCP server overview, remote setup, OAuth, tools reference.
Endpoints 28
1. Start here: auth discovery
- POSTCall /mcp without credentials (expect 401)
{{mcpUrl}}Sends an MCP initialize request with no Authorization header to show that the remote server refuses anonymous clients. With the collection's Basic auth (keyId… - POSTInitialize with your merchant token
{{mcpUrl}}Runs the MCP initialize handshake as raw JSON-RPC using the collection's Basic auth, so you can see the protocol version, server name and capabilities the… - GETOAuth authorization server metadata
{{authBase}}/.well-known/oauth-authorization-serverReads the OAuth discovery document that OAuth-capable MCP clients use: authorize, token and registration endpoints, the read_only scope, PKCE S256, and the… - POSTRegister an OAuth client (dynamic registration)
{{authBase}}/registerRegisters an OAuth client with POST /register as described in Razorpay's MCP OAuth guide. client_name, redirect_uris, grant_types and response_types are…
2. Orders
- MCPCreate an order
{{mcpUrl}}Calls create_order. amount (smallest unit, so 50000 = INR 500) and currency are required; receipt (unique, max 40 chars), notes (up to 15 pairs) and… - MCPFetch an order
{{mcpUrl}}Calls fetch_order with order_id (prefix order_) and returns amount, amount_paid, amount_due, status (created, attempted, paid) and attempts. Use it to check… - MCPList orders
{{mcpUrl}}Calls fetch_all_orders with optional count (max 100), skip, from and to (Unix seconds), receipt, authorized (0 or 1) and expand (payments, payments.card,… - MCPPayments for an order
{{mcpUrl}}Calls fetch_order_payments with an order_id and lists every payment attempt made against it, including failed ones, with status and method. Copy a pay_ id… - MCPUpdate order notes
{{mcpUrl}}Calls update_order to replace the notes on an order. order_id and notes are both required; notes take up to 15 key-value pairs of 256 characters. Only notes…
3. Payments
- MCPList payments
{{mcpUrl}}Calls fetch_all_payments with optional count (default 10, max 100), skip, and a from/to window in Unix seconds. Returns payments newest first with status,… - MCPFetch a payment
{{mcpUrl}}Calls fetch_payment with payment_id (prefix pay_) and returns the full payment: amount in paise, status (created, authorized, captured, refunded, failed),… - MCPFetch card details of a payment
{{mcpUrl}}Calls fetch_payment_card_details with a card payment's id and returns the card network, type, issuer and last four digits. Only works for payments made by… - MCPAdd notes to a payment
{{mcpUrl}}Calls update_payment to set notes on a payment; payment_id and notes are required and values must be strings or integers. Handy for tagging payments with your… - MCPCapture an authorised payment
{{mcpUrl}}Calls capture_payment to move a payment from authorized to captured, which settles the money to you. payment_id, amount (must equal the authorised amount, in…
4. Payment links and QR codes
- MCPCreate a payment link
{{mcpUrl}}Calls create_payment_link. amount (paise) and currency are required; description, customer_name, customer_email, customer_contact, notify_sms, notify_email,… - MCPCreate a UPI payment link
{{mcpUrl}}Calls payment_link_upi_create (listed as create_payment_link_upi in the README). Same fields as a standard link, but INR only and the customer pays through a… - MCPFetch a payment link
{{mcpUrl}}Calls fetch_payment_link with payment_link_id (prefix plink_) and returns its status (created, partially_paid, paid, expired, cancelled), amount_paid and the… - MCPList payment links
{{mcpUrl}}Calls fetch_all_payment_links. Optional filters: payment_id, reference_id and upi_link (1 for UPI links only). Use it to find the link you sent for a given… - MCPResend a payment link
{{mcpUrl}}Calls payment_link_notify (README name: send_payment_link) with payment_link_id and medium set to sms or email. This sends a real message to the customer on… - MCPCreate a UPI QR code
{{mcpUrl}}Calls create_qr_code. type must be upi_qr and usage is single_use or multiple_use; name, description, fixed_amount with payment_amount (paise), close_by and… - MCPList QR codes
{{mcpUrl}}Calls fetch_all_qr_codes with optional count (max 100), skip and a from/to window in Unix seconds. Returns QR codes with status, usage and total amount…
5. Refunds, settlements and payouts
- MCPList refunds
{{mcpUrl}}Calls fetch_all_refunds with optional count, skip, from and to. Returns refunds with rfnd_ ids, payment_id, amount, speed and status (pending, processed,… - MCPRefunds for a payment
{{mcpUrl}}Calls fetch_multiple_refunds_for_payment with a payment_id (prefix pay_) and lists every refund issued against it, with optional count, skip, from and to… - MCPList settlements
{{mcpUrl}}Calls fetch_all_settlements with optional count (max 100), skip, from and to. Returns settlements (setl_ ids) with amount, fees, tax, UTR and status, so you… - MCPSettlement reconciliation report
{{mcpUrl}}Calls fetch_settlement_recon_details for a year and month (day optional, plus count and skip) and returns line-by-line recon: which payments, refunds and… - MCPList RazorpayX payouts
{{mcpUrl}}Calls fetch_all_payouts. account_number (your RazorpayX business account, from the accountNumber variable) is required; count and skip page the results.…
6. Checkout integration helper
- MCPDetect a project's stack
{{mcpUrl}}Calls detect_stack with a list of project file paths and, optionally, the contents of package.json, requirements.txt, go.mod and similar manifests. It returns… - MCPGenerate Standard Checkout code
{{mcpUrl}}Calls integrate_razorpay_checkout with language, backendFramework and frontendFramework (all required, from fixed lists such as typescript/nextjs/react or…
API details
- Base URL
https://mcp.razorpay.com/mcp- Authentication
- HTTP Basic authentication (username and password)
OAuth 2.0 (authorization code flow) with 1 scope - Operations
- 28 operations on 28 pathsPOST 27GET 1
- Main resources
- 1. Start here: auth discovery 42. Orders 53. Payments 54. Payment links and QR codes 75. Refunds, settlements and payouts 56. Checkout integration helper 2
- Description format
- Swastik Codes guided collection, API version
checked against the docs on 2026-11-18 - Links
- Documentation
How to test the Razorpay MCP server in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Razorpay MCP server collection, without the publisher's secrets.
- Add your credentialsThis API uses HTTP Basic authentication (username and password). Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Call /mcp without credentials (expect 401)” (POST {{mcpUrl}}), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Razorpay MCP server?
Let AI assistants work with Razorpay over MCP: orders, payments, payment links, QR codes, refunds and settlements. It is listed under Payments and has 28 endpoints.
Who publishes the Razorpay MCP server?
It is listed from Razorpay's public API description (an OpenAPI document), not published by Razorpay on Swastik Codes. Anyone who controls razorpay.com can claim the profile by adding a DNS TXT record.
What is the base URL of the Razorpay MCP server?
Requests go to https://mcp.razorpay.com/mcp. Endpoint paths are added to this base URL.
How do I authenticate with the Razorpay MCP server?
It accepts 2 methods: HTTP Basic authentication (username and password); OAuth 2.0 (authorization code flow) with 1 scope.
How many endpoints does the Razorpay MCP server have?
28 operations on 28 paths (27 POST, 1 GET). The largest groups are 1. Start here: auth discovery, 2. Orders, 3. Payments, 4. Payment links and QR codes.
Is forking the Razorpay MCP server free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.