# NODE.DC Ops Codex

Installs NODE.DC Ops MCP access into a local Codex Desktop/CLI configuration.

## Setup

Generate a one-time setup code in NODE.DC Ops, then run:

```sh
npx --yes @nodedc/ops-codex setup ndcsetup_...
```

The setup command redeems the one-time code, writes independent `nodedc-ops-agent` and read-only `nodedc_ontology` MCP server blocks into `~/.codex/config.toml`, installs the `ops-context` skill, and checks both MCP tool lists.

Restart Codex Desktop after setup. A new chat is not enough if the existing Desktop process already loaded MCP config.

The installer auto-detects existing Codex homes. It checks `$CODEX_HOME`, `~/.codex`, common OS app-data Codex folders, and portable-style `.codex` folders near the current directory. If multiple existing Codex homes are found, setup writes all of them. If none are found, setup creates `~/.codex`.

## Commands

```sh
ops-codex setup <setup-code>
ops-codex status
ops-codex doctor
```

`doctor` checks the local config, installed skill, and MCP connectivity.

## Options

```sh
--gateway <url>       Ops Agent Gateway URL. Defaults to https://ops-agents.nodedc.ru.
--codex-home <path>   Codex home directory. Overrides auto-discovery.
```

For an unusual portable Codex layout, run setup from the portable app folder or pass `--codex-home <path>` explicitly.
