You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Empty [mcp_servers] in agent role files does not clear inherited MCP servers #16686
bugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatesmcpIssues related to the use of model context protocol (MCP) servers
What terminal emulator and version are you using (if applicable)?
Winddows Terminal (Command Line)
What issue are you seeing?
When declaring an agent in .codex/agents, specifying an empty [mcp_servers] table to clear inherited MCP servers has no effect: the servers from the parent context are still inherited.
# .codex/agents/noop_no_mcp.toml
name = "noop_no_mcp"
description = "Agent with no MCP servers"
developer_instructions = "You are a minimal agent."
[mcp_servers]
# Intended to clear inherited MCP servers, but they are still inherited
What steps can reproduce the bug?
Configure one or more MCP servers in your user or project config.toml:
Confirmed on Codex CLI 0.149.1 on Linux x86_64. This is broader than empty-table clearing: a non-empty agent-local [mcp_servers.playwright] is accepted but silently dropped.
Reproduction evidence:
The custom role loads its name, model, reasoning effort, and developer instructions.
The spawned child keeps parent-owned MCP tools but has no mcp__playwright__* tools from the role file.
The configured launcher completes a direct MCP initialize + tools/list handshake and returns the full Playwright tool set, so the MCP server is healthy.
codex ... mcp list --json resolves the same launcher as an enabled parent-level MCP configuration.
The current behavior comes from #39299, merged on August 18. AgentRoleOverrides has no mcp_servers field, and apply_role_to_config_inner rebuilds the role layer only from that bounded struct. The test explicitly asserts that the child keeps parent.mcp_servers and that mcp_servers is absent from the projected role layer: role_tests.rs.
This now conflicts with the official custom-agent documentation, which says custom agent files may include mcp_servers and shows a browser-debugger agent with its own MCP server. The runtime should either support role-local MCP servers within the intended authority model, or reject the field and update the docs. Silently accepting it makes valid-looking custom browser agents fail without an MCP startup error.
bugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatesmcpIssues related to the use of model context protocol (MCP) servers
Activity
github-actions commentedon Apr 3, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
ahalekelly commentedon Aug 31, 2026
Confirmed on Codex CLI 0.149.1 on Linux x86_64. This is broader than empty-table clearing: a non-empty agent-local
[mcp_servers.playwright]is accepted but silently dropped.Reproduction evidence:
mcp__playwright__*tools from the role file.initialize+tools/listhandshake and returns the full Playwright tool set, so the MCP server is healthy.codex ... mcp list --jsonresolves the same launcher as an enabled parent-level MCP configuration.The current behavior comes from #39299, merged on August 18.
AgentRoleOverrideshas nomcp_serversfield, andapply_role_to_config_innerrebuilds the role layer only from that bounded struct. The test explicitly asserts that the child keepsparent.mcp_serversand thatmcp_serversis absent from the projected role layer:role_tests.rs.This now conflicts with the official custom-agent documentation, which says custom agent files may include
mcp_serversand shows a browser-debugger agent with its own MCP server. The runtime should either support role-local MCP servers within the intended authority model, or reject the field and update the docs. Silently accepting it makes valid-looking custom browser agents fail without an MCP startup error.