home / mcp / razorpay mcp server

Razorpay MCP Server

Provides access to Razorpay payment APIs and tools via an MCP server for automated workflows and AI-powered integrations.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "razorpay-razorpay-mcp-server": {
      "url": "https://mcp.razorpay.com/mcp",
      "headers": {
        "RAZORPAY_KEY_ID": "your_key_id",
        "RAZORPAY_KEY_SECRET": "your_key_secret"
      }
    }
  }
}

You deploy the Razorpay MCP Server to connect your applications or AI tools to Razorpay APIs, enabling automated payment workflows, data access, and action endpoints. You can run a remote MCP server with zero setup or host a local instance to access all available tools and customize your environment.

How to use

Connect your MCP client to Razorpay MCP Server to perform actions such as capturing payments, fetching payments, creating payment links, managing orders, refunds, QR codes, settlements, payouts, and more. Use the remote MCP server for quick access with automatic updates, or run a local MCP server to retain full control and access every tool.

How to install

Prerequisites depend on whether you choose a remote or local MCP server.

Option 1: Use Remote MCP Server (recommended for most users) to connect instantly without local setup.

Option 2: Run Local MCP Server on your infrastructure to access all tools and customize your environment.

Remote MCP Server setup (zero local setup)

{
  "mcpServers": {
    "rzp_remote": {
      "type": "http",
      "url": "https://mcp.razorpay.com/mcp",
      "args": []
    }
  }
}

Local MCP Server setup (Docker)

Run the official Razorpay MCP Server locally using Docker. Provide your Razorpay key ID and key secret as environment variables.

{
  "mcpServers": {
    "razorpay_mcp": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "RAZORPAY_KEY_ID",
        "-e",
        "RAZORPAY_KEY_SECRET",
        "razorpay/mcp"
      ],
      "env": {
        "RAZORPAY_KEY_ID": "your_razorpay_key_id",
        "RAZORPAY_KEY_SECRET": "your_razorpay_key_secret"
      }
    }
  }
}

Run from source (build from Docker or build from source)

If you prefer to build locally, you can either build the Docker image or compile from source and run directly.

# Build the Docker image from the repository (assuming you have Git and Docker)
# git clone https://github.com/razorpay/razorpay-mcp-server.git
# cd razorpay-mcp-server
# docker build -t razorpay-mcp-server:latest .
```
```bash
# Or build from source and run the binary directly
# git clone https://github.com/razorpay/razorpay-mcp-server.git
# cd razorpay-mcp-server
# go build -o razorpay-mcp-server ./cmd/razorpay-mcp-server

Additional sections

Configuration details, security considerations, and troubleshooting options are provided to help you tailor the MCP server to your environment.

For the remote server, you typically provide a merchant token or base64-encoded credentials in your client configuration when composing requests. For the local server, set environment variables RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET to your Razorpay API credentials.

Notes on security and maintenance

Use secure channels for all communications with the MCP server. Rotate credentials as recommended by Razorpay, and limit permissions to only what is needed by your tools and workflows. When running locally, keep your Docker images up to date and follow best practices for secret management.

Troubleshooting tips

If you encounter connection issues, verify that the MCP URL is reachable for remote mode or that Docker is running with the correct environment variables. Check that your Razorpay credentials are valid and have the necessary permissions for the actions you request.

Available tools

capture_payment

Change the 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.

initiate_payment

Initiate a payment using saved payment method with order and customer details.

resend_otp

Resend OTP if the previous one was not received or expired.

submit_otp

Verify and submit OTP to complete payment authentication.

create_payment_link

Creates a new payment link (standard).

create_payment_link_upi

Creates a new UPI payment link.

fetch_all_payment_links

Fetch all the 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

Updates a new standard payment link.

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.

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.

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.

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.

fetch_all_payouts

Fetch all payout details with A/c number.

fetch_payout_by_id

Fetch the payout details with payout ID.

fetch_tokens

Get all saved payment methods for a contact number.

revoke_token

Revoke a saved payment method (token) for a customer.