> ## 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 MCP Server Configuration

> Detailed configuration options, region settings and advanced setup for the Razorpay MCP Server in the United States.

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

The Razorpay MCP Server uses the following environment variables for configuration:

| Variable | Type | Required | Description |
| - | - | - | - |
| `RAZORPAY_KEY_ID` | string | Yes | Your Razorpay API key ID |
| `RAZORPAY_KEY_SECRET` | string | Yes | Your Razorpay API key secret |
| `RAZORPAY_REGION` | string | No | Region of your Razorpay account. Use `US` for the United States (recommended: always set this) |
| `RAZORPAY_REGION_CONFIG` | string | No | Path to a YAML file that overrides region profiles |
| `LOG_FILE` | string | No | Path to log file for server logs |
| `TOOLSETS` | string | No | Comma-separated list of toolsets to enable (default: `all`) |
| `READ_ONLY` | boolean | No | Run server in read-only mode (default: `false`) |

## Command Line Flags

When running the Local MCP Server binary directly, you can use the following command line flags:

| Flag (Short) | Description |
| - | - |
| `--key` (`-k`) | Your Razorpay API key ID |
| `--secret` (`-s`) | Your Razorpay API key secret |
| `--region` | Region of your Razorpay account. Use `US` for the United States (recommended: always set this) |
| `--region-config` | Path to a YAML file that overrides region profiles |
| `--log-file` (`-l`) | Path to log file |
| `--toolsets` (`-t`) | Comma-separated list of toolsets to enable |
| `--read-only` | Enable read-only mode |

## Regions

The server runs for one region at a time. The region decides:

* Which Razorpay API host is called. For the United States, this is `api-us.razorpay.com`.
* Which tools are available. Tools for products not offered in the region are hidden.
* The default currency and how amounts are described to the AI assistant. For the United States, this is USD.

### How the Region is Chosen

Always set the region to `US`. Not every API key carries a country code, so do not rely on the key to select the region.

The server chooses the region in the following order:

1. The `--region` flag or the `RAZORPAY_REGION` environment variable, if set.
2. Otherwise, the country code in the API key. Keys such as `rzp_live_us_…` or `rzp_test_us_…` select `US`.
3. Otherwise, India (`IN`).

> [!WARNING]
>
> **Watch Out!**
>
> Setting a region that does not match the country in the API key stops the server with an error. For example, `--region IN` with an `rzp_live_us_…` key.

### Regions and Toolsets

The region decides which tools exist. The `--toolsets` and `--read-only` options only narrow that set further.

* If you request a toolset that has no tools in the region, the server stops with an error. For example, `--toolsets payouts --region US`.
* If a requested toolset has some tools that the region does not offer, the server leaves those tools out and logs them.

### Accounts in More Than One Region

If you have Razorpay accounts in more than one region, add one server per region in your MCP client, each with the API keys of that region:

```json theme={null}
{
  "mcpServers": {
    "razorpay-us": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "-e", "RAZORPAY_KEY_ID", "-e", "RAZORPAY_KEY_SECRET", "razorpay/mcp"],
      "env": {
        "RAZORPAY_KEY_ID": "your_us_key_id",
        "RAZORPAY_KEY_SECRET": "your_us_key_secret"
      }
    },
    "razorpay-sg": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "-e", "RAZORPAY_KEY_ID", "-e", "RAZORPAY_KEY_SECRET", "razorpay/mcp"],
      "env": {
        "RAZORPAY_KEY_ID": "your_sg_key_id",
        "RAZORPAY_KEY_SECRET": "your_sg_key_secret"
      }
    }
  }
}
```

### Override a Region Profile

Use a region config file to change the tools the server offers for a region. An entry needs only the fields it changes. The rest are kept from the built-in profile. For example, to serve only payment reads in the United States:

```yaml regions.yaml theme={null}
US:
  tools: ["fetch_payment", "fetch_all_payments"]
```

Pass the file with `--region-config` or `RAZORPAY_REGION_CONFIG`. With Docker, you must also mount the file into the container. For example, add `-v /path/regions.yaml:/regions.yaml -e RAZORPAY_REGION_CONFIG=/regions.yaml` to the `docker run` arguments.

## Related Information

* [Use Cases](https://razorpay.com/docs/us/mcp-server/use-cases.md)
* [Tools Reference](https://razorpay.com/docs/us/mcp-server/tools-reference.md)
* [FAQs](https://razorpay.com/docs/us/mcp-server/faqs.md)
