Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.422.20832 (2025)
What subscription do you have?
Pro
What platform is your computer?
Darwin 25.4.0 arm64 arm
What issue are you seeing?
Whenever my local MCP server has updates to its tools, the existing Codex UI thread can't access any of the updates, requiring a human to create a new thread in the UI. This is a huge blocker becuase if I'm using Codex to automatically update the MCP surface overnight, every other automation is blocked because existing threads cannot access the updated MCP surface. There needs to be a way to hot-load local MCP changes into existing threads.
What steps can reproduce the bug?
Uploaded thread: 019de35b-8816-72d3-b69b-773269fd8e01
The repro is:
-
Start with a Codex thread that has the local MCP server attached.
In this repo,portfolio_stateis built from tools/prompt_wave_controller.py and launched as:python3 -u tools/portfolio_state_mcp_server.py serve
-
In that existing thread, record what it can see: server version, tool count, and tool names. Current fresh local probe is:
cd /Users/devin.bost/proj/repos/thespaceplace python3 tools/probe_local_orchestrator_mcp_servers.py --server portfolio_state --jsonRight now that reports
portfolio_stateversion1.31.0with107tools. -
Update the MCP surface on disk. For example, add a new
portfolio_statetool intools/portfolio_state_mcp_server.py, add it to the controller allowlist inLOCAL_PORTFOLIO_STATE_MCP_TOOL_NAMES, update shape snapshots/changelog, and bump the MCP server version. -
Fresh-probe the local server in a new process:
python3 tools/probe_local_orchestrator_mcp_servers.py --server portfolio_state --json
This should show the new version/tool count/tool name, because the probe starts a fresh stdio MCP process.
-
Return to the already-open Codex thread and try to call or discover the new tool. The existing thread should still fail to see it or be unable to call it, because its MCP attachment/tool surface was captured before the update. Existing long-lived MCP server processes also do not hot-reload Python module changes.
-
Confirm the mismatch with the repo’s stale-attachment logic: compare the existing thread’s attached observation against the fresh probe. The expected status is
attachment_stale_needs_refreshorstop_attachment_stale; the relevant fail-closed guidance is in tools/kappability_multi_codex_portfolio_supervisor.py, and old contracts explicitly say to refresh the Codex MCP attachment before relying on new behavior in tools/portfolio_state_mcp_server.py.
The key observation: a fresh local probe can see the updated MCP surface, but an already-created Codex thread cannot. The fix is to start a new Codex thread/session or otherwise refresh the MCP attachment.
What is the expected behavior?
An already-open Codex thread should automatically refresh its attached local MCP surface after the local MCP server/config changes, without requiring a new thread or manual restart.
Concretely:
- After a local MCP tool is added, renamed, removed, or its schema/version changes, the existing thread should detect the changed surface.
- On the next tool-discovery or tool-call opportunity, the thread should use a fresh MCP tools/list result instead of the stale attached snapshot.
- Newly added tools should become discoverable and callable from the existing thread.
- Updated tool schemas/output contracts should be reflected in the thread’s callable metadata.
- Removed tools should disappear or fail with a clear “tool no longer available” error, not linger as stale callable tools.
- MCP identity/freshness checks should report the refreshed version/tool count/source hashes as current.
- Repo trust checks such as get_go_loop_mcp_attachment_freshness should return an aligned/usable state rather than attachment_stale_needs_refresh or stop_attachment_stale.
- If automatic refresh fails, Codex should fail closed with a clear refresh error and recovery hint, not silently keep using stale MCP metadata.
A crisp acceptance-test version:
- Open Codex thread with portfolio_state attached.
- Add a new MCP tool locally and update the server allowlist/version.
- Fresh local probe sees the new tool.
- Without starting a new Codex thread, ask the existing thread to discover/call that new tool.
- Expected fixed behavior: the existing thread sees and can call the new tool automatically.
Additional information
No response
Activity
github-actions commentedon May 1, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
devinbost commentedon May 1, 2026
Hi @etraut-openai, I think #19155 may be in the MCP refresh/tool-list area you recently touched.
I put together a small demonstration branch here:
https://github.com/openai/codex/compare/main...devinbost:feat/mcp-tool-list-refresh?expand=1
The change wires MCP
notifications/tools/list_changedthroughcodex-rmcp-clientintocodex-mcp, marks the cached tools stale, and refreshestools/listthe next time an existing thread reads its tool surface. It passes:cargo build -p codex-clicargo test -p codex-rmcp-clientcargo test -p codex-mcpcargo clippy --fix --tests --allow-dirty -p codex-rmcp-client -p codex-mcpI know external PRs are invitation-only, so I’m not trying to bypass that process. Would you be the right person to say whether this is the intended direction, or to invite/open an internal PR if it looks right?
CC @aibrahim-oai since the patch also touches the
codex-mcpManagedClienttool cache path from #19725.devinbost commentedon May 1, 2026
@etraut-openai, I updated the demonstration branch to cover the local-stdio hot-load part of #20605 in addition to #19155:
https://github.com/openai/codex/compare/main...devinbost:feat/mcp-tool-list-refresh?expand=1
The branch now has two pieces:
For Stale MCP Tool Schema After Server Restart #19155, it wires MCP
notifications/tools/list_changedthroughcodex-rmcp-clientintocodex-mcp, marks the cached tool list stale, and refreshestools/listthe next time the existing session reads MCP tools.For Need way to hot-load local MCP changes into existing Codex thread #20605, it adds a core watcher for local stdio MCP surfaces. Existing sessions watch the user MCP config plus path-like stdio command/args, reload MCP config when those files change, and queue a deferred MCP server refresh so the stdio server is restarted and the tool surface is rebuilt on the next turn/tool-list request.
The implementation is intentionally conservative: for local stdio MCP servers, it watches files referenced directly by the configured command/args, plus the immediate parent directory of those files. For example, if the MCP config launches a server as
python3 -u tools/portfolio_state_mcp_server.py serve, Codex watchestools/portfolio_state_mcp_server.pyandtools/. That covers common Python/Node script-based MCP servers without recursively watching the whole repo.It should work for things like:
Caveats:
You (or another maintainer) may want to decide whether broader project config watching, dependency-root watching, or an explicit MCP
watch_rootsconfig would be the preferred product shape.I ran:
cargo fmt -- --config imports_granularity=Itemcargo test -p codex-rmcp-clientcargo test -p codex-mcpcargo test -p codex-core mcp_server_watcher --libcargo test -p codex-core reload_user_config_layer_updates_mcp_servers --libcargo test -p codex-core queue_current_mcp_server_refresh_uses_reloaded_config --libcargo test -p codex-core refresh_mcp_servers_is_deferred_until_next_turn --libcargo clippy --fix --tests --allow-dirty -p codex-rmcp-client -p codex-mcpcargo clippy --fix --tests --allow-dirty -p codex-coreWould you be the right person to advise whether this is close to the intended architecture, or should I ping someone else for the MCP/session refresh path?
Kaexburli commentedon Jun 24, 2026
Same need here from a slightly different runtime shape.
We can verify out-of-band that the MCP server has the updated/real tool catalog available, and the server logs a Codex MCP client connection. But the already-open Codex thread still has the stale MCP tool attachment captured earlier and cannot call the real tools until the session/thread is restarted.
So the missing capability is exactly a hot refresh of the thread-attached MCP tool surface after the underlying server/catalog changes or recovers.
100yenadmin commentedon Jul 16, 2026
Additional exact reproduction from Codex Desktop on macOS arm64 with
codex-cli 0.144.0and a local stdio MCP server:gitnexusMCP namespace after the server/config was repaired.codex mcp listandcodex mcp get gitnexusboth reported the server enabled.initializefollowed bytools/listsucceeded and returned 13 read-only tools.codex exectask then called the same server'slist_repostool successfully and received 34 repositories.This isolates the failure to the existing task's attached tool surface rather than server startup, config parsing, or MCP protocol behavior. A full Desktop restart was not required for a newly created task; creating a new task was sufficient. The missing capability is a current-task MCP reconnect/reload exactly as described here.
No credentials or private configuration values are included in this report.
TeaShaman-cyber commentedon Aug 8, 2026
Windows/AppX reproduction and operational impact
This is also reproducible on current Windows Codex Desktop
26.803.5235.0.Our live control comparison shows:
mcp__family_gramps__*tools and a read-onlyget_metadatacall succeeds;mcp__github__*tools appear;The missing capability is an in-process/live MCP manifest refresh. When an external server is started, repaired, re-authenticated, or its tools change, the current task should be able to request a bounded refresh of its attached MCP catalog without restarting the whole Desktop app.
A full restart is not a cheap workaround for this problem. On Windows, restarting Codex can require reopening and reconstructing historical tasks, while existing reports also describe eager history hydration, UI stalls, repeated history replay, and MCP process startup during task navigation:
This makes MCP diagnosis and configuration disproportionately expensive for users, especially when working with remote or authenticated MCP servers.
Suggested acceptance criteria:
497429018 commentedon Sep 3, 2026
Additional exact reproduction from Codex Desktop on macOS with a remote authenticated MCP server.
Environment:
Reproduction:
Observed:
Expected:
No credentials, private URLs, API keys, or business payloads are included.
497429018 commentedon Sep 20, 2026
macOS Codex Desktop: full restart disrupts unrelated active tasks
Additional reproduction and product impact:
26.915.319450.145.0~/.codex/config.toml.codex mcp listimmediately parsed the updated configuration and reported both servers asenabled.This makes routine MCP configuration and credential repair operationally disruptive. A change needed by one task forces an application-wide restart even when other long-running tasks are healthy.
Suggested behavior:
No credentials, server URLs, repository details, or private payloads are included.
rexsacrorum commentedon Sep 21, 2026
Reproduced on Windows with Codex Desktop 26.915.31945;
codex --versionreportscodex-cli 0.153.4.This also affects a newly added project-scoped MCP server, not only changes to an existing server's tool list:
.codex/config.toml.codex mcp listandcodex mcp get <server>show the server as enabled.PATH.The thread still cannot discover or call the server's tools. The agent-visible tool inventory remains the one created before the project MCP configuration existed.
The installed CLI exposes
list,get,add,remove,login, andlogoutundercodex mcp. It has no reload or reconnect command. The agent also has no callable action that refreshes the current thread's MCP attachment.Starting a new thread is the current workaround. An agent-callable refresh operation would be particularly useful because the agent can diagnose that
codex mcp listis current while its own tool inventory is stale, but it cannot repair that state.qianyizhang commentedon Oct 13, 2026
MCP App discovery and server lifetime: diagnosis and resolution
Observed on macOS 26.6.2 arm64, Codex desktop 26.1007.30912 (20156), bundled CLI 0.162.0-alpha.17.2.
Two distinct failures occurred:
-32603 unknown MCP server 'repo_canvas'for bothmcpServer/tool/callandmcpServer/resource/read. A fresh SDK connection to the same running server succeeded. This supports a stale per-chat registry diagnosis; the internal cause was not established.Resolution: after loading the revised registration, the native MCP App sent a user message into the existing conversation through
ui/message; that conversation successfully calledcanvas_readand delivered a reply throughcanvas_reply. No separate agent was involved. We did not isolate whether reconnecting alone would resolve the first failure.Requested improvement: expose an actionable per-chat MCP reconnect/error state, and document that registration, app-menu discovery, server availability, and current-chat readiness are separate checks. A successful SDK probe does not refresh an existing chat, and a generic “Couldn't display” screen obscures failures that happen before HTML delivery.
No private repository contents, credentials, or session identifiers are included.
hyeonbungi commentedon Nov 23, 2026
Windows 재현 — MCP 다시 시작 직후 진행 중인 응답이 표시 없이 중단됩니다
환경
Windows 11 Home x64 (빌드
26300), Microsoft Store 데스크톱 패키지26.1117.4957.0, 번들 런타임codex-cli 0.171.0-alpha.13입니다. Codex 모드의 로컬 채팅에서 Unity CLI1.0.1을 로컬 stdio MCP 서버로 등록한 상태였습니다.재현 절차
실제 결과
재시작 버튼을 누른 도구 호출이
aborted로 종료됐습니다. 이후 화면에는 직전의 접을 수 있는 활동 기록인 “명령을 실행했습니다”만 남았습니다. 최종 답변, 중단·오류 안내, 진행 중 표시가 나오지 않았고 응답도 자동으로 재개되지 않았습니다. 같은 채팅에 새 메시지를 보낸 뒤에야 남은 검증을 이어갈 수 있었습니다. 같은 채팅에서 이 동작이 여러 번 반복됐습니다.기대 결과
서버 목록 갱신이 현재 응답을 끊지 않으면 좋겠습니다. 응답 중단이 필요한 경우에는 재시작 전에 알려주시고, 복귀 후에는 해당 응답을 명시적으로 중단 상태로 표시해 남은 작업을 이어갈 방법을 제공해 주세요.
참고로 Unity 도구 목록의 자동 갱신은 별도로 확인했습니다.
mcp_tool_list_changed를 켠 뒤 같은 채팅에서 Unity를 나중에 열었을 때, 도구 목록이 1개에서 208개로 갱신됐고scene_list_open이 응답했습니다. 이 댓글은 데스크톱의 Restart 버튼을 누른 순간 진행 중인 응답의 상태가 화면에서 사라지는 동작을 기록합니다.otmanm commentedon Nov 25, 2026
A related old-thread versus fresh-thread result on macOS 27.2.1, Desktop 26.1120.41243 (0.171.0-alpha.13.2). Here the local MCP server was newly installed rather than an existing tool schema being changed. The original thread still reported an unknown server. In an app-server comparison, reloading the configuration did not fix an older test thread. Restarting the app server and reopening that same test thread restored the panel resource and card data; a thread created after installation also loaded them. This verifies the server-side difference, not that a panel rendered in the original desktop window.