Codex fails to detect and use configured MCP gateway, repeatedly guessing binaries instead
What version of Codex is running?
codex-cli 0.46.0
Which model were you using?
gpt-5-codex with high reasoning
What platform is your computer?
Darwin 25.0.0 arm64 arm
What steps can reproduce the bug?
Prereqs
- Docker Desktop with the MCP Toolkit enabled and Notion MCP installed.
- Codex CLI installed and configured via
~/.codex/config.toml. - A Docker MCP server entry.
My config snippet
[mcp_servers.docker_desktop]
command = "docker"
args = [
"mcp",
"gateway",
"run"
]
MCP list via Codex CLI
/mcp
๐ MCP Tools
โข Server: docker_desktop
โข Status: enabled
โข Auth: Unsupported
โข Command: docker mcp gateway run
Steps
-
Run Codex CLI and issue a task that explicitly asks to use the Notion MCP, e.g.:
codex> "Using Notion MCP, open [page] and summarize it" -
Observe that Codex fails to discover the Notion MCP via Docker and instead attempts to call local binaries and search the filesystem.
Note: Before this bug, the above prompt was enough for Codex to know that it needed to access Notion through the Docker MCP setup.
What is the expected behavior?
The expected behavior covers both the discovery and introspection phases when interacting with a Docker-backed Notion MCP through the Codex CLI.
Discovery:
When Codex receives a request that explicitly or implicitly mentions an MCP such as Notion, it should follow a clear, step-by-step process to resolve and connect to the appropriate service:
- Check the user's configuration file (e.g.,
~/.codex/config.tomlfor declared MCP servers, including any Docker-backed entries. - If a Docker MCP entry is found, Codex should immediately attempt to connect to the Docker MCP gateway using this configuration.
- Codex should avoid any fallback behaviors that probe for local executables named
notion,mcp,notion_mcp,mcp-notion, or perform ad-hoc filesystem searches for MCP-related content.
Even if the Docker MCP entry isn't found, if it checked the configuration file first, it would know that Notion didn't exist, and inform the user that it was not able to find any Notion MCP server entries.
- It should also avoid unnecessary attempts to list Python packages or run unrelated commands to discover MCP tools.
- This process should be automatic and transparent to the user, enabling seamless MCP discovery and connection without manual intervention or explicit commands.
Tool introspection:
Once connected to the Docker MCP gateway, Codex should automatically resolve the MCP connection and load the available tools exposed by the registry. This should happen without manually runing commands like docker mcp tools list or docker mcp tools inspect to "unlock" or discover the tools. These introspection commands should remain available as optional diagnostics or debugging aids, but they must not be prerequisites for the CLI to recognize and utilize the MCP. The CLI should maintain an internal cache or state reflecting the available tools, updating it as needed, so that tool invocation commands can be issued directly and reliably.
User experience expectations:
On startup and during usage, the CLI should proactively check the configuration file and auto-detect any accessible MCP servers, including those backed by Docker. This minimizes the need to perform manual discovery steps or troubleshoot why an MCP is not being recognized. The CLI should prioritize configured MCP entries over local binaries or heuristics, ensuring a smooth and predictable user experience.
What do you see instead?
- Codex ignored the Docker MCP config initially and attempted to:
- run
notion,mcp,npx notion,notion_mcp,mcp-notion(all missing), - search the working directory and
$HOMEfor Notion/MCP content, - list packages via
pip/python3 -m pip.
- run
- Only after being explicitly told that Notion MCP exists "through Docker" did it pivot to
docker mcp โฆsubcommands, after which the Notion tool catalog became visible. - Additionally, when prompted that Docker MCP access was defined in its configuration file, Codex proceeded to manually locate and read the file rather than automatically recognizing and applying the existing configuration.
Below is the actual session output up to the point where it began taking action:
โบ Using Notion MCP, can you redefine my Visual Identity Lab page to better optimize it and make it clearer. Create a beautiful, engaging, and useful Visual Identity. Before you start, you can use the Notion MCP to familiarize yourself with my Notion. Read every page.
โข Explored
โ List ls
Search Notion MCP
Read AGENTS.md
Search MCP
List ls -a
Search Notion
โข Ran notion --help
โ bash: notion: command not found
โข Ran mcp --help
โ bash: mcp: command not found
โข Ran npx notion --help
โ npm error could not determine executable to run
npm error A complete log of this run can be found in: /Users/austinwells/.npm/_logs/2025-10-14T03_24_06_033Z-debug-0.log
โข Explored
โ Search Notion
Search Notion MCP in ..
Search find . -maxdepth 2 -type d
Search notion
โข Ran env | sort
โ __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
__CFBundleIdentifier=dev.warp.Warp-Stable
โฆ +7 lines
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
โข Ran pip list | grep -i notion
โ bash: pip: command not found
โข Ran python3 -m pip list | grep -i notion
โ (no output)
โข Explored
โ Search *mcp* in ..
Search *notion* in ..
List ..
Search *notion* in Scripts
โข Ran notion_mcp --help
โ bash: notion_mcp: command not found
โข Ran mcp-notion --help
โ bash: mcp-notion: command not found
โข Explored
โ Search *notion* in ~
List notion-mcp
Read package.json
โ Conversation interrupted - tell the model what to do differently
โบ You have access to the Notion MCP through Docker as defined in your config file.
โข Explored
โ Search *codex* in ~
List .codex
Read config.toml
Search notion in .codex
โข Ran docker mcp gateway run --help
โ Docker MCP Toolkit's CLI - Manage your MCP servers and clients.
โฆ +7 lines
--watch Watch for changes and reconfigure the gateway (default true)
โข Explored
โ Read config.yaml, docker-mcp.yaml
Search notion in docker-mcp.yaml
Search notion in docker-mcp.yaml
Read docker-mcp.yaml, registry.yaml
List mcp
โข Ran docker mcp --help
โ Docker MCP Toolkit's CLI - Manage your MCP servers and clients.
โฆ +7 lines
version Show the version information
โข Ran docker mcp client --help
โ Docker MCP Toolkit's CLI - Manage your MCP servers and clients.
โฆ +5 lines
ls List client configurations
โข Ran docker mcp tools --help
โ Docker MCP Toolkit's CLI - Manage your MCP servers and clients.
โฆ +7 lines
list List tools
โข Ran docker mcp tools list --format json
โ [
{
โฆ +7 lines
}
]
โข Ran docker mcp tools call --help
โ Docker MCP Toolkit's CLI - Manage your MCP servers and clients.
Usage: docker mcp tools call
โข Ran docker mcp tools call --help --verbose
โ Docker MCP Toolkit's CLI - Manage your MCP servers and clients.
Usage: docker mcp tools call
โข Ran docker mcp tools inspect notion:API-post-search --format json
โ tool notion:API-post-search not found
โข Ran docker mcp tools list | head
โ 193 tools:
- API-create-a-comment - Notion | Create comment
โฆ +6 lines
- API-patch-block-children - Notion | Append block children
- API-patch-page - Notion | Update page properties
(We stop here because the next command actually succeeds and the model begins taking action.)
Additional information
- Environment hints (from the session): macOS (Warp terminal), no local
pipin PATH for the session, fresh shell. docker mcphelp output was accessible, confirming the Docker MCP Toolkit was installed.- First successful Notion interaction observed after discovery:
docker mcp tools call API-get-selfreturned the Notion bot profile for workspace. - Hypothesis (discovery): Codex CLI currently prioritizes local executables and file heuristics before honoring Docker MCP entries in
config.toml. When no local binaries are present, it doesnโt automatically fall back to the Docker MCP gateway.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #3666
- #3324
Powered by Codex Action
I've reviewed the linked issues and can confirm this report is not a duplicate.
The key difference is the stage at which the failure occurs:
- My issue describes a Discovery Failure. As shown in the logs, Codex fails to read its own configuration and cannot find the Docker MCP at all.
- Issue #3666 is an Execution Failure. Codex successfully finds the tool and creates the correct command but fails to run it.
- Issue #3324 is a Connection Failure (a timeout), which occurs after the tool has already been discovered.
My bug occurs at a more fundamental step in the process, before the failures described in the other issues could even happen.
I found this issue too, I think it has something to do with model reasoning ability, because after I switched model to gpt-5-high(before was gpt-5-codex-high), it never happens again
I found this issue too, I think it has something to do with model reasoning ability, because after I switched model to gpt-5-high(before was gpt-5-codex-high), it never happens again
It seems they changed it so the only models available are
- gpt-5-codex
- gpt-5
There's no reasoning level anymore!
I found this issue too, I think it has something to do with model reasoning ability, because after I switched model to gpt-5-high(before was gpt-5-codex-high), it never happens again
It seems they changed it so the only models available are
- gpt-5-codex
- gpt-5
There's no reasoning level anymore!
Actually when you switch it, it would show up options to select reasoning level, and you can set it in ~/.codex/config.toml with โmodel_reasoning_effort = "high"โ
I found this issue too, I think it has something to do with model reasoning ability, because after I switched model to gpt-5-high(before was gpt-5-codex-high), it never happens again
It seems they changed it so the only models available are
- gpt-5-codex
- gpt-5
There's no reasoning level anymore!
Actually when you switch it, it would show up options to select reasoning level, and you can set it in ~/.codex/config.toml with โmodel_reasoning_effort = "high"โ
Ah, you're right. I am on gpt-5-codex with high reasoning. I'll try the non-codex version. Thank you!
There are two separate things here:
- Does the Docker MCP gateway work?
- What does the model do when a tool call fails or it can't find the right tool.
Let's keep this issue focused on the first. The behavior for what the model will do in that sitaution is not something tangible to focus on in this PR but something I'll take to our research team for further discussion.
I just gave this a shot with 0.47 and had no issues using the docker mcp gateway to call the Notion MCP. Could you maybe try again?
There are two separate things here:
- Does the Docker MCP gateway work?
- What does the model do when a tool call fails or it can't find the right tool.
Let's keep this issue focused on the first. The behavior for what the model will do in that sitaution is not something tangible to focus on in this PR but something I'll take to our research team for further discussion.
I just gave this a shot with 0.47 and had no issues using the docker mcp gateway to call the Notion MCP. Could you maybe try again?
![]()
Understood! Thank you, Iโll try it again with 0.47.
To clarify the behavior Iโm describing: the Docker MCP gateway itself does work when I explicitly tell the model to use it. It connects and can successfully call the Notion MCP. The issue isnโt that the gateway fails, but that the model doesnโt automatically recognize or use it unless explicitly instructed.
In other words, if I simply ask it to โuse the Notion MCP,โ it doesnโt appear to check its configured MCP servers first. Instead, it tries to locate local binaries or search the filesystem before eventually being told to use Docker. Once directed, everything works as expected.
So the gateway functionality looks fine; the concern is about discovery โ how the model determines that it already has access to the MCP through its config, without needing to be told directly.
@stnwlls Could you try with 0.48? It includes some work that might help here.
@stnwlls Could you try with 0.48? It includes some work that might help here.
Hello, I tried with 0.48 and it was not successful.
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โจโUpdate available! 0.48.0 -> 0.50.0 โ
โ Run brew upgrade --cask codex to update. โ
โ โ
โ See full release notes: โ
โ https://github.com/openai/codex/releases/latest โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ >_ OpenAI Codex (v0.48.0) โ
โ โ
โ model: gpt-5-codex high /model to change โ
โ directory: ~ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
To get started, describe a task or try one of these commands:
/init - create an AGENTS.md file with instructions for Codex
/status - show current session configuration
/approvals - choose what Codex can do without approval
/model - choose what model and reasoning effort to use
/review - review any changes and find issues
โบ Using Notion MCP, can you redefine my Visual Identity Lab page to better optimize it and make it clearer. Create a beautiful, engaging, and useful Visual Identity. Before you start, you
can use the Notion MCP to familiarize yourself with my Notion. Read every page.
โข Called codex.list_mcp_resources({})
โ {"resources": []}
โข Called codex.list_mcp_resource_templates({})
โ {"resourceTemplates": [{"server": "docker_desktop", "name": "Repository Content", "uriTemplate": "repo://{owner}/{repo}/contents{/path*}"}, {"server": "docker_desktop", "name":
"Repository Content for specific branch", "uriTemplate": "repo://{owner}/{repo}/refs/heads/{branch}/contents{/path*}"}, {"server": "docker_desktop", "name": "Repository Content for
specific pull request", "uriTemplate": "repo://{owner}/{repo}/refs/pull/{prNumber}/head/contents{/path*}"}, {"server": "docker_desktop", "name": "Repository Content for specific
tag", "uriTemplate": "repo://{owner}/{repo}/refs/tags/{tag}/contents{/path*}"}, {"server": "docker_desktop", "name": "Repository Content for specific commit", "uriTemplate": "repo://
{owner}/{repo}/sha/{sha}/contents{/path*}"}]}
โข Iโm trying to figure out how to interact with the Notion MCP since thereโs no obvious server or list of servers named Notion. I want to see if calling list_mcp_resources with "notion"
or other possible server names helps reveal resources, since the user wants me to use Notion MCP to review and optimize their Visual Identity Lab page. It looks like I might need more
instructions or the userโs help enabling the plugin or confirming the server setup before proceeding.
โข Called notion.list_mcp_resources({"server":"notion"})
โ Error: resources/list failed: unknown MCP server 'notion'
โข Called notion_mcp.list_mcp_resources({"server":"notion_mcp"})
โ Error: resources/list failed: unknown MCP server 'notion_mcp'
โ Worked for 24s โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โข Iโm not seeing any Notion MCP resources available from this environmentโthe server doesnโt appear to be configuredโso I canโt browse your workspace yet. Could you confirm that the Notion
MCP connection is set up on your side (and let me know the server name if it differs)? Once I can reach the pages, Iโll review everything and start improving the Visual Identity Lab page
as requested.
/mcp
๐ MCP Tools
โข docker_desktop
โข Status: enabled
โข Auth: Unsupported
โข Command: docker mcp gateway run --tools
Same with 0.50:
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ >_ OpenAI Codex (v0.50.0) โ
โ โ
โ model: gpt-5-codex high /model to change โ
โ directory: ~/Desktop โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
To get started, describe a task or try one of these commands:
/init - create an AGENTS.md file with instructions for Codex
/status - show current session configuration
/approvals - choose what Codex can do without approval
/model - choose what model and reasoning effort to use
/review - review any changes and find issues
โบ Using Notion MCP, can you redefine my Visual Identity Lab page to better optimize it and make it clearer. Create a beautiful, engaging, and useful Visual Identity. Before you start, you
can use the Notion MCP to familiarize yourself with my Notion. Read every page.
โข Called codex.list_mcp_resources({})
โ {"resources": []}
โข Called codex.list_mcp_resource_templates({})
โ {"resourceTemplates": [{"server": "docker_desktop", "name": "Repository Content", "uriTemplate": "repo://{owner}/{repo}/contents{/path*}"}, {"server": "docker_desktop", "name":
"Repository Content for specific branch", "uriTemplate": "repo://{owner}/{repo}/refs/heads/{branch}/contents{/path*}"}, {"server": "docker_desktop", "name": "Repository Content for
specific pull request", "uriTemplate": "repo://{owner}/{repo}/refs/pull/{prNumber}/head/contents{/path*}"}, {"server": "docker_desktop", "name": "Repository Content for specific
tag", "uriTemplate": "repo://{owner}/{repo}/refs/tags/{tag}/contents{/path*}"}, {"server": "docker_desktop", "name": "Repository Content for specific commit", "uriTemplate": "repo://
{owner}/{repo}/sha/{sha}/contents{/path*}"}]}
โข It looks like the Notion MCP might not be configured or accessible since I can't find any related resources. Iโm considering trying to list resources with a 'notion' server parameter just
in case, but if that fails, I might need to ask the user to verify the setup before proceeding with reading their Notion pages as requested. This seems critical before I can move forward
with redefining the Visual Identity Lab page.
โข Called notion.list_mcp_resources({"server":"notion"})
โ Error: resources/list failed: unknown MCP server 'notion'
โ Worked for 25s โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โข I tried listing the available MCP resources, but thereโs no Notion MCP server configured in this environment, so I canโt read your Notion pages yet. Could you set up the Notion MCP
connection (or let me know its server name) so I can review the workspace before drafting the revamped Visual Identity Lab page?
Why don't you try using the Notion MCP directly?
Why don't you try using the Notion MCP directly?
It's not just Notion, Codex won't recognize any of the tools in Docker automatically.
It successfully searches it's config file first and probes deeper there, which does seem resolved from the last session, so if you'd like to close this, I would say it's resolved. Hopefully in future updates it can search deeper into Docker or other centralized containers that hold MCP servers to know what it can use.