feat(exec): Add --disable-builtin-tools flag for MCP-only mode - #5001
feat(exec): Add --disable-builtin-tools flag for MCP-only mode#5001provencher wants to merge 3 commits into
Conversation
This adds a new CLI flag that allows users to disable all built-in tools (shell, file operations, plan, apply_patch) while keeping MCP tools and web search available. This is useful for running codex exec in headless mode with only custom MCP tools. Changes: - Add --disable-builtin-tools CLI flag to exec - Thread flag through ConfigOverrides and Config - Update ToolsConfig to conditionally register built-in tools - Keep MCP tools, web_search, and view_image available 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
|
+1 on needing this flag |
|
Thanks for the contribution, and apologies for the slow response. We've received many PRs, and we don't have the bandwidth on the codex team to review all of them. We've updated our contribution guidelines to clarify that we're currently accepting contributions for bugs and security fixes, but we're not generally accepting new features at this time. We need to make sure that all new features compose well with both existing and upcoming features and fit into our roadmap. If you would like to propose a new feature, please file or upvote an enhancement request in the issue tracker. We will generally prioritize new features based on community feedback. |
Really too bad that this was closed. I think it's a large omission that codex does not permit even disabling the shell execution, as it's a security risk in many cases. I opened an issue to track the request |
Summary
Adds a new
--disable-builtin-toolsCLI flag tocodex execthat allows users to disable all built-in tools (shell, file operations, plan, apply_patch) while keeping MCP tools and web search available.This is useful for running codex exec in headless mode with only custom MCP tools, enabling better control over the agent's capabilities.
Changes
--disable-builtin-toolsCLI flag to execTesting
Verified the flag works correctly:
Built and tested successfully with both configurations.