Razorpay MCP Server

Razorpay MCP Server

The Razorpay MCP Server is an official implementation that acts as a bridge between Razorpay's APIs and applications or AI agents supporting the Model Context Protocol. It allows seamless, secure, and extensible integration with Razorpay's advanced payment system through standardized MCP tools.

Author: razorpay


View Protocol

What is Razorpay MCP Server?

The Razorpay MCP Server is a lightweight server that exposes Razorpay's payments and orders capabilities as executable MCP tools, making it easy for LLM-based agents and other MCP-enabled applications to programmatically interact with the Razorpay API. This server can be run locally or in containers and integrates directly with environments like Claude Desktop and Visual Studio Code.

How to Configure

Before running the server, you need to provide your Razorpay API credentials via environment variables or command line flags:

  • RAZORPAY_KEY_ID: Your Razorpay API key ID
  • RAZORPAY_KEY_SECRET: Your Razorpay API key secret
  • Optional: LOG_FILE (path to log file), TOOLSETS (comma-separated toolset list), READ_ONLY (set to true for read-only mode)

Server configuration can be supplied by:

  • Setting environment variables when launching the server
  • Passing flags such as --key, --secret, --log-file, --toolsets, --read-only to the binary

In Claude Desktop or VS Code, credentials and server configuration are set in their respective configuration files as shown in their sections below.

How to Use

Running the Server

Docker (Recommended):

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

After building, provide your Razorpay keys as environment variables when running the container.

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

Integrating with Claude Desktop

Add to 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"
            }
        }
    }
}

Integrating with VS Code

Add 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}"
        }
      }
    }
  }
}

Make sure your API keys are correctly set. Refer to the official documentation for up-to-date integration steps.

Key Features

  • Provides seamless integration between Razorpay API and any MCP-compatible application or agent.
  • Exposes prebuilt tools for major payment and order workflows (such as creating and fetching payments).
  • Supports Docker and native Go binaries for easy deployment across environments.
  • Designed for security, credentials are supplied at runtime (never hardcoded).
  • Allows customizable logging and selective enabling of toolsets.
  • Read-only mode available for safe experimentation.

Use Cases

  • Workflow Automation: Automate payments or order management in business workflows via MCP-compatible AI tools.
  • Agentic Applications: Enable AI agents to directly create and manage Razorpay payments or links in response to user commands.
  • Payment Operations: Seamlessly fetch payment details or order status from Razorpay through LLM-powered interfaces.

FAQ

Q1: Do I need a Razorpay account to use the MCP server?
Yes, you must have valid Razorpay API credentials (RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET) to authenticate and interact with Razorpay services.

Q2: Does the server need to be publically exposed to use with Claude Desktop or VS Code?
No, the server runs locally. Claude Desktop or VS Code connect to your locally running (or containerized) MCP server.

Q3: What permissions are required for the API keys?
The keys need permissions matching the operations/tools you wish to use (e.g., creating or fetching payments/links/orders).

Q4: Is my sensitive data secure when using the Razorpay MCP Server?
Credentials are provided at runtime and never hardcoded. You control access to the local server, and sensitive information is not shared by default.

Q5: What happens if I enable read-only mode?
In read-only mode, write operations such as creating payments, payment links, or orders are disabled; only retrieval tools will function.