Razorpay MCP Server

Set up and use the Razorpay Model Context Protocol (MCP) server to integrate Razorpay APIs with AI tools.


The Razorpay MCP Server implements the

to provide seamless integration between Razorpay payment APIs and AI tools. This server enables AI assistants to execute Razorpay API operations, empowering developers to build AI-powered payment applications.

  • Workflow Automation: Streamline your payment processing workflows by connecting AI assistants to your Razorpay account.
  • Agentic Applications: Build AI-powered tools that can interact with Razorpay's payment ecosystem.

The Razorpay MCP Server provides the following tools for integration:

Refer to the Prerequisites section and then choose a setup method to proceed. You can use

or .

Prerequisites

Before setting up the Razorpay MCP Server, ensure you have:

  1. Clone the repository:
    git clone https://github.com/razorpay/razorpay-mcp-server.git
    cd razorpay-mcp-server
  2. Build the Docker image:
    docker build -t razorpay-mcp-server:latest .

The resulting image razorpay-mcp-server:latest will be available in your local Docker registry.

Build From Source Instructions

  1. Clone the repository:
    git clone https://github.com/razorpay/razorpay-mcp-server.git
    cd razorpay-mcp-server
  2. Build the Go binary:
    go build -o razorpay-mcp-server ./cmd/razorpay-mcp-server

The resulting binary razorpay-mcp-server will be created in your current directory.

Follow the integration steps given below:

Step 1: Claude Desktop Configuration

To use the Razorpay MCP Server with Claude Desktop:

  1. Install
  2. Add the following configuration 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"
}
}
}
}

Watch Out!

Remember to replace your_razorpay_key_id and your_razorpay_key_secret with your actual Razorpay API credentials.

Step 2: VS Code Integration

To integrate the Razorpay MCP Server 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}"
}
}
}
}
}

Know more about MCP servers in

.

The Razorpay MCP Server requires the following configurations:

RAZORPAY_KEY_ID

mandatory

string Your Razorpay API key ID.

RAZORPAY_KEY_SECRET

mandatory

string Your Razorpay API key secret.

LOG_FILE

optional

string Path to log file for server logs.

TOOLSETS

optional

string Comma-separated list of toolsets to enable. By default, it is all.

READ_ONLY

optional

boolean Run server in read-only mode. By default, it is false.

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

Below are some examples of how to use the Razorpay MCP Server with Claude:

When using Claude with the Razorpay MCP Server configured, you can create a Payment Link with a natural language command:

"Create a payment link for ₹500 with the description 'Website Development Services' that expires in 7 days"

Claude will use the payment_link.create tool to generate the Payment Link and provide you with the details.

Fetching Order Details

You can retrieve information about an existing Order:

"Fetch the details for order ID order_MdbxVl9Y4xGzID"

Claude will use the order.fetch tool to retrieve and display the Order information.

Handy Tips

You can use standard Go debugging tools to troubleshoot issues with the server.

To debug the Razorpay MCP Server:

  1. Enable verbose logging by setting the LOG_FILE environment variable or using the --log-file flag
  2. Check the log files for error messages and troubleshooting information
  3. For Docker-related issues, use docker logs to view container output

1. What is MCP (Model Context Protocol)?

The Model Context Protocol (MCP) is a standard that allows AI models to interact with external tools and services. It enables AI assistants like Claude to execute operations on platforms like Razorpay through a standardised interface.

2. Can I use the Razorpay MCP Server in production?

Yes, the Razorpay MCP Server is an official integration designed for production use. Make sure to use appropriate API keys based on your environment (test or live).

3. How do I switch between test and live modes?

Use the corresponding Razorpay API keys for the environment you want to use:

  • For test mode, use your test environment API keys.
  • For live mode, use your production API keys.

Know more about

.


Was this page helpful?


razorpay mcp server
razorpay mcp
razorpay model context protocol