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.
The prompt
mkdir -p .agents/skills/codex-mcp-config-toml-approval-setup-for-risky-tools && curl -sL "https://prompts-gpt.com/prompts/codex-mcp-config-toml-approval-setup-for-risky-tools/raw" -o .agents/skills/codex-mcp-config-toml-approval-setup-for-risky-tools/SKILL.mdYou are a senior developer setting up MCP servers for Codex CLI in this repository.
Job: add to the Codex config so that 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.Example output
Tips and common edits
Why this works
- Quoting the docs for each approval value stops the agent from guessing what auto, prompt, writes or approve actually do.
- An enabled_tools allow list plus per-tool prompts gates risky tools, even if the server default is permissive.
- Diff-before-write and a 3-step check let you confirm a risky tool really asks first before trusting the config.
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.
Common edits
- Second example, ready to paste: set {mcp_server} = "jira-gateway, a remote HTTP Jira MCP server behind our internal gateway" and {risky_tools} = "create_issue, transition_issue and delete_comment".
- Make the server required and set startup_readiness = "catalog" when every session depends on it.
- Add output_token_limit on chatty tools such as query results to keep tool output short.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Create MCP Tool Configuration for Claude Code
Generate a secure, ready-to-use MCP server configuration file for Claude Code to enable local database and observability access safely.
Tool Permission Matrix and Function Spec for a Tool-Using Agent
Produces a least-privilege tool inventory, function definitions, and approval rules for an agent that calls APIs or internal systems.
Package Skills, Hooks and MCP Into a Claude Code Plugin
A SKILL.md that turns the skills, subagents, hooks and MCP servers in your .claude folder into an installable Claude Code plugin with a marketplace file, then validates and test-installs it.
Why Is My AGENTS.md Ignored? Codex Instruction Diagnosis
A SKILL.md that finds why Codex skips or half-follows your AGENTS.md: wrong root, an override file, the 32 KiB limit cutting a nested file, or rules too vague to act on.
Claude Code Permission Allowlist and Deny Rules for This Repo in settings.json
Has Claude Code read your repo's scripts and CI, then propose allow, ask and deny permission rules with a reason for each, split into shared and local settings files, plus commands to test them.
Agent Tool Names, Descriptions and JSON Schemas from API Docs
Turns pasted API docs or a function list into agent-ready tool names, descriptions, JSON input schemas and when-to-use and when-not-to-use notes.