initial mcp add interface (#3543)

Adds `codex mcp add`, `codex mcp list`, `codex mcp remove`. Currently writes to global config.
This commit is contained in:
easong-openai
2025-09-14 21:30:56 -07:00
committed by GitHub
parent a797051921
commit 6a8e743d57
9 changed files with 849 additions and 5 deletions

View File

@@ -367,6 +367,24 @@ env = { "API_KEY" = "value" }
startup_timeout_ms = 20_000
```
You can also manage these entries from the CLI [experimental]:
```shell
# Add a server (env can be repeated; `--` separates the launcher command)
codex mcp add docs -- docs-server --port 4000
# List configured servers (pretty table or JSON)
codex mcp list
codex mcp list --json
# Show one server (table or JSON)
codex mcp get docs
codex mcp get docs --json
# Remove a server
codex mcp remove docs
```
## shell_environment_policy
Codex spawns subprocesses (e.g. when executing a `local_shell` tool-call suggested by the assistant). By default it now passes **your full environment** to those subprocesses. You can tune this behavior via the **`shell_environment_policy`** block in `config.toml`: