MCP access over CodeRabbit Reverse Tunnel was introduced in connector image
20260818224116. Run that image or a newer one to serve MCP routes; earlier images have no purpose-aware routing.Before you begin
You need the following before you write a configuration file:- A route key and a connector token for each destination. CodeRabbit issues these when it provisions a route for your workspace. Contact CodeRabbit Support or CodeRabbit Sales to have a route provisioned.
- Outbound HTTPS from the connector to the CodeRabbit gateway. No inbound ports are opened.
- HTTPS reachability from the connector to each destination you want to expose.
Enable the configuration file
SetREVERSE_TUNNEL_CONFIG_FILE to the path of your configuration file:
REVERSE_TUNNEL_CONFIG_FILE is unset or blank, the connector behaves exactly as before. When the variable is set, the connector loads the file instead and serves every route it declares.
A few properties of the loader are worth knowing:
- Both YAML and JSON are accepted. The examples here use YAML.
- Parsing is strict. An unknown field or a duplicate key is an error, not a warning, which means a typo fails loudly instead of being silently ignored.
- If the file cannot be read or fails validation at startup, the connector exits. It does not fall back to environment variables.
Configuration schema
Top level
connector
Settings that apply to the connector process as a whole.defaults
Optional values that every route inherits unless it sets its own.defaults holds two blocks, origin and reconnect.
There is no top-level
origin or reconnect key. Both appear only inside defaults and inside each route.
origin
Origin settings control how the connector connects to your internal destination. They appear in two places: underdefaults.origin, where they apply to every route, and under routes[].origin, where they override the default for that one route. serverName and hostHeader are route-only and cannot be set under defaults.
reconnect
Set these underdefaults.reconnect to apply to every route, or under routes[].reconnect for a single route.
routes
Each entry inroutes describes one destination.
To keep a token out of the file itself, reference an environment variable as the entire value:
token, and only when the reference is the whole value.
allowedHosts is matched exactly and case-insensitively. There is no subdomain or glob matching, so internal.example.com does not cover mcp.internal.example.com. A single * entry allows every host.
Durations and inheritance
Every duration is a string such as30s, 5m, or 15m, and must be positive. A bare number is rejected.
Settings resolve in this order: the value on the route, then the value under defaults, then the built-in default.
Example configuration
This connector serves two destinations — a GitHub Enterprise Server instance and an internal MCP server — from one process:MCP route settings
You do not choose a transport. CodeRabbit derives it from the server URL you register.
Reload behavior
A file-configured connector re-reads its configuration about every 30 seconds. A connector configured through environment variables never reloads. Polling rather than signalling is what lets a mountedConfigMap change take effect on its own, without an exec or a restart.
If a reload fails to parse or validate, the connector logs the failure and keeps the configuration it is already running. A broken edit does not take down live routes.
Health and readiness
The connector serves/healthz and /readyz on the metrics listener. Setting metricsListenAddr to disabled removes both endpoints along with metrics.
Both endpoints return the same body, so you can see per-route state from either:
source is file or environment, which is a quick way to confirm that a connector actually picked up the configuration file you intended.
Recommended topology
Routes in one connector process are isolated from each other, but they still share runtime, credentials, and network egress identity. Running Git and MCP traffic as separate deployments of the same image is the safer default: a restart or a bad configuration edit on the MCP side then cannot disturb pull request reviews. Use one process for both when the operational simplicity matters more, such as in a small environment or during evaluation.What’s next
Connect an MCP server
Add the MCP server in CodeRabbit and set its connection mode to Reverse tunnel.
Reverse Tunnel overview
Review the architecture, components, and traffic paths behind the tunnel.