> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Razorpay Local MCP Server Setup

> Complete guide to set up and run the Razorpay MCP Server in your own environment for accounts in the United States.

Available in
🇮🇳 India
🇸🇬 Singapore
🇺🇸 United States

The Razorpay Local MCP Server is a self-hosted solution that runs in your own environment and gives you complete control over your infrastructure. Your AI-assisted application starts the server and passes it your Razorpay API keys.

> [!NOTE]
>
> **Handy Tips**
>
> Region support for the United States is available from version 1.3.0 of the Razorpay MCP Server. If you pulled the Docker image or built the binary earlier, update it before you continue.

## Prerequisites

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

* **Docker**: Container platform for running the MCP server.
* **Git** and **Golang (Go)**: Required only if you build from source.
* **Razorpay API Keys**: Generate [API keys](https://razorpay.com/docs/us/payments/dashboard/account-settings/api-keys.md#generate-api-keys) from your Dashboard.
* **AI-assisted Application**: Claude Desktop, Visual Studio Code or a similar MCP-compatible application.

## Setup Options

Choose a setup method to proceed. You can use the public Docker image (recommended), build the Docker image yourself or build from source.

> [accordion] Public Docker Image (Recommended)
>
> Razorpay publishes the server as the public Docker image `razorpay/mcp`. You do not need to build anything. Ensure Docker is installed and running, then pull the latest image:
>
> ```bash Pull Docker Image theme={null}
> docker pull razorpay/mcp
> ```
>
> To use a specific version, replace `razorpay/mcp` with a version tag such as `razorpay/mcp:v1.3.0` in the configurations below. You can find the available tags on [Docker Hub](https://hub.docker.com/r/razorpay/mcp/tags).

> [accordion] Build the Docker Image
>
> 1. Clone the repository:
>
>    ```bash Clone Repo theme={null}
>    git clone https://github.com/razorpay/razorpay-mcp-server.git
>    cd razorpay-mcp-server
>    ```
>
> 2. Build the Docker image:
>
>    ```bash Build Docker Image theme={null}
>    docker build -t razorpay-mcp-server:latest .
>    ```
>
> The image `razorpay-mcp-server:latest` is now available in your local Docker registry. Use it in place of `razorpay/mcp` in the configurations below.

> [accordion] Build From Source
>
> 1. Clone the repository:
>
>    ```bash Clone Repo theme={null}
>    git clone https://github.com/razorpay/razorpay-mcp-server.git
>    cd razorpay-mcp-server
>    ```
>
> 2. Build the Go binary:
>
>    ```bash Build Go Binary theme={null}
>    go build -o razorpay-mcp-server ./cmd/razorpay-mcp-server
>    ```
>
> The binary `razorpay-mcp-server` is created in your current directory. In your application's MCP configuration, set `command` to the path of the binary instead of `docker`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "razorpay-mcp-server": {
>       "command": "/path/to/razorpay-mcp-server",
>       "args": ["stdio", "--log-file=/path/to/rzp-mcp.log"],
>       "env": {
>         "RAZORPAY_KEY_ID": "your_razorpay_key_id",
>         "RAZORPAY_KEY_SECRET": "your_razorpay_key_secret",
>         "RAZORPAY_REGION": "US"
>       }
>     }
>   }
> }
> ```

## Integration Steps

### Step 1: Configure Application

Follow the integration steps given below:

> [tab] For Claude Desktop
>
> To use the Razorpay MCP Server with Claude Desktop:
>
> 1. Install [Claude Desktop](https://claude.ai/download).
> 2. Go to **Settings** → **Developer** → **Edit Config**.
> 3. Add the following to your `claude_desktop_config.json` file:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "razorpay-mcp-server": {
>       "command": "docker",
>       "args": [
>         "run",
>         "--rm",
>         "-i",
>         "-e",
>         "RAZORPAY_KEY_ID",
>         "-e",
>         "RAZORPAY_KEY_SECRET",
>         "-e",
>         "RAZORPAY_REGION",
>         "razorpay/mcp"
>       ],
>       "env": {
>         "RAZORPAY_KEY_ID": "your_razorpay_key_id",
>         "RAZORPAY_KEY_SECRET": "your_razorpay_key_secret",
>         "RAZORPAY_REGION": "US"
>       }
>     }
>   }
> }
> ```
>
> > [!NOTE]
> >
> > **Handy Tips**
> >
> > * **Replace** `your_razorpay_key_id` and `your_razorpay_key_secret` with the API keys of your account in the United States.
> > * [Configure MCP servers in Claude Desktop](https://modelcontextprotocol.io/quickstart/user)

> [tab] For Visual Studio Code
>
> 1. Open **Visual Studio Code**.
> 2. Open Command Palette and type **Preferences: Open User Settings (JSON)**.
> 3. Select it from the dropdown to open the settings file.
> 4. Paste the following configuration:
>
> ```json theme={null}
> {
>   "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",
>           "-e",
>           "RAZORPAY_REGION",
>           "razorpay/mcp"
>         ],
>         "env": {
>           "RAZORPAY_KEY_ID": "${input:razorpay_key_id}",
>           "RAZORPAY_KEY_SECRET": "${input:razorpay_key_secret}",
>           "RAZORPAY_REGION": "US"
>         }
>       }
>     }
>   }
> }
> ```
>
> Learn more about MCP servers in VS Code's [agent mode documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).

### Step 2: Set the Region

The server runs for one region at a time. Always set the region to `US`, as shown in the configuration samples above. For the United States, the server then:

* Calls the Razorpay API host `api-us.razorpay.com`.
* Shows only the [tools available in the United States](https://razorpay.com/docs/us/mcp-server/tools-reference.md).
* Uses USD as the default currency and describes amounts to the AI assistant in USD.

To set the region, pass `-e RAZORPAY_REGION` in the Docker `args` and add `"RAZORPAY_REGION": "US"` to `env`, or use the `--region US` flag with the binary. The server can also detect the region from the country code in an API key, such as `rzp_live_us_…`, but not every key carries a country code. Without a region, the server defaults to India and requests made with these keys fail authentication.

> [!WARNING]
>
> **Watch Out!**
>
> The region you set must match the country in your API key. For example, setting `IN` with an `rzp_live_us_…` key stops the server with an error.

Refer to [Configuration](https://razorpay.com/docs/us/mcp-server/configuration.md) for all region options, including how to use accounts in more than one region.

### Step 3: Restart Application

Restart your AI assistant application after configuration. You should see [Razorpay MCP tools](https://razorpay.com/docs/us/mcp-server/tools-reference.md) become available. Test the connection by asking: **Show me available Razorpay tools**.

If successful, you should see the list of Razorpay MCP tools available in the United States.

## Next Steps

Once your Local MCP Server is running:

1. **Explore the Tools**: See the [Tools Reference](https://razorpay.com/docs/us/mcp-server/tools-reference.md) for everything you can do.
2. **Configure Advanced Options**: See the [Configuration Guide](https://razorpay.com/docs/us/mcp-server/configuration.md) for detailed settings.
3. **Review Use Cases**: Check [practical examples](https://razorpay.com/docs/us/mcp-server/use-cases.md).
