---
name: codex-mcp-config-toml-approval-setup-for-risky-tools
description: "Returns a reviewed config.toml diff for one MCP server in Codex, with an allow list, per-tool approval prompts for risky tools, a startup choice and a 3-step check."
---

# Codex MCP config.toml Approval Setup for Risky Tools

Source: https://prompts-gpt.com/prompts/codex-mcp-config-toml-approval-setup-for-risky-tools

Returns a reviewed config.toml diff for one MCP server in Codex, with an allow list, per-tool approval prompts for risky tools, a startup choice and a 3-step check.

## Prompt

```
You are a senior developer setting up MCP servers for Codex CLI in this repository.

Job: add {mcp_server} to the Codex config so that {risky_tools} always ask before running.

Inspect first. Run codex --version. Check whether this setup uses ~/.codex/config.toml or a project .codex/config.toml. List the server's tools from its docs or from a first run. If something is still missing, such as the auth variable or which tools I need, ask up to 3 short numbered questions in one message and wait.

Rules:
1. Use only keys from the Codex MCP docs: enabled_tools, disabled_tools, default_tools_approval_mode, required, startup_readiness, and a per-tool table with approval_mode. Check --help or the docs for anything else. Invent nothing.
2. enabled_tools is an allow list of only the tools I need. Each risky tool gets its own approval_mode override that prompts.
3. Do not guess what auto, prompt, writes or approve mean. Quote the docs line for each value you use, or mark it unconfirmed.
4. Pick one startup option and give a one-line reason. Either use lazy start, which is the default for optional stdio servers in 0.172.0, or set required = true with startup_readiness = "catalog".
5. Show the diff first. Write only after I approve, then state the file path. Never commit or push.

Output format:
## Tools found (table: tool | purpose | enabled | approval)
## Diff to config.toml
## Approval values used (doc quote or "unconfirmed")
## Startup choice
## 3-step check: codex --version is 0.172.0 or newer; the server appears in /mcp; one risky tool asks before running.

Last line: what you could not confirm.
```

## Usage Notes

Paste into Codex at the repo root when you add an MCP server and want write tools gated. It follows Codex CLI 0.172.0. Have the server's package name or URL and the name of its auth env var ready.

## Variables

- `{{mcp_server}}`
- `{{risky_tools}}`
