# l4 mcp uninstall

> Remove the LevelFour MCP server from your agent clients, and delete the dated backups that may still hold an old key.

Source: https://docs.levelfour.ai/cli/commands/mcp/uninstall


`l4 mcp uninstall` removes the entry [`l4 mcp install`](/cli/commands/mcp/install) wrote from every client that carries it.

```bash
l4 mcp uninstall [flags]
```

With no `--client`, it cleans every client carrying an entry under `--name`, and leaves alone any client that is installed but carries none.

On a terminal it asks you to confirm first. Declining prints `Aborted.` and exits `0`. In CI or through a pipe stdin is not a terminal, so it proceeds without asking. Pass `--yes` there to make that explicit in the script.

## Flags

| Flag              | Description                                                                                                                               |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `--client`        | Client to clean: `claude-code`, `claude-desktop`, `cursor`, `vscode`, `windsurf`. Repeatable. Defaults to every client carrying the entry |
| `--name`          | Name of the server entry to remove. Defaults to `levelfour`                                                                               |
| `--purge-backups` | Also delete the dated `.l4-backup-*` copies                                                                                               |
| `-y`, `--yes`     | Skip the confirmation prompt                                                                                                              |

Global flags (`--json`, `--jq`, `--template`, `--quiet`, `--token`, `--api`) apply. See [CLI overview](/cli#global-flags).

## What it touches

Only the entry under `--name`. It leaves every other MCP server in the same file exactly as it was, and takes a dated backup before rewriting anything.

An install made under a different name survives. If you installed a second organization as `levelfour-org-b`, remove it by name:

```bash
l4 mcp uninstall --name levelfour-org-b
```

## The backups it leaves behind

`l4 mcp install` backs up a config file before rewriting it.

> **Warning**
>
> When you install over an existing entry, the backup it takes holds the previous credential in plain text, and removing the entry does not remove that copy.

By default the backups stay and the command tells you how many are left:

```text
Cursor: removed entry "levelfour"
  Backup: /Users/you/.cursor/mcp.json.l4-backup-20260829-141207
2 backup file(s) left in place. A backup taken over an existing install still holds
that credential; --purge-backups deletes them.
```

To delete them as it removes the entry:

```bash
l4 mcp uninstall --purge-backups
```

> **Note**
>
> If you connected by signing in rather than with a key, no credential was ever written to disk and the backups hold nothing sensitive. Removing the client entry stops the client asking; it does not revoke what it already holds. Close the connection under [Connected Applications](/mcp/approving-a-connection#seeing-and-closing-connections) in the dashboard.

## Examples

Remove it everywhere:

```bash
l4 mcp uninstall
```

One client:

```bash
l4 mcp uninstall --client cursor
```

Unattended, deleting the backups as it goes:

```bash
l4 mcp uninstall --yes --purge-backups
```

## Errors

| Exit | Symptom                                                           | Cause                                                                          |
| ---- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `1`  | `no client carries an entry named "levelfour". Nothing to remove` | Nothing to do. Check the name with [`l4 mcp status`](/cli/commands/mcp/status) |
| `1`  | `N of M clients failed`                                           | It cleaned some and not others. The message names each failure                 |
| `1`  | `unknown client`                                                  | `--client` was given a name outside the supported set                          |

## Related

* [`l4 mcp install`](/cli/commands/mcp/install): what this reverses
* [`l4 mcp status`](/cli/commands/mcp/status): which clients carry an entry
* [Approving a connection](/mcp/approving-a-connection): closing a connection you signed in for
