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
Setup instructions
Provider
Razorpay
Release date
Apr 27, 2025
Language
Go
Stats
195 stars

The Razorpay MCP Server provides seamless integration with Razorpay APIs through the Model Context Protocol (MCP), enabling advanced payment processing capabilities for developers and AI tools. It can be used for workflow automation and building AI-powered tools that interact with Razorpay's payment ecosystem.

Setup Options

Remote MCP Server (Recommended)

The Remote MCP Server is hosted by Razorpay and provides instant access without any local setup.

Benefits

  • Zero setup - no Docker or Go required
  • Always updated with latest features
  • High availability with 99.9% uptime
  • Reduced latency with optimized routing
  • Enhanced security with token-based authentication
  • No maintenance required

Prerequisites

You need Node.js installed on your system which includes npx:

# Verify installation
npx --version

Authentication

The Remote MCP Server requires merchant token authentication:

  1. Access your API Key and Secret from the Razorpay Dashboard under Settings > API Keys
  2. Generate your merchant token:
    echo <RAZORPAY_API_KEY>:<RAZORPAY_API_SECRET> | base64
    
  3. Use the resulting base64-encoded output as your merchant token

Remote Server Configuration

Cursor Configuration

Add this to your Cursor settings:

{
  "mcpServers": {
    "rzp-sse-mcp-server": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.razorpay.com/sse",
        "--header",
        "Authorization:${AUTH_HEADER}"
      ],
      "env": {
        "AUTH_HEADER": "Bearer <Base64(key:secret)>"
      }
    }
  }
}

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "rzp-sse-mcp-server": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.razorpay.com/sse",
        "--header",
        "Authorization: Bearer <Merchant Token>"
      ]
    }
  }
}

VS Code Configuration

Add to your VS Code settings (JSON):

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "merchant_token",
        "description": "Razorpay Merchant Token",
        "password": true
      }
    ],
    "servers": {
      "razorpay-remote": {
        "command": "npx",
        "args": [
          "mcp-remote",
          "https://mcp.razorpay.com/sse",
          "--header",
          "Authorization: Bearer ${input:merchant_token}"
        ]
      }
    }
  }
}

Local MCP Server Setup

For users who prefer running the server on their own infrastructure:

Prerequisites

  • Docker
  • Golang
  • Git

Using Public Docker Image (Recommended)

Claude Desktop Configuration

Add 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"
            ],
            "env": {
                "RAZORPAY_KEY_ID": "your_razorpay_key_id",
                "RAZORPAY_KEY_SECRET": "your_razorpay_key_secret"
            }
        }
    }
}

VS Code Configuration

Add to your VS Code settings:

{
  "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"
        ],
        "env": {
          "RAZORPAY_KEY_ID": "${input:razorpay_key_id}",
          "RAZORPAY_KEY_SECRET": "${input:razorpay_key_secret}"
        }
      }
    }
  }
}

Build from Docker

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

Then replace razorpay/mcp with razorpay-mcp-server:latest in the configurations.

Build from Source

git clone https://github.com/razorpay/razorpay-mcp-server.git
cd razorpay-mcp-server
go build -o razorpay-mcp-server ./cmd/razorpay-mcp-server

VS Code configuration example:

{
  "razorpay": {
    "command": "/path/to/razorpay-mcp-server",
    "args": ["stdio","--log-file=/path/to/rzp-mcp.log"],
    "env": {
      "RAZORPAY_KEY_ID": "<YOUR_ID>",
      "RAZORPAY_KEY_SECRET" : "<YOUR_SECRET>"
    }
  }
}

Server Configuration Options

Environment variables:

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

Command line flags:

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

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "rzp-sse-mcp-server" '{"command":"npx","args":["mcp-remote","https://mcp.razorpay.com/sse","--header","Authorization:${AUTH_HEADER}"],"env":{"AUTH_HEADER":"Bearer <Base64(key:secret)>"}}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

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

{
    "mcpServers": {
        "rzp-sse-mcp-server": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.razorpay.com/sse",
                "--header",
                "Authorization:${AUTH_HEADER}"
            ],
            "env": {
                "AUTH_HEADER": "Bearer <Base64(key:secret)>"
            }
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "rzp-sse-mcp-server": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.razorpay.com/sse",
                "--header",
                "Authorization:${AUTH_HEADER}"
            ],
            "env": {
                "AUTH_HEADER": "Bearer <Base64(key:secret)>"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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