Codex bug: MCP servers load successfully but their tools aren't exposed to the model
Codex bug: MCP servers load successfully but their tools aren't exposed to the model
Suggested title for the issue:
MCP servers configured in [mcp_servers.X] load successfully but their tools are not surfaced to the model in the session
Suggested repo: openai/codex
---
Description
A user-defined MCP server configured under [mcp_servers.<name>] in ~/.codex/config.toml is spawned correctly and completes the MCP handshake (verified in logs), but the Codex session's tool list shown to the model contains only Codex-managed plugins (github, vercel, google-calendar, notion). The user-defined server's tools never appear, so the model can't invoke them.
Environment
- codex-cli: 0.128.0
- macOS: 14.x
Configuration
[mcp_servers.agent-state]
command = "bash"
args = ["/Users/<user>/.codex/mcp-wrappers/agent-state.sh"]
The wrapper resolves credentials from 1Password and execs a Node.js MCP server. Both work standalone — running the wrapper from a Terminal produces the expected agent-state-mcp ready stderr line and the server accepts tools/list requests.
Evidence the server loads + responds
From ~/.codex/logs_2.sqlite:
level=TRACE target=rmcp::service
serve_inner: new event evt=PeerMessage(Response(JsonRpcResponse {
jsonrpc: JsonRpcVersion2_0,
id: Number(1),
result: ListToolsResult(ListToolsResult {
meta: None,
next_cursor: None,
tools: [
Tool { name: "event_log", title: None, description: Some("..."), ... },
// ...13 more tools
]
})
}))
So at the protocol layer, Codex received the catalog of 14 tools.
What the model sees
When prompted "list all available tools", the model reports only github, vercel, google-calendar, notion — the four [plugins.*] entries from config.toml. It does not mention the agent-state server or any of its 14 tools, and direct invocations like "call the tool named event_log" return "no such tool."
Expected behavior
Tools from [mcp_servers.X] entries should be visible alongside [plugins.X] tools in the model's tool registry.
Reproduction
- Configure any MCP server under
[mcp_servers.X]in~/.codex/config.toml(a public stdio MCP like the GitHub MCP or a tiny local hello-world MCP works for repro) - Launch
codex - Verify in
~/.codex/logs_2.sqlitethatrmcp::servicerecordedListToolsResultfor the server (proves it loaded) - Inside the Codex session, ask the model to list available tools
- The user-defined server's tools are absent from the model's response
Hypothesis
Looks like there's a registration step between rmcp receiving the tool list and the session tool-registry being populated for the model. Either the registration call is missing, or the session's tool-list serialisation is filtering out non-plugin entries.
Workaround
None found. [plugins.*] entries work; [mcp_servers.*] entries connect but are unusable from the agent's perspective.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗