Skip to main content
A local review lets you review code changes before creating a pull request. Your MCP client collects the Git diff from your local worktree and sends it to Qodo for review against a pushed base commit. When the review completes, your client retrieves the findings, which can also be linked to an open pull request. The Qodo MCP server can’t read your worktree directly. Your MCP client collects the diff locally with Git commands and sends the diff inline. You don’t need the Qodo CLI or another MCP server. Before you start, connect your client to the Qodo MCP server. For more information, see Connect Qodo Agentic Toolbox with MCP.

How a local review runs

A local review is asynchronous. The start call returns a receipt, not the review.
1

Start the review

Call start-pre-pr-review. It returns an operation receipt with an operation_id.
2

Poll for completion

Call get-managed-agent-operation with the operation_id until terminal is true. Wait at least poll_interval_seconds between calls. Polling sooner returns MT-RATE-LIMITED with a retry delay.
3

Read the findings

When status is completed and result_available is true, call get-managed-agent-result to read the findings.Each lifecycle response includes:When a review fails, don’t start another attempt automatically. A validation error (MT-VALIDATION) describes what to change in the request. Don’t retry unchanged input.

Read the result

get-managed-agent-result returns the result as JSON in chunks of up to 32 KiB:
1

Fetch the first chunk

Call it with the operation_id.
2

Follow the cursor

While next_cursor is not null, call it again with cursor set to next_cursor.
3

Concatenate the chunks

Concatenate the chunk values in order.
4

Verify and parse

Verify the SHA-256 digest of the combined text against sha256, then parse it as JSON.
Each finding in the result has an id. For local findings, meta.local_review_ids maps each finding id to the local_review_id you need to dismiss the finding or mark it as implemented.

Cancel or find a review

Use these tools to cancel an active review or find its operation ID.
  • cancel-managed-agent-operation: Requests cancellation of a review. The response doesn’t confirm that the remote review stopped, so poll the operation to see its terminal status.
  • list-managed-agent-operations: Lists the operation_id values of your active local reviews. Completed and expired reviews aren’t included.

Start a review

Use start-pre-pr-review to submit a local review. The request includes a unique request_id and a params object containing the repository, base commit, and Git diff.”

Required fields

Common optional fields

Important notes

The start tool’s schema can change between deployments. Before you send optional fields, read the live schema that your client receives from the server, and send only the fields it lists. start-pre-pr-review doesn’t take an idempotency_key argument. request_id is its retry key. If you also send io.qodo/idempotency-key in the request _meta, it must match request_id.

Collect the diff

Your MCP client must collect and send a Git diff that Qodo can apply to base_sha. Follow these guidelines to ensure the diff is accepted:
1

Generate the diff

Run git -c core.quotePath=false diff --src-prefix=a/ --dst-prefix=b/ <base_sha> so that every file header uses unquoted a/ and b/ paths.
2

Include all relevant changes

Include committed changes since base_sha, staged and unstaged changes, and patches for untracked files you want reviewed.
3

Send the diff inline

Send the diff text inline, never a local file path.
4

Exclude unsupported files

Exclude files that Qodo rejects: .env* files, credentials, private keys, and other sensitive files; binary files; symlinks; and files whose names produce quoted or ambiguous Git headers.
5

Report omissions in review_scope

Report what you left out in review_scope:Omitted files aren’t reviewed. Don’t describe them as reviewed or clean.

Size limits

A request body over the limit returns HTTP 413 with the error code MT-VALIDATION. A diff over 4 MiB returns MT-VALIDATION. To fit the limits, narrow the review with review_scope.paths and report the rest in excluded_files. Qodo saves the findings of a local review only when the request includes branch. Without a branch, the review still returns findings, but they’re not saved and can’t be linked to a PR later. When the review completes, Qodo links its findings to an open PR if all of these conditions are met:
  • The request includes branch, comparison_branch, and commit_sha.
  • Exactly one open PR merges branch into comparison_branch, and its head commit equals commit_sha.
  • The PR’s source branch is in the same repository. PRs from forks aren’t linked.
If your deployment doesn’t offer comparison_branch, Qodo doesn’t link local findings to an open PR when the review completes. When Qodo reviews the PR later, it carries over local findings from the last 7 days whose code appears in the PR diff. Findings recorded as implemented or outdated aren’t carried over as open findings. Dismissing a finding doesn’t stop it from being carried over.

Resolve local findings

Use pr-review-dismiss or pr-review-mark-implemented to close local findings. Pass the finding IDs, the local_review_id of the review that raised them, and an idempotency_key. Batch only findings from the same local review in one call. For more information, see Qodo tools reference.

Track local review findings in Code review analytics

The Code review analytics dashboard shows how many findings Qodo raised in local reviews before a PR existed, in the Where findings were raised view. It counts local findings that are linked to a PR. For more information, see Qodo code review analytics.