Skip to main content
The CodeRabbit API and the hosted MCP server expose 11 configuration operations. Use them to read the effective configuration of a repository, preview a change without saving it, and update settings from your own tooling. The CLI’s agent mode drafts changes to the configuration file for you to review.

Before you start

  • The configuration operations are product operations for GitHub Cloud organizations. Other Git platforms and self-hosted CodeRabbit instances don’t offer them.
  • Create an API key, or connect an MCP client. See Authentication and MCP.
  • The settings in every request and response use the V2 shape, including for repositories that use V3.

Choose a client

Automate with the API and MCP

Automate this with the CodeRabbit API and MCP server.
Each operation is also an MCP tool with the same snake_case name. The get operations need the configuration:read scope. The set operations and Preview repository configuration need configuration:write.

Read the effective configuration and preview changes

The effective configuration is the resolved YAML plus the YAML of each layer. If CodeRabbit can’t resolve it, the response says complete: false with a reason.
A preview resolves the YAML that would apply if you saved the settings you send. It saves nothing, but it takes the same request body as a write. It needs the configuration:write scope, so agentic API keys can’t call it. The caller’s role needs permission to read and change repository settings and to read organization settings, and the caller needs read access on GitHub to the repository and to any central coderabbit repository.

Write configuration safely

1

Read the current settings

Call the repository or organization get operation. Keep settings_updated_at from the response.
2

Change the settings

Send settings, or settings_yaml up to 131,072 characters, together with expected_settings_updated_at set to the value you read.
3

Handle a conflict

If someone saved in between, CodeRabbit rejects the write. Read again, merge your change, and retry.
The source write works the same way, with expectedUpdatedAt set to the updatedAt from your last read, or null when no policy exists.

Permissions and limits

What organization and workspace reads return

  • Organization: review settings, the authored and stored YAML, inherited settings, global overrides and the data opt-out state.
  • Workspace: review settings, YAML, global overrides and the data opt-out state. There is no operation that changes them.
  • Workspace configuration defaults: one setting, the Use workspace settings as defaults toggle.
  • Global overrides: read-only through the API.

Draft changes with the CLI agent mode

cr config --agent returns structured state without prompts: the active configuration, whether it can be edited, and its content hash as baseHash. Add --generate to get a validated before-and-after YAML proposal, and --profile to shape it.
Neither command saves the proposal. Review it, write the file, and open a pull request. See Agent mode.

What’s next

API overview

Keys, regions and conventions.

MCP tools

Every tool with its scopes.

Check the configuration used

Compare an API read with a review.