# disconnect_repo

URL: https://codepanel.ai/docs/mcp-server/disconnect_repo

The CodePanel MCP tool that stops reviewing a repository and keeps its past reviews, settings and webhook. Safe to call twice.

`disconnect_repo` stops CodePanel reviewing a repository and keeps everything it already produced. It marks the repository inactive, so new pull requests are not reviewed and its webhook deliveries are ignored, while past reviews, findings and settings stay. Calling it again on the same repository succeeds with the same answer.

## When to call it

- **When the person asks to stop reviews on a repository.**
- **Not to pause for a while.** `update_repo_settings` with `autoReview: false` stops automatic reviews and keeps the repository connected.
- **Not to remove the webhook.** See below: this tool leaves it on GitHub.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `repo` | string | yes | Repository as owner/name |

It writes: the server marks it `readOnlyHint: false` and `destructiveHint: true` (it can change what is already there), so a client that asks before writes asks here.

`repo` must be `owner/name`. A repository you have not connected, or that belongs to another account, gives the same answer:

```text
CodePanel: Repository not found
```

CodePanel does not say which of the two it was, so the call cannot be used to find out who has connected what.

## What it returns

`{ "ok": true }`, and nothing else.

What changes: the repository's `isActive` becomes `false` and CodePanel forgets the cached GitHub App token for it. What stays:

- Reviews, findings, ratings and spend history.
- The repository's `settings`, including its gate, round limits and switches.
- The webhook on GitHub. Only **Disconnect** on the repository's **Settings** tab in the dashboard also removes the hook.
- The row in [`list_repos`](/docs/mcp-server/list_repos), now with `isActive: false`.

## Why a second call also succeeds

The tool only looks up your own row for that name and sets `isActive` to `false`. It never requires the row to be active first, so repeating it changes nothing but the row's `updatedAt`. An agent that retries after a timeout does not need to check first. To confirm the state, read `isActive` in `list_repos`.

To review the repository again, call [`connect_repo`](/docs/mcp-server/connect_repo). It reuses the same row and its settings.

## Examples

These responses come from a test account on a local backend. The same call was made twice in a row.

```json title="Call"
{ "repo": "codepanel-dev/docs-site" }
```

```json title="Result"
{ "ok": true }
```

```json title="Second call, same input"
{ "ok": true }
```

## The same step without MCP

| Surface | Form |
| --- | --- |
| CLI | `codepanel repos disconnect <owner/name>` ([CLI](/docs/cli#repositories)) |
| HTTP API | [`POST /repos/disconnect`](/docs/api#post-reposdisconnect) with `{"repo":"owner/name"}` |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Stop reviewing a repository. Past reviews are kept.

## Related

- [`connect_repo`](/docs/mcp-server/connect_repo): reverse it.
- [`list_repos`](/docs/mcp-server/list_repos): see `isActive`.
- [`update_repo_settings`](/docs/mcp-server/update_repo_settings): turn off automatic review without disconnecting.
- [MCP server](/docs/mcp-server): install, sign-in and every other tool.
