Razorpay MCP server

Provides a bridge between natural language commands and Razorpay's payment processing APIs, enabling seamless integration for payment operations, payment links, and order management.
Back to servers
Provider
Razorpay
Release date
Apr 27, 2025
Language
Go
Stats
182 stars

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. This server exposes numerous Razorpay API endpoints as tools that can be used with AI assistants supporting the MCP protocol.

Installation

Prerequisites

  • Docker
  • Golang (Go)
  • Git

Using Docker (Recommended)

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

# Build the Docker image
docker build -t razorpay-mcp-server:latest .

Building 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

Configuration

The server requires the following configuration:

  • RAZORPAY_KEY_ID: Your Razorpay API key ID
  • RAZORPAY_KEY_SECRET: Your Razorpay API key secret

Optional configuration parameters:

  • LOG_FILE: Path to log file for server logs
  • TOOLSETS: Comma-separated list of toolsets to enable (default: "all")
  • READ_ONLY: Run server in read-only mode (default: false)

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

Usage

Setting Up 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"
            }
        }
    }
}

Replace your_razorpay_key_id and your_razorpay_key_secret with your actual Razorpay API keys.

Setting Up 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}"
        }
      }
    }
  }
}

Available Tools

The Razorpay MCP Server provides the following tools that can be used by AI assistants:

Payment Tools

  • capture_payment: Change payment status from authorized to captured
  • fetch_payment: Fetch payment details with ID
  • fetch_payment_card_details: Fetch card details used for a payment
  • fetch_all_payments: Fetch all payments with filtering and pagination
  • update_payment: Update the notes field of a payment

Payment Link Tools

  • create_payment_link: Creates a new standard payment link
  • create_payment_link_upi: Creates a new UPI payment link
  • fetch_all_payment_links: Fetch all payment links
  • fetch_payment_link: Fetch details of a payment link
  • send_payment_link: Send a payment link via SMS or email
  • update_payment_link: Update a standard payment link

Order Tools

  • create_order: Creates an order
  • fetch_order: Fetch order with ID
  • fetch_all_orders: Fetch all orders
  • update_order: Update an order
  • fetch_order_payments: Fetch all payments for an order

Refund Tools

  • create_refund: Creates a refund
  • fetch_refund: Fetch refund details with ID
  • fetch_all_refunds: Fetch all refunds
  • update_refund: Update refund notes with ID
  • fetch_multiple_refunds_for_payment: Fetch multiple refunds for a payment
  • fetch_specific_refund_for_payment: Fetch a specific refund for a payment

QR Code Tools

  • create_qr_code: Creates a QR Code
  • fetch_qr_code: Fetch QR Code with ID
  • fetch_all_qr_codes: Fetch all QR Codes
  • fetch_qr_codes_by_customer_id: Fetch QR Codes with Customer ID
  • fetch_qr_codes_by_payment_id: Fetch QR Codes with Payment ID
  • fetch_payments_for_qr_code: Fetch Payments for a QR Code
  • close_qr_code: Closes a QR Code

Settlement Tools

  • fetch_all_settlements: Fetch all settlements
  • fetch_settlement_with_id: Fetch settlement details
  • fetch_settlement_recon_details: Fetch settlement reconciliation report
  • create_instant_settlement: Create an instant settlement
  • fetch_all_instant_settlements: Fetch all instant settlements
  • fetch_instant_settlement_with_id: Fetch instant settlement with ID

Payout Tools

  • fetch_all_payouts: Fetch all payout details with account number
  • fetch_payout_by_id: Fetch payout details with payout ID

Debugging

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

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later