Razorpay MCP Payments
Look up payments, orders, refunds and settlements, and create payment links on your Razorpay account.
Quick start
- Add a Razorpay connection with the settings below, then click Test configuration.
- Create an API key for your agent.
- Paste the key below, click Test endpoint, and copy the configuration for your platform.
| Endpoint | https://market.oshaani.com/razorpay (your default connection) or https://market.oshaani.com/razorpay/<connection-id> |
|---|---|
| Transport | Streamable HTTP (stateless, JSON responses). MCP protocol versions 2024-11-05 to 2025-11-25 and 2026-07-28. |
| Authentication | Authorization: Bearer <API key>, using a key from the API keys page. |
Agent configuration
initialize and tools/list against the endpoint, exactly like an agent. No credits are charged.
Any MCP client that supports remote (Streamable HTTP) servers with custom headers.
{
"name": "razorpay",
"transport": "streamable-http",
"url": "https://market.oshaani.com/razorpay",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
~/.cursor/mcp.json (all projects) or .cursor/mcp.json in a project.
{
"mcpServers": {
"razorpay": {
"url": "https://market.oshaani.com/razorpay",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Settings > Developer > Edit Config (claude_desktop_config.json). Uses the mcp-remote bridge; needs Node.js.
{
"mcpServers": {
"razorpay": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://market.oshaani.com/razorpay",
"--header",
"Authorization:${AUTH_HEADER}"
],
"env": {
"AUTH_HEADER": "Bearer YOUR_API_KEY"
}
}
}
}
Run in your terminal, or put the JSON in .mcp.json at the project root.
claude mcp add --transport http razorpay https://market.oshaani.com/razorpay \
--header "Authorization: Bearer YOUR_API_KEY"
# .mcp.json
{
"mcpServers": {
"razorpay": {
"type": "http",
"url": "https://market.oshaani.com/razorpay",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
.vscode/mcp.json (GitHub Copilot agent mode). VS Code prompts for the key once and stores it securely.
{
"inputs": [
{
"type": "promptString",
"id": "oshaani-mcp-key",
"description": "oshaani MCP Marketplace API key",
"password": true
}
],
"servers": {
"razorpay": {
"type": "http",
"url": "https://market.oshaani.com/razorpay",
"headers": {
"Authorization": "Bearer ${input:oshaani-mcp-key}"
}
}
}
}
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"razorpay": {
"serverUrl": "https://market.oshaani.com/razorpay",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Responses API remote MCP tool (Python SDK).
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-4.1",
tools=[{
"type": "mcp",
"server_label": "razorpay",
"server_url": "https://market.oshaani.com/razorpay",
"headers": {"Authorization": "Bearer YOUR_API_KEY"},
"require_approval": "never", # or "always" to approve each tool call
}],
input="What can you do with these tools?",
)
print(response.output_text)
Messages API MCP connector (Python SDK).
import anthropic
client = anthropic.Anthropic()
response = client.beta.messages.create(
model="claude-sonnet-4-5",
max_tokens=1024,
messages=[{"role": "user", "content": "What can you do with these tools?"}],
mcp_servers=[{
"type": "url",
"url": "https://market.oshaani.com/razorpay",
"name": "razorpay",
"authorization_token": "YOUR_API_KEY",
}],
betas=["mcp-client-2025-04-04"],
)
print(response.content)
Official MCP Python SDK 2.x (pip install mcp); works inside any agent framework.
import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import create_mcp_http_client, streamable_http_client
async def main():
headers = {"Authorization": "Bearer YOUR_API_KEY"}
async with create_mcp_http_client(headers=headers) as http:
async with streamable_http_client("https://market.oshaani.com/razorpay", http_client=http) as (read, write, *_):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
print([tool.name for tool in tools.tools])
asyncio.run(main())
Quick check from a terminal: lists the tools without charging credits.
curl -s https://market.oshaani.com/razorpay \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-06-18" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Connection settings
Entered once per connection on market.oshaani.com. Secrets are encrypted and never shown again or sent to agents.
| Setting | Type | Description |
|---|---|---|
Key IDkey_id
required |
string | From Razorpay Dashboard > Account & Settings > API Keys, e.g. rzp_live_XXXXXXXX pattern ^rzp_(test|live)_[A-Za-z0-9]+$ |
Key secretkey_secret
required secret |
string | |
Allow creating orders, payment links and refundsallow_write_actions
|
boolean default false |
Off by default: agents can only read data until this is enabled |
Largest refund per call (paise)max_refund_amount
|
integer | Refunds above this amount are refused. Leave empty for no limit. min 1 |
Tools (11)
list_payments
read-only
List payments, newest first, optionally within a date range
| Argument | Type | Description |
|---|---|---|
from_date |
string (date) | Only records created on or after this date (YYYY-MM-DD, IST) |
to_date |
string (date) | Only records created on or before this date (YYYY-MM-DD, IST) |
count |
integer default 25 |
Number of records to return (max 100) min 1, max 100 |
skip |
integer default 0 |
Number of records to skip, for paging min 0 |
get_payment
read-only
Get a payment's status, method, fees, refunds and failure reason
| Argument | Type | Description |
|---|---|---|
payment_id required |
string | e.g. pay_29QQoUBi66xm2f pattern ^pay_\w+$ |
list_orders
read-only
List orders, newest first, optionally filtered by receipt or date range
| Argument | Type | Description |
|---|---|---|
receipt |
string | Your receipt/reference number for the order |
from_date |
string (date) | Only records created on or after this date (YYYY-MM-DD, IST) |
to_date |
string (date) | Only records created on or before this date (YYYY-MM-DD, IST) |
count |
integer default 25 |
Number of records to return (max 100) min 1, max 100 |
skip |
integer default 0 |
Number of records to skip, for paging min 0 |
get_order
read-only
Get an order and the payment attempts made against it
| Argument | Type | Description |
|---|---|---|
order_id required |
string | e.g. order_DBJOWzybf0sJbb pattern ^order_\w+$ |
list_refunds
read-only
List refunds, newest first, optionally within a date range
| Argument | Type | Description |
|---|---|---|
from_date |
string (date) | Only records created on or after this date (YYYY-MM-DD, IST) |
to_date |
string (date) | Only records created on or before this date (YYYY-MM-DD, IST) |
count |
integer default 25 |
Number of records to return (max 100) min 1, max 100 |
skip |
integer default 0 |
Number of records to skip, for paging min 0 |
list_settlements
read-only
List settlements paid out to your bank account
| Argument | Type | Description |
|---|---|---|
from_date |
string (date) | Only records created on or after this date (YYYY-MM-DD, IST) |
to_date |
string (date) | Only records created on or before this date (YYYY-MM-DD, IST) |
count |
integer default 25 |
Number of records to return (max 100) min 1, max 100 |
skip |
integer default 0 |
Number of records to skip, for paging min 0 |
list_customers
read-only
List saved customers
| Argument | Type | Description |
|---|---|---|
count |
integer default 25 |
Number of records to return (max 100) min 1, max 100 |
skip |
integer default 0 |
Number of records to skip, for paging min 0 |
list_payment_links
read-only
List payment links, optionally filtered by your reference ID or a payment ID
| Argument | Type | Description |
|---|---|---|
reference_id |
string | Reference ID you set when creating the link |
payment_id |
string | Payment made through the link pattern ^pay_\w+$ |
create_order
Create an order to collect a payment through Razorpay Checkout
| Argument | Type | Description |
|---|---|---|
amount required |
integer | Amount in the smallest currency unit, e.g. paise for INR (₹499 = 49900) > 0 |
currency |
string default "INR" |
pattern ^[A-Z]{3}$ |
receipt |
string | Your own reference, unique per order max length 40 |
notes |
object | Up to 15 key/value notes stored with the record |
create_payment_link
Create a shareable payment link and optionally send it to the customer by SMS/email
| Argument | Type | Description |
|---|---|---|
amount required |
integer | Amount in the smallest currency unit, e.g. paise for INR (₹499 = 49900) > 0 |
description required |
string | What the customer is paying for min length 1, max length 2048 |
currency |
string default "INR" |
pattern ^[A-Z]{3}$ |
customer_name |
string | |
customer_email |
string | |
customer_contact |
string | Phone number with country code, e.g. +919000090000 |
notify |
boolean default false |
Send the link to the customer's email/phone |
reference_id |
string | Your own reference, unique per link max length 40 |
expire_in_days |
integer | Link expiry; omit for no expiry min 1, max 180 |
notes |
object | Up to 15 key/value notes stored with the record |
refund_payment
destructive
Refund a captured payment in full or in part. This moves real money.
| Argument | Type | Description |
|---|---|---|
payment_id required |
string | pattern ^pay_\w+$ |
amount |
integer | Partial refund amount in paise; omit to refund the remaining balance > 0 |
speed |
"normal" | "optimum" default "normal" |
'optimum' attempts an instant refund where supported |
receipt |
string | Your own reference for the refund max length 40 |
notes |
object | Up to 15 key/value notes stored with the record |
Billing & errors
Each successful tool call costs 1 oshaani.com credit. initialize, tools/list, failed calls and timeouts are free.
| JSON-RPC code | Meaning |
|---|---|
-32054 (HTTP 401) | Missing, unknown or revoked API key |
-32053 (HTTP 404) | No Razorpay connection configured for your organisation, or the connection ID is wrong |
-32055 (HTTP 403) | Connection disabled or origin not allowed |
-32052 (HTTP 429) | Rate limit reached; retry after a minute |
-32050 | Not enough oshaani.com credits for the call |
-32051 | Billing temporarily unavailable; the call was not run |
Errors from Razorpay itself (bad IDs, permissions) come back as tool results with isError: true so the agent can read and correct them.
See the Razorpay API documentation.