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

# Connect MCP servers

> Connect CodeRabbit to external tools and data sources through the Model Context Protocol (MCP) for enhanced code reviews with richer contextual understanding.

export const TeamPlanBadge = ({tip = "This feature is available on Team (formerly Pro+), Advanced, and Enterprise. Please refer to our pricing page for more information about our plans and features.", title = "Team Plan", cta = "Read more", href = "https://coderabbit.ai/pricing", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="shield-plus" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const EssentialsPlanBadge = ({tip = "This feature is available on Essentials (formerly Pro), Team (formerly Pro+), Advanced, and Enterprise. Please refer to our pricing page for more information about our plans and features.", title = "Essentials Plan", cta = "Read more", href = "https://coderabbit.ai/pricing", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="shield-check" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const AllPlatformsBadge = ({tip = "This feature is available on all supported platforms: GitHub, GitLab, Azure DevOps, and Bitbucket.", title = "All Platforms", cta, href, disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="globe" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

<AllPlatformsBadge /> | <EssentialsPlanBadge /> <TeamPlanBadge />

Connect CodeRabbit to external tools and data sources through the Model Context Protocol (MCP). CodeRabbit acts as the MCP client and uses the server's tools to provide richer context during supported workflows.

<Info>
  The number of MCP server connections you can configure depends on your plan. See [Plans and pricing — MCP servers](/management/plans#mcp-servers) for current limits.
</Info>

## What MCP integration enables

<CardGroup cols={3}>
  <Card title="Code reviews">
    Enhanced analysis with external context and documentation
  </Card>

  <Card title="Code suggestions">
    Improved validation using your organization's knowledge
  </Card>

  <Card title="PR chat">
    Access to relevant documentation and project information
  </Card>
</CardGroup>

## Supported integrations

The [Connections](https://app.coderabbit.ai/connections) page includes all connections including MCP connectors. A suggested connector supplies the server name, hosted endpoint, and authentication method. To connect another MCP server, select the custom connector and enter its connection details manually.

## Considerations

<CardGroup cols={1}>
  <Card>
    <Info>
      **CodeRabbit as MCP client**: CodeRabbit acts as the MCP client, not the
      server. It ingests data from your connected MCP servers.
    </Info>

    <Warning>
      **Data relevance**: Consider what MCP data will be helpful for code
      reviews. CodeRabbit uses this data for analysis, validation, and chat
      interactions.
    </Warning>

    <Tip>
      **Faster integrations**: This approach unlocks integrations without
      waiting for formal CodeRabbit support. If a tool has an MCP server,
      CodeRabbit can connect to it via custom MCP server setup.
    </Tip>
  </Card>
</CardGroup>

## Setup

<Steps>
  <Step title="Open Connections">
    Open [Connections](https://app.coderabbit.ai/connections) and select **Add connection**.
  </Step>

  <Step title="Choose an MCP server">
    Select a suggested connector and choose its MCP connection method, or select the custom connector for a custom setup.

    Add **Usage guidance** when CodeRabbit needs help finding the right information on the server. See [User guidance](#user-guidance) for details.
  </Step>

  <Step title="Choose a connection mode (optional)">
    *This choice appears only when your workspace has an active CodeRabbit Reverse Tunnel route for MCP.*

    Choose **Direct** when CodeRabbit can reach the server at a public HTTPS URL, or **Reverse tunnel** when the server runs on a private network. See [Connect through a reverse tunnel](#connect-through-a-reverse-tunnel).
  </Step>

  <Step title="Complete authentication">
    Enter the required API token, complete OAuth, or continue without authentication according to the server's configuration.
  </Step>

  <Step title="Configure tools">
    Discover the tools exposed by the server and choose which tools CodeRabbit may use, then save the connection.
  </Step>

  <Step title="Add the connection to Base Scopes">
    Add the saved connection to the Base Scope for each product that should use it. If you did not add it during connection setup, use [Review scopes](/connections/scopes-review), [Slack scopes](/slack-agent/connections-and-scopes), or [Discord scopes](/discord-agent/connections-and-scopes) to select it.
  </Step>
</Steps>

## Manage authentication

For an existing MCP connection marked as needing authentication, an administrator can select **Authenticate** to complete the required authentication flow.

For an editable MCP connection that uses OAuth, an administrator can select **Re-authenticate** to start OAuth again. **Re-authenticate** is available even when the current token is healthy, so the administrator can approve newly required permissions before the token expires. API-key connections do not show the OAuth **Re-authenticate** action.

<Info>
  If a provider returns an incomplete permission grant, CodeRabbit stops setup and shows a permissions message instead of saving a connection that cannot read the requested content. Restart authentication and approve the requested read access.
</Info>

### Atlassian

The Atlassian MCP connection uses `https://mcp.atlassian.com/v1/mcp/authv2`. During OAuth consent, it requests these Jira and Confluence read and search permissions:

* `read:jira-work`
* `search:confluence`
* `read:confluence-user`
* `read:page:confluence`
* `read:space:confluence`
* `read:comment:confluence`
* `read:hierarchical-content:confluence`

CodeRabbit uses these permissions to retrieve Jira issue and Confluence page context during reviews and agent workflows.

<Warning>
  **Existing Atlassian connections:** A connection stored under the former `/v1/mcp` route does not migrate automatically. When an administrator selects **Re-authenticate**, CodeRabbit moves the connection to `/v1/mcp/authv2` and preserves the upgraded URL. If the connection's token lacks the required Jira or Confluence read permissions, token refresh cannot add them. Select **Re-authenticate**, approve the requested permissions, and then run a new review for the added context to become available.
</Warning>

## Connect through a reverse tunnel

CodeRabbit can reach an MCP server that has no public address and no inbound firewall rule, using the [CodeRabbit Reverse Tunnel](/self-hosted/coderabbit-reverse-tunnel). A connector running inside your network dials out to CodeRabbit, and reviews call your internal MCP tools over that outbound connection.

Set **Connection mode** when you add or edit an MCP server:

| Mode               | Behavior                                                             |
| ------------------ | -------------------------------------------------------------------- |
| **Direct**         | CodeRabbit connects to the MCP server over a public HTTPS URL.       |
| **Reverse tunnel** | CodeRabbit connects through a connector running inside your network. |

You do not pick a route. Enter the server URL and CodeRabbit matches it against the active routes in your workspace. If no route covers that URL, saving fails with `No active workspace connector route matches this MCP server.`

Requirements and limits for reverse tunnel mode:

* The server URL must use HTTPS, and its origin must fall within a route your workspace already has.
* Streamable HTTP and SSE transports both work. WebSocket transport is not supported over the tunnel.
* The route must be active. CodeRabbit provisions routes; they are not self-service.

<Info>
  The **Connection mode** control is hidden until your workspace has at least one active MCP route. To set one up, see [Reverse Tunnel connector configuration](/self-hosted/reverse-tunnel-connector-configuration).
</Info>

## How it works

<Tabs>
  <Tab title="During code reviews">
    CodeRabbit automatically calls relevant MCP tools during analysis to:

    <CardGroup cols={2}>
      <Card title="Gather context">
        Collects additional review context from your connected data sources
      </Card>

      <Card title="Enhance comments">
        Validates and enriches suggested review comments with relevant information
      </Card>
    </CardGroup>

    <Info>
      Enhanced review comments will include enriched insights while maintaining your existing workflow. Tools used during analysis are listed under **"Additional context used."**
    </Info>
  </Tab>

  <Tab title="In chat interactions">
    MCP integration enhances chat by providing access to:

    <CardGroup cols={2}>
      <Card title="Contextual information">
        Retrieves relevant information based on discussion topics
      </Card>

      <Card title="External documentation">
        Accesses your organization's knowledge bases and documentation
      </Card>
    </CardGroup>
  </Tab>
</Tabs>

## User guidance

The **Usage guidance** field contains instructions that CodeRabbit reads before using your MCP server. Use it to describe what information is available, what to look for, and why it matters for code reviews.

Some MCP servers need no additional guidance—the agent can figure out how to use their tools on its own. But many servers benefit from explicit context, especially when:

* The server stores a wide variety of content (for example, a Notion workspace covering engineering specs, meeting notes, HR policies, and runbooks)
* The server uses internal naming conventions or project keys that the agent can't guess
* The server is a custom in-house tool whose purpose isn't obvious from its tool names alone
* Resources are organized in non-standard hierarchies that the agent can't automatically navigate

### What to include in user guidance

Good user guidance answers three questions for the agent:

1. **What is stored here?** Describe the kind of information available on this MCP server.
2. **What should CodeRabbit look for?** Narrow the scope to what's relevant for code reviews.
3. **How is it organized?** Provide naming conventions, key formats, or URL patterns the agent needs to find the right resources.

### Example configurations

<Tabs>
  <Tab title="Notion">
    Notion workspaces can contain many different types of content. Tell the agent which pages or databases are relevant to code reviews:

    ```text wrap theme={null}
    This Notion workspace contains our engineering documentation.
    For code reviews, look in the "Engineering" space—specifically:
    - "Architecture Decisions" for design rationale
    - "API Contracts" for interface specifications
    - "Service Runbooks" for operational context

    Do not pull content from HR, Finance, or Company-wide spaces.
    ```
  </Tab>

  <Tab title="Custom in-house MCP server">
    For internal tools, explain what the server exposes and why it's useful for reviews:

    ```text wrap theme={null}
    This is our internal quality gate service. It provides:
    - Static analysis results for each pull request
    - Security scan findings from our custom ruleset
    - Architecture compliance checks against our approved patterns

    Always fetch the quality gate report for the current PR before commenting
    on code quality or security issues. Results are indexed by repository name
    and PR number.
    ```
  </Tab>

  <Tab title="Jenkins">
    If your Jenkins jobs are organized in folders that CodeRabbit can't automatically discover:

    ```text wrap theme={null}
    Jenkins builds are located at:
    https://jenkins.company.com/job/{workspace}/job/{repo}/job/PR-{pr}/

    Use getBuild or getBuildLog to fetch build results directly from this path.
    ```

    <Tip>
      This is particularly useful for Jenkins Organization Folders, where jobs are nested under workspace/repo/PR structures that aren't searchable via the standard Jenkins API.
    </Tip>
  </Tab>

  <Tab title="SonarQube">
    If your SonarQube project keys follow a naming convention:

    ```text wrap theme={null}
    SonarQube project key format: {org}_{repo}
    Dashboard: https://sonar.company.com/dashboard?id={org}_{repo}
    ```
  </Tab>

  <Tab title="Azure DevOps">
    For Azure DevOps pipelines using project-specific paths:

    ```text wrap theme={null}
    Pipeline runs: https://dev.azure.com/{org}/{project}/_build?definitionId=1&branchName=refs/pull/{pr}/merge
    ```
  </Tab>
</Tabs>

### URL template placeholders

When guidance includes URLs that change per pull request, use **placeholders** that CodeRabbit automatically expands with values from the current PR:

```text theme={null}
https://jenkins.company.com/job/{workspace}/job/{repo}/job/PR-{pr}/
```

#### Available placeholders

| Placeholder                             | Description                   | Example value |
| --------------------------------------- | ----------------------------- | ------------- |
| `{repo}`, `{repo name}`, `{repository}` | Repository name               | `my-backend`  |
| `{pr}`, `{pr number}`                   | Pull request number           | `42`          |
| `{mr}`, `{mr number}`                   | Merge request number (GitLab) | `42`          |
| `{workspace}`, `{owner}`, `{org}`       | Organization or workspace     | `acme-corp`   |
| `{project}`                             | Project name (Azure DevOps)   | `MyProject`   |

<Info>
  Placeholders are case-insensitive. `{repo}`, `{REPO}`, and `{Repo}` all work the same way.
</Info>

## What's next

<CardGroup cols={1}>
  <Card title="Plans and pricing" href="/management/plans" icon="credit-card" horizontal>
    Check how many MCP server connections your plan includes.
  </Card>

  <Card title="Reverse Tunnel connector configuration" href="/self-hosted/reverse-tunnel-connector-configuration" icon="settings" horizontal>
    Configure a connector so CodeRabbit can reach an MCP server on your private network.
  </Card>
</CardGroup>
