razorpay-mcp
Provides tools to fetch payments, orders, customers, subscriptions, refunds, and analytics from a Razorpay account, enabling natural language queries for revenue trends, failure analysis, and dashboard summaries.
razorpay-mcp
An MCP (Model Context Protocol) server that connects AI assistants like Claude directly to your Razorpay account. Once configured, you can ask your AI to fetch payments, analyze revenue trends, inspect failed transactions, monitor subscriptions, and get a real-time business dashboard — all in natural language, with no code required.
Quick Start
# Clone
git clone https://github.com/indiamcp/razorpay-mcp
# Install
cd razorpay-mcp
npm install
# Configure
cp .env.example .env
# Add your Razorpay API keys to .env
# Build
npm run build
# Run
npm startRelated MCP server: Safaricom Daraja MCP Server
Claude Desktop Setup
Add this to your claude_desktop_config.json (usually at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"razorpay": {
"command": "node",
"args": ["/path/to/razorpay-mcp/dist/index.js"],
"env": {
"RAZORPAY_KEY_ID": "rzp_test_xxxxxxxxxxxx",
"RAZORPAY_KEY_SECRET": "your_secret_here"
}
}
}
}Or use npx (once published):
{
"mcpServers": {
"razorpay": {
"command": "npx",
"args": ["-y", "@indiamcp/razorpay-mcp"],
"env": {
"RAZORPAY_KEY_ID": "rzp_test_xxxxxxxxxxxx",
"RAZORPAY_KEY_SECRET": "your_secret_here"
}
}
}
}Available Tools
Tool | Description | Key Parameters |
| Fetch a specific payment by ID |
|
| List payments with filters |
|
| Revenue, success rate, method breakdown |
|
| Fetch a specific order by ID |
|
| List orders with filters |
|
| Fetch a specific customer by ID |
|
| List customers |
|
| Fetch a specific subscription by ID |
|
| List subscriptions with filters |
|
| Active count, churn rate, upcoming renewals |
|
| Fetch a specific refund |
|
| List refunds for a payment |
|
| Business health check — revenue today/week/month | (none) |
| Failure reasons, by method and bank |
|
Example Prompts
Once connected, try asking Claude:
"Show me all failed payments in the last 7 days and why they failed"
"What's my total revenue this month?"
"List all active subscriptions"
"Which payment method do my customers prefer?"
"Show me customers who signed up this week"
"What's my subscription churn rate this month?"
"Find payment pay_xxxxx"
"How many refunds are pending?"
"Give me a dashboard summary of my business today"
"Analyze payment failures for the last 30 days"
Security Note
Environment variables only — API keys are read from env vars and never hardcoded or logged
Read-only in v1 — this server only fetches data; it cannot create payments, issue refunds, or modify any records
No data storage — payment data is never persisted or cached by this server
Use test keys during development — Razorpay test keys (
rzp_test_*) are safe and make no real charges
Development
# Run in dev mode (no build needed)
npm run dev
# Type check
npm run lint
# Run tests
npm testPart of IndiaMCP
This server is part of IndiaMCP — a suite of open-source MCP servers for the Indian API stack.
Available Tools
14 toolsget_customerA
Fetch details of a specific customer by ID
Inputs: customer_id (required).
get_dashboard_summaryA
Get a high-level business summary — revenue today, this week, this month, success rate, top payment methods. Perfect for a quick business health check.
Inputs: no named parameters.
get_failed_payment_analysisB
Analyze why payments are failing — breakdown by error code, bank, payment method
Inputs: from (required), to (required).
get_orderA
Fetch details of a specific order by ID
Inputs: order_id (required).
get_paymentA
Fetch details of a specific payment by ID
Inputs: payment_id (required).
get_payment_analyticsA
Analyze payments for a date range — total revenue, success rate, failure breakdown, payment method distribution
Inputs: from (required), to (required).
get_refundC
Fetch details of a specific refund
Inputs: payment_id (required), refund_id (required).
get_subscriptionA
Fetch details of a specific subscription
Inputs: subscription_id (required).
get_subscription_analyticsA
Analyze subscriptions — active count, churn rate, MRR, upcoming renewals
Inputs: from (required), to (required).
list_customersC
List customers with optional filters
Inputs: count, skip.
list_ordersC
List orders with optional filters
Inputs: from (required), to (required), status (required), authorized (required), +3 more.
list_paymentsC
List payments with optional filters
Inputs: from (required), to (required), status (required), count, +1 more.
list_refundsC
List refunds for a payment
Inputs: payment_id (required), count, skip.
list_subscriptionsC
List subscriptions with optional filters
Inputs: from (required), to (required), status (required), count, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Every tool targets a distinct resource or analysis type (customers, orders, payments, refunds, subscriptions, dashboard, failed payment analysis), with no overlapping purposes. An agent can clearly differentiate between them.
All tools follow a consistent verb_noun pattern using lowercase and underscores: 'get_' for single items and 'list_' for collections. No mixing of conventions.
14 tools is well-scoped for a payment gateway MCP, covering all major entities and analytics without being excessive or insufficient.
The tool surface is entirely read-only (get and list operations), lacking any create, update, or delete tools. For a payment gateway, this is a significant gap that prevents agents from taking actions like creating payments or refunds.
Maintenance
Related MCP Connectors
Hosted Stripe MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server that connects AI assistants like Claude to your Chatwoot instance. Manage customer conversations, read messages, send replies, and filter by date ranges -- all through natural language.552 npmMIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that integrates Safaricom's M-PESA Daraja API with Claude, enabling natural language payment processing and real-time transaction notifications.3-
- AlicenseNot gradedqualityBmaintenanceA remote MCP server that lets any AI agent accept payments in India via UPI, cards, netbanking, and wallets through Razorpay Payment Links. Bring your own credentials, stateless, no funds touched.MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server for integrating Xero with GenAI applications.-