Set up CodeRabbit
Help the user reach connected and ready to review, with optional review settings tailored to their repository. Setup alone does not authorize uploading code or starting a review.
If the user wants to keep the existing CLI-only workflow, explain the review skill's CLI-only option and leave MCP setup unstarted. That route does not need MCP consent or preparation of the pinned runtime.
For a configuration-only request, read references/repository-config.md and use the packaged CLI; local configuration does not require MCP sign-in. For general setup, make the connection ready below, then offer repository configuration once. Keep existing suitable settings and avoid delaying an already-requested review with optional configuration.
- Read this plugin's
cli.json. Resolve itslauncherrelative to the plugin root, keep it inside that root, and quote its absolute path. For the native Claude package, use the installed root already supplied by/coderabbit:setupor the invoking plugin skill; do not read an unresolved placeholder from a shell environment. A directly loaded Claude plugin skill substitutes${CLAUDE_PLUGIN_ROOT}; in Codex the root is two directories above the loaded setup skill. Fordelivery: download, follow runtime preparation before using the CLI. Fordelivery: bundled, run--versiondirectly. If local execution is unavailable, connect the remote account/PR tools but report that local reviews and local configuration are unavailable; do not reserve a review. A missing or corrupt bundled executable requires reinstalling the complete package. Neither delivery mode installs a global CLI or needs a CLI login. - Read
launchModeincli.json; the package determines the launcher, not a user choice during setup. Forhook, verify the installed post-tool hook is supported and trusted through the host's controls. It runs the normal CLI review only after an approved plugin-ownedstart_code_reviewcall. Codex hook packages are unavailable until server identity can be verified. If the hook cannot run, stop local-review setup and explain the native trust or compatibility requirement; do not switch to direct execution. Only adirectpackage uses hook-free execution. Confirm permitted local execution, network access and a process interface that can supply stdin separately from command arguments before starting a direct review. Ensure no hook will also launch. When direct execution is selected and safe stdin delivery is unavailable, report that local review is unavailable; do not reserve a review. A trusted hook supplies its own handoff. Do not bypass a denied execution or upload decision. - In Claude Code, check the active server in
/mcpagainst this package's declared URL:mcpServers.coderabbit.urlin.claude-plugin/plugin.jsonfor the native root package, or.mcp.jsonfor an independently assembled package. A manually configured connection at the same endpoint can hide the plugin connection. Local reviews require the plugin-qualified toolmcp__plugin_coderabbit_coderabbit__start_code_review; a bare server name cannot prove plugin ownership. If a manual entry shadows it, explain the conflict and let the user disable that duplicate in its native scope, then restart and verify the plugin server. Preserve the entry and unrelated integrations. Renaming alone does not fix endpoint deduplication. Never widen the hook to a bare name, another plugin, or another endpoint. - Discover CodeRabbit MCP tools and call
get_meorconnection_status. If unavailable or signed out, use the app's CodeRabbit Connect or Reconnect action to open browser sign-in. Return to the app when it completes, refresh the tool connection if required, and verify status again. Never request a pasted code, inspect credentials, or run CLI authentication. - Confirm the returned account and organization, and that
start_code_reviewandget_code_revieware available with review permission. If a review was already requested, resume the packaged code-review skill with every original option, including directory, base, scope,include_untracked, andinstructions. Otherwise confirm the connection is ready and offer to tailor review settings for this repository, or start with “Review my changes.” When the user wants configuration help, read references/repository-config.md. Do not upload a repository just to test setup.
The plugin needs permission to prepare and run its pinned CLI and access the requested repository and review endpoint. Use the host's normal permissions when needed; do not change sandbox settings or route around a denied permission. A cloud or remote session uses its own available filesystem, not the user's laptop.
If browser sign-in or reconnection fails, show the concrete error and the next
supported app action. Do not claim a successful connection from a browser success
page alone; verify it through get_me or the available connection-status tool.
Reference: Claude MCP scope precedence.