Metadata-Version: 2.4
Name: codex-mcp-eraser
Version: 0.0.6
Summary: Safely remove user-configured MCP servers and hooks from Codex CLI
Classifier: Environment :: Console
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# Codex MCP eraser

A Python command-line tool that removes user-configured MCP server tables and
hooks from Codex CLI configuration. It does not modify plugin settings or
managed policies. Requires Python 3.11 or later.

## Install

Create and activate a virtual environment:

```bash
python3 -m venv .venv
source .venv/bin/activate
```

Install the package inside it:

```bash
python -m pip install codex-mcp-eraser
```

## Use

The default is a dry run. Review the reported files before applying changes:

```bash
codex-mcp-eraser
codex-mcp-eraser --apply
```

Dry runs print complete current and planned file contents. Use `--summary-only`
to show the affected paths and actions without printing file contents:

```bash
codex-mcp-eraser --summary-only
```

Applying changes prompts for confirmation. Add `--yes` to skip that prompt:

```bash
codex-mcp-eraser --apply --yes
```

By default, the tool checks `CODEX_HOME` or `~/.codex`. Use `--codex-home PATH`
to select another Codex configuration directory. Repeat `--project PATH` to
also check multiple projects' `.codex/` directories:

```bash
codex-mcp-eraser --codex-home ~/.codex \
  --project /path/to/project-one --project /path/to/project-two
```

The tool removes only the MCP server named `sheriff` from `config.toml`,
removes `hooks.json` in the checked directories, and removes the Sheriff-managed
instruction block from the user Codex home's `AGENTS.md` when present. Other
configured MCP servers and surrounding `AGENTS.md` content are preserved.
Before applying changes, it creates a backup under the user Codex home directory
with restricted permissions. It does not modify plugin settings or managed
policies.

## Run from a checkout

After installing the package in the active virtual environment, you can also
run it as a module:

```bash
python -m codex_mcp_eraser
```

The source checkout includes `codex_mcp_eraser_launcher.py` and the legacy
`eraser.py` launcher.

## Development

With the virtual environment active, run the unit tests with:

```bash
python -m unittest discover -s tests -v
```

Build and check the package with the repository script (it creates a temporary
virtual environment for the build):

```bash
./build-package.sh
```
