> ## 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.

# CodeRabbit MCP server

> Connect Claude Code, Codex, Claude, or another MCP client to CodeRabbit's MCP server so your AI agent can read pull requests and reviews, request reviews, and run coding tasks.

GitHub Cloud (The MCP server's product tools are available for GitHub Cloud organizations in CodeRabbit's US region.)

The CodeRabbit MCP server turns CodeRabbit into tools for your AI agent. Connect it to Claude Code, Codex, or Claude, and the agent can read your pull requests and CodeRabbit's review threads, check review status, request a review, start and steer coding tasks, and work with Triage, security findings, Verify, automations, reports, Knowledge Base, and settings. The agent acts as you, in the organization you choose, within the permissions you approve.

> [!NOTE]
>
> This page is about your AI agent calling CodeRabbit. It isn't **Connections** in CodeRabbit's settings, where CodeRabbit calls your own MCP servers during reviews and chat. For that, see [Connect MCP servers](https://docs.coderabbit.ai/connections/mcp-servers.md).

The CodeRabbit MCP server is also different from the docs MCP server that Mintlify provides for this documentation. The CodeRabbit MCP server acts in CodeRabbit: it reads your pull requests and starts reviews and coding tasks. The docs MCP server only searches these docs, and you add it from the menu at the top of any docs page. If one client uses both, give them different names, such as `coderabbit` for the CodeRabbit MCP server and `coderabbit-docs` for the docs MCP server.

The MCP server suits interactive work: your agent acts with your own CodeRabbit account, in one organization, after you sign in through your browser. It doesn't suit unattended jobs, such as CI pipelines or scheduled scripts, because every connection starts with a person signing in. It doesn't suit managing users and seats across an Enterprise SSO workspace either, because each connection reaches one organization. For those jobs, use the API with a key; [Authentication](https://docs.coderabbit.ai/api/authentication.md) says which key fits which job.

## How it works

| Property | Value |
| - | - |
| Server URL | `https://mcp.coderabbit.ai/` |
| Transport | Streamable HTTP |
| Sign-in | OAuth authorization code flow with PKCE (`S256`) in your browser, with consent per organization. No API key. |
| Consent page | `https://app.coderabbit.ai/mcp/connect` |
| Clients | Public OAuth clients, registered through dynamic client registration or a client ID metadata document |
| Region | US only |
| Organization | One per connection, chosen when you approve it |

Most tools come from the [CodeRabbit API](https://docs.coderabbit.ai/api.md): an API operation becomes a tool with the same name as its `operationId`, such as `get_me` or `create_code_task`, the operation's summary and description as its title and description, and the same inputs and outputs. Tools run the same permission checks as the API and the CodeRabbit app, so the agent can only do what your role, repository access, and plan already allow. See [MCP tools](https://docs.coderabbit.ai/api/mcp/tools.md) for the full list.

## Availability

* **Plan:** the MCP server has no plan requirement of its own. Each tool applies the plan and access checks of the operation behind it; see [Plans](https://docs.coderabbit.ai/api.md#plans).
* **Region:** the MCP server serves organizations in CodeRabbit's US region. If your organization is in the EU region, use the [API](https://docs.coderabbit.ai/api/conventions.md#base-urls-and-regions) with an API key, or [`coderabbit api`](https://docs.coderabbit.ai/api/cli) from the CLI.
* **Git platform:** GitHub Cloud organizations get all the tools in [MCP tools](https://docs.coderabbit.ai/api/mcp/tools.md). You can connect an organization on another Git platform, but only the account tools work there: `connection_status`, `get_me`, and `get_usage`.
* **Deployment:** organizations on self-hosted CodeRabbit or on a self-hosted Git provider, such as GitHub Enterprise Server, can't connect.
* **GitHub identity:** `list_pull_requests` and `get_pull_request` need a GitHub account linked to your CodeRabbit user. If you sign in to CodeRabbit with GitHub, that account is linked already. In an Enterprise SSO workspace, connect your GitHub account in CodeRabbit or ask an admin to link it; see [How IdP members, Git identities, and seats relate](https://docs.coderabbit.ai/management/seat-assignment.md#how-idp-members-git-identities-and-seats-relate).

## Choose scopes

Scopes are the permissions your client asks for when it connects. CodeRabbit's consent page shows them, and the connection gets exactly the scopes you approve. A scope limits what the agent can do; it never grants access you don't already have in CodeRabbit.

Decide on scopes before you connect. Every scope list must include `connection`: CodeRabbit refuses a sign-in whose list leaves it out. Claude Code and Codex request only the scopes you configure, and without a setting they request only `connection`, which is enough for `connection_status` and nothing else.

### Common setups

| Job | Scopes | Tools the agent calls |
| - | - | - |
| Check the review status of your pull request and read its summary | `connection account:read repositories:read pull_requests:read` | `list_pull_requests` with `repository_url` and `head_branch`, or `get_pull_request` with the pull request URL. Both return the repository as `owner/name` and the pull request `number`, not the numeric repository ID. Call `list_repositories`, follow `next_page_token`, and take the `id` of the repository whose `full_name` matches. Then call `get_pull_request_review` with that `repository_id` and the `number`, and `get_pull_request_review_summary`. If `review` is `null`, CodeRabbit has no status for the current commit; see [follow the review status](https://docs.coderabbit.ai/api/guides/pull-request-reviews.md#4-follow-the-review-status). Read the summary instead: `summary: null` means CodeRabbit hasn't posted one. |
| Request a review after you push | The scopes above, plus `reviews:write` | `get_pull_request_review` first. Each request starts a review like a new push, so request again only when no review of the current head is running or completed. Then `request_pull_request_review` and `get_pull_request_review` to follow the status. The pull request must be open. No API key is involved. |
| Read open plan feedback on a coding task | `connection account:read code:read` | `list_code_tasks`, then pick the task whose `pull_request_url` or `title` matches. `get_code_task`, `get_code_task_plan`, and `list_code_task_plan_comments` follow. Keep the threads with `status: open`. |
| Work through your Triage queue | `connection account:read triage:read`, plus `triage:write` to set priorities | `list_triage_changes`, `get_triage_change`, and `list_triage_change_history`. With `triage:write`, `set_triage_change_priority` sets a change's manual priority: pass the `priority.revision` from `get_triage_change` as `expected_revision`, and reuse the same `idempotency_key` when you retry. |
| Manage Triage rules | `connection account:read triage:read triage:write` | `list_triage_rules`, `preview_triage_rule`, `create_triage_rule`, `update_triage_rule`, and `transition_triage_rule`. |
| Explore without changing anything | `connection account:read usage:read repositories:read pull_requests:read`, plus any other read scopes from the table below | `get_me`, `get_usage`, `list_repositories`, `list_pull_requests`, and `get_pull_request`, plus the read tools of the areas you add. |

To combine jobs, join their scopes. For one agent that reads your pull request's review, requests a review, and reads plan feedback, use this list:

```text theme={null}
connection account:read repositories:read pull_requests:read reviews:write code:read
```

Claude Code takes it space-separated in `oauth.scopes`. Codex takes it comma-separated.

To read plan feedback, the agent passes each result to the next call: `get_code_task` returns the task's `plan_version`; `get_code_task_plan` takes it as `version` and returns the plan's `sha256`; `list_code_task_plan_comments` takes `version` and `sha256`. The result has open and resolved threads, so the agent keeps the threads whose `status` is `open`.

### Scopes by area

| Area | Read scope | Write scope | What the agent can do |
| - | - | - | - |
| Connection | `connection` | | Check which account and organization the connection uses. Always include it: a sign-in whose scope list leaves it out fails. |
| Account | `account:read` | | Read your profile and organization memberships. Include it in every list: nearly every tool also needs it. |
| Usage | `usage:read` | | Read usage and credit balances. |
| Repositories | `repositories:read` | | List and read the repositories you can access. |
| Pull requests | `pull_requests:read` | `reviews:write` | Read pull requests, discussions, and review state; with the write scope, request reviews. |
| Local reviews | | `review` | Start reviews of local code, which the CodeRabbit CLI uploads from your machine. |
| Coding tasks | `code:read` | `code:write` | Read coding tasks; with the write scope, create tasks and make code changes through them. |
| Triage | `triage:read` | `triage:write` | Read Triage changes and rules; with the write scope, set a change's manual priority and create, change, and delete rules. |
| Security | `security:read` | `security:write` | Read security findings; with the write scope, start scans and request fixes. |
| Settings, users, and roles | `configuration:read` | `configuration:write` | Read settings, users, roles, and audit logs; with the write scope, change organization and repository settings and manage roles and seats. |
| Connections | `connections:read` | `connections:write` | Read the workspace connections in CodeRabbit's settings, such as the MCP servers CodeRabbit calls during reviews and chat; with the write scope, manage them. It isn't about the CodeRabbit MCP server your agent uses. |
| Knowledge Base | `knowledge:read` | `knowledge:write` | Read Learnings, connected knowledge repositories, and architecture documents; with the write scope, manage Learnings and connected repositories. |
| Reports | `reports:read` | `reports:write` | Read reports; with the write scope, generate and manage them. |
| Verify | `verify:read` | `verify:write` | Read Verify jobs and findings; with the write scope, configure Verify and run jobs. |
| Automations | `automations:read` | `automations:write` | Read automations and their runs; with the write scope, manage and run them. |

A read scope doesn't include its write scope, so request both when the agent reads before it changes something. Triage rule changes need both. Write scopes that start work, such as `review`, `reviews:write`, `code:write`, `security:write`, `verify:write`, `automations:write`, `reports:write`, and `triage:write`, let the agent take actions that can consume credits or paid usage. When a tool needs a scope that your connection lacks, the call fails with `insufficient_scope` and names the missing scope. [MCP tools](https://docs.coderabbit.ai/api/mcp/tools.md#scopes-by-area) lists the scopes for each group of tools.

To add a scope later, add it to your client's scope list and sign in again. Keep `connection` in the list. A connection never gains scopes on its own.

## Connect your agent

The Claude Code and Codex examples connect with the scopes for exploring without changing anything, from [Common setups](#common-setups). Add the scopes your jobs need before you sign in.

> [tab] Claude Code
>
> 1. Add the server with the scopes you want in `oauth.scopes`. `--scope user` is Claude Code's configuration scope, which makes the server available in all your projects; it isn't a CodeRabbit permission.
>
>    ```bash theme={null}
>    claude mcp add-json --scope user coderabbit '{"type":"http","url":"https://mcp.coderabbit.ai/","oauth":{"scopes":"connection account:read usage:read repositories:read pull_requests:read"}}'
>    ```
>
> 2. In Claude Code, run `/mcp`, select **coderabbit**, and sign in. You can also run `claude mcp login coderabbit` from your shell.
>
> 3. Approve the connection in your browser. See [Approve the connection](#approve-the-connection).
>
> Claude Code requests exactly the scopes in `oauth.scopes`. To change them, run `claude mcp logout coderabbit` and `claude mcp remove coderabbit`, add the server again with the new list, and sign in again. See [Claude Code's MCP documentation](https://code.claude.com/docs/en/mcp) for configuration scopes and project `.mcp.json` files.

> [tab] Codex
>
> 1. Add the server:
>
>    ```bash theme={null}
>    codex mcp add coderabbit --url https://mcp.coderabbit.ai/
>    ```
>
> 2. Sign in with the scopes you want, separated by commas:
>
>    ```bash theme={null}
>    codex mcp login coderabbit --scopes connection,account:read,usage:read,repositories:read,pull_requests:read
>    ```
>
> 3. Approve the connection in your browser. See [Approve the connection](#approve-the-connection).
>
> In the Codex TUI, run `/mcp` to check that the server is connected. To change scopes, run `codex mcp login` again with the new list. See [Codex's MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli) for other configuration options.

> [tab] Claude
>
> These steps add CodeRabbit as a custom connector in Claude on the web and in Claude Desktop.
>
> 1. Open the connector settings:
>    * **Pro and Max:** go to **Customize** > **Connectors**, then click **+ Add** > **Add custom connector**.
>    * **Team and Enterprise:** an owner goes to **Organization settings** > **Connectors**, clicks **Add**, hovers over **Custom**, and selects **Web**.
> 2. Enter `CodeRabbit` as the name and `https://mcp.coderabbit.ai/` as the server URL, then click **Continue**.
> 3. Under the OAuth client setting, select **Register automatically**.
> 4. Click **Add**, then click **Connect** next to the connector. On Team and Enterprise plans, each member connects from **Customize** > **Connectors**.
> 5. Check the permissions on the consent page, then approve. See [Approve the connection](#approve-the-connection).
>
> Claude's connector settings have no scope list, so the consent page shows the scopes that Claude requests.
>
> See [Claude's custom connector guide](https://support.claude.com/en/articles/11175166-getting-started-with-custom-connectors-using-remote-mcp) for plan limits and per-chat settings.

> [tab] Other clients
>
> Other MCP clients can connect if they support Streamable HTTP and OAuth with PKCE, and register either through dynamic client registration or with a client ID metadata document. Add `https://mcp.coderabbit.ai/` as a remote HTTP server, set the client's OAuth scopes if it has that setting, and sign in. See [Approve the connection](#approve-the-connection).
>
> CodeRabbit gives a sign-in that requests no scopes only `connection`. A client that can't set scopes therefore connects with `connection` alone, and the agent can call `connection_status` and nothing else. The consent page lists what the client requested.

## Approve the connection

When your client signs in, your browser opens CodeRabbit. Sign in if you aren't already, then:

1. Choose the organization to connect. The connection works only in this organization, and tool arguments can't switch it.
2. Read the summary under **Allow *client* to access your selected organization?** It lists what the connection can read and do, based on the requested scopes, and warns when actions can consume credits or paid usage.
3. Check the hostname in **Return to *hostname* after connecting.** For a client on your computer, approve only connections you started.
4. Click **Connect to *organization***, or **Cancel** to refuse.

A consent request expires after 10 minutes. Your client refreshes its access automatically, and the connection lasts up to 30 days. It ends sooner if the CodeRabbit browser session you approved it in ends, for example when you sign out, or if you lose access to the organization. Then sign in again from your client.

## Check the connection

Ask your agent to call the account tools:

```text theme={null}
Use the coderabbit MCP server: call connection_status, then get_me, and tell me which organization and role you see.
```

`connection_status` returns your user ID, the connected organization, and the region. `get_me` needs `account:read` and returns your profile, your role in the connected organization, and your other organization memberships. Memberships don't give the connection access to those organizations.

In Claude Code, `claude mcp list` also shows whether the server is connected or needs authentication.

## Disconnect

* **Claude Code:** run `claude mcp logout coderabbit` to clear the stored sign-in, then `claude mcp remove coderabbit` to remove the server.
* **Claude:** disconnect or remove the connector in **Customize** > **Connectors**.
* **Other clients:** use the client's sign-out or remove action.

CodeRabbit doesn't list MCP connections in its app, so disconnect from the client. A connection you don't disconnect still ends after 30 days at most.

## Troubleshooting

| Problem | Cause | Fix |
| - | - | - |
| Sign-in fails with `invalid_scope` | The scope list leaves out `connection`, or it has a scope that CodeRabbit doesn't support. | Add `connection`, check the other scopes against [Choose scopes](#choose-scopes), and sign in again. |
| The agent can call only `connection_status` | The connection has only the `connection` scope, because the client didn't request any other scopes. | Set the scopes in your client and sign in again. If the client has no scope setting, see the **Other clients** tab in [Connect your agent](#connect-your-agent). |
| A tool fails with `insufficient_scope`, or Claude Code says the server needs additional permissions | The connection doesn't have a scope that the tool needs. | Add the scope named in the error to your client's scope list, then sign in again. |
| The client reports `401` or says the server needs authentication | The connection ended: it expired, you signed out of CodeRabbit, your access changed, or it was revoked. | Sign in again from your client. |
| The consent page says the connection request has ended | You took longer than 10 minutes, or the request was already used. | Start the sign-in again from your client. |
| The consent page says connection access was denied | The selected organization can't be connected. | Select another organization in the organization picker. |
| Only `connection_status`, `get_me`, and `get_usage` work | The connected organization isn't on GitHub Cloud. | The other tools need a GitHub Cloud organization. Sign in again and choose one. |
| `list_pull_requests` or `get_pull_request` returns `unsupported_connection` | Your CodeRabbit user has no linked GitHub account, or the organization isn't on GitHub Cloud. | Link your GitHub account as [Availability](#availability) describes, or connect a GitHub Cloud organization. |
| The agent works in the wrong organization | Each connection is bound to the organization you approved. | Disconnect, sign in again, and choose the other organization on the consent page. |
| A tool returns `not_found` | The resource doesn't exist, or you can't access it. | Check the identifier and your access in CodeRabbit. |
| A tool returns `rate_limit_exceeded` | MCP tools share your organization's API quota with API and CLI requests. | Wait for the `retry_after` seconds in the result. See [Rate limits](https://docs.coderabbit.ai/api/conventions.md#rate-limits). |

## What's next

> [card] [Browse MCP tools](https://docs.coderabbit.ai/api/mcp/tools.md)
>
> Find the tool for each task and the scopes its group needs.

> [card] [Call from the CLI](https://docs.coderabbit.ai/api/cli.md)
>
> Run the same operations from a terminal or CI job with an API key.

> [card] [Authenticate requests](https://docs.coderabbit.ai/api/authentication.md)
>
> Create an API key for scripts and integrations that don't use MCP.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.