razorpay-mcp-server

MCP.Pizza Chef: razorpay

The Razorpay MCP Server is an official Model Context Protocol server that integrates Razorpay's payment APIs into MCP-enabled environments. It allows developers and AI tools to interact programmatically with Razorpay's payment processing system, including capturing payments, fetching payment details, and retrieving card information. This server facilitates seamless, real-time payment operations within AI workflows, enhancing automation and financial transaction management.

Use This MCP server To

Capture authorized payments programmatically via MCP Fetch detailed payment information by payment ID Retrieve card details used in specific payments Integrate Razorpay payment processing into AI workflows Automate payment status updates in financial applications Enable AI agents to manage payment lifecycle events

README

Razorpay MCP Server (Official)

The Razorpay MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with Razorpay APIs, enabling advanced payment processing capabilities for developers and AI tools.

Available Tools

Currently, the Razorpay MCP Server provides the following tools:

Tool Description API
capture_payment Change the payment status from authorized to captured. Payment
fetch_payment Fetch payment details with ID Payment
fetch_payment_card_details Fetch card details used for a payment Payment
fetch_all_payments Fetch all payments with filtering and pagination Payment
update_payment Update the notes field of a payment Payment
create_payment_link Creates a new payment link (standard) Payment Link
create_payment_link_upi Creates a new UPI payment link Payment Link
fetch_all_payment_links Fetch all the payment links Payment Link
fetch_payment_link Fetch details of a payment link Payment Link
send_payment_link Send a payment link via SMS or email. Payment Link
update_payment_link Updates a new standard payment link Payment Link
create_order Creates an order Order
fetch_order Fetch order with ID Order
fetch_all_orders Fetch all orders Order
update_order Update an order Order
fetch_order_payments Fetch all payments for an order Order
create_refund Creates a refund Refund
fetch_refund Fetch refund details with ID Refund
fetch_all_refunds Fetch all refunds Refund
update_refund Update refund notes with ID Refund
fetch_multiple_refunds_for_payment Fetch multiple refunds for a payment Refund
fetch_specific_refund_for_payment Fetch a specific refund for a payment Refund
create_qr_code Creates a QR Code QR Code
fetch_qr_code Fetch QR Code with ID QR Code
fetch_all_qr_codes Fetch all QR Codes QR Code
fetch_qr_codes_by_customer_id Fetch QR Codes with Customer ID QR Code
fetch_qr_codes_by_payment_id Fetch QR Codes with Payment ID QR Code
fetch_payments_for_qr_code Fetch Payments for a QR Code QR Code
close_qr_code Closes a QR Code QR Code
fetch_all_settlements Fetch all settlements Settlement
fetch_settlement_with_id Fetch settlement details Settlement
fetch_settlement_recon_details Fetch settlement reconciliation report Settlement
create_instant_settlement Create an instant settlement Settlement
fetch_all_instant_settlements Fetch all instant settlements Settlement
fetch_instant_settlement_with_id Fetch instant settlement with ID Settlement
fetch_all_payouts Fetch all payout details with A/c number Payout
fetch_payout_by_id Fetch the payout details with payout ID Payout

Use Cases

  • Workflow Automation: Automate your day to day workflow using Razorpay MCP Server.
  • Agentic Applications: Building AI powered tools that interact with Razorpay's payment ecosystem using this Razorpay MCP server.

Setup

Prerequisites

  • Docker
  • Golang (Go)
  • Git

To run the Razorpay MCP server, use one of the following methods:

Using Docker (Recommended)

You need to clone the Github repo and build the image for Razorpay MCP Server using docker. Do make sure docker is installed and running in your system.

# Run the server
git clone https://github.com/razorpay/razorpay-mcp-server.git
cd razorpay-mcp-server
docker build -t razorpay-mcp-server:latest .

Post this razorpay-mcp-server:latest docker image would be ready in your system.

Build from source

# Clone the repository
git clone https://github.com/razorpay/razorpay-mcp-server.git
cd razorpay-mcp-server

# Build the binary
go build -o razorpay-mcp-server ./cmd/razorpay-mcp-server

Binary razorpay-mcp-server would be present in your system post this.

Usage with Claude Desktop

Add the following to your claude_desktop_config.json:

{
    "mcpServers": {
        "razorpay-mcp-server": {
            "command": "docker",
            "args": [
                "run",
                "--rm",
                "-i",
                "-e",
                "RAZORPAY_KEY_ID",
                "-e",
                "RAZORPAY_KEY_SECRET",
                "razorpay-mcp-server:latest"
            ],
            "env": {
                "RAZORPAY_KEY_ID": "your_razorpay_key_id",
                "RAZORPAY_KEY_SECRET": "your_razorpay_key_secret"
            }
        }
    }
}

Please replace the your_razorpay_key_id and your_razorpay_key_secret with your keys.

  • Learn about how to configure MCP servers in Claude desktop: Link
  • How to install Claude Desktop: Link

Usage with VS Code

Add the following to your VS Code settings (JSON):

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "razorpay_key_id",
        "description": "Razorpay Key ID",
        "password": false
      },
      {
        "type": "promptString",
        "id": "razorpay_key_secret",
        "description": "Razorpay Key Secret",
        "password": true
      }
    ],
    "servers": {
      "razorpay": {
        "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "-e",
          "RAZORPAY_KEY_ID",
          "-e",
          "RAZORPAY_KEY_SECRET",
          "razorpay-mcp-server:latest"
        ],
        "env": {
          "RAZORPAY_KEY_ID": "${input:razorpay_key_id}",
          "RAZORPAY_KEY_SECRET": "${input:razorpay_key_secret}"
        }
      }
    }
  }
}

Learn more about MCP servers in VS Code's agent mode documentation.

Configuration

The server requires the following configuration:

  • RAZORPAY_KEY_ID: Your Razorpay API key ID
  • RAZORPAY_KEY_SECRET: Your Razorpay API key secret
  • LOG_FILE (optional): Path to log file for server logs
  • TOOLSETS (optional): Comma-separated list of toolsets to enable (default: "all")
  • READ_ONLY (optional): Run server in read-only mode (default: false)

Command Line Flags

The server supports the following command line flags:

  • --key or -k: Your Razorpay API key ID
  • --secret or -s: Your Razorpay API key secret
  • --log-file or -l: Path to log file
  • --toolsets or -t: Comma-separated list of toolsets to enable
  • --read-only: Run server in read-only mode

Debugging the Server

You can use the standard Go debugging tools to troubleshoot issues with the server. Log files can be specified using the --log-file flag (defaults to ./logs)

License

This project is licensed under the terms of the MIT open source license. Please refer to LICENSE for the full terms.

razorpay-mcp-server FAQ

How do I authenticate the Razorpay MCP Server?
Authentication typically requires Razorpay API keys configured securely within the MCP server environment to authorize API calls.
Can I capture payments that are only authorized?
Yes, the server provides a capture_payment tool specifically to change payment status from authorized to captured.
What payment details can I fetch using this server?
You can fetch comprehensive payment details including amount, status, method, and card information.
Is this MCP server compatible with multiple LLM providers?
Yes, it is designed to work with various LLMs like OpenAI, Claude, and Gemini through the MCP protocol.
How does the server handle sensitive card information?
Card details are fetched securely via Razorpay's APIs, and the server ensures data privacy and compliance with PCI standards.
Can I extend the server with additional Razorpay API endpoints?
Yes, the server architecture allows adding more tools to expose additional Razorpay API functionalities.
What environments support deploying the Razorpay MCP Server?
It can be deployed in cloud or on-premises environments that support MCP server hosting and secure API connectivity.
How do I troubleshoot API errors from Razorpay within this MCP server?
The server logs API responses and errors, enabling debugging and monitoring of payment operations.