OpenAI Codex CLI
Overview
Section titled “Overview”The OpenAI Codex CLI supports MCP servers. AgentZero can provide policy-enforced tools to Codex sessions.
1. Build with MCP support
Section titled “1. Build with MCP support”cargo build --release --features mcp2. Add to Codex MCP config
Section titled “2. Add to Codex MCP config”Add AgentZero to your Codex MCP configuration:
{ "mcpServers": { "agentzero": { "command": "az", "args": ["mcp"] } }}Or use the automated setup:
az connect codex --dry-run # preview the configaz connect codex # write config3. Verify
Section titled “3. Verify”Start Codex in your project directory. AgentZero tools will be available alongside Codex’s built-in capabilities.
Available Tools
Section titled “Available Tools”| Tool | Description |
|---|---|
read_file | Read file contents (policy-checked) |
list_directory | List directory contents |
search_files | Search for patterns in files |
write_file | Write content to a file (requires approval) |
run_command | Execute a shell command (requires approval) |
Security
Section titled “Security”- Policy engine enforces deny-by-default rules
- Path validation and sensitive file blocking
- Full audit trail in
.agentzero/audit/
Troubleshooting
Section titled “Troubleshooting”- Tools not visible — ensure
azis in your PATH and built with--features mcp - Policy denials — check
az policy status