# What Gets Removed During `agent-reach uninstall` and What Configuration Settings Persist

> Understand what agent-reach uninstall removes and what configurations persist. Learn how to keep tokens and API keys with the --keep-config flag.

- Repository: [Pnant/Agent-Reach](https://github.com/Panniantong/Agent-Reach)
- Tags: how-to-guide
- Published: 2026-07-09

---

**Running `agent-reach uninstall` removes the `~/.agent-reach` configuration directory, skill files from Claude Code and OpenClaw directories, and MCP server entries, while the `--keep-config` flag preserves your stored tokens and API keys by skipping the config directory deletion.**

The **Agent Reach** CLI tool provides a structured uninstallation process that cleans up three distinct categories of artefacts it created during installation. According to the `Panniantong/Agent-Reach` source code, the private helper `_cmd_uninstall()` in [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py) handles this process systematically, with specific logic to optionally preserve user configuration data.

## Three Categories of Data Removed by agent-reach uninstall

The uninstall command targets specific locations where Agent Reach stores persistent data and integrations.

### 1. Configuration Directory

The command removes the entire `~/.agent-reach` folder, which houses the **[`config.yaml`](https://github.com/Panniantong/Agent-Reach/blob/main/config.yaml)** file and all associated user data. This includes **saved tokens**, **cookies**, **API keys**, and **proxy settings** accumulated during usage. The deletion logic executes between lines 64 and 71 in [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py), effectively erasing all personalized configuration state stored by the tool.

### 2. Skill Files

Agent Reach removes skill installations from multiple known agent directories. The command deletes the `agent-reach` subdirectory (or symlink) from:
- `~/.openclaw/skills/agent-reach`
- `~/.claude/skills/agent-reach`
- `~/.agents/skills/agent-reach`

The skill directory removal loop operates in [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py) (lines 84-92), targeting the reference files and [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md) content originally copied from the `agent_reach/skill/` package during installation.

### 3. MCP Server Entries

The uninstaller cleans up **Model Context Protocol (MCP)** entries that were registered via the `mcporter` tool, specifically entries like `exa` and `xiaohongshu`. If the `mcporter` binary is present on the system, the command executes `mcporter config remove …` for each matching entry. This cleanup logic appears in [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py) between lines 106 and 124.

## How the --keep-config Flag Affects Uninstallation

The **`--keep-config`** option modifies the uninstallation behavior to preserve user settings while removing integrations.

- **Without `--keep-config`**: The command deletes the `~/.agent-reach` directory entirely, removing all stored credentials and configuration data alongside the skills and MCP entries.
- **With `--keep-config`**: The command prints "Skipping config directory (--keep-config)" and bypasses step 1 entirely, leaving `~/.agent-reach` and its [`config.yaml`](https://github.com/Panniantong/Agent-Reach/blob/main/config.yaml) intact. It still removes skill files from Claude Code/OpenClaw directories and cleans up MCP entries via `mcporter`.

This flag only influences the configuration directory removal; it has no effect on skill file deletion or MCP entry cleanup.

## Command Examples

The CLI supports dry-run mode to preview changes before executing them.

```bash

# Complete removal of all Agent Reach data

agent-reach uninstall

# Preview what would be deleted without making changes

agent-reach uninstall --dry-run

# Remove skills and MCP entries but preserve config files and tokens

agent-reach uninstall --keep-config

# Preview full uninstall while keeping config

agent-reach uninstall --dry-run --keep-config

```

After execution, the command prints a summary and suggests manual cleanup commands (such as `pip uninstall agent-reach` or `npm uninstall -g mcporter`) that are **not** executed automatically.

## Summary

- **[`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py)** implements the uninstall logic in `_cmd_uninstall()`, handling three distinct cleanup operations.
- **Three removal targets**: The `~/.agent-reach` config directory, skill files in `~/.claude/skills/` and similar paths, and MCP entries managed by `mcporter`.
- **`--keep-config` behavior**: Preserves the configuration directory and all stored credentials while still removing skill installations and MCP configurations.
- **Manual cleanup required**: The CLI suggests but does not execute `pip` or `npm` uninstall commands for the Python package and external tools.

## Frequently Asked Questions

### Does `agent-reach uninstall` remove the Python package itself?

No, the uninstall command does not remove the Python package or the `mcporter` npm package. The `_cmd_uninstall()` function only removes data directories and configuration entries. You must run `pip uninstall agent-reach` and `npm uninstall -g mcporter` manually if you wish to remove the actual binaries.

### What happens to my API keys and tokens when I use `--keep-config`?

When using the **`--keep-config`** flag, all API keys, access tokens, cookies, and proxy settings stored in `~/.agent-reach/config.yaml` remain on your system. The flag explicitly skips the deletion of the config directory (lines 64-71 in [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py)), preserving your credentials while removing only the skill files and MCP integrations.

### Can I recover my configuration after running `agent-reach uninstall` without `--keep-config`?

No, once the command executes without the `--keep-config` flag, the `~/.agent-reach` directory is permanently deleted. The CLI does not move files to a trash or backup location; it performs a direct removal of the configuration folder. If you need to retain settings for potential reinstallation, always use `--keep-config` or manually back up `~/.agent-reach/config.yaml` before uninstalling.

### Which MCP entries does the uninstaller specifically target?

The uninstaller targets entries added to the MCP server configuration via the `mcporter` tool, specifically searching for entries named `exa` and `xiaohongshu` (as referenced in the source at lines 106-124 of [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py)). It removes these entries using the `mcporter config remove` command if the binary is available on your system.